:root {
  color-scheme: dark;
  --navy: #0b1220;
  --panel: #111827;
  --panel-soft: #172136;
  --gold: #f5c542;
  --gold-soft: #ffd86b;
  --cream: #f5f9e8;
  --muted: #aeb8c8;
  --line: rgba(245, 197, 66, 0.2);
  --danger: #ff665f;
  --bar-height: 68px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: #050914; scroll-behavior: smooth; }
body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(circle at 12% 0, rgba(245, 197, 66, .12), transparent 30rem), #050914;
  color: var(--cream);
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }

.site-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(var(--bar-height) + 30px + env(safe-area-inset-bottom));
  overflow: hidden;
  background: rgba(11, 18, 32, .97);
  box-shadow: 0 0 52px rgba(0, 0, 0, .5);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 62px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 18, 32, .94);
  backdrop-filter: blur(14px);
}
.menu-toggle {
  display: inline-grid;
  place-content: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--gold-soft);
  cursor: pointer;
}
.menu-toggle span { width: 19px; height: 2px; border-radius: 2px; background: currentColor; }
.brand {
  min-width: 0;
  color: var(--gold);
  font-size: clamp(1.35rem, 6vw, 1.8rem);
  font-weight: 950;
  letter-spacing: -.06em;
  line-height: 1;
  text-shadow: 0 2px 16px rgba(245, 197, 66, .34);
}
.auth-links { display: flex; gap: 6px; white-space: nowrap; }
.auth-links a {
  padding: 8px 9px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-soft);
  font-size: .72rem;
  font-weight: 850;
}
.auth-links .primary { background: linear-gradient(135deg, var(--gold), var(--gold-soft)); color: #171109; }

.promo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 10px 12px 2px; }
.promo-pill {
  min-width: 0;
  padding: 8px 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(245, 197, 66, .13), rgba(17, 24, 39, .9));
  color: var(--gold-soft);
  font-size: .66rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-nav { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; }
.chip-nav::-webkit-scrollbar { display: none; }
.nav-chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.nav-chip[aria-current="page"] { border-color: var(--gold); background: rgba(245, 197, 66, .14); color: var(--gold-soft); }

.content { padding: 4px 12px 24px; }
.breadcrumb { margin: 0 0 10px; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.breadcrumb a { color: var(--gold-soft); }
.hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, #182236, #0f1727 68%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .28);
}
.hero-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--line); }
.hero-card::after {
  position: absolute;
  right: -32px;
  bottom: -48px;
  width: 130px;
  height: 130px;
  border: 24px solid rgba(245, 197, 66, .055);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; padding: 18px; }
.eyebrow { margin: 0 0 7px; color: var(--gold); font-size: .68rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { text-wrap: balance; }
h1 { margin: 0; color: var(--cream); font-size: clamp(1.65rem, 8vw, 2.45rem); line-height: 1.08; letter-spacing: -.035em; }
.lead { margin: 12px 0 0; color: #d9e1ec; font-size: .96rem; line-height: 1.75; }

.page-toc {
  margin: 14px 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(17, 24, 39, .92);
}
.page-toc strong { display: block; margin-bottom: 9px; color: var(--gold-soft); }
.page-toc div { display: grid; gap: 7px; }
.page-toc a { position: relative; padding-left: 17px; color: #dce4ee; font-size: .84rem; line-height: 1.45; }
.page-toc a::before { position: absolute; left: 2px; color: var(--gold); content: "•"; }

.article-body { display: grid; gap: 12px; }
.article-section {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(24, 34, 54, .92), rgba(15, 23, 39, .96));
}
.article-section h2, .faq-section h2, .related-section h2 { margin: 0 0 12px; color: var(--gold-soft); font-size: 1.2rem; line-height: 1.3; }
.article-section p, .notice-card p, .site-footer p { margin: 0; color: #d8e0eb; font-size: .94rem; line-height: 1.82; }
.article-section p + p { margin-top: 10px; }
.check-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 23px; color: #cbd5e1; font-size: .88rem; line-height: 1.55; }
.check-list li::before { position: absolute; left: 0; top: .05em; color: var(--gold); font-weight: 900; content: "✓"; }

.notice-card { margin-top: 14px; padding: 16px; border: 1px solid rgba(255, 102, 95, .34); border-radius: 18px; background: rgba(112, 28, 31, .18); }
.notice-card strong { display: block; margin-bottom: 7px; color: #ff9c96; font-size: .82rem; letter-spacing: .04em; }
.faq-section, .related-section { margin-top: 18px; }
.faq-item { margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.faq-item button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 15px;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.faq-item button span:last-child { color: var(--gold); font-size: 1.3rem; transition: transform .2s ease; }
.faq-answer { display: none; padding: 0 15px 15px; }
.faq-answer p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.faq-item.is-open .faq-answer { display: block; }
.faq-item.is-open button span:last-child { transform: rotate(45deg); }
.related-grid { display: grid; gap: 9px; }
.related-card { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.related-card span { color: var(--gold); font-size: .65rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.related-card strong { color: var(--cream); font-size: .94rem; line-height: 1.4; }
.related-card small { color: var(--muted); }
.back-to-top { display: block; margin: 18px auto 0; padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--gold-soft); cursor: pointer; }

.site-footer { padding: 21px 16px; border-top: 1px solid var(--line); background: #080e19; text-align: center; }
.site-footer strong { color: var(--gold); font-size: 1.2rem; }
.site-footer p { margin-top: 7px; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 760px);
  min-height: var(--bar-height);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(8, 14, 25, .96);
  backdrop-filter: blur(14px);
}
.bottom-nav a { display: grid; place-content: center; gap: 3px; color: var(--muted); font-size: .67rem; font-weight: 800; text-align: center; }
.bottom-nav a span { color: var(--gold); font-size: 1.1rem; }

.menu-overlay { position: fixed; inset: 0; z-index: 60; visibility: hidden; background: rgba(0, 0, 0, .62); opacity: 0; transition: .2s ease; }
.menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: min(86vw, 360px);
  height: 100dvh;
  padding: 16px;
  overflow-y: auto;
  transform: translateX(-102%);
  border-right: 1px solid var(--line);
  background: #0a111e;
  box-shadow: 20px 0 50px rgba(0, 0, 0, .42);
  transition: transform .22s ease;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; color: var(--gold-soft); }
.drawer-head button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--gold-soft); font-size: 1.3rem; }
.menu-drawer nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.drawer-link { padding: 11px 9px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; background: var(--panel); color: var(--muted); font-size: .78rem; font-weight: 800; text-align: center; }
.drawer-link[aria-current="page"] { border-color: var(--gold); color: var(--gold-soft); }
.menu-drawer > p { margin-top: 18px; color: var(--muted); font-size: .8rem; line-height: 1.6; }
body.menu-open .menu-overlay { visibility: visible; opacity: 1; }
body.menu-open .menu-drawer { transform: translateX(0); }

@media (min-width: 680px) {
  .content { padding-inline: 22px; }
  .hero-card { display: grid; grid-template-columns: 44% 1fr; min-height: 330px; }
  .hero-card img { height: 100%; aspect-ratio: auto; border-right: 1px solid var(--line); border-bottom: 0; }
  .hero-copy { display: grid; align-content: center; padding: 26px; }
  .page-toc div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .auth-links a { padding-inline: 7px; font-size: .66rem; }
  .promo-pill { font-size: .6rem; }
  .hero-copy, .article-section { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
