:root {
  --safe: #b9a17e;
  --safe-fill: #dccab0;
  --unsafe: #9a3e43;
  --unsafe-fill: #bd6868;
  --figure: #faf7f1;
  --plot-rule: #d9cfc2;
}
:root[data-theme="dark"] {
  --safe: #c6af8e;
  --safe-fill: #b09a7c;
  --unsafe: #eca19a;
  --unsafe-fill: #d9817e;
  --figure: #24201e;
  --plot-rule: #4d423a;
}
.note-page { padding-top: 48px; }
.reading-width { width: min(100%, 740px); margin-inline: auto; }
.back-link { display: inline-block; font-size: 12px; margin-bottom: 36px; color: var(--muted); }
.note-header h1 { font-size: clamp(34px, 4.5vw, 47px); line-height: 1.25; letter-spacing: -1.6px; margin-bottom: 20px; }
.note-header .eyebrow { font-size: 10px; letter-spacing: 1.4px; }
.note-deck { font-size: 18px; color: var(--muted); line-height: 1.8; margin-bottom: 18px; }
.byline { font-size: 12px; color: var(--muted); }
.note-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.note-meta .byline { margin: 0; }
.note-pdf-download { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; text-decoration: none; }
.note-pdf-download svg { width: 17px; height: 17px; flex: 0 0 17px; }
.note-outline { display: flex; flex-wrap: wrap; gap: 9px 22px; padding-block: 22px; margin-block: 29px 44px; border-block: 1px solid var(--rule); font-size: 12px; }
.prose p { margin-bottom: 23px; line-height: 1.95; }
.prose strong { color: var(--ink); }
.prose em { font-style: normal; }
.cite { white-space: nowrap; font-size: .8em; }
.note-section { margin-top: 64px; scroll-margin-top: 25px; }
#starting-point, #references { scroll-margin-top: 25px; }
.section-number { color: var(--accent); font-size: 11px; letter-spacing: 1px; }
.prose .section-number { margin-bottom: 12px; }
.note-section h2 { font-size: 29px; line-height: 1.45; margin-bottom: 23px; letter-spacing: -.7px; }
.equation { text-align: center; margin: 29px 0; padding-block: 24px; color: var(--ink); background: var(--surface); font-size: 16px; overflow-wrap: anywhere; }
.equation sub { font-size: 10px; }
.equation-divider { display: inline-block; margin-inline: 10px; color: var(--accent); }
.inline-math { white-space: nowrap; color: var(--ink); font-size: .95em; }
.direction-derivation { margin: 32px 0; padding: 24px 28px 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; color: var(--ink); }
.derivation-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 7px 18px; margin-bottom: 24px; font-size: 11px; color: var(--ink); }
.derivation-method { color: var(--muted); font-size: 10px; }
.class-means { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.class-mean { min-width: 0; border-top: 2px solid var(--safe); padding-top: 14px; }
.mean-unsafe { border-top-color: var(--unsafe); }
.math-step { display: block; font-size: 10px; line-height: 1.7; color: var(--muted); }
.mean-unsafe .math-step { color: var(--accent); }
.direction-derivation math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", math; font-size: 19px; margin-block: 22px 14px; }
.direction-derivation mtext { font-size: .82em; }
.equation-number { display: block; text-align: right; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.derivation-row { display: grid; grid-template-columns: 175px minmax(0, 1fr) 30px; align-items: center; gap: 10px; border-top: 1px solid var(--rule); padding-block: 22px; margin-top: 22px; }
.derivation-row + .derivation-row { margin-top: 0; }
.derivation-row math { margin-block: 0; }
.notation-key { border-top: 1px solid var(--rule); padding-top: 13px; }
.notation-key summary { font-size: 11px; color: var(--muted); }
.notation-key dl { margin: 17px 0 5px; font-size: 11px; line-height: 1.85; }
.notation-key dl > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 17px; margin-top: 12px; }
.notation-key dt { color: var(--ink); }
.notation-key dd { margin: 0; color: var(--muted); }
.interactive-figure { margin: 38px 0; padding: 29px 30px 24px; background: var(--figure); border: 1px solid var(--rule); border-radius: 3px; }
.figure-heading { display: flex; gap: 15px; align-items: baseline; margin-bottom: 25px; }
.figure-index { color: var(--accent); font-size: 12px; flex: 0 0 23px; }
.figure-heading h3 { margin: 0 0 6px; font-size: 21px; line-height: 1.5; letter-spacing: -.4px; }
.figure-heading p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.8; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row button { color: var(--body); background: transparent; border: 1px solid var(--plot-rule); border-radius: 3px; font-size: 11px; line-height: 1.6; padding: 9px 12px; min-height: 38px; cursor: pointer; }
.choice-row button:hover { border-color: var(--accent); color: var(--accent); }
.choice-row button[aria-pressed="true"] { color: var(--page); background: var(--accent); border-color: var(--accent); }
.example-prompt { margin-block: 27px 21px; padding-top: 20px; border-top: 1px solid var(--rule); }
.small-label { color: var(--muted); display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.example-prompt p[lang="ar"] { margin: 6px 0; text-align: start; font-size: 20px; line-height: 1.7; }
[lang="ar"] { font-family: "Geeza Pro", "Noto Naskh Arabic", Tahoma, serif; }
.response-pair { display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid var(--plot-rule); }
.response-pair > div { padding: 22px 22px 20px 0; }
.response-pair > div + div { padding-left: 23px; padding-right: 0; border-left: 1px solid var(--plot-rule); }
.response-pair blockquote { margin: 14px 0; line-height: 1.9; color: var(--ink); font-size: 21px; }
.response-after .small-label { color: var(--accent); }
.translation { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0; }
.figure-takeaway { padding-left: 16px; border-left: 2px solid var(--accent); margin: 24px 0 18px; font-size: 13px; line-height: 1.9; color: var(--body); }
figcaption { font-size: 11px; line-height: 1.9; color: var(--muted); }
.data-detail { margin: 34px 0; border-block: 1px solid var(--rule); padding: 17px 0; }
summary { cursor: pointer; color: var(--ink); font-size: 13px; line-height: 1.8; }
summary span { display: inline-block; color: var(--muted); margin-left: 8px; font-size: 11px; }
.table-help { color: var(--muted); font-size: 11px; line-height: 1.9; margin: 15px 0 6px; }
.table-scroll { width: 100%; overflow-x: auto; margin: 15px 0; }
table { border-collapse: collapse; width: 100%; font-size: 11px; line-height: 1.7; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--muted); font-size: 10px; padding-bottom: 12px; }
th, td { padding: 12px 10px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-size: 10px; font-weight: 400; }
td { color: var(--body); }
th button, td button { background: transparent; color: inherit; padding: 0; border: 0; font: inherit; text-align: inherit; cursor: pointer; min-height: 28px; }
td button { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
th button:hover, td button:hover { color: var(--hover); text-decoration-color: currentColor; }
tr.is-selected { background: var(--selection); }
tr.is-selected td { color: var(--selection-ink); }
.data-stages { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; padding: 0; }
.data-stages li { border-top: 2px solid var(--rule); padding-top: 14px; }
.data-stages strong { display: block; font-size: 14px; margin-bottom: 7px; }
.data-stages span { display: block; color: var(--accent); font-size: 11px; line-height: 1.8; }
.data-stages small { display: block; color: var(--muted); font-size: 11px; line-height: 1.9; margin-top: 9px; }
.figure-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 23px; }
.guard-toolbar { display: grid; grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr); gap: 24px; }
.baseline-refusal { padding-inline: 22px; border-inline: 1px solid var(--rule); }
.baseline-heading { display: flex; gap: 16px; align-items: baseline; margin: 0 0 10px; font-size: 11px; color: var(--ink); }
.baseline-heading a { margin-left: auto; font-size: 9px; color: var(--muted); white-space: nowrap; }
.baseline-refusal dl { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0; }
.baseline-refusal dt { color: var(--muted); font-size: 10px; white-space: nowrap; }
.baseline-refusal dd { color: var(--ink); font-size: 22px; line-height: 1.7; margin: 0; font-variant-numeric: tabular-nums; }
.figure-toolbar label { display: block; font-size: 11px; color: var(--muted); }
select { display: block; margin-top: 6px; max-width: 100%; padding: 9px 30px 9px 10px; font-size: 12px; background: var(--page); color: var(--ink); border: 1px solid var(--plot-rule); border-radius: 3px; min-height: 42px; cursor: pointer; }
.auc-note { margin: 0; font-size: 11px; text-align: right; color: var(--muted); }
.auc-note strong { font-size: 21px; color: var(--ink); font-weight: 400; margin-left: 5px; font-variant-numeric: tabular-nums; }
.auc-note span { display: block; font-size: 10px; margin-top: 3px; }
.control-label { display: block; font-size: 11px; color: var(--muted); margin: 0 0 9px; }
.threshold-control { margin-top: 23px; }
.threshold-control label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
output { font-variant-numeric: tabular-nums; color: var(--accent); font-size: 18px; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 8px 0; cursor: pointer; min-height: 26px; }
.range-hints { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; }
.chart-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 10px; margin-block: 26px 15px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 13px; height: 9px; display: inline-block; }
.safe-swatch { background: var(--safe-fill); border: 1px solid var(--safe); }
.unsafe-swatch { background: var(--unsafe-fill); border: 1px solid var(--unsafe); }
.threshold-key { color: var(--ink); }
.distribution-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.distribution-panel h4 { margin: 0 0 14px; font-weight: 400; font-size: 14px; color: var(--ink); border-top: 1px solid var(--rule); padding-top: 17px; }
.distribution-panel h4 span { float: right; font-size: 10px; color: var(--muted); margin-top: 3px; }
.score-chart svg, .layer-chart svg { width: 100%; height: auto; display: block; overflow: visible; font-family: inherit; }
.plot-text { fill: var(--muted); font-size: 11px; }
.plot-label { fill: var(--muted); font-size: 10px; }
.plot-axis { stroke: var(--plot-rule); stroke-width: 1; }
.plot-threshold { stroke: var(--ink); stroke-width: 1.5; }
.safe-bin { fill: var(--safe-fill); }
.unsafe-bin { fill: var(--unsafe-fill); }
.metric-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.metric-pair div { border-top: 2px solid var(--safe); padding-top: 10px; }
.metric-pair div + div { border-top-color: var(--unsafe); }
.metric-pair span { display: block; color: var(--muted); font-size: 10px; }
.metric-pair strong { display: block; color: var(--ink); font-weight: 400; font-size: 25px; line-height: 1.65; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.metric-pair small { display: block; font-size: 9px; color: var(--muted); }
.figure-detail { border-top: 1px solid var(--rule); padding-top: 13px; margin-bottom: 15px; }
.figure-detail summary { font-size: 12px; }
.threshold-figure figcaption, .layer-figure figcaption { margin-top: 22px; }
.margin-note { border-left: 2px solid var(--safe); padding-left: 20px; color: var(--muted); font-size: 13px; }
.layer-chart { margin: 27px 0 0; }
.layer-line { fill: none; stroke: var(--unsafe); stroke-width: 2; stroke-linejoin: round; }
.layer-point { fill: var(--unsafe); }
.layer-used { stroke: var(--unsafe); stroke-width: 1.5; stroke-dasharray: 4 4; }
.layer-best { stroke: var(--safe); stroke-width: 2; stroke-dasharray: 2 3; }
.layer-used-point { fill: var(--unsafe); stroke: var(--figure); stroke-width: 2; }
.layer-best-point { fill: var(--safe); stroke: var(--ink); stroke-width: 1; }
.layer-target { cursor: crosshair; outline: none; }
.layer-hit { fill: transparent; }
.layer-target.is-inspected circle:last-child, .layer-target:focus-visible circle:last-child { stroke: var(--ink); stroke-width: 2; r: 6; }
.layer-tooltip { pointer-events: none; }
.layer-tooltip rect { fill: var(--figure); stroke: var(--rule); }
.layer-tooltip text { fill: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.references { padding-top: 35px; border-top: 1px solid var(--rule); }
.references h2 { font-size: 24px; }
.references ol { padding-left: 25px; font-size: 12px; line-height: 1.9; color: var(--muted); }
.references li { padding-left: 8px; margin-bottom: 17px; scroll-margin-top: 25px; }
.references li:target { background: var(--selection); color: var(--selection-ink); }
.references code { font-family: inherit; font-size: 11px; overflow-wrap: anywhere; }
.source-note { font-size: 12px; color: var(--muted); padding-top: 18px; border-top: 1px solid var(--rule); }
button:disabled, select:disabled, input:disabled { cursor: wait; opacity: .55; }
@media (max-width: 760px) {
  .guard-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .guard-toolbar .auc-note { grid-column: 1 / -1; text-align: left; }
  .baseline-refusal { border-right: 0; padding-right: 0; }
  .note-page { padding-top: 32px; }
  .interactive-figure { padding: 23px 20px; }
  .distribution-pair { gap: 20px; }
  .note-header h1 { font-size: 38px; }
  .note-deck { font-size: 16px; }
  .note-section { margin-top: 48px; }
  .note-section h2 { font-size: 26px; }
  .class-means { grid-template-columns: 1fr; row-gap: 23px; }
  .class-mean math { font-size: 21px; }
}
@media (max-width: 560px) {
  .back-link { margin-bottom: 29px; }
  .note-header h1 { font-size: 34px; letter-spacing: -1px; }
  .desktop-break { display: none; }
  .note-outline { gap: 10px 19px; font-size: 11px; margin-bottom: 30px; }
  .interactive-figure { padding: 22px 15px; margin-inline: -5px; }
  .figure-heading { gap: 9px; margin-bottom: 19px; }
  .figure-index { flex-basis: 18px; font-size: 10px; }
  .figure-heading h3 { font-size: 19px; }
  .figure-heading p { font-size: 11px; }
  .choice-row { gap: 6px; }
  .choice-row button { font-size: 10px; padding: 9px 10px; }
  .response-pair, .distribution-pair { grid-template-columns: 1fr; }
  .response-pair > div { padding: 20px 0; }
  .response-pair > div + div { padding: 20px 0; border-left: none; border-top: 1px solid var(--plot-rule); }
  .response-pair blockquote { font-size: 21px; }
  .figure-toolbar { flex-direction: column; align-items: stretch; gap: 14px; }
  .guard-toolbar { grid-template-columns: minmax(0, 1fr); }
  .baseline-refusal { border: 0; padding: 8px 0; }
  .baseline-refusal dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure-toolbar select { width: 100%; }
  .auc-note { text-align: left; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
  .auc-note span { flex: 1 1 100%; margin-top: -2px; }
  .data-stages { grid-template-columns: 1fr; gap: 14px; }
  .data-stages li { padding-top: 11px; }
  .data-stages strong { display: inline; margin-right: 10px; }
  .data-stages span { display: inline; }
  .data-stages small { margin-top: 4px; }
  .equation { font-size: 13px; padding: 20px 8px; }
  .equation-divider { margin-inline: 3px; }
  .direction-derivation { padding: 20px 17px 15px; }
  .class-mean math { font-size: 19px; }
  .derivation-row { grid-template-columns: minmax(0, 1fr) 25px; row-gap: 17px; padding-block: 20px; }
  .derivation-row .math-step { grid-column: 1 / -1; }
  .notation-key dl > div { grid-template-columns: 1fr; gap: 3px; }
  .range-hints { font-size: 8px; }
  .distribution-pair { gap: 25px; }
  .metric-pair strong { font-size: 25px; }
  .references ol { font-size: 11px; padding-left: 20px; }
}

.chart-legend .guard-line-key { height: 0; border-top: 2px dashed var(--unsafe); width: 18px; }
.chart-legend .best-line-key { height: 0; border-top: 2px dotted var(--safe); width: 18px; }
@media (max-width: 380px) {
  .direction-derivation { padding-inline: 11px; }
  .class-mean math { font-size: 16px; }
}
