/* Gearbox thermal capacity — on top of calc.css */
main.gb { --gb-oil-cool: #eed6a0; --gb-oil-hot: #c47022; }   /* theme: keep (oil by temperature; dark values below) */
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) main.gb { --gb-oil-cool: #4f4029; --gb-oil-hot: #a5612a; } }   /* theme: keep */
@media screen { :root[data-theme="dark"] main.gb { --gb-oil-cool: #4f4029; --gb-oil-hot: #a5612a; } }   /* theme: keep */
main.gb .tabs { grid-template-columns: repeat(3, 1fr); }
main.gb .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.gb .stage-bar .hist { margin-left: auto; }
.gb-types button { white-space: nowrap; }
#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.hx { cursor: ew-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); }
#view.dragging .handle { cursor: grabbing; }

/* parts */
.gb-hub { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1; }
.gb-ringout { fill: none; stroke: var(--steel-700); stroke-width: 1.1; }
.gb-bore { fill: var(--steel-50); stroke: var(--steel-700); stroke-width: 1; }
.gb-rf { fill: none; stroke: var(--steel-700); stroke-width: .9; stroke-dasharray: 5 4; pointer-events: none; }
.gb-ctr { stroke: var(--steel-550); stroke-width: .8; stroke-dasharray: 10 3 2 3; fill: none; pointer-events: none; }
.gb-shaft { fill: var(--steel-300); stroke: var(--steel-750); stroke-width: 1; }
.gb-plateA { fill: var(--x-b9c0c8, #b9c0c8); stroke: var(--steel-850); stroke-width: 1; }
.gb-plateB { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1; }
.gb-cup { stroke: var(--steel-700); stroke-width: 1.1; stroke-linejoin: round; }
.gb-cone { fill: var(--steel-300); stroke: var(--steel-850); stroke-width: 1.1; stroke-linejoin: round; }
.gb-drum { fill: var(--steel-200); stroke: var(--steel-750); stroke-width: 1.2; }
.gb-drumring { fill: none; stroke: var(--x-c3c9cf, #c3c9cf); }
.gb-band { fill: none; stroke-width: 4; stroke-linecap: round; }
.gb-tie { fill: none; stroke: var(--steel-850); stroke-width: 2; }
.gb-lever { fill: var(--x-b9c0c8, #b9c0c8); stroke: var(--steel-850); stroke-width: 1; }
.gb-ground { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1; }
.gb-ground-l { stroke: var(--steel-700); stroke-width: 1.2; fill: none; }
.gb-pin { fill: var(--surface); stroke: var(--steel-850); stroke-width: 1.2; }
.gb-pinB { fill: var(--steel-850); }
.gb-shoe { fill: none; stroke: var(--steel-650); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.gb-lining { fill: none; stroke-linecap: butt; }
.gb-env { fill: none; stroke: var(--x-b0623a, #b0623a); stroke-width: .8; stroke-dasharray: 2 2; pointer-events: none; }
.gb-rot { cursor: pointer; }
.gb-rothit { fill: none; stroke: transparent; stroke-width: 18; }
.gb-rot:focus { outline: none; }
.gb-ext { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.gb-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.gb-dimh { fill: var(--steel-550); }
.gb-load line, .gb-load path.sh { stroke: var(--load); stroke-width: 1.8; fill: none; }
.gb-load path.hd { fill: var(--load); stroke: none; }
.gb-load.gb-grey line, .gb-load.gb-grey path.sh { stroke: var(--steel-550); } .gb-load.gb-grey path.hd { fill: var(--steel-550); }
.gb-load.gb-thin line { stroke-width: 1.2; }
.gb-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.gb-role { font-size: 11px; fill: var(--text-3); }
.gb-nm { cursor: text; }
.gb-nm:hover .gb-name, .gb-nm:focus .gb-name { fill: var(--sel); }
.gb-nm:focus { outline: none; }
.gb-vlab { font-size: 11px; fill: var(--text-3); letter-spacing: .02em; }
.gb-leg { font-size: 11px; fill: var(--text-3); }
.gb-shoelab { font-size: 11px; font-weight: 500; fill: var(--text-2); }

/* 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.dimv rect { stroke: var(--steel-200); }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.load text { fill: var(--load); 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 { cursor: pointer; }
#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, #view .pill.desig:focus { outline: none; }

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

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

/* panel */
.gb-seg { margin-bottom: 6px; }
.gb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.gb-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.gb-chip:hover { border-color: var(--line-2); }
.gb-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.gb-forms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
.gb-form { display: grid; justify-items: center; gap: 2px; padding: 5px 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 12px; color: var(--text-2); }
.gb-form:hover { border-color: var(--line-2); }
.gb-form.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); color: var(--text); }
.gb-lab { font-size: 12px; color: var(--text-3); margin: 8px 0 4px; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#panel select { max-width: 100%; }
#panel .f.sel.wide { grid-template-columns: minmax(0, 1fr); }
#panel .f.sel.wide select { width: 100%; }

/* summary */
.gb-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.gb-des { font-weight: 600; color: var(--x-1e4fbf, #1e4fbf); }
.gb-tag { display: inline-flex; align-items: center; line-height: 1; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin-left: 4px; white-space: nowrap; vertical-align: 1px; }

/* chart and dimensions */
.gb-two { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
#pchart .tdrag { cursor: ew-resize; }
#pchart { touch-action: none; user-select: none; }
.gb-dims table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.gb-dims th { font-weight: 500; font-size: 11.5px; color: var(--text-3); text-align: left; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); }
.gb-dims td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.gb-dims td.v { text-align: right; white-space: nowrap; font-weight: 500; }
.gb-dims td.t { color: var(--text-3); white-space: nowrap; text-align: right; }
.gb-dims .gb-desig { font-weight: 600; color: var(--text); margin: 0 0 8px; font-size: 13px; }
.gb-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }

@media (max-width: 1100px) { .gb-two { grid-template-columns: minmax(0, 1fr); } }
#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); }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
/* phones: the margins as stacked cards (no sideways scroll) */
@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; }
  .gb-types { width: 100%; }
  .gb-dims td.v, .gb-dims td.t { white-space: normal; }
  .gb-types button { flex: 1 1 0; padding-left: 4px; padding-right: 4px; }
}
@media print { .gb-edit { display: none !important; } }
#panel .gb-link, .small-note .gb-link { border: 0; background: none; padding: 0; color: var(--sel); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.gb-flag { color: var(--warn); }
#hchart { touch-action: pan-y; }

/* gearbox drawing */
.gb-wall { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1.1; }
.gb-in { fill: var(--surface-2); stroke: var(--steel-550); stroke-width: .8; }
.gb-oil { stroke: none; opacity: .85; }
.gb-oilline { stroke: var(--x-a8743a, #a8743a); stroke-width: 1; stroke-dasharray: 6 4; fill: none; }
.gb-gear { fill: var(--steel-300); stroke: var(--steel-850); stroke-width: .9; stroke-linejoin: round; fill-opacity: .92; }
.gb-gear-g { fill: var(--steel-200); }
.gb-gear.wet { stroke: var(--x-8a5a24, #8a5a24); }
.gb-shaft { fill: var(--surface); stroke: var(--steel-850); stroke-width: 1.2; }
.gb-face { fill: var(--steel-300); stroke: var(--steel-850); stroke-width: .9; fill-opacity: .9; }
.gb-ctr { stroke: var(--steel-550); stroke-width: .8; stroke-dasharray: 10 3 2 3; fill: none; pointer-events: none; }
.gb-con line { stroke: var(--moment); stroke-width: 1.6; } .gb-con path.hd { fill: var(--moment); stroke: none; }
.gb-rad path.sh { stroke: var(--rust); stroke-width: 1.4; fill: none; } .gb-rad path.hd { fill: var(--rust); stroke: none; }
.gb-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
#view .pill.heat rect { stroke: color-mix(in srgb, var(--moment) 40%, transparent); } #view .pill.heat text { fill: var(--x-2c4a8a, #2c4a8a); font-weight: 600; }
#view .pill.loss rect { stroke: color-mix(in srgb, var(--rust) 40%, transparent); } #view .pill.loss text { fill: var(--load-ink); font-weight: 600; }
#view .pill.oiltemp rect { stroke: var(--steel-300); } #view .pill.oiltemp text { font-weight: 600; }
#view .pill.oiltemp.good text { fill: var(--good-ink, #22613f); } #view .pill.oiltemp.warn text { fill: var(--warn-ink, #8a5a12); } #view .pill.oiltemp.bad text { fill: var(--bad-ink, #a3271c); }
.gb-brg { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.gb-brg:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.gb-brg-h { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 4px; }
#hchart, #pchart { touch-action: pan-y; user-select: none; }
#hchart .tdrag, #pchart .tdrag { cursor: ew-resize; touch-action: none; }
.ch-l.halo { paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; }
.gb-brg-d { font-weight: 400; color: var(--text-3); margin-left: 6px; }

/* 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-2c4a8a: #84a1dc; --x-6e7177: #85827f; --x-8a5a24: #c89d73; --x-a8743a: #d7aa7b;
    --x-b0623a: #e29e7d; --x-b9c0c8: #44494f; --x-c3c9cf: #3f4347; --x-cfd5db: #373b3f; --x-ecd6a6: #453613;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-2c4a8a: #84a1dc; --x-6e7177: #85827f; --x-8a5a24: #c89d73; --x-a8743a: #d7aa7b;
    --x-b0623a: #e29e7d; --x-b9c0c8: #44494f; --x-c3c9cf: #3f4347; --x-cfd5db: #373b3f; --x-ecd6a6: #453613;
  }
}
/* theme-auto:end */
