/* ScanCraft legal pages — paper, scan corners and the app's blue/cyan palette. */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --ink: #17243a;
  --muted: #627089;
  --line: #dce4f0;
  --accent: #245ed8;
  --accent-soft: #e9f0ff;
  --cyan: #22d3ee;
  --paper-line: #dbe5f5;
  --shadow: 0 12px 36px rgba(28, 58, 108, .055);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #172235;
  --surface-soft: #1b2940;
  --ink: #edf3ff;
  --muted: #a7b7ce;
  --line: #2d3d55;
  --accent: #91b7ff;
  --accent-soft: #223859;
  --paper-line: #405575;
  --shadow: 0 12px 36px rgba(0, 0, 0, .14);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
::selection { background: #bfdbfe; color: #102445; }
.shell { width: min(1120px, calc(100% - 64px)); margin: 0 auto; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 12px 18px; background: var(--ink); color: var(--surface); border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* A simple home link in the header; app identity beside each document title. */
.app-header { min-height: 102px; display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.home-brand { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 600; text-decoration: none; flex-shrink: 0; }
.home-brand:hover { color: var(--accent); }
.app-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.app-icon { display: block; width: 43px; height: 43px; border-radius: 11px; box-shadow: 0 4px 12px rgba(29, 78, 216, .14); }
.app-brand strong { display: block; font-size: 21px; line-height: 1.15; letter-spacing: -.65px; font-weight: 700; }
.app-brand small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.3; color: var(--muted); letter-spacing: .15px; }
.page-nav { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.page-nav a { padding: 9px 14px; font-size: 13px; font-weight: 550; color: var(--muted); border-radius: 8px; text-decoration: none; white-space: nowrap; }
.page-nav a:hover { color: var(--ink); background: var(--surface); }
.page-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.theme-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; flex-shrink: 0; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* A quiet scanner illustration gives the legal documents the app's identity. */
.legal-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: center; padding: 56px 0 50px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--accent); font-size: 10px; font-weight: 650; letter-spacing: 1.8px; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.hero-copy .eyebrow::before { display: none; }
.hero-copy .eyebrow .icon { width: 17px; height: 17px; }
.hero-copy h1 { margin: 16px 0 20px; font-size: clamp(42px, 5.4vw, 62px); line-height: 1.04; letter-spacing: -2.6px; font-weight: 720; }
.legal-intro { max-width: 58ch; color: var(--muted); font-size: 17px; line-height: 1.75; }
.document-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin-top: 25px; color: var(--muted); font-size: 11px; }
.document-meta > span:first-child { color: var(--ink); font-weight: 600; padding-right: 12px; border-right: 1px solid var(--line); }
.document-meta time { font-variant-numeric: tabular-nums; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.scan-art { min-height: 280px; position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scan-art::before { content: ""; position: absolute; width: 270px; height: 270px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 72%); z-index: -1; }
.scan-frame { width: 250px; height: 247px; position: relative; display: grid; place-items: center; }
.corner { position: absolute; width: 27px; height: 27px; border-color: var(--accent); border-style: solid; opacity: .75; }
.corner.tl { top: 0; left: 0; border-width: 2px 0 0 2px; border-radius: 7px 0 0 0; }
.corner.tr { top: 0; right: 0; border-width: 2px 2px 0 0; border-radius: 0 7px 0 0; }
.corner.bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; border-radius: 0 0 0 7px; }
.corner.br { bottom: 0; right: 0; border-width: 0 2px 2px 0; border-radius: 0 0 7px 0; }
.scan-sheet { width: 176px; height: 214px; position: relative; padding: 23px 23px 20px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); box-shadow: 0 13px 20px rgba(33, 73, 130, .09); transform: rotate(-5deg); overflow: hidden; }
.scan-sheet::after { content: ""; position: absolute; top: 0; right: 0; width: 24px; height: 24px; background: var(--accent-soft); clip-path: polygon(0 0, 100% 100%, 0 100%); }
.sheet-mark { color: var(--accent); margin-bottom: 9px; line-height: 1; }
.sheet-mark .icon { width: 24px; height: 24px; }
.sheet-title { font-size: 13px; font-weight: 650; line-height: 1.35; color: var(--ink); }
.sheet-lines { display: grid; gap: 8px; margin-top: 19px; }
.sheet-lines i { height: 4px; border-radius: 3px; background: var(--paper-line); }
.sheet-lines i:nth-child(2) { width: 86%; }
.sheet-lines i:nth-child(4) { width: 92%; }
.sheet-lines i:last-child { width: 63%; }
.scan-beam { position: absolute; top: 59%; left: -4px; right: -4px; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan) 12%, var(--cyan) 88%, transparent); box-shadow: 0 -6px 20px rgba(34, 211, 238, .2); }
.scan-label { margin-top: 15px; font-size: 9px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }

