/* Layout: a manila case dossier. Kraft-toned folder ground, typed pages, folder-tab section labels, red rubber stamps. */
:root {
  --paper: #e6d4a4;
  --paper-2: #dcc58f;
  --card: #f5ecd3;
  --tab: #d8bf85;
  --edge: #b89c62;
  --ink: #2b2417;
  --ink-2: #66573c;
  --rule: #cdb788;
  --green: #28457f;
  --green-ink: #f5ecd3;
  --signal: #8c4610;
  --stamp: #a52a1c;
  --redact: #2b2417;
  --shadow: 0 1px 0 rgba(60, 44, 14, .12), 0 6px 14px -10px rgba(60, 44, 14, .45);

  --f-display: "Special Elite", "Courier New", Courier, monospace;
  --f-body: "Courier Prime", "Courier New", Courier, monospace;
  --f-mono: "Courier Prime", "Courier New", Courier, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 36px; --s7: 56px;
  --t-xs: .74rem; --t-sm: .86rem; --t-md: 1rem; --t-lg: 1.2rem; --t-xl: 1.65rem; --t-xxl: clamp(2rem, 5.4vw, 3.2rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1d1912; --paper-2: #28221a; --card: #2a241b; --tab: #3b3223; --edge: #5a4b33;
    --ink: #ede2c6; --ink-2: #b4a586; --rule: #4b3f2d;
    --green: #a3bbeb; --green-ink: #1d1912;
    --signal: #efa65a; --stamp: #ee7b64; --redact: #ede2c6;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1d1912; --paper-2: #28221a; --card: #2a241b; --tab: #3b3223; --edge: #5a4b33;
  --ink: #ede2c6; --ink-2: #b4a586; --rule: #4b3f2d;
  --green: #a3bbeb; --green-ink: #1d1912;
  --signal: #efa65a; --stamp: #ee7b64; --redact: #ede2c6;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* Banner + nav */
.classbar {
  background: var(--stamp); color: var(--paper);
  font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .12em;
  text-transform: uppercase; text-align: center;
  padding: 6px 16px; font-weight: 500;
}
.nav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 16px;
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline;
  font-family: var(--f-display); font-size: 1.02rem; letter-spacing: .06em; text-transform: uppercase;
}
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--signal); }
.nav .home { color: var(--ink); font-weight: 700; margin-right: auto; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: var(--s6) var(--s7); }
.read { max-width: 70ch; }

/* Type */
h1, h2, h3, h4 { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .03em; line-height: 1.05; text-wrap: balance; margin: 0; }
h1 { font-size: var(--t-xxl); font-weight: 700; }
h2 { font-size: var(--t-xl); font-weight: 700; }
h3 { font-size: var(--t-lg); font-weight: 600; letter-spacing: .05em; }
h4 { font-size: 1.05rem; font-weight: 600; letter-spacing: .07em; color: var(--ink-2); }
p { margin: 0; }
.stack > * + * { margin-top: var(--s4); }
.stack-lg > * + * { margin-top: var(--s6); }
.eyebrow { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 62ch; }
.mono { font-family: var(--f-mono); font-size: .9em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
ul, ol { margin: 0; padding-left: 1.3em; }
li + li { margin-top: 6px; }
strong { font-weight: 650; }
em { font-style: italic; }
.redact { background: var(--redact); color: transparent; border-radius: 1px; padding: 0 .2em; user-select: none; }

/* Page header */
.pagehead { display: grid; gap: var(--s3); padding-bottom: var(--s5); border-bottom: 2px solid var(--ink); margin-bottom: var(--s6); }
.pagehead .meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }

/* Form sections (the DG sheet idiom: numbered sections with tab labels) */
.section { border: 1px solid var(--ink); background: var(--card); box-shadow: var(--shadow); }
.section > .tab {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-display); font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 12px; font-size: .98rem;
}
.section > .tab small { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; opacity: .85; align-self: center; }
.section > .body { padding: var(--s4); }
.section > .body.flush { padding: 0; }

