@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Bitter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/bitter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Bitter";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/bitter-italic-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #09100e;
  --bg-elevated: #0e1915;
  --panel: #13221c;
  --panel-2: #192c24;
  --panel-soft: rgba(26, 42, 35, .72);
  --line: #2b4237;
  --line-soft: rgba(114, 151, 123, .18);
  --text: #eef4ed;
  --muted: #a8b8ad;
  --faint: #74877b;
  --green: #7ab568;
  --green-bright: #b2df8e;
  --gold: #e3b966;
  --red: #dd7b6e;
  --blue: #72a9c8;
  --shadow: 0 24px 72px rgba(0, 0, 0, .36);
  --shadow-soft: 0 12px 38px rgba(0, 0, 0, .16);
  --topbar: 76px;
  --sidebar: 288px;
  --radius: 18px;
  --font: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Bitter", Georgia, serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f1efe6;
  --bg-elevated: #faf8f0;
  --panel: #fffdf6;
  --panel-2: #f3f0e4;
  --panel-soft: rgba(255, 253, 246, .84);
  --line: #d7d1bf;
  --line-soft: rgba(70, 91, 70, .14);
  --text: #1d2921;
  --muted: #526158;
  --faint: #78837b;
  --green: #4f7f48;
  --green-bright: #32672e;
  --gold: #a87320;
  --red: #a3493e;
  --blue: #377495;
  --shadow: 0 18px 50px rgba(53, 48, 36, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(90, 139, 86, .16), transparent 28rem),
    linear-gradient(180deg, var(--bg-elevated), var(--bg) 28rem);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.72;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .24;
  background-image:
    linear-gradient(rgba(164, 207, 143, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(164, 207, 143, .026) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green-bright); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold); }
img { display: block; max-width: 100%; }
kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font: 600 11px/1 var(--font);
  padding: 5px 7px;
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  background: var(--gold);
  color: #17130b;
  padding: .7rem 1rem;
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar);
  z-index: 60;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(240px, 680px) 44px;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--text); }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { font: 700 18px/1.1 var(--font-display); letter-spacing: .01em; }
.brand small { color: var(--faint); font-size: 11px; margin-top: 5px; text-transform: uppercase; letter-spacing: .11em; }
.brand-mark {
  position: relative;
  width: 35px;
  height: 35px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 2px;
  transform: rotate(-3deg);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.28));
}
.brand-mark i { display: block; background: var(--green); border: 1px solid rgba(255,255,255,.12); }
.brand-mark i:nth-child(1) { height: 17px; }
.brand-mark i:nth-child(2) { height: 30px; background: var(--gold); }
.brand-mark i:nth-child(3) { height: 23px; }

.search-trigger {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, transform .2s, background .2s;
}
.search-trigger:hover { border-color: var(--green); background: var(--panel-2); }
.search-trigger span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-button {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}
.icon-button:hover { background: var(--panel); border-color: var(--line); color: var(--text); }
.mobile-only { display: none; }