/* Contents sit beside a single paper-like reading surface. */
.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 38px; align-items: start; }
.legal-sidebar { position: sticky; top: 28px; padding-top: 7px; }
.legal-toc { display: grid; gap: 3px; }
.toc-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 13px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.toc-label span { font-size: 8px; letter-spacing: .6px; }
.legal-toc a { display: flex; align-items: baseline; gap: 11px; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.45; font-weight: 500; text-decoration: none; color: var(--muted); }
.toc-number { flex: 0 0 16px; font-size: 10px; font-variant-numeric: tabular-nums; opacity: .7; }
.legal-toc a:hover { background: var(--surface); color: var(--ink); }
.legal-toc a[aria-current="location"] { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.legal-toc a[aria-current="location"] .toc-number { opacity: 1; }
.sidebar-note { display: flex; gap: 10px; align-items: flex-start; margin: 26px 12px 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); }
.sidebar-note .icon { width: 18px; height: 18px; margin-top: 2px; }
.sidebar-note p { font-size: 11px; line-height: 1.7; }
.legal-body { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
.document-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 36px; border-bottom: 1px solid var(--line); background: var(--surface-soft); border-radius: 14px 14px 0 0; }
.document-label { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 550; }
.document-label .icon { width: 16px; height: 16px; color: var(--accent); }
.section-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.legal-section { margin: 0 36px; padding: 31px 0; scroll-margin-top: 28px; }
.legal-section + .legal-section { border-top: 1px solid var(--line); }
.legal-section:last-child { padding-bottom: 36px; }
.section-number { display: block; margin-bottom: 8px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; font-variant-numeric: tabular-nums; }
.legal-section h2 { color: var(--ink); font-size: 21px; line-height: 1.4; letter-spacing: -.45px; font-weight: 650; margin-bottom: 14px; }
.legal-section p, .legal-section li { color: var(--muted); font-size: 16px; line-height: 1.85; overflow-wrap: break-word; }
.legal-section p + p { margin-top: 15px; }
.legal-section strong { color: var(--ink); font-weight: 600; }
.legal-section ul { margin: 0; padding-left: 20px; }
.legal-section li + li { margin-top: 10px; }
.legal-section li::marker { color: var(--accent); }
.legal-section a { font-weight: 500; }

