/* ==========================================================================
   Wallet Desktop Guide — design system
   Independent editorial documentation site
   ========================================================================== */

/* --- tokens -------------------------------------------------------------- */
:root {
  --navy-900: #08131f;
  --navy-800: #0c1e30;
  --navy-700: #12304a;

  --ink: #0b1727;
  --ink-2: #35435c;
  --ink-3: #64738c;

  --paper: #ffffff;
  --paper-2: #f6f8fb;
  --paper-3: #edf1f7;

  --line: #e0e6ef;
  --line-strong: #c7d2e0;

  --accent: #0e7490;
  --accent-2: #0a5b72;
  --accent-ink: #ffffff;
  --accent-tint: #e8f4f8;
  --accent-line: #bcdde6;

  --warn: #8f5606;
  --warn-tint: #fdf4e6;
  --warn-line: #eed8b2;

  --safe: #0d6f4d;
  --safe-tint: #e8f6f0;
  --safe-line: #bce0d1;

  --danger: #a32218;
  --danger-tint: #fdecea;
  --danger-line: #f2c7c2;

  --radius-lg: 18px;
  --radius: 13px;
  --radius-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(9, 20, 38, 0.05), 0 6px 16px -10px rgba(9, 20, 38, 0.16);
  --shadow-md: 0 2px 6px rgba(9, 20, 38, 0.06), 0 20px 40px -24px rgba(9, 20, 38, 0.28);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1200px;
  --measure: 72ch;
  --header-h: 66px;

  color-scheme: light;
}

[data-theme="dark"] {
  --navy-900: #050c16;
  --navy-800: #0a1524;
  --navy-700: #0f2437;

  --ink: #e9eff7;
  --ink-2: #b3c0d2;
  --ink-3: #8595ac;

  --paper: #0b1524;
  --paper-2: #0f1c2e;
  --paper-3: #15253a;

  --line: #20324a;
  --line-strong: #33475f;

  --accent: #56b6d3;
  --accent-2: #7cc9e0;
  --accent-ink: #06212b;
  --accent-tint: #102c3b;
  --accent-line: #1f4a5e;

  --warn: #e0a556;
  --warn-tint: #2b2214;
  --warn-line: #4a3a1d;

  --safe: #63c79c;
  --safe-tint: #10291f;
  --safe-line: #1f4636;

  --danger: #f08a80;
  --danger-tint: #2c1a18;
  --danger-line: #4b2a26;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px -12px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45), 0 24px 48px -26px rgba(0, 0, 0, 0.8);

  color-scheme: dark;
}

