:root {
  --bg: #07140c;
  --bg-2: #0a1c12;
  --panel: #0c1f14;
  --line: #1d3d2a;
  --green: #3ddc84;
  --green-dim: #8fe7b4;
  --gold: #d4b56a;
  --text: #e8f5ee;
  --muted: #9bb6a8;
  --label: #6d8b7c;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 840px; margin: 0 auto; padding: 28px 22px 88px; }
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 36px;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--line);
}
.site-head .masthead { margin: 0; text-align: left; flex: 0 0 auto; width: auto; }
.site-head .brand-mark {
  width: 104px;
  margin: 0;
  filter: none;
}
.site-head .topnav { margin: 0; justify-content: flex-end; }
.masthead { display: block; text-align: center; margin: 0 auto 20px; }
.brand-mark {
  display: block;
  margin: 0 auto;
  width: min(160px, 48vw);
  height: auto;
}
.footer-mark {
  width: 88px;
  margin-bottom: 14px;
}
.topnav { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; align-items: center; margin-bottom: 28px; }
.brand { font-weight: 800; letter-spacing: 0.04em; color: var(--green); text-decoration: none; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.topnav a:hover, .topnav a.active { color: var(--green); }
.badge {
  display: inline-block; background: #123322; color: var(--green);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; border: 1px solid #1f5a38; margin-bottom: 16px;
}
h1 { font-size: clamp(1.7rem, 4.2vw, 2.25rem); font-weight: 700; letter-spacing: -0.04em; margin-bottom: 12px; }
.subtitle { color: var(--muted); max-width: 620px; margin-bottom: 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--label); margin-bottom: 36px; }
.meta span { background: var(--panel); border: 1px solid var(--line); padding: 6px 12px; border-radius: 10px; }
nav.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px 28px; margin-bottom: 28px; }
nav.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--label); margin-bottom: 12px; border: 0; padding: 0; }
nav.toc ol { columns: 2; column-gap: 28px; padding-left: 20px; }
@media (max-width: 640px) {
  nav.toc ol { columns: 1; }
  .site-head .topnav { justify-content: flex-end; }
}
nav.toc a { color: var(--green); text-decoration: none; font-size: 14px; }
nav.toc a:hover { text-decoration: underline; color: var(--gold); }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px 28px; margin-bottom: 14px; }
h2 { font-size: 1.25rem; color: var(--green-dim); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
h3 { font-size: 1rem; color: var(--gold); margin: 18px 0 8px; }
p, li { color: #d5e8dc; font-size: 15px; margin-bottom: 10px; }
ul, ol { padding-left: 22px; margin-bottom: 10px; }
li { margin-bottom: 6px; }
a { color: var(--green); }
a:hover { color: var(--gold); }
code { font-size: 0.92em; background: #08150e; padding: 1px 6px; border-radius: 6px; }
.note { background: #102418; border-left: 3px solid var(--green); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 14px 0; }
.note.warn { border-left-color: var(--gold); background: #1a180c; }
.note p { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 14px 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--label); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
footer { text-align: center; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
footer .logo { font-weight: 800; color: var(--green); letter-spacing: 0.08em; margin-bottom: 8px; }
footer p { color: var(--label); font-size: 13px; }
.links { margin-top: 12px; font-size: 14px; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; margin-left: auto; }
  .site-head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .site-head .masthead { margin: 0; order: 1; }
  .site-head .nav-toggle { order: 2; }
  .site-head .topnav { order: 3; }
  .site-head .topnav,
  .news-top .topnav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 8px 0 4px;
  }
  .site-head .topnav.open,
  .news-top .topnav.open,
  .topnav.open {
    display: flex;
  }
  .topnav a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
}