.sidebar {
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  z-index: 50;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-elevated) 92%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
  border-right: 1px solid var(--line-soft);
  overflow: auto;
  scrollbar-width: thin;
}
#sidebar-nav { padding: 26px 14px 30px; flex: 1; }
.nav-home { margin-bottom: 18px; }
.nav-group { margin-bottom: 9px; }
.nav-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px 8px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav-group-title::-webkit-details-marker { display: none; }
.nav-group-title::after { content: "›"; margin-left: 1px; font-size: 17px; line-height: 1; transition: transform .18s ease; }
.nav-group[open] > .nav-group-title::after { transform: rotate(90deg); }
.nav-group-title i { margin-left: auto; min-width: 20px; padding: 2px 5px; border-radius: 999px; background: var(--panel); color: var(--faint); font: 700 9px/1 var(--font); text-align: center; }
.nav-group-links { padding-bottom: 9px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 11px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active { color: var(--green-bright); background: linear-gradient(90deg, rgba(107, 160, 92, .16), rgba(107, 160, 92, .05)); border-color: rgba(128, 184, 107, .2); box-shadow: inset 3px 0 var(--green); }
.nav-icon { width: 22px; text-align: center; font-size: 16px; }

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 110;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  box-shadow: 0 0 10px color-mix(in srgb, var(--green) 70%, transparent);
  pointer-events: none;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 14px 16px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--panel-soft);
}
.sidebar-footer strong, .sidebar-footer small { display: block; line-height: 1.25; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer small { color: var(--faint); font-size: 10px; margin-top: 3px; }
.status-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #75c46b; box-shadow: 0 0 0 4px rgba(117,196,107,.12); }

.content {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: calc(var(--topbar) + 46px) clamp(24px, 5vw, 84px) 88px;
  outline: none;
}
.content-inner { width: min(1160px, 100%); margin: 0 auto; }
.loading-state { min-height: 60vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loader { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero {
  position: relative;
  min-height: 510px;
  display: flex;
  align-items: end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #14231d;
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .72; z-index: -2; }
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(6,12,9,.97) 0%, rgba(8,15,11,.84) 48%, rgba(8,14,11,.08) 100%), linear-gradient(0deg, rgba(8,14,11,.9), transparent 58%);
}
.hero-copy { max-width: 720px; padding: clamp(32px, 5vw, 68px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #c4e3b3; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .13em; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--green); }
.hero h1 { margin: 16px 0 16px; font: 760 clamp(42px, 6vw, 76px)/.98 var(--font-display); letter-spacing: -.045em; color: #fff; text-wrap: balance; text-shadow: 0 8px 32px rgba(0,0,0,.38); }
.hero p { max-width: 590px; margin: 0; color: #c7d2ca; font-size: clamp(15px, 2vw, 18px); }
.hero-search {
  margin-top: 26px;
  min-height: 54px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 15px;
  background: rgba(13, 23, 18, .76);
  color: #dce6de;
  cursor: text;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 36px rgba(0,0,0,.24);
}
.hero-search:hover { border-color: var(--green); }
.hero-search span:nth-child(2) { flex: 1; text-align: left; color: #aebdb3; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-meta span { padding: 6px 9px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: #c5d2c9; background: rgba(8,14,11,.4); font-size: 11px; }

.section { margin-top: 58px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font: 720 clamp(25px, 3vw, 36px)/1.15 var(--font-display); letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.section-link { flex: none; color: var(--green-bright); font-size: 12px; font-weight: 750; text-decoration: none; }
.section-link:hover { color: var(--gold); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.quick-card, .feature-card, .mod-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.quick-card:hover, .feature-card:hover, .mod-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--green) 52%, var(--line)); color: var(--text); background: var(--panel); box-shadow: 0 22px 46px rgba(0,0,0,.24); }
.quick-card { min-height: 142px; padding: 20px; }
.quick-card .card-icon { font-size: 27px; }
.quick-card h3 { margin: 16px 0 5px; font: 700 16px/1.25 var(--font-display); }
.quick-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.quick-card::after { content: "→"; position: absolute; top: 18px; right: 18px; color: var(--faint); }
.feature-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.feature-card { min-height: 270px; display: flex; align-items: end; }
.feature-card:first-child { grid-row: span 2; min-height: 554px; }
.feature-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,8,6,.92), rgba(4,8,6,.05) 72%); }
.feature-card-copy { position: relative; z-index: 1; padding: 21px; color: white; }
.feature-card-copy h3 { margin: 0 0 5px; font: 720 23px/1.2 var(--font-display); letter-spacing: -.02em; }
.feature-card-copy p { margin: 0; color: #ced8d0; font-size: 12px; }
.mod-list-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.mod-card { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 74px; }
.mod-card img, .mod-icon { width: 46px; height: 46px; flex: none; border-radius: 10px; object-fit: cover; background: var(--panel-2); image-rendering: auto; }
.mod-card strong, .mod-card small { display: block; line-height: 1.25; }
.mod-card strong { font-size: 12px; font-weight: 750; }
.mod-card small { color: var(--faint); font-size: 10px; margin-top: 4px; }

.notice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.notice { padding: 17px; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--panel-soft); }
.notice strong { display: block; margin-bottom: 5px; font-size: 13px; }
.notice p { margin: 0; color: var(--muted); font-size: 12px; }
.notice.green { border-left: 3px solid var(--green); }
.notice.gold { border-left: 3px solid var(--gold); }
.notice.blue { border-left: 3px solid var(--blue); }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 18px; color: var(--faint); font-size: 12px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.article-header {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  display: flex;
  align-items: end;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}
.article-header.with-image { min-height: 390px; color: white; box-shadow: var(--shadow); }
.article-header.with-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,9,6,.94), rgba(4,9,6,.2)); }
.article-header-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article-header-copy { position: relative; z-index: 1; max-width: 780px; }
.article-kicker { color: var(--green-bright); text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: 10px; }
.with-image .article-kicker { color: #c5ecb1; }
.article-header h1 { margin: 10px 0 12px; font: 760 clamp(36px, 5vw, 62px)/1.02 var(--font-display); letter-spacing: -.04em; text-wrap: balance; }
.article-header p { margin: 0; max-width: 720px; color: var(--muted); font-size: 15px; }
.with-image p { color: #d0dad3; }
.badge-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 10px; font-weight: 700; }
.with-image .badge { background: rgba(10,18,13,.58); border-color: rgba(255,255,255,.18); color: #e0e8e2; }

.article-layout { display: grid; grid-template-columns: minmax(0, 800px) 270px; gap: 48px; align-items: start; margin-top: 42px; }
.article-body { min-width: 0; }
.article-body h2 { margin: 50px 0 15px; padding: 10px 0 0; font: 720 30px/1.2 var(--font-display); letter-spacing: -.025em; scroll-margin-top: calc(var(--topbar) + 20px); }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin: 30px 0 10px; font: 700 19px/1.3 var(--font-display); scroll-margin-top: calc(var(--topbar) + 20px); }
.article-body p { color: color-mix(in srgb, var(--text) 90%, var(--muted)); }
.article-body li { margin: 7px 0; }
.article-body strong { color: var(--text); }
.article-body hr { border: 0; border-top: 1px solid var(--line-soft); margin: 32px 0; }
.article-body code { padding: 2px 6px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--panel-2); color: var(--gold); font-size: .88em; }
.article-body table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; font-size: 12px; background: color-mix(in srgb, var(--panel) 62%, transparent); box-shadow: var(--shadow-soft); }
.article-body th, .article-body td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.article-body th { background: var(--panel-2); color: var(--green-bright); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body .callout { margin: 20px 0; padding: 15px 17px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 10px; background: var(--panel-soft); }
.article-body .callout.warning { border-left-color: var(--gold); }
.article-body .callout.danger { border-left-color: var(--red); }
.article-body .callout p { margin: 0; font-size: 13px; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { position: relative; min-height: 42px; padding: 3px 0 18px 48px; margin: 0; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: rgba(128,184,107,.13); color: var(--green-bright); border: 1px solid rgba(128,184,107,.24); font-size: 12px; font-weight: 800; }
.key-table kbd { display: inline-block; color: var(--text); min-width: 28px; text-align: center; }

.article-aside { position: sticky; top: calc(var(--topbar) + 24px); display: grid; gap: 13px; }
.toc, .info-card { padding: 18px; border: 1px solid var(--line-soft); border-radius: 15px; background: color-mix(in srgb, var(--panel) 78%, transparent); box-shadow: var(--shadow-soft); backdrop-filter: blur(10px); }
.toc strong, .info-card > strong { display: block; margin-bottom: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 11px; line-height: 1.35; }
.toc a:hover { color: var(--green-bright); }
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.info-row:last-child { border-bottom: 0; }
.info-row span:first-child { color: var(--faint); }
.info-row span:last-child { text-align: right; color: var(--text); font-weight: 650; }
.aside-actions { display: grid; gap: 7px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); text-decoration: none; cursor: pointer; font-size: 11px; font-weight: 700; }
.button:hover { border-color: var(--green); color: var(--text); }
.button.primary { background: var(--green); border-color: var(--green); color: #0d160e; }

.article-body .lead {
  margin: 0 0 28px;
  color: var(--muted);
  font: 500 18px/1.7 var(--font-display);
}

.article-body .stat-grid,
.article-body .content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.article-body .stat,
.article-body .content-card {
  padding: 17px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-soft);
}

.article-body .stat strong,
.article-body .content-card strong {
  display: block;
  margin-bottom: 5px;
  font: 700 14px/1.3 var(--font-display);
}

.article-body .stat span,
.article-body .content-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.article-body details {
  margin: 10px 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-soft);
  overflow: hidden;
}

