/* ============================================================================
   DadPrep — Identity A "Editorial Data", self-contained.
   Deliberately NOT importing _shared/datasite.css: DadPrep is a commercial
   property outside the ring, so a ring-wide `apply.mjs` push must never be
   able to restyle it. Tokens are copied from the Identity A master so it
   still reads as part of the family.
   ========================================================================== */
:root {
  --paper: #FBF9F5;
  --paper-2: #F4F1EA;
  --surface: #FFFFFF;
  --ink: #14181B;
  --ink-2: #454D53;
  --muted: #646C72;
  --line: #E7E1D6;
  --line-2: #D6CEC0;
  --accent: var(--site-accent, #2C6E63);
  --accent-soft: color-mix(in srgb, var(--accent) 8%, var(--paper));
  --accent-line: color-mix(in srgb, var(--accent) 32%, var(--paper));
  --warn-soft: #FBF2E7;
  --warn-line: #D9A05B;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px;
  --radius: 6px;
  --max: 1080px;
  --measure: 72ch;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.62 var(--sans);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--s4); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s3); top: var(--s3); background: var(--ink); color: #fff; padding: var(--s2) var(--s3); z-index: 99; border-radius: var(--radius); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ header */
header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .bar { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: baseline; padding-top: var(--s4); padding-bottom: var(--s4); }
.brand { text-decoration: none; color: var(--ink); display: block; }
.brand span { font: 600 24px/1 var(--serif); letter-spacing: -.01em; display: block; }
.brand small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
header.site nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s4); margin: 0; padding: 0; }
header.site nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; padding-bottom: 2px; border-bottom: 2px solid transparent; }
header.site nav a:hover { color: var(--accent); }
header.site nav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }

main { padding: var(--s5) 0 var(--s7); }

/* ------------------------------------------------------------------ typography */
h1 { font: 600 clamp(30px, 4.4vw, 44px)/1.14 var(--serif); letter-spacing: -.015em; margin: 0 0 var(--s3); max-width: 20ch; }
h2 { font: 600 clamp(21px, 2.4vw, 27px)/1.25 var(--serif); margin: var(--s6) 0 var(--s3); max-width: 30ch; }
h3 { font: 600 18px/1.35 var(--sans); margin: var(--s5) 0 var(--s2); }
p, ul, ol, dl, table, blockquote { max-width: var(--measure); }
p { margin: 0 0 var(--s3); }
ul, ol { margin: 0 0 var(--s3); padding-left: 1.25em; }
li { margin-bottom: var(--s2); }
strong { font-weight: 600; }
em { font-style: italic; }

.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0; margin: 0 0 var(--s4); font-size: 14px; color: var(--muted); }
.crumb li + li::before { content: "/"; margin-right: var(--s2); color: var(--line-2); }
.crumb a { color: var(--muted); }

.doc-h { border-bottom: 1px solid var(--line); padding-bottom: var(--s4); margin-bottom: var(--s5); }
.answer { font-size: 19px; line-height: 1.6; color: var(--ink-2); border-left: 3px solid var(--accent); padding-left: var(--s3); margin: var(--s4) 0; }
.answer p:last-child { margin-bottom: 0; }
.byline { font-size: 13.5px; color: var(--muted); margin: var(--s3) 0 0; }
.byline .tag { color: var(--accent); font-weight: 500; }
.lede { font-size: 18px; }

/* ------------------------------------------------------------------ toc */
.toc { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); margin: 0 0 var(--s5); max-width: var(--measure); }
.toc h2 { font: 600 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 var(--s2); }
.toc ol { margin: 0; font-size: 15px; }

/* ------------------------------------------------------------------ blocks */
.note, .warn { border-radius: var(--radius); padding: var(--s3) var(--s4); margin: var(--s4) 0; max-width: var(--measure); }
.note { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.warn { background: var(--warn-soft); border-left: 3px solid var(--warn-line); }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }

blockquote { margin: var(--s4) 0; padding-left: var(--s4); border-left: 2px solid var(--line-2); color: var(--ink-2); font-style: italic; }
blockquote cite { display: block; font-style: normal; font-size: 14px; color: var(--muted); margin-top: var(--s2); }

ol.steps { list-style: none; counter-reset: s; padding-left: 0; }
ol.steps li { counter-increment: s; position: relative; padding-left: 2.4em; margin-bottom: var(--s3); }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: .1em;
  width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}

dl.kv { margin: var(--s4) 0; }
dl.kv dt { font-weight: 600; margin-top: var(--s3); }
dl.kv dd { margin: var(--s1) 0 0; color: var(--ink-2); }

.tw { overflow-x: auto; margin: var(--s4) 0; max-width: var(--measure); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line-2); }
tbody th { font-weight: 500; }

.faq details { border-bottom: 1px solid var(--line); max-width: var(--measure); }
.faq summary { cursor: pointer; padding: var(--s3) 0; font-weight: 500; }
.faq details[open] summary { color: var(--accent); }
.faq details > div { padding-bottom: var(--s2); }

.sources { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); }
.sources ul { font-size: 15px; }
.disclose { font-size: 13px; color: var(--muted); max-width: var(--measure); }

/* ------------------------------------------------------------------ CTA */
.cta-inline { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: var(--s3) var(--s4); margin: var(--s5) 0; border-radius: var(--radius); max-width: var(--measure); }
.cta-inline p { margin-bottom: var(--s2); }
.cta-link { font-weight: 600; white-space: nowrap; }