.support-card { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 22px; margin-top: 48px; padding: 30px 32px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 28px; }
.support-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--surface); color: var(--accent); }
.support-copy .eyebrow { font-size: 9px; letter-spacing: 1.3px; }
.support-copy .eyebrow::before { display: none; }
.support-copy h2 { margin: 4px 0 6px; color: var(--ink); font-size: 19px; line-height: 1.35; letter-spacing: -.35px; font-weight: 650; }
.support-copy p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.support-email { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; font-size: 12px; font-weight: 600; text-decoration: none; }
.support-email .icon { width: 17px; height: 17px; }
.support-email:hover { text-decoration: underline; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 0 35px; color: var(--muted); font-size: 11px; }
.footer-owner a { color: inherit; text-decoration: none; }
.footer-owner a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 950px) {
  .app-header { gap: 18px; }
  .legal-hero { grid-template-columns: minmax(0, 1fr) 250px; gap: 30px; }
  .legal-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 24px; }
  .legal-section { margin-inline: 28px; }
  .document-bar { padding-inline: 28px; }
  .support-card { grid-template-columns: 46px minmax(0, 1fr); gap: 16px 20px; }
  .support-email { grid-column: 2; min-height: 30px; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 40px); }
  .app-header { min-height: 90px; flex-wrap: wrap; gap: 14px; padding: 20px 0 14px; }
  .home-brand { flex: 1; }
  .app-brand strong { font-size: 20px; }
  .page-nav { order: 3; width: 100%; margin-left: 0; gap: 4px; }
  .page-nav a { padding: 9px 12px; }
  .theme-toggle { order: 2; }
  .legal-hero { grid-template-columns: minmax(0, 1fr) 180px; gap: 18px; padding: 38px 0; }
  .hero-copy h1 { font-size: 43px; letter-spacing: -1.9px; }
  .legal-intro { font-size: 15px; }
  .scan-art { min-height: 225px; transform: scale(.74); transform-origin: center; margin-inline: -30px; }
  .legal-layout { display: block; }
  .legal-sidebar { position: static; padding: 0; margin-bottom: 25px; }
  .legal-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; padding: 17px 12px 12px; border: 1px solid var(--line); border-radius: 12px; }
  .toc-label { grid-column: 1 / -1; padding-bottom: 8px; }
  .sidebar-note { display: none; }
  .support-card { margin-top: 30px; padding: 25px; }
  .app-footer { align-items: flex-start; flex-direction: column; gap: 14px; }
}

@media (max-width: 520px) {
  .legal-hero { grid-template-columns: 1fr; padding: 34px 0 30px; }
  .hero-copy h1 { margin: 13px 0 17px; font-size: 42px; }
  .legal-intro { font-size: 15px; line-height: 1.75; }
  .document-meta { margin-top: 20px; }
  .scan-art { display: none; }
  .legal-toc { gap: 2px 4px; padding-inline: 7px; }
  .legal-toc a { gap: 7px; padding: 9px 9px; font-size: 11px; }
  .toc-label { padding-left: 9px; }
  .legal-section { margin-inline: 22px; padding: 25px 0; }
  .legal-section h2 { font-size: 20px; }
  .legal-section p, .legal-section li { font-size: 15px; line-height: 1.85; }
  .document-bar { padding: 16px 22px; gap: 10px; }
  .document-label { font-size: 10px; }
  .section-count { font-size: 9px; }
  .support-card { grid-template-columns: 38px minmax(0, 1fr); padding: 22px 20px; gap: 14px; }
  .support-icon { width: 38px; height: 38px; border-radius: 10px; }
  .support-icon .icon { width: 20px; height: 20px; }
  .support-copy h2 { font-size: 18px; }
  .support-email { grid-column: 1 / -1; padding-top: 4px; font-size: 12px; }
  .footer-links { flex-wrap: wrap; gap: 12px 20px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-soft: #fff; --ink: #000; --muted: #333; --line: #ccc; --accent: #174eb3; --shadow: none; color-scheme: light; }
  body { font-size: 11pt; }
  .shell { width: 100%; }
  .app-header, .legal-sidebar, .scan-art, .support-card, .skip-link, .footer-links { display: none; }
  .legal-hero { display: block; padding: 0 0 24px; }
  .hero-copy h1 { font-size: 30pt; }
  .legal-layout { display: block; }
  .legal-body { border: 0; border-radius: 0; box-shadow: none; }
  .document-bar { padding: 10px 0; border-radius: 0; }
  .legal-section { margin: 0; padding: 20px 0; }
  .legal-section h2 { break-after: avoid; }
  .legal-section p, .legal-section li { font-size: 11pt; line-height: 1.65; }
  .app-footer { padding-bottom: 0; }
}