.article-body summary {
  padding: 13px 16px;
  cursor: pointer;
  color: var(--text);
  font-weight: 750;
}

.article-body details > :not(summary) { margin-left: 16px; margin-right: 16px; }
.article-body details > :last-child { margin-bottom: 16px; }

.article-body .checklist { list-style: none; padding: 0; }
.article-body .checklist li { position: relative; padding-left: 28px; }
.article-body .checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--green-bright); font-weight: 800; }

.article-body .code-proof {
  position: relative;
  margin: 22px 0 28px;
  padding: 16px 18px 16px 52px;
  border: 1px solid color-mix(in srgb, var(--green) 38%, var(--line));
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--green) 11%, var(--panel)), var(--panel-soft));
}
.article-body .code-proof::before { content: "</>"; position: absolute; left: 16px; top: 17px; color: var(--green-bright); font: 800 11px/1 var(--font); }
.article-body .code-proof span { display: block; margin-bottom: 4px; color: var(--green-bright); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.article-body .code-proof p { margin: 0; font-size: 12px; }

.article-body .link-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 24px; }
.article-body .link-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, color .18s ease;
}
.article-body .link-cloud a:hover { transform: translateY(-1px); border-color: var(--green); color: var(--green-bright); }

.search-modal[hidden] { display: none; }
.search-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 10vh 18px 18px; }
.search-backdrop { position: absolute; inset: 0; background: rgba(3,7,5,.72); backdrop-filter: blur(7px); }
.search-panel { position: relative; width: min(720px, 100%); max-height: 76vh; overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-elevated); box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.search-input-wrap { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: var(--bg-elevated); }
.search-input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 17px; }
.search-input-wrap input::placeholder { color: var(--faint); }
.search-hints { display: flex; flex-wrap: wrap; gap: 7px; padding: 13px 17px 0; }
.search-hints button { border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); padding: 5px 9px; cursor: pointer; font-size: 10px; }
.search-hints button:hover { color: var(--text); border-color: var(--green); }
.search-results { padding: 10px; }
.search-result { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 11px; border-radius: 11px; color: var(--text); text-decoration: none; }
.search-result:hover, .search-result.selected { background: var(--panel); color: var(--text); }
.search-result-icon { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: var(--panel-2); font-size: 21px; }
.search-result-icon img { width: 100%; height: 100%; object-fit: cover; }
.search-result strong, .search-result small { display: block; }
.search-result strong { font-size: 13px; }
.search-result small { margin-top: 3px; color: var(--faint); font-size: 10px; }
.search-result > span:last-child { color: var(--faint); }
.empty-search { padding: 36px 20px; text-align: center; color: var(--muted); }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; transform: translateY(20px); opacity: 0; pointer-events: none; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-size: 12px; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.page-footer { margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 20px; color: var(--faint); font-size: 11px; }