/* Callouts */
.note {
  border: 1px dashed var(--green); padding: var(--s3) var(--s4);
  background: color-mix(in srgb, var(--green) 7%, var(--card));
}
.note > .label { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--green); display: block; margin-bottom: 4px; }
.readaloud {
  border-top: 2px solid var(--signal); border-bottom: 2px solid var(--signal);
  padding: var(--s4) 0; font-style: italic; font-size: 1.06rem;
}
.readaloud::before { content: "Read aloud"; display: block; font-style: normal; font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); margin-bottom: 6px; }
.broadcast {
  font-family: var(--f-mono); font-size: .95rem; color: var(--signal);
  border-left: 3px solid var(--signal); padding: 6px 0 6px 12px;
}
.broadcast::before { content: "KHBY 1520 AM · "; letter-spacing: .08em; font-size: .75rem; opacity: .9; }
.san { font-family: var(--f-mono); font-size: .85rem; white-space: nowrap; background: var(--paper-2); border: 1px solid var(--rule); padding: 0 6px; }

/* Tables */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
td.n, th.n { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--f-mono); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s5); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s4); }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--f-mono); font-size: var(--t-sm); }

/* Index: file folders */
.files { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); }
.file {
  display: grid; gap: 6px; align-content: start;
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--ink); background: var(--card); padding: var(--s4);
  position: relative; box-shadow: var(--shadow);
  transition: transform .15s ease, background .15s ease;
}
.file:hover { background: var(--paper-2); transform: translateY(-2px); }
.file .code { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .12em; color: var(--ink-2); text-transform: uppercase; }
.file h3 { font-size: 1.45rem; }
.file p { color: var(--ink-2); font-size: .95rem; line-height: 1.5; }
.file .who { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; }
.who.player { color: var(--green); }
.who.handler { color: var(--stamp); }

/* Agent roster cards */
.roster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s4); }
.agent-card { display: grid; gap: 8px; align-content: start; text-decoration: none; color: var(--ink); border: 1px solid var(--ink); background: var(--card); padding: var(--s4); }
.agent-card:hover { background: var(--paper-2); }
.agent-card .role { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.agent-card h3 { font-size: 1.5rem; }
.agent-card .stats { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--f-mono); font-size: .8rem; color: var(--ink-2); }
.agent-card p { font-size: .95rem; color: var(--ink-2); line-height: 1.5; }

