/* Compressible flow — on top of calc.css (light only, the site's tokens) */
main.cf .tabs { grid-template-columns: repeat(2, 1fr); }
main.cf .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.cf .stage-bar .hist { margin-left: auto; }
.cf-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.cf-mode { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 14px; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; line-height: 1.2; }
.cf-mode:hover { border-color: var(--text-3); color: var(--text); }
.cf-mode[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--on-accent); }
#view { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view.dragging .handle { cursor: grabbing; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }

/* charts */
.cf-plot { fill: var(--surface-2); stroke: var(--steel-350); stroke-width: .8; }
.cf-grid { fill: var(--fill-2); }
.cf-tick { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.cf-tick.small { font-size: 10px; }
.cf-axt { font-size: 11px; font-weight: 500; fill: var(--text-2); }
.cf-c { fill: none; stroke-width: 2; stroke-linejoin: round; }
.cf-ref { fill: none; stroke: var(--x-a9aeb5, #a9aeb5); stroke-width: 1.1; stroke-dasharray: 5 3; }
.cf-fam { fill: none; stroke: var(--steel-400); stroke-width: 1; }
.cf-locus { fill: none; stroke: var(--text-4); stroke-width: 1; stroke-dasharray: 2 3; }
.cf-dist { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.cf-pb { fill: none; stroke: var(--load); stroke-width: 1.6; stroke-dasharray: 6 4; }
.cf-vline { fill: color-mix(in srgb, var(--sel) 35%, transparent); }
.cf-lev { fill: var(--text-2); }
.cf-band { stroke: none; }
.cf-sonic { fill: var(--steel-350); }
.cf-lstar { fill: color-mix(in srgb, var(--bad) 55%, transparent); }
.cf-guide { fill: none; stroke: var(--steel-500); stroke-width: 1; stroke-dasharray: 3 3; }
.cf-dot { stroke: var(--halo); stroke-width: 1.5; }
.cf-ghost { fill: var(--surface); stroke-width: 1.6; }
.cf-mark { fill: var(--x-6e7177, #6e7177); }
.cf-cl { font-size: 11px; font-weight: 500; fill: var(--text); paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; stroke-linejoin: round; }
.cf-cl.ref { font-size: 10.5px; fill: var(--text-3); }

/* sketches */
.cf-wall { fill: var(--steel-200); stroke: none; }
.cf-wline { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.cf-axis { fill: none; stroke: var(--text-4); stroke-width: .8; stroke-dasharray: 10 3 2 3; }
.cf-shock { fill: none; stroke: var(--load-ink); stroke-width: 2.6; stroke-linecap: round; }
.cf-shock2 { fill: none; stroke: var(--load-ink); stroke-width: 1.6; }
.cf-fan { fill: none; stroke: var(--blue); stroke-width: 1; }
.cf-jetb { fill: none; stroke: var(--x-6e7177, #6e7177); stroke-width: 1.1; stroke-dasharray: 5 3; }
.cf-stream { fill: none; stroke: color-mix(in srgb, var(--ink) 45%, transparent); stroke-width: 1; }
.cf-flow { stroke: var(--blue); stroke-width: 1.8; }
.cf-flow-h { fill: var(--blue); }
.cf-heat { stroke: var(--load); stroke-width: 1.8; }
.cf-heat-h { fill: var(--load); }
.cf-sw { stroke: color-mix(in srgb, var(--ink) 18%, transparent); stroke-width: .6; }
.cf-lab { font-size: 11px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.cf-lab.small { font-size: 10.5px; }
.cf-lab.strong { font-weight: 600; fill: var(--text); }
.cf-lab.warn { font-weight: 600; fill: var(--bad-ink); }
#view .sb { font-size: 75%; }
.pill rect { fill: var(--surface); stroke: var(--steel-300); }
.pill text { font-weight: 600; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.pill.sel rect { stroke: var(--sel); } .pill.sel text { fill: var(--sel); }
.pill.load rect { stroke: color-mix(in srgb, var(--load) 60%, transparent); } .pill.load text { fill: var(--load-ink); }
.pill.editable { cursor: text; }
.pill.editable:hover rect, .pill.editable:focus rect { stroke-width: 1.6; }
.pill.editable:focus { outline: none; }
.cf-edit { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1.5px solid var(--sel); border-radius: 9px; padding: 2px 8px 2px 4px; box-shadow: 0 6px 18px rgba(20, 22, 28, .14); }
.cf-edit input { width: 80px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; background: transparent; color: var(--text); }
.cf-edit span { font-size: 11.5px; color: var(--text-3); }
main.cf .stage { position: relative; }

/* live strip and flags */
.cf-live { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 38px; align-items: center; }
.cf-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.cf-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.cf-flags span { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.cf-flags span.cf-err { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.cf-seg { margin: 4px 0 6px; }
.f.cf-wide { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.f.cf-wide select { width: 100%; font: inherit; font-size: 13px; color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 6px; background: var(--surface); }
.cf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.cf-chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.cf-chip:hover { border-color: var(--text-3); color: var(--text); }
#panel input.bad { color: var(--bad); }
#panel.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
#panel.fade-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px); mask-image: linear-gradient(to bottom, transparent, #000 28px); }
#panel.fade-t.fade-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); }

/* summary */
.cf-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 40ch; }

/* tables */
table.cf-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.cf-table th { font-size: 12px; font-weight: 500; color: var(--text-3); text-align: right; padding: 6px 8px; white-space: nowrap; }
table.cf-table tr.u th { font-weight: 400; font-size: 11.5px; padding-top: 0; border-bottom: 1px solid var(--line); }
table.cf-table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.cf-table .l { text-align: left; white-space: normal; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
@media print { .cf-edit { display: none !important; } }

@media (max-width: 760px) {
  .cf-modes { gap: 5px; }
  .cf-mode { padding: 4px 11px; font-size: 12.5px; }
  #checks thead { display: none; }
  #checks, #checks tbody { display: block; width: 100%; }
  #checks tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  #checks td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  #checks td.chk { grid-column: 1; grid-row: 1; }
  #checks td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; }
  #checks td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  #checks td:nth-child(3) { grid-column: 2; grid-row: 2; font-size: 12.5px; text-align: right; }
  #checks td:nth-child(2)::before { content: "actual "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "allowed "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); min-width: 0; }
  /* states: one card per row, each value labelled */
  table.cf-table thead { display: none; }
  table.cf-table, table.cf-table tbody { display: block; width: 100%; }
  table.cf-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  table.cf-table td { display: block; border: 0; padding: 0; text-align: left; font-size: 12.5px; white-space: normal; }
  table.cf-table td.l { grid-column: 1 / -1; font-weight: 500; }
  table.cf-table td[data-l]::before { content: attr(data-l) " "; color: var(--text-3); }
}

/* Mach bands in dark, picked by hand: the rule mirrors pale colours down but lifts the saturated warm end, which made the
   scale non-monotonic (Mach 2.5 to 4 glowed pastel). Subsonic stays cool, supersonic deepens to copper as Mach rises. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --cf-m2: #2f3a48; --cf-m3: #3a4a5e; --cf-m4: #362c20; --cf-m5: #47341e; --cf-m6: #5e4428; --cf-m7: #77512c; --cf-m8: #8f5c30; --cf-m9: #a8663a; }
}
@media screen {
  :root[data-theme="dark"] { --cf-m2: #2f3a48; --cf-m3: #3a4a5e; --cf-m4: #362c20; --cf-m5: #47341e; --cf-m6: #5e4428; --cf-m7: #77512c; --cf-m8: #8f5c30; --cf-m9: #a8663a; }
}
/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-2f5a8f: #7ea3d3; --x-5f3c80: #ae91ce; --x-6e5520: #b29c72; --x-6e7177: #85827f; --x-7a4fa0: #b895dc;
    --x-8a6d2b: #c2a975; --x-a3402a: #e38b77; --x-a9aeb5: #51555a; --x-b2c8e2: #3d4d5f; --x-c4c9cf: #3f4347;
    --x-e6e1ef: #332f38; --x-eabf94: #a78664; --x-f3e3d3: #382e24;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-2f5a8f: #7ea3d3; --x-5f3c80: #ae91ce; --x-6e5520: #b29c72; --x-6e7177: #85827f; --x-7a4fa0: #b895dc;
    --x-8a6d2b: #c2a975; --x-a3402a: #e38b77; --x-a9aeb5: #51555a; --x-b2c8e2: #3d4d5f; --x-c4c9cf: #3f4347;
    --x-e6e1ef: #332f38; --x-eabf94: #a78664; --x-f3e3d3: #382e24;
  }
}
/* theme-auto:end */