/* --- base ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- typography --------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 660;
  letter-spacing: -0.022em;
  line-height: 1.18;
  margin: 0 0 0.6em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.4vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.05rem); margin-top: 2.2em; }
h3 { font-size: clamp(1.16rem, 1.05rem + 0.45vw, 1.4rem); margin-top: 1.7em; }
h4 { font-size: 1.03rem; margin-top: 1.5em; letter-spacing: -0.01em; }

p { margin: 0 0 1.15em; }
strong { font-weight: 640; color: var(--ink); }

.lede {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.32rem);
  line-height: 1.6;
  color: var(--ink-2);
  letter-spacing: 0;
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 640;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9em;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-3);
  margin: 0 0 1.4em;
}
.meta-line span { display: inline-flex; align-items: center; gap: 0.4rem; }

blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.3em;
  border-left: 3px solid var(--accent-line);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink-2);
}
blockquote p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.35em; }
li { margin-bottom: 0.45em; }
li::marker { color: var(--ink-3); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }

/* --- layout ------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.section { padding: 4.2rem 0; }
.section--tight { padding: 3rem 0; }
.section--alt { background: var(--paper-2); border-block: 1px solid var(--line); }

.section-head { max-width: 62ch; margin-bottom: 2.2rem; }
.section-head p { color: var(--ink-2); margin-bottom: 0; }

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* --- header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 640;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--navy-700), var(--accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}
.brand-mark svg { width: 17px; height: 17px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 0.99rem; }
.brand-sub {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 560;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 0.15rem; }

.nav a {
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 520;
  padding: 0.5rem 0.62rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--paper-3); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-tint); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; margin-left: 0.5rem; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .icon-moon,
[data-theme="dark"] .icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-moon { display: block; }

.nav-toggle { display: none; }

@media (max-width: 1024px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 18px 1.2rem;
    margin: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 0.75rem 0.6rem; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a:last-of-type { border-bottom: 0; }
  .header-actions { margin-left: auto; }
}

/* --- progress ----------------------------------------------------------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width 0.1s linear;
}

/* --- hero --------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--navy-900);
  color: #eef4fb;
  overflow: hidden;
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 12% 0%, rgba(14, 116, 144, 0.4), transparent 60%);
  z-index: -1;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2.6rem;
  align-items: center;
  padding: 4.6rem 0 4.2rem;
}
.hero h1 { color: #f6fafd; }
.hero .eyebrow { color: #7fd0e8; }
.hero .lede { color: #b9cade; max-width: 46ch; }
.hero-media img {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.85);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.7rem; }
.hero-meta { color: #93a9c0; margin-top: 1.5rem; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 3.2rem 0 3rem; gap: 2rem; }
  .hero-media { order: -1; }
}

/* --- badges / buttons ---------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 620;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-tint);
  color: var(--accent);
}
.hero .badge {
  border-color: rgba(127, 208, 232, 0.4);
  background: rgba(127, 208, 232, 0.12);
  color: #a7e0f2;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; opacity: 0.85; }
.btn--ghost:hover { opacity: 1; }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn--light:hover { border-color: var(--line-strong); }

/* --- cards --------------------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card-title { font-weight: 640; font-size: 1.06rem; letter-spacing: -0.018em; line-height: 1.28; margin: 0 0 0.5rem; color: var(--ink); }
.card--link { transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease; }
.card--link:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.card--link a { text-decoration: none; }
.card-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 620;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}
.card-arrow { color: var(--accent); font-weight: 620; font-size: 0.9rem; }

/* --- steps --------------------------------------------------------------- */
.steps { display: grid; gap: 0.85rem; counter-reset: step; min-width: 0; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  min-width: 0;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1.15rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 660;
  font-size: 0.98rem;
  color: var(--accent);
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
}
.step h3, .step h4 { margin: 0.2rem 0 0.6rem; font-size: 1.08rem; }
.step > *:last-child { margin-bottom: 0; }
.step p { color: var(--ink-2); }
.step p:last-child { margin-bottom: 0; }
.step-title { margin: 0.15rem 0 0.55rem; font-size: 1.09rem; font-weight: 660; letter-spacing: -0.016em; line-height: 1.3; }

/* --- callouts ------------------------------------------------------------ */
.callout {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.8em 0;
  background: var(--paper-2);
}
.callout > *:last-child { margin-bottom: 0; }
.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 640;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.callout-title svg { width: 18px; height: 18px; flex: 0 0 auto; }
.callout p, .callout li { font-size: 0.96rem; }

.callout--note { border-left-color: var(--accent); background: var(--accent-tint); }
.callout--note .callout-title { color: var(--accent); }
.callout--warn { border-left-color: var(--warn); background: var(--warn-tint); }
.callout--warn .callout-title { color: var(--warn); }
.callout--safe { border-left-color: var(--safe); background: var(--safe-tint); }
.callout--safe .callout-title { color: var(--safe); }
.callout--danger { border-left-color: var(--danger); background: var(--danger-tint); }
.callout--danger .callout-title { color: var(--danger); }

/* --- tables -------------------------------------------------------------- */
.table-wrap {
  max-width: 100%;
  margin: 1.8em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; min-width: 520px; }
caption {
  caption-side: top;
  text-align: left;
  padding: 0.9rem 1.1rem 0.2rem;
  font-size: 0.82rem;
  color: var(--ink-3);
  font-weight: 560;
}
th, td { padding: 0.78rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  background: var(--paper-2);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 640;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; color: var(--ink); width: 34%; }