@media (max-width: 1050px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .mod-list-grid { grid-template-columns: repeat(3, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-aside { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); order: -1; }
}

@media (max-width: 780px) {
  :root { --topbar: 62px; }
  .topbar { grid-template-columns: 40px minmax(0, 1fr) 40px; padding: 0 11px; gap: 8px; }
  .topbar .brand { justify-self: center; }
  .brand small, .brand-mark, .topbar > .search-trigger { display: none; }
  .mobile-only { display: grid; }
  .sidebar { top: var(--topbar); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; padding: calc(var(--topbar) + 18px) 14px 60px; }
  .hero { min-height: 500px; border-radius: 17px; }
  .hero::after { background: linear-gradient(0deg, rgba(8,14,11,.96), rgba(8,14,11,.34)); }
  .hero-copy { padding: 24px; }
  .hero h1 { font-size: 46px; }
  .hero-search kbd { display: none; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-card:first-child { grid-column: 1 / -1; grid-row: auto; min-height: 360px; }
  .mod-list-grid { grid-template-columns: repeat(2, 1fr); }
  .notice-grid { grid-template-columns: 1fr; }
  .article-header { border-radius: 16px; }
  .article-aside { grid-template-columns: 1fr; }
  .article-body .stat-grid, .article-body .content-grid { grid-template-columns: 1fr 1fr; }
  .toc { display: none; }
  .article-body table { display: block; overflow-x: auto; }
  .page-footer { display: block; }
}

@media (max-width: 520px) {
  .card-grid, .feature-grid, .mod-list-grid { grid-template-columns: 1fr; }
  .feature-card:first-child { grid-column: auto; }
  .quick-card { min-height: 118px; }
  .section { margin-top: 34px; }
  .article-header.with-image { min-height: 300px; }
  .article-header h1 { font-size: 38px; }
  .article-layout { gap: 24px; }
  .article-body h2 { font-size: 25px; }
  .article-body .stat-grid, .article-body .content-grid { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .sidebar, .article-aside, .page-footer, .search-modal, .toast { display: none !important; }
  .content { margin: 0; padding: 0; }
  body { background: white; color: black; }
  .article-header, .article-body table, .callout { border-color: #aaa !important; box-shadow: none; }
  .article-header.with-image { min-height: auto; color: black; }
  .article-header-image { display: none; }
  .article-header.with-image::after { display: none; }
  .article-header p, .with-image p { color: #333; }
}
