/* Traverse adjustment — on top of calc.css. Light only, like calc.css; drawing colours are tokens. */
main.tv { --tv-fill: color-mix(in srgb, var(--moment) 7%, transparent); --tv-ink: var(--steel-750); --tv-pill: var(--surface); --tv-pill-line: var(--steel-300); --tv-plot: var(--surface); --tv-grid: var(--fill-1); --tv-box: var(--surface-2); }
main.tv .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.tv .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 .knob { fill: var(--tv-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; }

.tv-fill { fill: var(--tv-fill); stroke: none; }
.tv-leg { stroke: var(--tv-ink); stroke-width: 1.6; }
.tv-leg.on { stroke: var(--x-1e4fbf, #1e4fbf); stroke-width: 2.2; }
.tv-st { fill: var(--tv-ink); }
.tv-st.start { fill: none; stroke: var(--tv-ink); stroke-width: 1.6; }
.tv-open { fill: none; stroke: var(--warn); stroke-width: 1.6; stroke-dasharray: 2 2; }
.tv-corr line { stroke: var(--warn); stroke-width: 1.5; } .tv-corr path.hd { fill: var(--warn); }
.tv-fixed { stroke: var(--tv-ink); stroke-width: 3.5; stroke-opacity: .35; }
.tv-north line { stroke: var(--text-2); stroke-width: 1.6; } .tv-north path.hd { fill: var(--text-2); }
.tv-nT { font-size: 11px; font-weight: 600; fill: var(--text-2); }
.tv-stT { font-size: 13px; font-weight: 600; fill: var(--text); }
.tv-nm { cursor: text; } .tv-nm:hover .tv-stT, .tv-nm:focus .tv-stT { fill: var(--sel); } .tv-nm:focus { outline: none; }
.tv-azT { font-size: 10.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.tv-areaT { font-size: 12px; fill: var(--x-2f4a8a, #2f4a8a); font-weight: 500; }
/* inset */
.tv-insbox { fill: var(--tv-box); stroke: var(--line); }
.tv-insT { font-size: 11px; font-weight: 600; fill: var(--text-2); letter-spacing: .04em; }
.tv-insS { font-size: 11.5px; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.tv-insV { font-size: 13px; font-weight: 600; fill: var(--text); font-variant-numeric: tabular-nums; }
.tv-insC { fill: none; stroke: var(--steel-400); stroke-width: .9; stroke-dasharray: 3 3; }
.tv-gap line { stroke: var(--bad); stroke-width: 1.8; } .tv-gap path.hd { fill: var(--bad); }

/* pills */
#view .pill rect { fill: var(--tv-pill); stroke: var(--tv-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.angle rect { stroke: color-mix(in srgb, var(--moment) 45%, transparent); } #view .pill.angle text { fill: var(--x-2f4a8a, #2f4a8a); font-weight: 600; }
#view .pill.angle.sel rect { stroke: var(--sel); }
#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.good rect { stroke: color-mix(in srgb, var(--good) 45%, transparent); } #view .pill.good text { fill: var(--good-ink); font-weight: 600; }
#view .pill.warnp rect { stroke: color-mix(in srgb, var(--bad) 55%, transparent); } #view .pill.warnp text { fill: var(--bad-ink); font-weight: 600; }
#view .pill.corrp rect { stroke: color-mix(in srgb, var(--amber) 60%, transparent); } #view .pill.corrp text { fill: var(--warn-ink); font-weight: 600; }
#view .pill.editable, #view .pill[data-name] { cursor: text; }
#view .pill.editable:hover rect, #view .pill.editable:focus rect, #view .pill[data-name]:hover rect, #view .pill[data-name]:focus rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus, #view .pill[data-name]:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.tv-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); }
.tv-edit input { width: 120px; 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); }
.tv-edit-name input { width: 180px; text-align: center; }
.tv-edit span { font-size: 11.5px; color: var(--text-3); }

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

/* panel */
.tv-seg { margin-bottom: 6px; }
.tv-seg button { white-space: normal; line-height: 1.25; }
.f.tv-wide { grid-template-columns: minmax(0, 1fr) 150px; }
#panel input.tv-ang { text-align: right; font-variant-numeric: tabular-nums; }
#panel input.bad { color: var(--bad-ink); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
.tv-stn { border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px 4px; margin-bottom: 8px; }
.tv-stn.on { border-color: var(--line-2); background: color-mix(in srgb, var(--sel) 5%, transparent); }
.tv-st-h { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; flex-wrap: wrap; }
.tv-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; font-size: 13px; color: var(--text); cursor: text; }
.tv-name:hover { color: var(--sel); }
.tv-sub { font-size: 11.5px; color: var(--text-3); margin-right: auto; }
.tv-mini { font-size: 12px; }
.tv-cls { display: grid; gap: 4px; margin: 2px 0 8px; }
.tv-chip { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; text-align: left; }
.tv-chip:hover { border-color: var(--line-2); }
.tv-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.tv-r { font-variant-numeric: tabular-nums; color: var(--text-3); white-space: nowrap; }
.tv-no { animation: tvNo .5s; }
@keyframes tvNo { 25%, 75% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .tv-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); }

.tv-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.tv-stats .v { font-variant-numeric: tabular-nums; }
.tv-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 traverse sheet */
.tv-sheet { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tv-sheet th { font-weight: 500; color: var(--text-3); font-size: 11.5px; text-align: right; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tv-sheet td { text-align: right; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text-2); }
.tv-sheet .l { text-align: left; }
.tv-sheet tbody tr { cursor: pointer; }
.tv-sheet tr.sel td { background: color-mix(in srgb, var(--sel) 6%, transparent); }
.tv-sheet tfoot td { color: var(--text); font-weight: 500; border-bottom: 0; }

/* chart */
#cchart { touch-action: none; user-select: none; }
#cchart .cdrag { cursor: ew-resize; }
#cchart .ch-bg { fill: var(--tv-plot); }
#cchart .ch-grid { fill: var(--tv-grid); }
#cchart .ch-pill { fill: var(--tv-plot); stroke: var(--sel); }
.tv-lm { fill: none; stroke: var(--moment); stroke-width: 2; stroke-linejoin: round; }
.tv-lo { fill: none; stroke: var(--steel-550); stroke-width: 1.4; stroke-dasharray: 5 3; }
.tv-dot { fill: var(--moment); }
.tv-tm { fill: var(--moment); } .tv-to { fill: var(--text-3); }

#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; }
  /* the sheet as cards */
  .tv-sheet thead { display: none; }
  .tv-sheet, .tv-sheet tbody, .tv-sheet tfoot { display: block; width: 100%; }
  .tv-sheet tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .tv-sheet td { border: 0; padding: 0; text-align: left; white-space: normal; font-size: 12px; }
  .tv-sheet td:nth-child(1) { grid-column: 1 / -1; font-size: 13px; }
  .tv-sheet td:nth-child(8) { display: none; }
  .tv-sheet tbody td:nth-child(2)::before { content: "L "; color: var(--text-3); }
  .tv-sheet tbody td:nth-child(3)::before { content: "α "; color: var(--text-3); }
  .tv-sheet tbody td:nth-child(4)::before { content: "ΔN "; color: var(--text-3); }
  .tv-sheet tbody td:nth-child(5)::before { content: "ΔE "; color: var(--text-3); }
  .tv-sheet tbody td:nth-child(6)::before { content: "cN "; color: var(--text-3); }
  .tv-sheet tbody td:nth-child(7)::before { content: "cE "; color: var(--text-3); }
  .tv-sheet tbody td:nth-child(9)::before { content: "E "; color: var(--text-3); }
  .tv-sheet tbody td:nth-child(10)::before { content: "N "; color: var(--text-3); }
  .tv-sheet tfoot td:empty { display: none; }
}
@media print { .tv-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-2f4a8a: #85a1db; --x-6e7177: #85827f;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-2f4a8a: #85a1db; --x-6e7177: #85827f;
  }
}
/* theme-auto:end */
