:root {
  --navy: #0b2a4a;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #f0fdfa;
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f8fb;
  --card: #fff;
  --radius: 14px;
  --side-w: 288px;
  --bar-h: 64px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
main { outline: none; }
svg { width: 18px; height: 18px; flex: none; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(15, 118, 110, 0.35); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 12px; }

/* ── Shell: sidebar + page ─────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--line);
  z-index: 30;
}
.side-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; }
.side-brand { display: flex; align-items: center; }
.side-brand img { height: 30px; width: auto; display: block; }
.side-tag { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); background: var(--teal-soft); border: 1px solid #ccfbf1; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.side-close { display: none; margin-left: auto; border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; }
.side-close:hover { background: #f1f5f9; color: var(--ink); }

.side-search { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; color: var(--muted); }
.side-search:focus-within { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12); }
.side-search svg { width: 16px; height: 16px; }
.side-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 0.9rem; padding: 9px 0; color: var(--ink); outline: none; }

.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; overscroll-behavior: contain; }
.side-group { margin-bottom: 2px; }
.side-group summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
}
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; margin: 0 4px 0 2px; }
.side-group[open] summary::before { transform: rotate(45deg); }
.side-group summary:hover { background: #f8fafc; }
.side-group summary span:first-child { flex: 1; }
.side-count { font-size: 0.7rem; font-weight: 700; color: var(--muted); background: #f1f5f9; border-radius: 999px; padding: 1px 7px; letter-spacing: 0; }
.side-group ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 14px; border-left: 1px solid var(--line); margin-left: 16px; }
.side-group li a { display: block; padding: 6px 10px; margin-left: -1px; border-left: 2px solid transparent; color: #334155; text-decoration: none; font-size: 0.88rem; line-height: 1.35; border-radius: 0 8px 8px 0; }
.side-group li a:hover { color: var(--ink); background: #f8fafc; border-left-color: #cbd5e1; }
.side-group li a.active { color: var(--teal); background: var(--teal-soft); border-left-color: var(--teal); font-weight: 700; }
.side-empty { color: var(--muted); font-size: 0.9rem; padding: 8px 12px; }

.side-foot { border-top: 1px solid var(--line); padding: 14px 20px 18px; font-size: 0.85rem; }
.side-foot-title { margin: 0 0 2px; font-weight: 700; color: var(--ink); }
.side-foot a { font-weight: 600; text-decoration: none; }
.side-foot-small { margin: 6px 0 0; color: var(--muted); font-size: 0.8rem; }

.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 25; }

/* Page */
.page { min-width: 0; display: flex; flex-direction: column; }
.pagebar {
  position: sticky; top: 0; z-index: 20; height: var(--bar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 32px; background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 12px; font: inherit; font-weight: 700; font-size: 0.9rem; color: var(--ink); cursor: pointer; }
.pagebar-brand { display: none; }
.pagebar-brand img { height: 26px; width: auto; display: block; }
.pagebar-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pagebar-links a { color: #334155; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 8px; font-size: 0.92rem; }
.pagebar-links a:hover { background: #f1f5f9; color: var(--ink); }
.pagebar-links a.top-cta, .top-cta { white-space: nowrap; background: var(--teal); color: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; display: inline-block; margin-left: 6px; }
.pagebar-links a.top-cta:hover, .top-cta:hover { background: var(--teal-dark); color: #fff; }

main#main { flex: 1; width: 100%; max-width: 1240px; padding: 28px 32px 8px; }

/* ── Home ─────────────────────────────────────────────────────────────── */
.hero { background: radial-gradient(circle at 92% 0%, rgba(13, 148, 136, 0.55), transparent 55%), linear-gradient(135deg, var(--navy), #12406b); color: #fff; border-radius: 20px; padding: 40px 40px 34px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 800; color: #5eead4; margin: 0 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); margin: 0 0 10px; line-height: 1.15; color: #fff; }
.lead { max-width: 68ch; color: #dbeafe; font-size: 1.04rem; margin: 0 0 20px; }
.search input { width: 100%; max-width: 620px; border: 0; border-radius: 12px; padding: 14px 16px; font: inherit; font-size: 1rem; box-shadow: 0 8px 24px rgba(2, 6, 23, 0.25); }
.emergency-note { margin-top: 16px; display: inline-block; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 10px; padding: 8px 12px; font-size: 0.9rem; }

.policy-banner { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 10px 16px; margin: 20px 0 14px; font-size: 0.875rem; }
.policy-banner:empty { display: none; }
.category-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.category-nav a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.88rem; }
.category-nav a:hover { border-color: var(--teal); color: var(--teal); }
.no-results { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); }

.category { margin: 32px 0; scroll-margin-top: calc(var(--bar-h) + 16px); }
.category-head h2 { margin: 0 0 4px; color: var(--ink); font-size: 1.3rem; }
.category-head p { margin: 0 0 14px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08); color: inherit; }
.card h3 { margin: 0; font-size: 1rem; color: var(--ink); line-height: 1.35; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }
.card-more { color: var(--teal); font-weight: 700; font-size: 0.86rem; }
.card-tag { align-self: flex-start; background: var(--teal-soft); color: var(--teal); border-radius: 999px; padding: 2px 9px; font-size: 0.74rem; font-weight: 700; }

/* ── Policy page ──────────────────────────────────────────────────────── */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.doc.has-toc { grid-template-columns: minmax(0, 1fr) 240px; }

.policy-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 36px 40px; box-shadow: var(--shadow); max-width: 820px; }
.policy-head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 8px; }
.policy-meta { margin: 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; color: var(--teal); }
.policy-card h1 { margin: 8px 0 10px; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); color: var(--ink); line-height: 1.18; letter-spacing: -0.01em; }
.policy-summary { font-size: 1.06rem; color: var(--muted); margin: 0 0 18px; }
.policy-facts-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.policy-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.policy-facts dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.policy-facts dd { margin: 0; color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.btn-print { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.btn-print svg { width: 16px; height: 16px; color: var(--muted); }
.btn-print:hover { border-color: var(--teal); color: var(--teal); }

.policy-card section { scroll-margin-top: calc(var(--bar-h) + 16px); }
.policy-card h2 { font-size: 1.18rem; margin: 30px 0 10px; color: var(--ink); }
.policy-card p { margin: 0 0 12px; }
.policy-card ul { margin: 0 0 14px; padding-left: 22px; }
.policy-card li { margin-bottom: 8px; }
.policy-card li::marker { color: var(--teal); }
.policy-contact { margin-top: 32px; background: var(--teal-soft); border: 1px solid #99f6e4; border-radius: 12px; padding: 16px 18px; }
.policy-contact p { margin: 4px 0 0; }

.toc { position: sticky; top: calc(var(--bar-h) + 24px); max-height: calc(100vh - var(--bar-h) - 48px); overflow-y: auto; padding: 4px 0; }
.toc summary { list-style: none; margin: 0 0 10px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); pointer-events: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.85rem; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a.current { color: var(--teal); border-left-color: var(--teal); font-weight: 600; }

.related { margin: 36px 0 0; max-width: 820px; }
.related h2 { font-size: 1.15rem; color: var(--ink); }
.related .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 32px 30px; color: var(--muted); font-size: 0.88rem; background: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 1176px; }
.footer-grid strong { color: var(--ink); }
.footer-grid p { margin: 4px 0 0; }
.footer-small { margin: 18px 0 0; font-size: 0.8rem; }
.notfound { padding: 80px 16px; text-align: center; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .doc.has-toc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; order: -1; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; max-width: 820px; }
  .toc ol { columns: 2; column-gap: 24px; border-left: 0; }
  .toc a { border-left: 0; padding: 4px 0; break-inside: avoid; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: 0 0 40px rgba(15, 23, 42, 0.2); }
  body.side-open .side { transform: none; }
  body.side-open { overflow: hidden; }
  .side-close { display: inline-flex; }
  .menu-btn { display: inline-flex; }
  .pagebar { padding: 0 16px; }
  .pagebar-brand { display: block; }
  .pagebar-links a:not(.top-cta) { display: none; }
  main#main { padding: 20px 16px 8px; }
  .site-footer { padding: 22px 16px 28px; }
}

@media (max-width: 640px) {
  .hero { padding: 28px 22px 24px; border-radius: 16px; }
  .policy-card { padding: 22px 20px; border-radius: 14px; }
  .toc ol { columns: 1; }
  .toc summary { pointer-events: auto; cursor: pointer; margin: 0; display: flex; justify-content: space-between; align-items: center; }
  .toc summary::after { content: "+"; font-size: 1.1rem; color: var(--teal); }
  .toc[open] summary { margin-bottom: 10px; }
  .toc[open] summary::after { content: "−"; }
  .pagebar-links a.top-cta { padding: 8px 12px; font-size: 0.85rem; }
}
@media (max-width: 430px) {
  .pagebar-brand { display: none; }
}

@media print {
  .side, .scrim, .pagebar, .btn-print, .related, .site-footer, .crumbs, .toc, .skip { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  main#main { padding: 0; max-width: none; }
  .policy-card { border: 0; padding: 0; box-shadow: none; max-width: none; }
  a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .side { transition: none; }
}
