/* Coordinate transformations — on top of calc.css. Light only, like calc.css; drawing colours are tokens. */
main.gc { --gc-paper: var(--bg); --gc-grat: var(--rock); --gc-zone: color-mix(in srgb, var(--moment) 7%, transparent); --gc-ink: var(--steel-750); --gc-pill: var(--surface); --gc-pill-line: var(--steel-300); --gc-plot: var(--surface); --gc-grid: var(--fill-1); --gc-dial: var(--surface-2); }
main.gc .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.gc .stage-bar .hist { margin-left: auto; }
#view { display: block; width: 100%; height: auto; user-select: none; touch-action: none; cursor: crosshair; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view .handle .knob { fill: var(--gc-pill); stroke: var(--sel); stroke-width: 2; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }
#view.dragging, #view.dragging .handle { cursor: grabbing; }

.gc-paper { fill: var(--gc-paper); }
.gc-frame { fill: none; stroke: var(--steel-400); stroke-width: 1; }
.gc-grat { fill: var(--gc-grat); }
.gc-zone { fill: var(--gc-zone); }
.gc-zl { fill: none; stroke: var(--x-8f9bb3, #8f9bb3); stroke-width: 1; stroke-dasharray: 5 4; }
.gc-grid { fill: none; stroke: var(--moment); stroke-width: .9; stroke-opacity: .55; }
.gc-k1 { fill: none; stroke: var(--good); stroke-width: 1.4; stroke-dasharray: 2 3; }
.gc-city { fill: var(--steel-550); stroke: var(--steel-550); stroke-width: .6; }
.gc-cityT { font-size: 10.5px; fill: var(--text-3); }
.gc-zT { font-size: 10.5px; font-weight: 600; fill: var(--x-6c7a96, #6c7a96); }
.gc-gT { font-size: 10px; fill: var(--text-3); }
.gc-cross { stroke: var(--sel); stroke-width: 1.4; }
.gc-nm { cursor: text; }
.gc-nm:focus { outline: none; }

/* dial */
.gc-dialbox { fill: var(--gc-dial); stroke: var(--line); }
.gc-dial { fill: none; stroke: var(--steel-350); stroke-width: 1; }
.gc-tick { stroke: var(--steel-350); stroke-width: 1; }
.gc-gn line { stroke: var(--text-2); stroke-width: 1.6; } .gc-gn path.hd { fill: var(--text-2); }
.gc-tn line { stroke: var(--load); stroke-width: 1.8; } .gc-tn path.hd { fill: var(--load); }
.gc-arc { fill: none; stroke: var(--moment); stroke-width: 1.4; }
.gc-hub { fill: var(--text-2); }
.gc-dialT { font-size: 11px; font-weight: 600; fill: var(--text-2); letter-spacing: .04em; }
.gc-gnT { font-size: 10.5px; fill: var(--text-3); }
.gc-dialS { font-size: 11.5px; fill: var(--text-2); }

/* pills */
#view .pill rect { fill: var(--gc-pill); stroke: var(--gc-pill-line); }
#view .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.dimv rect { stroke: var(--steel-200); }
#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.perim rect { stroke: color-mix(in srgb, var(--moment) 50%, transparent); } #view .pill.perim text { fill: var(--x-2f4a8a, #2f4a8a); font-weight: 600; }
#view .gc-nm:hover rect, #view .gc-nm:focus rect { stroke: var(--sel); stroke-width: 1.4; }

/* editors in the drawing */
.stage { position: relative; }
.gc-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); }
.gc-edit input { width: 180px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: center; padding: 3px 2px; background: transparent; color: var(--text); }

/* live strip */
.gc-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; }
.gc-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }

/* panel */
.gc-seg { margin-bottom: 6px; }
.gc-seg button { white-space: normal; line-height: 1.25; }
#panel input.gc-ang { text-align: left; font-variant-numeric: tabular-nums; }
#panel .num:has(input.gc-ang) { flex: 1 1 auto; }
#panel input.bad, .gc-systems input.bad { color: var(--bad-ink); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--sel); text-decoration: underline; cursor: pointer; }
.gc-no { animation: gcNo .5s; }
@keyframes gcNo { 25%, 75% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .gc-no { animation: none; } }
#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 */
.gc-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.gc-big { font-variant-numeric: tabular-nums; font-size: 17px; line-height: 1.3; display: inline-block; }
.gc-stats .v { font-variant-numeric: tabular-nums; }
.gc-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; }

/* the systems */
.gc-systems { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.gc-sys { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px 10px; min-width: 0; }
.gc-sys.on { border-color: var(--line-2); background: color-mix(in srgb, var(--sel) 5%, transparent); }
.gc-sys-h { display: flex; align-items: center; gap: 8px; }
.gc-sys-t { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; }
.gc-sys-t:hover { color: var(--sel); }
.gc-sys.on .gc-sys-t { color: var(--x-1e4fbf, #1e4fbf); }
.gc-sys-s { font-size: 11.5px; color: var(--text-3); margin: 2px 0 7px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.gc-flds { display: grid; gap: 5px; }
.gc-fld { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.gc-sym { font-size: 12.5px; color: var(--text-2); font-style: italic; text-align: center; }
.gc-fld input { width: 100%; min-width: 0; border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 8px; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; background: var(--surface); color: var(--text); }
.gc-fld .u { font-size: 11.5px; color: var(--text-3); min-width: 10px; }

/* chart */
#kchart { touch-action: none; user-select: none; }
#kchart .kdrag { cursor: ew-resize; }
#kchart .ch-bg { fill: var(--gc-plot); }
#kchart .ch-grid { fill: var(--gc-grid); }
#kchart .ch-ok { fill: color-mix(in srgb, var(--good) 7%, transparent); }
#kchart .ch-pill { fill: var(--gc-plot); stroke: var(--sel); }
.gc-zero { fill: var(--steel-400); }
.gc-cu, .gc-cg, .gc-cl { fill: none; stroke-width: 1.5; stroke-opacity: .55; }
.gc-cu { stroke: var(--moment); } .gc-cg { stroke: var(--x-b06f1f, #b06f1f); } .gc-cl { stroke: var(--good); }
.gc-cu.on, .gc-cg.on, .gc-cl.on { stroke-width: 2.2; stroke-opacity: 1; }
.gc-tu { fill: var(--moment); } .gc-tg { fill: var(--x-8a5413, #8a5413); } .gc-tl { fill: var(--good-ink); }
.gc-dot { fill: var(--sel); stroke: var(--gc-plot); stroke-width: 1.5; }

#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
@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: "limit "; 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; }
  .gc-systems { grid-template-columns: minmax(0, 1fr); }
}
@media print { .gc-edit { display: none !important; } }

.f.gc-wide { grid-template-columns: minmax(0, 1fr) 176px; }

/* 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-2f4a8a: #85a1db; --x-6c7a96: #768299; --x-6e7177: #85827f; --x-8a5413: #ca9a6c;
    --x-8f9bb3: #5a6375; --x-9aa6bd: #525b6c; --x-b06f1f: #dfa66d;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-2f4a8a: #85a1db; --x-6c7a96: #768299; --x-6e7177: #85827f; --x-8a5413: #ca9a6c;
    --x-8f9bb3: #5a6375; --x-9aa6bd: #525b6c; --x-b06f1f: #dfa66d;
  }
}
/* theme-auto:end */
