/* phantom-audit — console additions (v2, deployed-palette).
   EVERYTHING in this file is INSTRUMENT/IMPROVISATION, not canon: the audit
   console kit (chips, stat row, filters, ledger chrome), the provenance panel,
   the marks layer, demo frames and the evidence gallery. Colours are drawn
   from the deployed palette only (pink #ff6bbc, state pink #f2849e, lime
   #3ef900, blue #20a3f5, red #f51616, purple #8833e3, ink #585858, lines
   #c9c9c9). Marked in the DOM with data-improvised / data-kit; gap records in
   the review workspace. The system itself lives in assets/css/main.css
   (derived verbatim from the deployment). */

/* ---- marks layer: reveal improvisations ---- */
body.marks-on [data-improvised],
body.marks-on [data-adapted],
body.marks-on [data-fallback] { outline: 2px dashed #f2849e; outline-offset: 3px; }
body.marks-on [data-improvised]::after,
body.marks-on [data-adapted]::after,
body.marks-on [data-fallback]::after {
  content: attr(data-mk);
  display: inline-block; max-width: 100%;
  font-size: 0.62em; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase;
  color: #f2849e; border: 1px dashed #f2849e; border-radius: 0;
  padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}
.marks-toggle.icon { position: fixed; right: 1.25em; bottom: 1.25em; z-index: 10005; background: #fff; }

/* ---- chips (console kit) ---- */
.chip { display: inline-block; font-size: 0.62em; font-weight: 900; letter-spacing: 0.18em;
  text-transform: uppercase; border: solid 1px #585858; border-radius: 0; padding: 2px 8px;
  color: #585858; margin: 0 6px 4px 0; white-space: nowrap; }
.chip--canon { border-color: #ff6bbc; color: #ff6bbc; }
.chip--base { border-color: #585858; color: #585858; }
.chip--override { border-color: #3ef900; color: #585858; background: rgba(62,249,0,0.14); }
.chip--candidate { border-color: #8833e3; color: #8833e3; }
.chip--improv { border-style: dashed; border-color: #f2849e; color: #f2849e; }
.chip--gap { border-color: #c9c9c9; color: rgba(88,88,88,0.9); background: rgba(144,144,144,0.075); }
.chip--defect { border-color: #585858; background: #585858; color: #fff; }
.chip--fix { border-color: #f51616; color: #f51616; }

/* ---- stat row ---- */
.statrow { display: flex; flex-wrap: wrap; margin: 0 0 1.5em -1.5em; }
.statrow .stat { padding: 0 0 0 1.5em; margin: 0 0 1em 0; }
.statrow .stat b { display: block; font-size: 2.2em; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
.statrow .stat span { font-size: 0.64em; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(88,88,88,0.75); }

/* ---- console bar (override toggle etc.) ---- */
.consolebar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75em; margin: 0 0 1.5em 0; }
.consolebar .button.small[aria-pressed="true"] { background: #585858; color: #ffffff !important; box-shadow: inset 0 0 0 2px #585858; }

/* ---- filters ---- */
ul.filters { list-style: none; padding: 0; margin: 0 0 1.25em 0; }
ul.filters li { display: inline-block; margin-right: 0.5em; }
ul.filters .button.small { box-shadow: inset 0 0 0 1px #585858; }
ul.filters .button.small[data-active] { background: #585858; color: #ffffff !important; box-shadow: inset 0 0 0 2px #585858; }

/* ---- provenance panel ---- */
.panel { position: fixed; top: 0; right: 0; width: 24em; max-width: 92%; height: 100%;
  background: #fff; border-left: solid 1px #c9c9c9; border-radius: 0; z-index: 10010;
  display: flex; flex-direction: column; }
.panel[hidden] { display: none; }
.panel > header { padding: 1.25em 1.5em 0.75em 1.5em; border-bottom: solid 1px #c9c9c9; }
.panel > header h3 { font-size: 1em; margin: 0 0 0.35em 0; }
.panel > header .close { position: absolute; top: 0.9em; right: 1em; }
.panel .body { padding: 1em 1.5em 2em 1.5em; overflow-y: auto; }
.panel .body p, .panel .body li { font-size: 0.85em; line-height: 1.6; }
.panel .body .kv { margin: 0 0 0.8em 0; }
.panel .body .kv b { display: block; font-size: 0.66em; font-weight: 900; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(88,88,88,0.75); }

/* ---- ledger chrome ---- */
table tbody tr[data-open] { cursor: pointer; }
table.tight td, table.tight th { font-size: 0.82em; }
td .ev { font-size: 0.85em; color: rgba(88,88,88,0.85); }
.ba-table td, .ba-table th { font-size: 0.8em; }

/* ---- demo frames ---- */
.demo { background: rgba(144,144,144,0.075); border-radius: 0; padding: 1.5em 1.75em; margin: 0 0 1em 0; }
.demo > .demo-label { font-size: 0.62em; font-weight: 900; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(88,88,88,0.75); margin-bottom: 0.9em; }

/* ---- artifact cards ---- */
.cards { list-style: none; padding: 0; margin: -1.5em 0 2em -1.5em; display: flex; flex-wrap: wrap; }
.cards > li { width: 100%; padding: 1.5em 0 0 1.5em; }
@media screen and (min-width: 737px) { .cards > li { width: 50%; } }
.cards .card-inner { border-top: solid 2px #c9c9c9; padding: 1.1em 0 0.4em 0; cursor: pointer; }
.cards h3 { margin: 0 0 0.35em 0; font-size: 0.9em; letter-spacing: 0.2em; }
.cards .id { font-family: "Courier New", monospace; font-size: 0.72em; color: rgba(88,88,88,0.75); }
.cards .mini { margin: 0.75em 0 0.5em 0; }
.cards .note { font-size: 0.8em; line-height: 1.55; margin: 0.4em 0 0.6em 0; }

/* ---- adaptation cards ---- */
.adapt { border-top: solid 1px #c9c9c9; padding: 1.5em 0 0.5em 0; margin-bottom: 1.5em; }
.adapt h3 { font-size: 1em; margin: 0 0 0.4em 0; }
.ba { display: flex; flex-wrap: wrap; margin-left: -1.5em; }
.ba > div { flex: 1 1 20em; margin-left: 1.5em; }
.ba .ba-label { font-size: 0.62em; font-weight: 900; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(88,88,88,0.75); margin-bottom: 0.4em; }

/* AA swatches */
.aa { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 0.75em; }
.aa .sw { width: 2.2em; height: 2.2em; border-radius: 0; margin-right: 0.9em; border: solid 1px rgba(88,88,88,0.25); }
.aa .ratio { font-size: 0.8em; margin-right: 0.9em; }
.aa .verdict { font-size: 0.62em; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; }

/* carousel demo (candidate preview) */
.car { max-width: 34em; }
.car .frame { background: #fff; border: solid 1px #c9c9c9; border-radius: 0; height: 12em;
  display: flex; align-items: center; justify-content: center; color: rgba(88,88,88,0.55);
  font-size: 0.72em; font-weight: 900; letter-spacing: 0.24em; text-transform: uppercase; }
.car .ctrl { display: flex; align-items: center; justify-content: space-between; margin-top: 0.6em; }
.car .pos { font-size: 0.78em; color: rgba(88,88,88,0.8); }

/* section anchor nav */
ul.snav { list-style: none; padding: 0; margin: 0 0 2em 0; }
ul.snav li { display: inline-block; margin-right: 1.25em; }
ul.snav a { font-size: 0.68em; font-weight: 900; letter-spacing: 0.28em; text-transform: uppercase; border-bottom: dotted 1px #20a3f5; padding-bottom: 2px; }
ul.snav a[data-current] { border-bottom: solid 1px #f2849e; }

/* evidence gallery */
.evgrid { list-style: none; padding: 0; margin: -1.5em 0 1em -1.5em; display: flex; flex-wrap: wrap; }
.evgrid > li { width: 100%; padding: 1.5em 0 0 1.5em; }
@media screen and (min-width: 737px) { .evgrid > li { width: 50%; } }
.evgrid .evcard { border: solid 1px #c9c9c9; border-radius: 0; background: #fff; }
.evgrid .evimg { display: block; width: 100%; height: auto; border-bottom: solid 1px #c9c9c9; background: rgba(144,144,144,0.075); }
.evgrid .evbody { padding: 1em 1.1em 1.1em 1.1em; }
.evgrid .evbody h4 { margin: 0 0 0.3em 0; font-size: 0.78em; letter-spacing: 0.18em; }
.evgrid .evbody p { margin: 0; font-size: 0.82em; }

/* console code tweaks: tame inline code inside dense copy */
p code { font-size: 0.85em; }

/* the review's own load-in replay target */
.wrapper-replay { display: inline-block; }

/* mini system previews in cards */
.preview { border: solid 1px #c9c9c9; border-radius: 0; padding: 0.9em; background: #fff; }

/* the override demo: clicking "view as project page" flips the app to the
   deployment's sanctioned black-body override (P-R7). Console control; the
   override itself is canon (shared style block of the project pages). */
body.alt-override { background: #fbfbfb; color: #000000; }
body.alt-override a { color: #6bff2c; border-bottom-color: #20a3f5; }

/* ---- explainer accordion (console kit) ---- */
details.explainer { border-top: solid 2px #c9c9c9; border-bottom: solid 1px #c9c9c9; margin: 0 0 2em 0; }
details.explainer > summary { cursor: pointer; list-style: none; font-size: 0.68em; font-weight: 900; letter-spacing: 0.28em; text-transform: uppercase; padding: 1.2em 0; }
details.explainer > summary::-webkit-details-marker { display: none; }
details.explainer > summary::before { content: "\25B8"; margin-right: 0.9em; }
details.explainer[open] > summary::before { content: "\25BE"; }
details.explainer > summary:hover { color: #f2849e; }
details.explainer .expl-body { padding: 0 0 1.2em 0; }
details.explainer .expl-body h3 { font-size: 0.7em; margin: 1.2em 0 0.5em 0; }
details.explainer .expl-body p { font-size: 0.9em; margin: 0 0 0.8em 0; }

/* explainer poster figure (console kit) */
.expl-figure { margin: 1.4em 0 0.2em 0; }
.expl-figure img { width: 100%; height: auto; border: solid 1px #c9c9c9; display: block; }
.expl-figure figcaption { font-size: 0.8em; color: rgba(88,88,88,0.85); margin-top: 0.6em; }

/* explainer: at-a-glance block + live worked example (console kit) */
.aglance { border-bottom: solid 1px #c9c9c9; padding: 0 0 1.6em 0; margin: 0 0 2em 0; }
.ag-kicker { font-size: 0.68em; font-weight: 900; letter-spacing: 0.28em; text-transform: uppercase; color: #ff6bbc; margin-bottom: 0.8em; }
.aglance h2 { margin-top: 0; }
.ag-cols { display: flex; flex-wrap: wrap; gap: 0 2em; }
.ag-col { flex: 1 1 14em; min-width: 0; margin-bottom: 1em; }
.filelist { font-family: "Courier New", monospace; font-size: 0.76em; line-height: 1.95; }
.filelist .c { color: rgba(88,88,88,0.7); }
.filelist .cnt { color: #ff6bbc; font-weight: 700; }
.fstep { display: flex; align-items: center; gap: 0.6em; margin-bottom: 0.35em; }
.fstep .arr { color: #ff6bbc; font-weight: 900; width: 1em; text-align: center; flex: 0 0 auto; }
.fstep .fbox { flex: 1 1 auto; min-width: 0; border: solid 1px #c9c9c9; padding: 0.4em 0.8em; font-size: 0.8em; line-height: 1.5; }
.fstep .fbox b { font-weight: 900; font-size: 0.85em; letter-spacing: 0.14em; text-transform: uppercase; margin-right: 0.5em; }
.fstep .fbox.l { border-left: solid 3px #f2849e; }
.fstep .fbox.r { border-left: solid 3px #20a3f5; }
.fstep .fbox.report { border-left: solid 3px #3ef900; background: rgba(62,249,0,0.12); }
ul.evol { list-style: none; }
ul.evol li { font-size: 0.85em; margin-bottom: 0.6em; padding-left: 1.4em; position: relative; line-height: 1.55; }
ul.evol li::before { content: "—"; position: absolute; left: 0; color: #ff6bbc; font-weight: 900; }
.ag-link { font-size: 0.8em; margin-top: 1em; }
ul.expl-timeline { list-style: none; margin: 1em 0 1.4em 0; }
ul.expl-timeline li { position: relative; padding: 0 0 1.5em 2.4em; border-left: solid 2px #c9c9c9; margin-left: 0.6em; }
ul.expl-timeline li::before { content: ""; position: absolute; left: -0.65em; top: 0.15em; width: 1.1em; height: 1.1em; border-radius: 100%; background: #fff; border: solid 3px #585858; box-sizing: border-box; }
ul.expl-timeline li.v2::before { border-color: #ff6bbc; background: #ff6bbc; }
ul.expl-timeline li.bad::before { border-color: #f51616; }
ul.expl-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
ul.expl-timeline .ver { font-weight: 900; font-size: 0.95em; }
ul.expl-timeline p { font-size: 0.85em; margin: 0.3em 0 0 0; }
.expl-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9em 1.6em; margin: 0.6em 0 1.2em 0; }
.expl-rules .r { border-left: solid 3px #ff6bbc; padding: 0.1em 0 0.1em 0.9em; }
.expl-rules .r.grey { border-left-color: #585858; }
.expl-rules .r.purple { border-left-color: #8833e3; }
.expl-rules .r.blue { border-left-color: #20a3f5; }
.expl-rules .r b { display: block; font-size: 0.82em; letter-spacing: 0.04em; }
.expl-rules .r span { font-size: 0.82em; line-height: 1.5; }
@media screen and (max-width: 736px) { .expl-rules { grid-template-columns: 1fr; } }

.ag-cta { margin: 1.4em 0 0 0; }
.lede-ish { font-size: 1.05em; }

/* ---- reading ink (AA strategy of candidate/text-as-accent) — DEFAULT ON ----
   deep raspberry #b03b72 (5.66:1) + teal links #0b7285 (5.64:1) + white code ink.
   Toggle switches back to the exact as-deployed values (the finding, 2.6:1). */
body.ink-reading { color: #b03b72; }
body.ink-reading a { color: #0b7285; }
body.ink-reading code { color: #ffffff; }
body.ink-reading .ag-kicker { color: #b03b72; }
body.ink-reading .statrow .stat b { color: inherit; }

/* contents ("in this review") — console kit */
ul.contents { list-style: none; padding: 0; margin: 0.2em 0 1.4em 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.9em 1.6em; }
ul.contents li a { display: block; border: solid 1px #c9c9c9; padding: 0.9em 1.1em; }
ul.contents li a:hover { border-color: #f2849e; }
ul.contents b { display: block; font-size: 0.8em; letter-spacing: 0.2em; text-transform: uppercase; color: #585858; }
ul.contents span { font-size: 0.84em; color: rgba(88,88,88,0.85); }
@media screen and (max-width: 736px) { ul.contents { grid-template-columns: 1fr; } }