/* Character sheet */
.sheet { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s4); }
.sheet > * { min-width: 0; }
.span-12 { grid-column: span 12; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; } .span-8 { grid-column: span 8; }
@media (max-width: 820px) { .span-7, .span-5, .span-6, .span-4, .span-8 { grid-column: span 12; } }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; }
.field { padding: 8px 12px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); min-width: 0; }
.field .k { display: block; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.field .v { font-size: 1rem; }
.statrow td:first-child { font-family: var(--f-display); font-weight: 600; letter-spacing: .08em; font-size: 1.05rem; }
.statrow .big { font-size: 1.3rem; font-weight: 600; }
.skills { columns: 2 220px; column-gap: 20px; padding: var(--s3) var(--s4); font-size: .93rem; }
.skill { display: flex; justify-content: space-between; gap: 8px; break-inside: avoid; padding: 3px 0; border-bottom: 1px dotted var(--rule); color: var(--ink-2); }
.skill .pct { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.skill.trained { color: var(--ink); font-weight: 600; }
.skill.trained .pct { color: var(--green); }

/* Trackers */
.trackers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
.tracker { padding: 10px 12px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; gap: 6px; }
.tracker .k { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.tracker .row { display: flex; align-items: center; gap: 8px; }
.tracker .val { font-family: var(--f-display); font-size: 2rem; font-weight: 700; min-width: 2.2ch; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.tracker .max { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-2); }
.tracker.warn .val { color: var(--stamp); }
.step {
  width: 32px; height: 32px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  font-family: var(--f-mono); font-size: 1.05rem; cursor: pointer; line-height: 1; padding: 0;
}
.step:hover { background: var(--paper-2); }
.bond { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.bond .who-b { font-weight: 600; }
.bond .desc { grid-column: 1 / -1; font-size: .9rem; color: var(--ink-2); line-height: 1.45; }
.bond .row { display: flex; align-items: center; gap: 6px; }
.bond .val { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.boxes { display: flex; gap: 6px; }
.box { width: 26px; height: 26px; border: 1.5px solid var(--ink); background: var(--paper); cursor: pointer; padding: 0; color: var(--ink); font-family: var(--f-mono); }
.box[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.box[aria-pressed="true"]::after { content: "×"; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .9rem; }
.btn {
  font-family: var(--f-display); text-transform: uppercase; letter-spacing: .08em; font-size: .95rem; font-weight: 600;
  border: 1px solid var(--ink); background: var(--card); color: var(--ink); padding: 6px 14px; cursor: pointer;
}
.btn:hover { background: var(--paper-2); }
.btn.danger { border-color: var(--stamp); color: var(--stamp); }
.btn.primary { background: var(--ink); color: var(--paper); }
.gear li { margin-top: 4px; }

/* Handouts */
.handouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s5); }
.handout { background: var(--card); border: 1px solid var(--rule); padding: var(--s5); display: grid; gap: var(--s3); align-content: start; }
.handout .label { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.phone { font-family: var(--f-mono); background: var(--paper-2); border: 1px solid var(--rule); padding: 12px; border-radius: 14px; font-size: .95rem; }
.scrawl { font-family: var(--f-mono); font-size: 1.05rem; line-height: 1.9; }
.scrawl .circ { border: 2px solid var(--stamp); border-radius: 50%; padding: 0 6px; }
.tape { font-family: var(--f-display); font-size: 1.5rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; }

/* Screen: broadcast clock + dice */
.clock { display: grid; gap: 0; }
.clock-line { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--rule); align-items: start; }
.clock-line .i { font-family: var(--f-mono); font-size: .85rem; color: var(--ink-2); padding-top: 2px; }
.clock-line .t { font-family: var(--f-mono); font-size: .95rem; }
.clock-line .when { display: block; font-family: var(--f-body); font-size: .85rem; color: var(--ink-2); }
.clock-line.done .t { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--rule); }
.clock-line.now { background: color-mix(in srgb, var(--signal) 14%, var(--card)); }
.clock-line.now .t { color: var(--signal); font-weight: 500; }
.dice { display: flex; flex-wrap: wrap; gap: 8px; }
.dice-out { font-family: var(--f-display); font-size: 3rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.dice-log { font-family: var(--f-mono); font-size: .82rem; color: var(--ink-2); }
.test-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.test-row input { width: 5.5em; font-family: var(--f-mono); font-size: 1rem; padding: 5px 8px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
.verdict { font-family: var(--f-mono); font-size: .95rem; }
.verdict.good { color: var(--green); } .verdict.bad { color: var(--stamp); }

.footer { border-top: 1px solid var(--rule); margin-top: var(--s7); padding-top: var(--s4); font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .08em; color: var(--ink-2); text-transform: uppercase; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 480px) { body { font-size: 16px; } .section > .body { padding: var(--s3); } }

.with-aside { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: var(--s6); align-items: start; }
.with-aside > * { min-width: 0; }
.aside { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }
@media (max-width: 860px) {
  .with-aside { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
}
@media (max-width: 700px) {
  .nav-inner { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .nav .home { margin-right: 0; }
}


/* ================= Dossier layer ================= */
body { font-size: 16px; line-height: 1.62; }
strong { font-weight: 700; }
h1, h2, h3, h4 { font-weight: 400; letter-spacing: .04em; }
h1 { line-height: 1.02; }
h4 { font-family: var(--f-mono); font-weight: 700; font-size: .82rem; letter-spacing: .14em; }

/* Stamp strip */
.classbar {
  background: var(--paper); color: var(--stamp);
  font-family: var(--f-mono); font-weight: 700; letter-spacing: .16em;
  border-bottom: 2px solid var(--stamp);
  padding: 7px 16px;
}
.nav { background: var(--paper-2); border-bottom: 1px solid var(--edge); }
.nav-inner { font-family: var(--f-display); font-size: .98rem; letter-spacing: .04em; }
.nav a[aria-current="page"] { border-bottom: 2px solid var(--stamp); }

/* Page header with rubber stamp */
.pagehead { position: relative; border-bottom: 2px dashed var(--edge); }
.pagehead::after {
  content: "Confidential";
  position: absolute; right: 4px; top: -6px;
  font-family: var(--f-display); font-size: 1.35rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--stamp); border: 3px solid var(--stamp); border-radius: 4px;
  padding: 2px 12px; transform: rotate(-7deg); opacity: .82; pointer-events: none;
}
@media (min-width: 701px) { .pagehead h1 { max-width: calc(100% - 210px); } }
@media (max-width: 700px) { .pagehead::after { position: static; justify-self: start; transform: rotate(-4deg); font-size: 1rem; order: -1; } }

/* Folder-tab sections */
.section { border: 0; background: none; box-shadow: none; display: flex; flex-direction: column; align-items: flex-start; }
.section > .tab {
  display: inline-flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; justify-content: flex-start;
  max-width: 100%;
  background: var(--tab); color: var(--ink);
  border: 1px solid var(--edge); border-bottom: 0; border-radius: 9px 9px 0 0;
  padding: 5px 16px 4px; margin-left: 10px;
  font-family: var(--f-display); font-weight: 400; letter-spacing: .06em; font-size: .98rem;
}
.section > .tab small { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; opacity: 1; color: var(--ink-2); }
.section > .body {
  align-self: stretch; background: var(--card); border: 1px solid var(--edge); border-radius: 3px;
  box-shadow: var(--shadow);
}

/* Files on the index: folders with tabs */
.file, .agent-card {
  border: 1px solid var(--edge); background: var(--card); border-radius: 3px 3px 3px 3px;
  box-shadow: var(--shadow); margin-top: 18px; overflow: visible;
}
.file::before, .agent-card::before {
  content: ""; position: absolute; top: -17px; left: 14px; width: 42%; height: 17px;
  background: var(--tab); border: 1px solid var(--edge); border-bottom: 0; border-radius: 8px 8px 0 0;
}
.agent-card { position: relative; }
.file:hover, .agent-card:hover { background: color-mix(in srgb, var(--card) 80%, var(--tab)); }
.file h3, .agent-card h3 { font-size: 1.35rem; }
.who.player { color: var(--green); }
.agent-card .role { color: var(--stamp); }

/* Callouts */
.note { border: 1px dashed var(--edge); background: var(--card); }
.note > .label { color: var(--stamp); font-weight: 700; }
.readaloud { border-color: var(--edge); border-top-style: dashed; border-bottom-style: dashed; }
.readaloud::before { color: var(--stamp); font-weight: 700; }
.san { background: var(--card); border-color: var(--edge); }

/* Tables and fields */
th { color: var(--ink-2); font-weight: 700; }
th, td { border-bottom: 1px dotted var(--edge); }
.field, .tracker { border-color: var(--rule); }
.field .k, .tracker .k { font-weight: 700; }
.skill.trained .pct, .skill.trained { color: var(--ink); }
.skill.trained .pct { color: var(--green); font-weight: 700; }
.skill { border-bottom-color: var(--rule); }

/* Controls */
.step, .box, .btn, .test-row input { border-color: var(--ink-2); background: var(--card); border-radius: 2px; }
.btn { font-family: var(--f-display); font-weight: 400; letter-spacing: .06em; }
.btn.primary { background: var(--ink); color: var(--card); border-color: var(--ink); }
.btn.danger { border-color: var(--stamp); color: var(--stamp); }
.tracker .val, .bond .val, .dice-out { font-weight: 400; }

/* Redaction marker reads as a black bar */
.redact { background: var(--redact); }

/* Handouts: loose papers clipped into the folder */
.handout { border: 1px solid var(--edge); box-shadow: var(--shadow); position: relative; }
.handout:nth-child(odd) { transform: rotate(-.4deg); }
.handout:nth-child(even) { transform: rotate(.35deg); }
.handout::before {
  content: ""; position: absolute; top: -10px; left: 22px; width: 14px; height: 34px;
  border: 2px solid var(--ink-2); border-radius: 8px; background: transparent; opacity: .7;
}
.phone { background: var(--paper-2); border-color: var(--edge); }
@media (prefers-reduced-motion: reduce) { .handout { transform: none !important; } }

.footer { border-top: 1px dashed var(--edge); }

/* Field Manual: org chart */
.orgchart { display: grid; justify-items: center; gap: 0; padding: var(--s5) 0; max-width: 760px; margin-inline: auto; }
.org-box {
  display: grid; gap: 2px; text-align: center; min-width: 0; width: min(100%, 280px);
  background: var(--card); border: 1px solid var(--edge); box-shadow: var(--shadow);
  padding: 10px 14px; font-family: var(--f-display); font-size: 1.02rem; letter-spacing: .03em;
}
.org-box span { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.org-muted { background: transparent; box-shadow: none; border-style: dashed; color: var(--ink-2); }
.org-main { background: var(--tab); }
.org-pc { border-color: var(--stamp); color: var(--stamp); }
.org-pc span { color: var(--stamp); }
.org-shi { border: 2px solid var(--ink); }
.org-line { width: 0; height: 22px; border-left: 2px solid var(--edge); }
.org-line.dashed { border-left-style: dashed; }
.org-split { width: 50%; height: 22px; border: 2px solid var(--edge); border-bottom: 0; position: relative; }
.org-split::before { content: ""; position: absolute; left: 50%; top: -24px; height: 22px; border-left: 2px solid var(--edge); }
.org-mid { display: grid; grid-template-columns: 1fr minmax(0, 280px) 1fr; align-items: center; width: 100%; }
.org-mid > .org-main { width: 100%; }
.org-side { display: flex; align-items: center; min-width: 0; }
.org-dash { flex: 0 0 56px; border-top: 2px dashed var(--edge); }
.org-side .org-box { width: auto; flex: 0 1 auto; max-width: 180px; }
.org-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.org-col { display: grid; justify-items: center; align-content: start; min-width: 0; }
@media (max-width: 520px) { .org-box { font-size: .9rem; padding: 8px; } }

/* Contractor ID badge (top of each sheet) */
.idcard {
  max-width: 460px; background: var(--card); border: 1px solid var(--edge); border-radius: 10px;
  box-shadow: var(--shadow); overflow: hidden; margin: 4px 0 8px 0;
}
.id-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: var(--ink); color: var(--card); padding: 6px 14px; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.id-body { display: grid; grid-template-columns: 92px minmax(0, 1fr) 84px; gap: 14px; padding: 14px; align-items: center; }
.id-photo {
  width: 92px; height: 116px; border: 1px solid var(--edge); border-radius: 2px;
  background-color: var(--paper-2); background-size: cover; background-position: center;
}
.id-photo::after { content: ""; display: block; width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--edge) 22%, transparent) 6px 7px); }
.id-fields { min-width: 0; }
.id-k { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-top: 6px; font-weight: 700; }
.id-k:first-child { margin-top: 0; }
.id-v { font-family: var(--f-mono); font-size: .92rem; overflow-wrap: anywhere; }
.id-seal { width: 84px; height: 84px; color: var(--green); opacity: .85; transform: rotate(8deg); }
.id-foot { border-top: 1px dotted var(--edge); padding: 8px 14px; font-size: .74rem; color: var(--ink-2); }
@media (max-width: 480px) {
  .id-body { grid-template-columns: 76px minmax(0, 1fr); }
  .id-photo { width: 76px; height: 96px; }
  .id-seal { display: none; }
}
@media (prefers-reduced-motion: reduce) { .idcard { transform: none; } }
@media (max-width: 560px) {
  .org-mid { grid-template-columns: 60px minmax(0, 1fr) 60px; }
  .org-dash { flex-basis: 10px; }
  .org-side .org-box { padding: 6px 4px; font-size: .85rem; }
  .org-side .org-box span { display: none; }
}

.steps { padding-left: 1.6em; }
.steps li + li { margin-top: 14px; }
.steps li::marker { font-family: var(--f-display); color: var(--stamp); }

.motto { font-family: var(--f-display); font-size: 1.35rem; line-height: 1.4; color: var(--stamp); border-top: 1px dashed var(--edge); border-bottom: 1px dashed var(--edge); padding: var(--s4) 0; text-wrap: balance; }

.nav-inner { justify-content: flex-end; }
.nav .home { margin-right: 0; }
@media (max-width: 700px) { .nav-inner { justify-content: flex-start; } }
.id-photo.has-photo { background-color: var(--paper-2); background-size: cover; background-position: center top; }
.id-photo.has-photo::after { display: none; }

/* Skills with their specialty underneath */
.skill-item { break-inside: avoid; padding: 3px 0 7px; border-bottom: 1px dotted var(--rule); }
.skill-item .skill { border-bottom: 0; padding-bottom: 0; }
.skill.mid, .skill.mid .pct { color: var(--ink); }
.spec { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; line-height: 1.4; color: var(--ink-2); padding-top: 2px; }
.spec > span:last-child { min-width: 0; }
.specbox { flex: none; width: 12px; height: 12px; border: 1.5px solid var(--ink-2); margin-top: 3px; }
.spec.has { color: var(--ink); }
.spec.has .specbox { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 2px var(--card); }

/* Larger skill names and numbers, with what each covers in brackets */
.skill-item .skill { align-items: baseline; font-size: 1.12rem; gap: 12px; }
.skill-item .skill .sname { min-width: 0; }
.skill-item .skill .pct { flex: none; font-size: 1.28rem; font-weight: 700; }
.skill-item small { font-size: .8rem; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.skill-item { padding: 6px 0 9px; }
.spec { font-size: .92rem; }
.spec.has .spname { font-weight: 700; }


/* ================= Public site ================= */
.nav-inner { justify-content: flex-start; }
.nav .home { margin-right: auto; }
.pagehead[data-stamp]::after { content: attr(data-stamp); }
.pagehead.no-stamp::after { content: none; }
@media (min-width: 701px) { .pagehead.no-stamp h1 { max-width: none; } }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s6); align-items: center; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }
.photo { margin: 0; border: 1px solid var(--edge); background: var(--card); padding: 8px 8px 0; box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
.photo img { display: block; max-width: 100%; height: auto; }
.photo figcaption { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding: 6px 2px 8px; }
.hero .photo { transform: rotate(1.2deg); width: 100%; }
.hero .photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; filter: sepia(.28) contrast(1.04); }
@media (prefers-reduced-motion: reduce) { .hero .photo { transform: none; } }

.report { font-size: 1.05rem; line-height: 1.75; max-width: 70ch; }
.report > * + * { margin-top: 1.15em; }
.report .photo { margin-block: var(--s5); }
.video { aspect-ratio: 16 / 9; max-width: 100%; border: 1px solid var(--edge); background: var(--ink); box-shadow: var(--shadow); margin-block: var(--s5); }
.video iframe { display: block; width: 100%; height: 100%; border: 0; }
.dinkus { border: 0; text-align: center; margin-block: var(--s5); }
.dinkus::before { content: "* * * * *"; font-family: var(--f-mono); letter-spacing: .5em; color: var(--ink-2); }
.report-foot { display: grid; gap: var(--s5); margin-top: var(--s7); padding-top: var(--s5); border-top: 1px dashed var(--edge); }
.back-link { font-family: var(--f-display); letter-spacing: .06em; text-transform: uppercase; }
.badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); gap: var(--s5); }
.badges .idcard { margin: 0; max-width: none; }
.news > * + * { margin-top: 1em; }
.news .lead { font-family: var(--f-display); font-size: 1.25rem; letter-spacing: .03em; }
.embed { display: flex; justify-content: center; }
.embed > div { max-width: 540px; width: 100%; }
.footer a { color: inherit; }

/* Local tools */
.tool label { display: block; margin-top: var(--s4); font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
.tool input[type=text], .tool textarea, .tool select { width: 100%; padding: 8px 10px; margin-top: 6px; font-family: var(--f-mono); font-size: 1rem; line-height: 1.5; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--card); color: var(--ink); }
.tool textarea { min-height: 110px; resize: vertical; }
.tool #bodyText, .tool #newsText { min-height: 300px; }
.tool .hint { font-size: .86rem; color: var(--ink-2); margin-top: 6px; }
.tool code { font-family: var(--f-mono); background: var(--paper-2); border: 1px solid var(--rule); padding: 0 5px; }
.tool .checkbox-row { display: flex; align-items: center; gap: 10px; margin-top: var(--s4); }
.tool .checkbox-row label { margin-top: 0; }
.tool .checkbox-row input { width: 18px; height: 18px; accent-color: var(--stamp); }
.tool .btn { margin-top: var(--s5); font-size: 1rem; padding: 10px 20px; }
.tool #output { display: none; margin-top: var(--s6); }
.tool .step { border: 1px solid var(--edge); background: var(--card); padding: var(--s4); }
.tool .step + .step { margin-top: var(--s3); }
.tool .step > * + * { margin-top: 8px; }
.tool #snippetBox { min-height: 96px; font-size: .88rem; }
.tool h2 { margin-top: var(--s6); margin-bottom: var(--s2); }
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
