/* Accumulator sizing — on top of calc.css */
main.ac .tabs { grid-template-columns: repeat(3, 1fr); }
main.ac .ac-solve button { min-width: 44px; }
main.ac .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.ac .stage-bar .hist { margin-left: auto; }
#view { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view .handle.hy { cursor: ns-resize; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }

/* line, valve, profile */
.ac-pipe { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1; }
.ac-bore { fill: var(--surface-2); stroke: none; }
.ac-cl { fill: none; stroke: var(--steel-500); stroke-width: .7; stroke-dasharray: 8 3 1.5 3; pointer-events: none; }
.ac-run { fill: none; stroke: var(--blue-5); stroke-width: 1.6; stroke-dasharray: 3 13; stroke-linecap: round; pointer-events: none; }
.ac-flow line { stroke: var(--moment); stroke-width: 1.8; }
.ac-flow path { fill: var(--moment); stroke: none; }
.ac-break { fill: var(--surface); stroke: var(--steel-700); stroke-width: .9; }
.ac-tap { fill: none; stroke: var(--steel-700); stroke-width: 1.2; }
.ac-gauge { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1.1; }
.ac-axis { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.ac-pv { fill: none; stroke: var(--bad); stroke-width: 1; stroke-dasharray: 5 3; opacity: .8; }
.ac-vap { fill: color-mix(in srgb, var(--bad) 12%, transparent); stroke: none; pointer-events: none; }
.ac-prof { fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linejoin: round; }
.ac-axt { font-size: 11px; fill: var(--text-3); }
.ac-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.ac-role { font-size: 11px; fill: var(--text-3); }
.ac-nm { cursor: text; }
.ac-nm:hover .ac-name, .ac-nm:focus .ac-name { fill: var(--sel); }
.ac-nm:focus { outline: none; }

/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.flow rect { stroke: color-mix(in srgb, var(--moment) 45%, transparent); } #view .pill.flow text { fill: var(--x-2c4a91, #2c4a91); font-weight: 600; }
#view .pill.desig rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.desig text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.desig.bad rect { stroke: color-mix(in srgb, var(--bad) 50%, transparent); } #view .pill.desig.bad text { fill: var(--x-b0321f, #b0321f); }
#view .pill.pv rect { stroke: color-mix(in srgb, var(--bad) 35%, transparent); } #view .pill.pv text { fill: var(--x-b0321f, #b0321f); }
#view .pill.warnp rect { stroke: color-mix(in srgb, var(--bad) 50%, transparent); }
#view .pill.reg rect { stroke: var(--steel-300); }
#view .pill.reg.cavitating rect { stroke: color-mix(in srgb, var(--amber) 60%, transparent); } #view .pill.reg.cavitating text { fill: var(--x-9a6a12, #9a6a12); font-weight: 600; }
#view .pill.reg.choked rect, #view .pill.reg.flashing rect { stroke: color-mix(in srgb, var(--bad) 50%, transparent); } #view .pill.reg.choked text, #view .pill.reg.flashing text { fill: var(--x-b0321f, #b0321f); font-weight: 600; }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect, #view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.ac-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); }
.ac-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.ac-edit-name input { width: 180px; text-align: center; }
.ac-edit span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* accumulator drawing */
.ac-shellbg { fill: var(--surface-2); stroke: none; }
.ac-shell { fill: none; stroke: var(--steel-700); }
.ac-gas { fill: var(--sel-line); stroke: none; }
.ac-bladder { stroke: var(--moment); stroke-width: 1.2; }
.ac-oil { fill: var(--x-f3e2c7, #f3e2c7); stroke: none; }
.ac-piston { fill: var(--steel-350); stroke: var(--steel-750); stroke-width: 1; }
.ac-membrane { fill: none; stroke: var(--moment); stroke-width: 1.6; }
.ac-valve { fill: var(--steel-350); stroke: var(--steel-750); stroke-width: .9; }
.ac-port { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: .9; }
.ac-was { fill: none; stroke: var(--x-b48a4a, #b48a4a); stroke-width: 1; stroke-dasharray: 4 3; }
.ac-dim { fill: none; stroke: var(--x-6e7177, #6e7177); stroke-width: .9; }
.ac-step line { stroke: var(--steel-550); stroke-width: 1.6; } .ac-step path { fill: var(--steel-550); stroke: none; }
.ac-st { font-size: 12px; font-weight: 600; fill: var(--text-2); }
.ac-vol { font-size: 11.5px; fill: var(--moment); font-variant-numeric: tabular-nums; }
.ac-vol2 { font-size: 11.5px; fill: var(--x-8a6324, #8a6324); font-variant-numeric: tabular-nums; }
.ac-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.ac-role { font-size: 11px; fill: var(--text-3); }
.ac-nm { cursor: text; }
.ac-nm:hover .ac-name, .ac-nm:focus .ac-name { fill: var(--sel); }
.ac-nm:focus { outline: none; }
.ac-axt { font-size: 11px; fill: var(--text-3); }
#view .pill.pre rect { stroke: color-mix(in srgb, var(--moment) 45%, transparent); } #view .pill.pre text { fill: var(--x-2c4a91, #2c4a91); font-weight: 600; }
#view .pill.deliv rect { stroke: color-mix(in srgb, var(--x-b48a4a, #b48a4a) 60%, transparent); } #view .pill.deliv text { fill: var(--x-7a5418, #7a5418); font-weight: 600; }
#view .handle.hy { cursor: ns-resize; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 8px; }
.ac-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.ac-chip:hover { border-color: var(--text); color: var(--text); }

/* panel labels wrap rather than end in an ellipsis */
.f > label span { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.3; }

/* live strip and flags */
.ac-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; }
.ac-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.ac-live i { font-style: normal; color: var(--text-3); }
.ac-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ac-flags span { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.ac-flags span.bad, .ac-flags span.ac-err { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.ac-seg { margin-bottom: 6px; }
.ac-lab { font-size: 12px; color: var(--text-3); margin: 8px 0 4px; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.ac-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.ac-chip:hover { border-color: var(--line-2); }
.ac-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
#panel input.bad { color: var(--bad); }
#panel .small-note a { color: inherit; }
#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 */
.ac-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 36ch; }
.ac-des { font-weight: 600; color: var(--x-1e4fbf, #1e4fbf); }
.ac-tag { display: inline-block; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; line-height: 1.5; }

/* charts */
.ac-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#cChart, #qChart { touch-action: none; user-select: none; }
#cChart .cdrag, #qChart .cdrag { cursor: ew-resize; }
#cChart .cdrag.cdy { cursor: ns-resize; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }

@media (max-width: 1100px) { .ac-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  #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; }
}
@media print { .ac-edit { display: none !important; } }

/* 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-1e4fbf: #749ff5; --x-2c4a91: #81a0e0; --x-6e7177: #85827f; --x-7a5418: #be9c6e; --x-7f93c2: #99aad2;
    --x-8a6324: #c5a372; --x-9a6a12: #d0a66a; --x-b0321f: #ef8470; --x-b48a4a: #d9b682; --x-f3e2c7: #3a2f1d;
    --x-f6dfd6: #3b2d27;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-2c4a91: #81a0e0; --x-6e7177: #85827f; --x-7a5418: #be9c6e; --x-7f93c2: #99aad2;
    --x-8a6324: #c5a372; --x-9a6a12: #d0a66a; --x-b0321f: #ef8470; --x-b48a4a: #d9b682; --x-f3e2c7: #3a2f1d;
    --x-f6dfd6: #3b2d27;
  }
}
/* theme-auto:end */
