* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --indigo: #4f46e5;
  --indigo-dark: #4338ca;
  --ink: #0f172a;
  --body: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-light: #f1f5f9;
  --bg-side: #fafbfc;
  --sidebar-w: 268px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff;
  color: var(--body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 60px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 14px;
}
.topbar-logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 16px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.02em; line-height: 1;
}
.topbar-logo:hover { text-decoration: none; }
.topbar-logo img { display: block; border-radius: 6px; width: 26px; height: 26px; }
.topbar-logo .tag {
  font-size: 12px; font-weight: 600; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: 10px; margin-left: 2px;
}
.topbar-spacer { flex: 1; }
.topbar-link {
  font-size: 14px; font-weight: 500; color: var(--muted);
}
.topbar-link:hover { color: var(--indigo); text-decoration: none; }

/* Hamburger (mobile only) */
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  color: var(--ink); border-radius: 7px;
}
.menu-toggle:hover { background: var(--line-light); }
.menu-toggle svg { width: 22px; height: 22px; }

/* ---------- Layout shell ---------- */
.shell { display: flex; max-width: 1240px; margin: 0 auto; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  align-self: flex-start;
  border-right: 1px solid var(--line);
  padding: 30px 20px 60px;
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  min-height: 0;
  position: sticky; top: 60px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}
.side-group { margin-bottom: 26px; }
.side-group-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px; padding-left: 10px;
}
.side-link {
  display: block;
  font-size: 14.5px; font-weight: 500; color: var(--body);
  padding: 7px 10px; border-radius: 7px;
  line-height: 1.4;
}
.side-link:hover { background: var(--line-light); color: var(--ink); text-decoration: none; }
.side-link.active {
  background: #eef2ff; color: var(--indigo); font-weight: 600;
}

/* ---------- Main content ---------- */
.content {
  flex: 1; min-width: 0;
  padding: 44px 56px 90px;
  max-width: 820px;
}
.breadcrumb {
  font-size: 13px; color: var(--muted); margin-bottom: 18px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--indigo); }
.breadcrumb .sep { margin: 0 8px; color: var(--line); }

.content h1 {
  font-size: 34px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 14px;
}
.content .intro {
  font-size: 18px; color: var(--muted); line-height: 1.6;
  margin-bottom: 36px;
}
.content h2 {
  font-size: 21px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.02em; margin-top: 40px; margin-bottom: 12px;
  padding-bottom: 0;
}
.content h3 {
  font-size: 17px; font-weight: 650; color: var(--ink);
  margin-top: 26px; margin-bottom: 8px;
}
.content p { margin-bottom: 18px; }
.content ul, .content ol { margin: 0 0 18px 22px; }
.content li { margin-bottom: 8px; }
.content strong { color: var(--ink); font-weight: 600; }

/* Callout box */
.note {
  background: #eef2ff; border: 1px solid #e0e7ff;
  border-radius: 10px; padding: 14px 16px; margin: 24px 0;
  font-size: 15px; color: #3730a3;
}
.note strong { color: #312e81; }

/* Step list */
.steps { counter-reset: step; list-style: none; margin-left: 0; }
.steps li {
  position: relative; padding-left: 42px; margin-bottom: 18px;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--indigo); color: #fff;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Index page cards ---------- */
.hero-help {
  padding: 8px 0 30px;
}
.hero-help h1 {
  font-size: 36px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.03em; margin-bottom: 12px;
}
.hero-help p { font-size: 18px; color: var(--muted); }

.card-group { margin-top: 36px; }
.card-group-title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.cards {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-bottom: 10px;
}
.doc-card {
  display: block;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: #fff;
}
.doc-card:hover {
  border-color: var(--indigo);
  box-shadow: 0 4px 16px rgba(79,70,229,0.08);
  text-decoration: none;
  transform: translateY(-1px);
}
.doc-card-title {
  font-size: 16px; font-weight: 650; color: var(--ink);
  margin-bottom: 5px;
}
.doc-card-desc { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---------- Footer ---------- */
.content-footer {
  margin-top: 60px; padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.content-footer a { color: var(--muted); }

/* ---------- Mobile ---------- */
/* Closed: not positioned, no hit-testing. Covering styles apply only when .show + mobile. */
.sidebar-backdrop {
  display: none;
  pointer-events: none;
}

@media (max-width: 860px) {
  .menu-toggle { display: flex; }
  .content { padding: 32px 22px 70px; }
  .content h1 { font-size: 28px; }
  .hero-help h1 { font-size: 30px; }
  .cards { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; top: 60px; left: 0; bottom: 0;
    height: auto;
    max-height: none;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.22s ease, visibility 0.22s ease;
    z-index: 45;
    box-shadow: 2px 0 16px rgba(0,0,0,0.06);
    pointer-events: none;
    visibility: hidden;
  }
  .sidebar.open {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
  }
  .sidebar-backdrop.show {
    display: block;
    pointer-events: auto;
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(15,23,42,0.35);
    z-index: 40;
  }
  .topbar-logo .tag { display: none; }
}

/* Desktop: never let a leftover .show/.open overlay cover content */
@media (min-width: 861px) {
  .sidebar-backdrop,
  .sidebar-backdrop.show {
    display: none;
    pointer-events: none;
  }
}