.cta-end { margin: var(--s7) 0 0; padding: var(--s5); background: var(--surface); border: 1px solid var(--line-2); border-top: 3px solid var(--accent); border-radius: var(--radius); max-width: var(--measure); }
.cta-end h2 { margin-top: 0; font-size: 24px; }
.cta-meta { font-size: 14px; color: var(--muted); font-weight: 500; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 600; padding: 13px var(--s5); border-radius: var(--radius); border: 0; cursor: pointer;
  font-size: 16px; font-family: inherit;
}
.btn:hover { filter: brightness(1.08); }
.btn-sm { padding: 8px var(--s3); font-size: 14px; }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }

.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: var(--s3); align-items: center; justify-content: center; flex-wrap: wrap;
  background: var(--ink); color: var(--paper); padding: var(--s2) var(--s5) var(--s2) var(--s3);
  font-size: 14.5px;
}
.sticky p { margin: 0; max-width: none; }
.sticky .btn { background: var(--paper); color: var(--ink); }
.sticky .sx { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--paper); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; }

/* ------------------------------------------------------------------ cards */
.cards { list-style: none; padding: 0; margin: var(--s4) 0 0; max-width: none; display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards a { display: block; height: 100%; padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.cards a:hover { border-color: var(--accent); }
.cards strong { display: block; font: 600 17px/1.3 var(--serif); margin-bottom: var(--s1); }
.cards span { display: block; font-size: 14.5px; color: var(--muted); }
.cards em { display: block; font-style: normal; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: var(--s1); }
.cards.big strong { font-size: 20px; }
.related, .stagemap, .toolmap { margin-top: var(--s6); }

/* ------------------------------------------------------------------ tools */
.tool-ui { margin: var(--s4) 0 var(--s5); }
.tool-bar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin: var(--s3) 0; }
.tool-bar label { font-size: 14px; font-weight: 500; }
.tool-bar input { font: inherit; padding: 9px var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.prog { margin: 0; font-size: 15px; color: var(--muted); }
.prog output { font-weight: 600; color: var(--accent); }

.checkgroup { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s2); margin: 0 0 var(--s3); background: var(--surface); max-width: var(--measure); }
.checkgroup legend { font: 600 15px/1 var(--sans); padding: 0 var(--s2); color: var(--accent); }
.checkgroup ul { list-style: none; padding: 0; margin: 0; }
.checkgroup li { margin: 0; border-bottom: 1px solid var(--paper-2); }
.checkgroup label { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s2) 0; cursor: pointer; font-size: 15.5px; }
.checkgroup input { margin-top: 5px; width: 19px; height: 19px; accent-color: var(--accent); flex: none; }
.checkgroup input:checked + span { color: var(--muted); text-decoration: line-through; }

.nowcard { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: var(--s4); margin: var(--s4) 0; max-width: var(--measure); }
.wkcard { border-bottom: 1px solid var(--line); padding: var(--s3) 0; max-width: var(--measure); }
.wkcard h3 { margin-top: 0; }
.wkcard.cur { border-left: 3px solid var(--accent); padding-left: var(--s3); background: var(--surface); }
.wkcard p { font-size: 15.5px; margin-bottom: var(--s2); }
.listh { margin-top: var(--s6); }

.tapgrid { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); max-width: var(--measure); }
.tap { font: 600 15px/1.2 var(--sans); padding: var(--s4) var(--s2); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; color: var(--ink); }
.tap:active, .tap.hit { background: var(--accent); color: #fff; border-color: var(--accent); }
.since { font-size: 16px; font-weight: 500; margin-top: var(--s3); }
.loglist { list-style: none; padding: 0; max-width: var(--measure); font-size: 15px; }
.loglist li { display: flex; gap: var(--s3); border-bottom: 1px solid var(--line); padding: var(--s2) 0; margin: 0; }
.loglist time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 4.2em; }
.loglist em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 13.5px; }

.namelist { padding-left: 1.4em; max-width: var(--measure); }
.namelist li { display: flex; justify-content: space-between; gap: var(--s3); align-items: center; border-bottom: 1px solid var(--line); padding: var(--s2) 0; }
.namelist.plain { }
.namelist .empty { color: var(--muted); display: block; }
.row-actions { display: flex; gap: var(--s1); }
.row-actions button { background: none; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; width: 30px; height: 30px; color: var(--ink-2); font-size: 14px; }
.row-actions button:hover { border-color: var(--accent); color: var(--accent); }

.capture { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: var(--s4); margin: var(--s5) 0; max-width: var(--measure); }
.capture h3 { margin-top: 0; }
.capture form { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s2); }
.capture input { flex: 1 1 220px; font: inherit; padding: 11px var(--s3); border: 1px solid var(--line-2); border-radius: var(--radius); }
.capture .soon { color: var(--muted); font-size: 15px; margin-bottom: 0; }

/* ------------------------------------------------------------------ footer */
footer.site { border-top: 1px solid var(--line); background: var(--paper-2); padding: var(--s6) 0 var(--s7); margin-top: var(--s7); font-size: 14.5px; color: var(--ink-2); }
footer.site .disc { max-width: var(--measure); font-size: 13.5px; color: var(--muted); }
footer.site nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); padding: 0; margin: var(--s4) 0; max-width: none; }
footer.site a { color: var(--ink-2); }
.fine { font-size: 13px; color: var(--muted); max-width: var(--measure); }
p.disc { background: var(--paper-2); border-radius: var(--radius); padding: var(--s3); font-size: 13.5px; color: var(--ink-2); }

/* ------------------------------------------------------------------ print */
@media print {
  header.site nav, footer.site nav, .sticky, .cta-inline, .cta-end, .related, .toc, .capture, .tool-bar { display: none !important; }
  body { font-size: 11pt; background: #fff; }
  .checkgroup { break-inside: avoid; border-color: #999; }
  a { text-decoration: none; color: #000; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 var(--s3); }
  header.site .bar { gap: var(--s3); }
  .cta-end { padding: var(--s4); }
  .sticky { font-size: 13.5px; padding-right: var(--s4); }
}