/* --- checklist ----------------------------------------------------------- */
.checklist {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: var(--shadow-sm);
  margin: 1.8em 0;
}
.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.checklist-head h3, .checklist-head h2 { margin: 0; font-size: 1.08rem; }
.checklist-meter {
  height: 6px;
  background: var(--paper-3);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.7rem 0 1rem;
}
.checklist-meter span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
.checklist ol { list-style: none; margin: 0; padding: 0; counter-reset: chk; }
.checklist li { margin: 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist label {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.7rem 0.2rem;
  cursor: pointer;
  font-size: 0.97rem;
  color: var(--ink-2);
}
.checklist input[type="checkbox"] {
  appearance: none;
  width: 21px; height: 21px;
  margin: 0.12rem 0 0;
  border: 1.6px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  flex: 0 0 auto;
  position: relative;
  cursor: pointer;
}
.checklist input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.checklist input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 11px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checklist input:checked + span { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.checklist label span strong { color: inherit; }
.checklist-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.checklist-foot .hint { font-size: 0.82rem; color: var(--ink-3); }
.text-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.text-btn:hover { text-decoration: underline; }

/* --- troubleshooting panel ---------------------------------------------- */
.ts-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem 1.4rem;
  margin: 0 0 1.1rem;
}
.ts-panel > h3 { margin: 0 0 0.35rem; font-size: 1.12rem; }
.ts-panel .ts-cause { color: var(--ink-3); font-size: 0.88rem; margin-bottom: 1rem; }
.ts-row { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 0.55rem 1.1rem; padding: 0.72rem 0; border-top: 1px solid var(--line); }
.ts-row:first-of-type { border-top: 0; }
.ts-row dt {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 660;
  color: var(--ink-3);
  padding-top: 0.15rem;
}
.ts-row dd { margin: 0; font-size: 0.95rem; color: var(--ink-2); }
.ts-row dd ul { margin: 0; padding-left: 1.15rem; }
.ts-row dd li:last-child { margin-bottom: 0; }
.ts-row--solution dt { color: var(--safe); }
.ts-row--support dt { color: var(--accent); }
@media (max-width: 640px) {
  .ts-row { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* --- accordion / faq ---------------------------------------------------- */
.accordion { border-top: 1px solid var(--line); margin: 1.6em 0; }
.accordion details {
  border-bottom: 1px solid var(--line);
  padding: 0.15rem 0;
}
.accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 1.02rem 2.2rem 1.02rem 0;
  font-weight: 600;
  font-size: 1.01rem;
  letter-spacing: -0.012em;
  position: relative;
  color: var(--ink);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 1.5rem;
  width: 9px; height: 9px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}
.accordion details[open] summary::after { transform: rotate(-135deg); top: 1.75rem; }
.accordion summary:hover { color: var(--accent); }
.accordion .acc-body { padding: 0 0 1.25rem; color: var(--ink-2); }
.accordion .acc-body > *:last-child { margin-bottom: 0; }
.accordion details > p, .accordion details > ul, .accordion details > ol { color: var(--ink-2); }
.accordion details > p:last-child, .accordion details > ul:last-child, .accordion details > ol:last-child, .accordion details > .table-wrap:last-child { margin-bottom: 1.2rem; }
.accordion details > .table-wrap, .accordion details > .callout { margin-top: 0.4rem; }

/* --- code --------------------------------------------------------------- */
.code {
  position: relative;
  margin: 1.6em 0;
  background: #0a1424;
  border: 1px solid #1d3149;
  border-radius: var(--radius);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.7rem 0.55rem 1rem;
  border-bottom: 1px solid #1d3149;
  background: #0d1a2c;
}
.code-head span { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8ba3bd; font-weight: 600; }
.code pre {
  margin: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  color: #d7e6f5;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}
.code code { font-family: inherit; }
.copy-btn {
  border: 1px solid #28415c;
  background: #12263d;
  color: #a9c3da;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 7px;
  cursor: pointer;
}
.copy-btn:hover { color: #fff; border-color: #3d5f83; }
.copy-btn[data-copied="true"] { color: #6fd0a6; border-color: #2f6b52; }

p code, li code, td code, dd code {
  font-family: var(--font-mono);
  font-size: 0.855em;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.35em;
  word-break: break-word;
}

/* --- article layout / toc ---------------------------------------------- */
.article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 3.2rem;
  align-items: start;
  padding: 2.6rem 0 4rem;
}
.article-body { max-width: var(--measure); min-width: 0; }
@media (max-width: 1000px) {
  .article { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .article-body { max-width: none; }
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  font-size: 0.9rem;
  border-left: 1px solid var(--line);
  padding-left: 1.1rem;
  max-height: calc(100vh - var(--header-h) - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.toc-title {
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 640;
  margin-bottom: 0.7rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0 0 0.15rem; }
.toc a {
  display: block;
  padding: 0.32rem 0;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  margin-left: -1.1rem;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a[data-active="true"] { color: var(--accent); border-left-color: var(--accent); font-weight: 580; }
.toc ol ol { margin: 0 0 0.5rem; padding-left: 0; }
.toc ol ol a { font-size: 0.83rem; color: var(--ink-3); padding-top: 0.2rem; padding-bottom: 0.2rem; }
.toc ol ol a:hover { color: var(--ink); }
.toc ol ol a[data-active="true"] { color: var(--accent); }
@media (max-width: 1000px) {
  .toc { position: static; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.1rem; background: var(--paper-2); }
  .toc > ol { columns: 2; column-gap: 1.4rem; }
  .toc ol ol { margin-bottom: 0.35rem; }
  .toc { max-height: none; overflow: visible; }
}
@media (max-width: 560px) { .toc > ol { columns: 1; } }

/* --- page hero ---------------------------------------------------------- */
.page-hero {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  padding: 2.6rem 0 2.2rem;
  position: relative;
}
.page-hero h1 { margin-bottom: 0.5rem; max-width: 24ch; }
.page-hero .lede { max-width: 62ch; }
.page-hero--dark { background: var(--navy-900); border-bottom-color: var(--navy-700); color: #e8f0f8; }
.page-hero--dark h1 { color: #f7fbfe; }
.page-hero--dark .lede { color: #b6c8db; }
.page-hero--dark .eyebrow { color: #7fd0e8; }
.page-hero--dark .meta-line { color: #93a9c0; }

.crumbs { font-size: 0.83rem; color: var(--ink-3); margin-bottom: 1rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.crumbs li::after { content: "/"; margin-left: 0.4rem; color: var(--line-strong); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--accent); }
.page-hero--dark .crumbs, .page-hero--dark .crumbs a { color: #8ea5bd; }

/* --- banner media ------------------------------------------------------- */
.media-banner {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
  background: var(--paper-3);
}
.media-banner img { width: 100%; }
.media-banner figcaption {
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  color: var(--ink-3);
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

/* --- stat strip --------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--paper); padding: 1.1rem 1.2rem; }
.stat dt, .stat .stat-label { font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); font-weight: 640; }
.stat dd, .stat .stat-value { margin: 0.35rem 0 0; font-size: 0.98rem; font-weight: 580; color: var(--ink); }

/* --- related links ------------------------------------------------------ */
.related {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 1.6rem;
}
.related h2 { font-size: 1.1rem; margin: 0 0 1rem; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.related a { font-weight: 560; }

/* --- footer ------------------------------------------------------------- */
.site-footer {
  background: var(--navy-900);
  color: #a9bcd0;
  padding: 3.2rem 0 2rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}
.site-footer a { color: #cfe0ef; }
.site-footer h2, .site-footer h3 { color: #eaf2fa; font-size: 0.78rem; letter-spacing: 0.11em; text-transform: uppercase; margin: 0 0 0.85rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; font-weight: 620; margin-bottom: 0.8rem; }
.footer-brand .brand-mark { background: linear-gradient(150deg, #164a63, #0e7490); }
.footer-about { max-width: 46ch; line-height: 1.65; }
.footer-nav { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 0.45rem; }
.footer-disclaimer {
  margin-top: 2.4rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: #cddced;
  line-height: 1.62;
}
.footer-disclaimer strong { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  color: #8ea3b8;
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }

/* --- utilities ---------------------------------------------------------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 0.87rem; }
.stack-sm > * + * { margin-top: 0.6rem; }
.divider { height: 1px; background: var(--line); margin: 2.4rem 0; border: 0; }

@media print {
  .site-header, .site-footer, .toc, .progress { display: none; }
  body { font-size: 12pt; }
}

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