:root {
  --teal: #2D5A5C;
  --teal-dark: #244B4D;
  --teal-tint: #F0FDF9;
  --ink: #1F1F1F;
  --body: #4B5563;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --line: #E5E7EB;
  --line-soft: #F3F4F6;
  --bg: #F4F5F7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font-family: "Inter", system-ui, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.serif { font-family: "Crimson Text", Georgia, serif; }

.masthead { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.masthead-inner { max-width: 1120px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-bar { width: 4px; height: 32px; background: var(--teal); border-radius: 999px; }
.brand-top { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); margin: 0; }
.brand-sub { font-size: 11px; color: var(--faint); margin: 2px 0 0; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--muted); border-radius: 5px; }
.topnav a:hover { background: var(--line-soft); color: var(--teal); text-decoration: none; }
.topnav a.current { background: var(--teal-tint); color: var(--teal); font-weight: 600; }

.page { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.page.single { grid-template-columns: 1fr; max-width: 860px; }
@media (max-width: 900px) { .page { grid-template-columns: 1fr; } .toc { position: static !important; } }

.toc { position: sticky; top: 84px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.toc p { font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: block; font-size: 12.5px; color: var(--muted); padding: 5px 6px; border-radius: 4px; font-weight: 500; }
.toc a::before { content: counter(toc) ". "; color: var(--faint); }
.toc a:hover { background: var(--line-soft); color: var(--teal); text-decoration: none; }

.doc { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 36px 40px; }
@media (max-width: 640px) { .doc { padding: 24px 20px; } }
.doc-head { border-bottom: 1px solid var(--line-soft); padding-bottom: 20px; margin-bottom: 8px; }
.doc h1 { font-family: "Crimson Text", Georgia, serif; font-size: 34px; font-weight: 600; margin: 0; line-height: 1.15; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 12px; color: var(--faint); }
.meta b { color: var(--muted); font-weight: 600; }
.doc h2 { font-family: "Crimson Text", Georgia, serif; font-size: 23px; font-weight: 600; margin: 34px 0 10px; padding-top: 4px; }
.doc h3 { font-size: 13px; font-weight: 700; margin: 22px 0 6px; color: var(--ink); }
.doc p, .doc li { font-size: 14px; line-height: 1.75; color: var(--body); }
.doc ul, .doc ol { padding-left: 20px; }
.doc li { margin: 4px 0; }
.doc strong { color: var(--ink); font-weight: 600; }

.summary { background: var(--teal-tint); border: 1px solid #CDEBE3; border-radius: 8px; padding: 18px 20px; margin: 22px 0 6px; }
.summary p.label { font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 6px; }
.summary ul { margin: 0; }

.callout { border-left: 3px solid var(--teal); background: #FAFBFC; padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 14px 0; }
.callout p { margin: 0; }

.table-wrap { overflow-x: auto; margin: 12px 0 4px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; background: #F9FAFB; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 14px; }
td { border-bottom: 1px solid var(--line-soft); padding: 11px 14px; font-size: 13px; line-height: 1.6; color: var(--body); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td:first-child { color: var(--ink); font-weight: 500; }

.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 22px; }
.hub a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; color: inherit; transition: border-color 0.15s; }
.hub a:hover { border-color: var(--teal); text-decoration: none; }
.hub h3 { margin: 0 0 6px; font-family: "Crimson Text", Georgia, serif; font-size: 20px; font-weight: 600; }
.hub p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

.btn { display: inline-block; padding: 9px 18px; background: var(--teal); color: #fff; font-size: 13px; font-weight: 500; border-radius: 6px; }
.btn:hover { background: var(--teal-dark); text-decoration: none; }
.btn-secondary { background: var(--line-soft); color: #374151; border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--line); }

.footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 20px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--faint); }
.footer a { color: var(--muted); font-weight: 500; margin-right: 14px; }

@media print {
  .masthead, .toc, .footer { display: none; }
  body { background: #fff; }
  .page { display: block; padding: 0; }
  .doc { border: none; padding: 0; }
}
