/* Hand-built figures for lesson 14, Alignment and safety. */

/* shared: axes, ticks, work lines, tables, legends, wrapped segments */
.al-grid { stroke: var(--line-2); }
.al-axis { stroke: var(--ink-3); }
.al-tick { font: 12px var(--f-mono); fill: var(--ink-3); }
.al-tick.strong { fill: var(--ink-2); font-weight: 600; }
.al-work { font: 0.9rem/1.6 var(--f-mono); color: var(--ink-2); margin: 0 0 6px; overflow-wrap: anywhere; }
.al-work b { color: var(--ink); }
.al-work b.proxy { color: var(--accent-ink); }
.bad { color: var(--bad); } .good { color: var(--good); }
.al-table { border-collapse: collapse; width: 100%; font: 0.86rem var(--f-ui); }
.al-table th { text-align: left; font: 500 0.66rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.al-table td { padding: 8px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.al-table td.num { font-family: var(--f-mono); color: var(--ink); white-space: nowrap; }
.al-legend { font-size: 0.78rem; line-height: 1.6; color: var(--ink-3); text-align: center; margin: 8px 0 0; }
.al-legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 5px 0 12px; }
.al-legend .key:first-child { margin-left: 0; }
.key.proxy, .key.tr { background: var(--accent); } .key.true { background: var(--gold); }
.key.benign { background: var(--good); } .key.off { background: var(--bad); } .key.better { background: var(--gold); }
.seg.al-wrap { flex-wrap: wrap; border-radius: 18px; max-width: 100%; }
.seg.al-wrap button { height: auto; min-height: 28px; padding: 4px 12px; white-space: normal; text-align: left; line-height: 1.3; }
.al-slider.off { opacity: 0.4; }
.al-slider input { width: min(220px, 55vw); }

/* hero */
.ah { width: 100%; height: auto; display: block; max-width: 860px; margin: 0 auto; }
.ah-axis { stroke: var(--line-2); }
.ah-axis-lbl { font: 13px var(--f-mono); fill: var(--ink-3); }
.ah-proxy { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.ah-true { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }
.ah-lbl { font: 600 14px var(--f-ui); }
.ah-lbl.proxy { fill: var(--accent-ink); } .ah-lbl.true { fill: var(--gold); }
.ah-moment { opacity: 0; transition: opacity 0.6s var(--ease); }
.ah-moment.in { opacity: 1; }
.ah-mark { stroke: var(--ink-3); stroke-dasharray: 4 4; }
.ah-dot { stroke: var(--bg); stroke-width: 2; }
.ah-dot.proxy { fill: var(--accent); } .ah-dot.true { fill: var(--gold); }
.ah-moment-lbl { font: 400 17px var(--f-display); fill: var(--ink); }
@media (max-width: 600px) { .ah-moment-lbl { font-size: 20px; } .ah-lbl { font-size: 17px; } .ah-axis-lbl { font-size: 16px; } }

/* Level 1: the options map */
.ao-ask .kicker { margin-bottom: 8px; }
.ao-sits { gap: 4px; padding: 4px; }
.ao-sits button { font-size: 0.82rem; }
.ao-verdict { display: grid; gap: 10px 22px; grid-template-columns: 1fr; margin-top: 18px; padding: 16px 18px; border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--bg-2); min-height: 9rem; }
@media (min-width: 760px) { .ao-verdict { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ao-verdict p { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--ink-2); }
.ao-verdict .ao-h { font: 600 0.7rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--good); margin-bottom: 4px; }
.ao-verdict .watch .ao-h { color: var(--bad); }
.ao-always { font-size: 0.85rem; color: var(--ink-2); margin: 12px 0 0; }
.ao-always b { color: var(--ink); }
.ao-map { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.ao-gh { font: 500 0.7rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.ao-cards { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ao-card { margin: 0 !important; position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 30px; border-radius: var(--r-1); background: var(--surface-2); border: 1px solid var(--line); transition: opacity 0.25s, border-color 0.25s, background 0.25s; }
.ao-name { font: 600 0.9rem/1.3 var(--f-ui); color: var(--ink); }
.ao-lives { font-size: 0.76rem; color: var(--ink-3); }
.ao-does { font-size: 0.8rem; line-height: 1.4; color: var(--ink-2); margin-top: 4px; }
.ao-pick { position: absolute; left: 14px; bottom: 9px; font: 600 0.68rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--good); opacity: 0; transition: opacity 0.25s; }
.ao-card.on { border-color: var(--good); background: color-mix(in oklab, var(--good) 10%, var(--surface-2)); }
.ao-card.on .ao-pick { opacity: 1; }
.ao-card.dim { opacity: 0.45; }
@media (max-width: 600px) {
  .ao-cards { grid-template-columns: 1fr 1fr; gap: 6px; }
  .ao-card { padding: 10px 10px 26px; }
  .ao-name { font-size: 0.82rem; }
  .ao-does { display: none; }
  .ao-pick { left: 10px; font-size: 0.62rem; }
}

/* Level 2 opening: the brief and the checks */
.bc-ctl { margin-bottom: 14px; }
.bc-chain { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 10px; grid-template-columns: 1fr; counter-reset: none; }
@media (min-width: 900px) { .bc-chain { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bc-step { margin: 0 !important; position: relative; padding: 12px 14px; border-radius: var(--r-1); background: var(--surface-2); border: 1px solid var(--line); }
@media (min-width: 900px) { .bc-step { min-height: 7.5rem; } }
.bc-step.drift { border-color: color-mix(in oklab, var(--bad) 60%, transparent); background: color-mix(in oklab, var(--bad) 7%, var(--surface-2)); }
.bc-h { font: 600 0.68rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }
.bc-step.drift .bc-h { color: var(--bad); }
.bc-body { font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); }
.bc-body b { color: var(--ink); }
.bc-body ul { margin: 0; padding-left: 16px; }
.bc-body li { margin-bottom: 6px; }
.bc-body a { color: var(--accent-ink); }
@media (min-width: 900px) {
  .bc-step:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 12px; font: 400 1rem var(--f-ui); color: var(--ink-3); background: var(--surface); padding: 0 2px; z-index: 1; }
}

/* 1: Goodhart */
.gd-ctl { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 0.85rem; margin-bottom: 12px; }
.gd-pad { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gd-chart { width: 100%; display: block; }
.gd-proxy { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.gd-true { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }
.gd-dot { stroke: var(--bg); stroke-width: 2; }
.gd-dot.proxy { fill: var(--accent); } .gd-dot.true { fill: var(--gold); }
.gd-peak { stroke: var(--ink-3); stroke-dasharray: 4 4; }
.gd-peak-lbl { font: 12px var(--f-mono); fill: var(--ink-2); }
.gd-read { margin-top: 12px; min-height: 6.4em; }
.gd-verdict { font-size: 0.9rem; color: var(--ink-2); margin: 4px 0 0; }

/* 2: be the critic */
.cr-rules { list-style: none; margin: 0 0 16px; padding: 0 !important; display: grid; gap: 6px 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); font-size: 0.84rem; color: var(--ink-2); }
.cr-rules li { margin: 0 !important; }
.cr-rules b { color: var(--ink); font-family: var(--f-mono); font-weight: 600; margin-right: 6px; }
.cr-slots { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .cr-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cr-slot { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-1); background: var(--surface-2); border: 1px solid var(--line); }
.cr-lbl { font: 600 0.72rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.cr-text { width: 100%; box-sizing: border-box; resize: vertical; min-height: 3.6em; font: 0.92rem/1.45 var(--f-body); color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
.cr-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-chip { font: 0.72rem var(--f-mono); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-3); }
.cr-chip.broken { color: var(--bad); border-color: var(--bad); background: color-mix(in oklab, var(--bad) 10%, transparent); }
.cr-v { margin: 0; font: 0.84rem var(--f-mono); color: var(--ink-2); }
.cr-v b { color: var(--ink); }
.cr-slot .btn { align-self: flex-start; }
.cr-pairs { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); min-height: 6em; }
.cr-pairs .kicker { margin-bottom: 6px; }
.cr-pairlist { list-style: none; margin: 0; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.9rem; }
.cr-pairlist li { margin: 0 !important; }
.cr-pairlist b { font-family: var(--f-mono); color: var(--ink); }
.cr-pairs .muted { font-size: 0.84rem; margin: 6px 0 0; }

/* 3: the word-swap search */
.ws-top { margin-bottom: 4px; }
.ws-filter { font-size: 0.9rem; color: var(--ink-2); margin: 0 0 4px; }
.ws-chip { display: inline-block; font: 0.8rem var(--f-mono); padding: 2px 9px; border-radius: 999px; background: color-mix(in oklab, var(--bad) 12%, transparent); border: 1px solid var(--bad); color: var(--ink); margin-right: 4px; }
.ws-vocab { font-size: 0.8rem; margin: 0; }
.ws-ctl { margin: 10px 0 16px; }
.ws-two { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 820px) { .ws-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ws-log { min-height: 15rem; }
.ws-log .kicker, .ws-cover .kicker { margin-bottom: 6px; }
.ws-list { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 4px; }
.ws-list li { margin: 0 !important; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 5px 10px; border-radius: 6px; background: var(--surface-2); font: 0.84rem var(--f-mono); color: var(--ink-2); }
.ws-list li b { font-weight: 600; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.ws-list li.through b { color: var(--bad); } .ws-list li.blocked b { color: var(--ink-3); }
.ws-grid { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 5px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 480px) { .ws-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ws-cell { margin: 0 !important; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 6px; border: 1px dashed var(--line-2); font: 0.76rem/1.3 var(--f-mono); color: var(--ink-3); }
.ws-cell i { font-style: normal; font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; }
.ws-cell.tried { border-style: solid; color: var(--ink); background: var(--surface-2); }
.ws-cell.through.tried { border-color: var(--bad); background: color-mix(in oklab, var(--bad) 12%, var(--surface-2)); }
.ws-cell.through i { color: var(--bad); } .ws-cell.blocked i { color: var(--ink-3); }
.ws-cover-note { font-size: 0.8rem; margin: 8px 0 0; }
.ws-rate { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); min-height: 5.5em; }
.ws-bar { display: block; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; max-width: 420px; }
.ws-bar i { display: block; height: 100%; background: var(--bad); transition: width 0.3s var(--ease); }
.ws-note { font-size: 0.84rem; margin: 8px 0 0; }

/* 4: push the model */
.pm-table .seg button { font-size: 0.78rem; }
.pm-table td:first-child { color: var(--ink); }
.pm-rate { margin-top: 12px; }
.pm-trials { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 0.85rem; }
.pm-trials .kicker { margin: 0; }

/* 4 (end): the rater's thumb */
.rt-ctl { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 0.85rem; margin-bottom: 12px; }
.rt-chart { width: 100%; display: block; }
.rt-curve { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.rt-half { stroke: var(--ink-3); stroke-dasharray: 4 4; }
.rt-cross { stroke: var(--gold); stroke-dasharray: 3 4; }
.rt-dot { fill: var(--gold); stroke: var(--bg); stroke-width: 2; }
.rt-read { margin-top: 12px; min-height: 6em; }
.rt-split { display: flex; height: 30px; border-radius: 8px; overflow: hidden; margin: 6px 0 8px; font: 600 0.74rem var(--f-mono); }
.rt-split i { display: flex; align-items: center; padding: 0 10px; font-style: normal; white-space: nowrap; overflow: hidden; transition: width 0.3s var(--ease); }
.rt-split i.agree { background: color-mix(in oklab, var(--bad) 70%, var(--surface)); color: var(--ink); min-width: 0; }
.rt-split i.correct { flex: 1; background: color-mix(in oklab, var(--good) 55%, var(--surface)); color: var(--ink); justify-content: flex-end; }
.rt-split span { overflow: hidden; text-overflow: ellipsis; }
.rt-note { font-size: 0.84rem; margin: 0; }

/* 5: refusals */
.rd-ctl { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 0.85rem; margin-bottom: 12px; }
.rd-two { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 820px) { .rd-two { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.rd-strip, .rd-curve { width: 100%; display: block; }
.rd-refused { fill: color-mix(in oklab, var(--ink-3) 14%, transparent); }
.rd-dot { stroke: var(--bg); stroke-width: 2; }
.rd-dot.benign, .rd-bin.benign { fill: var(--good); } .rd-dot.off, .rd-bin.off { fill: var(--bad); }
.rd-dot.wrong { stroke: var(--ink); stroke-width: 3; }
.rd-bin { opacity: 0.45; } .rd-bin.wrong { opacity: 1; }
.rd-thresh { stroke: var(--ink); stroke-width: 2; }
.rd-thresh-lbl { font: 600 12px var(--f-mono); fill: var(--ink); }
.rd-read { margin-top: 10px; min-height: 3.4em; }
.rd-tr { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.rd-tr.better { stroke: var(--gold); stroke-dasharray: 5 4; }
.rd-now { fill: var(--gold); stroke: var(--bg); stroke-width: 2; }
.rd-curve-legend { min-height: 2.6em; }

/* on a phone the two tables stack: each row becomes a card, each cell captioned with its column */
@media (max-width: 700px) {
  .pm-table thead, .rg-table thead { display: none; }
  .pm-table, .rg-table, .pm-table tbody, .rg-table tbody { display: block; width: 100%; }
  .pm-table tr, .rg-table tr { display: grid; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .pm-table tr { grid-template-columns: 1fr 1fr; }
  .rg-table tr { grid-template-columns: 1fr 1fr 1fr; }
  .pm-table td, .rg-table td { display: block; padding: 0; border: 0; }
  .pm-table td:first-child, .pm-table td:nth-child(4), .rg-table td:first-child { grid-column: 1 / -1; }
  .pm-table td::before, .rg-table td::before { content: attr(data-col); display: block; font: 500 0.62rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
  .pm-table td:first-child::before, .rg-table td:first-child::before { display: none; }
  .pm-table td:first-child, .rg-table td:first-child { color: var(--ink); font-weight: 600; }
  .rg-num { width: 100%; box-sizing: border-box; }
}

/* 6: the release gate */
.rg-num { width: 5.5em; font: 0.9rem var(--f-mono); color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 8px; }
.rg-num:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rg-verdict { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--bg-2); min-height: 5.6em; font-size: 0.9rem; color: var(--ink-2); }
.rg-verdict p { margin: 0 0 6px; }
.rg-reasons { margin: 0; padding-left: 18px; }
.rg-reasons code { font-size: 0.86rem; }
.rg-warn { margin-top: 8px !important; }
