/* Speeds and feeds — on top of calc.css */
main.fd .tabs { grid-template-columns: repeat(3, 1fr); }
main.fd .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.fd .stage-bar .hist { margin-left: auto; }
.fd-ops 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.ns { cursor: ns-resize; }
#view .handle.ew { 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 .handle:focus { outline: none; }

/* parts */
.fd-work { fill: var(--steel-150); stroke: var(--steel-700); stroke-width: 1; }
.fd-work.fd-turned { fill: var(--steel-250); }
.fd-work.fd-done { fill: var(--steel-50); }
.fd-cut { fill: var(--surface-2); stroke: var(--steel-500); stroke-width: .8; stroke-dasharray: 4 3; }
.fd-hatch { fill: none; stroke: var(--steel-400); stroke-width: .6; pointer-events: none; }
.fd-cutter { fill: color-mix(in srgb, var(--moment) 7%, transparent); stroke: var(--moment); stroke-width: 1.4; }
.fd-deff { fill: none; stroke: var(--moment); stroke-width: .9; stroke-dasharray: 4 3; }
.fd-eng { fill: none; stroke: var(--load); stroke-width: 3; stroke-linecap: round; opacity: .55; }
.fd-tooth { stroke: var(--x-8f979f, #8f979f); stroke-width: 2; stroke-linecap: round; }
.fd-tooth.on { stroke: var(--ink); stroke-width: 2.4; }
.fd-axis { fill: var(--surface); stroke: var(--steel-750); stroke-width: 1; }
.fd-spin path { fill: none; stroke: var(--steel-750); stroke-width: 1.4; }
.fd-spin path.hd { fill: var(--steel-750); stroke: none; }
.fd-feed line { stroke: var(--blue-4); stroke-width: 1.8; }
.fd-feed path { fill: var(--blue-4); stroke: none; }
.fd-load line { stroke: var(--load); stroke-width: 1.8; }
.fd-load path { fill: var(--load); stroke: none; }
.fd-dim { fill: none; stroke: var(--steel-500); stroke-width: .8; stroke-dasharray: 3 3; }
.fd-dimthin { fill: none; stroke: var(--steel-500); stroke-width: .8; }
.fd-holder { fill: var(--steel-300); stroke: var(--steel-750); stroke-width: 1; }
.fd-tool { fill: var(--steel-350); stroke: var(--steel-750); stroke-width: 1.1; stroke-linejoin: round; }
.fd-insert { fill: var(--x-eadcb8, #eadcb8); stroke: var(--steel-750); stroke-width: 1.1; stroke-linejoin: round; }
.fd-flute { fill: none; stroke: var(--x-8f979f, #8f979f); stroke-width: .8; pointer-events: none; }
.fd-cl { fill: none; stroke: var(--steel-500); stroke-width: .7; stroke-dasharray: 8 3 1.5 3; pointer-events: none; }
.fd-chipsec { fill: color-mix(in srgb, var(--load) 35%, transparent); stroke: var(--load); stroke-width: .8; }
.fd-inset rect { fill: var(--surface); stroke: var(--x-e1e1dc, #e1e1dc); }
.fd-ax { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.fd-hcurve { fill: color-mix(in srgb, var(--load) 12%, transparent); stroke: var(--load); stroke-width: 1.4; }
.fd-hm { fill: none; stroke: var(--moment); stroke-width: 1; stroke-dasharray: 4 3; }
.fd-prof { fill: none; stroke: var(--text); stroke-width: 1.4; }
.fd-surf { fill: var(--steel-150); stroke: none; }
.fd-small { font-size: 11px; fill: var(--text-3); }

/* 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.feed rect { stroke: color-mix(in srgb, var(--blue-4) 45%, transparent); } #view .pill.feed text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.spd rect { stroke: color-mix(in srgb, var(--steel-750) 40%, transparent); } #view .pill.spd text { fill: var(--text); font-weight: 600; }
#view .pill.force rect { stroke: color-mix(in srgb, var(--load) 45%, transparent); } #view .pill.force text { fill: var(--x-b4462f, #b4462f); 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; }

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

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

/* panel */
.fd-seg { margin-bottom: 6px; }
.fd-lab { font-size: 12px; color: var(--text-3); margin: 8px 0 4px; }
.fd-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.fd-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; line-height: 1.5; }
.fd-chip:hover { border-color: var(--line-2); }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#panel .small-note a { color: inherit; }
#panel .f.sel.wide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
#panel .f.sel.wide select { width: 100%; max-width: none; }
.f > label span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
#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 and margins */
.fd-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 36ch; }
.fd-tag { display: inline-flex; align-items: center; 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; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
#checks .ms { white-space: nowrap; }

/* charts */
.fd-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#pwChart { touch-action: none; user-select: none; }
#pwChart .cdrag { cursor: ew-resize; }
main.fd .ch-pill rect { fill: var(--sel); }
main.fd .ch-pill text { fill: var(--on-accent); font-weight: 600; }

@media (max-width: 1100px) { .fd-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .fd-ops { display: flex; flex-wrap: wrap; }
  .fd-ops button { flex: 1 1 auto; }
  #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 { .fd-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-6e7177: #85827f; --x-8f979f: #61676d; --x-b4462f: #ed8d78; --x-e1e1dc: #35332f;
    --x-eadcb8: #3e341c;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-6e7177: #85827f; --x-8f979f: #61676d; --x-b4462f: #ed8d78; --x-e1e1dc: #35332f;
    --x-eadcb8: #3e341c;
  }
}
/* theme-auto:end */
