:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1c1f2a;
  --muted: #5b6275;
  --line: #e4e7ef;
  --accent: #2f6bff;
  --accent-soft: #e8efff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --card: #171a23;
    --text: #e7e9f0;
    --muted: #9aa1b4;
    --line: #262a36;
    --accent: #5b8cff;
    --accent-soft: #1d2640;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
header nav { display: flex; gap: 4px; flex-wrap: wrap; }
header nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
header nav a.active, header nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

main { padding: 32px 0 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
h2 { font-size: 20px; margin: 32px 0 8px; padding-top: 8px; border-top: 1px solid var(--line); }
h2:first-of-type { border-top: 0; }
ul { padding-left: 22px; }
li { margin: 4px 0; }
.note { background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; margin: 16px 0; }

table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile small { color: var(--muted); display: block; }

form { display: grid; gap: 12px; }
label { font-weight: 600; font-size: 14px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 140px; resize: vertical; }
button {
  justify-self: start; background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer;
}

footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; text-align: center; }
footer nav { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

@media (max-width: 600px) {
  .card { padding: 20px; }
  h1 { font-size: 24px; }
  .bar { height: auto; padding: 10px 16px; flex-direction: column; align-items: flex-start; }
}
