/* Four-bar linkage — on top of calc.css */
main.lk .tabs { grid-template-columns: repeat(3, 1fr); }
main.lk .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.lk .stage-bar .hist { margin-left: auto; }
main.lk .card.stage { overflow: visible; position: relative; }
#view { display: block; width: 100%; height: auto; flex: none; user-select: none; -webkit-user-select: none; touch-action: none; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view .knob { fill: var(--surface); fill-opacity: .2; stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus-visible .knob { stroke-width: 2.6; }
#view .handle:focus-visible { outline: none; }
#view .handle:focus-visible .hit { stroke: var(--sel); stroke-width: 1.2; stroke-dasharray: 3 2; }

/* drawing language */
.lk-path { fill: none; stroke: var(--x-b9c0c8, #b9c0c8); stroke-width: .8; stroke-dasharray: 4 3; pointer-events: none; }
.lk-ground { stroke: var(--steel-500); stroke-width: 1; stroke-dasharray: 10 3 2 3; pointer-events: none; }
.lk-stop { stroke: var(--steel-550); stroke-width: 1.4; pointer-events: none; }
.lk-ghost { fill: none; stroke: var(--steel-350); stroke-width: 1; stroke-dasharray: 3 2; stroke-linejoin: round; pointer-events: none; }
.lk-curve { stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.lk-dot { fill: var(--x-1e40af, #1e40af); opacity: .55; pointer-events: none; }
.lk-gnd { fill: var(--steel-150); stroke: var(--ink); stroke-width: 1; }
.lk-gline { stroke: var(--steel-700); stroke-width: 1.2; }
.lk-hatch { stroke: var(--steel-550); stroke-width: .8; }
.lk-bo { stroke: var(--ink); stroke-width: 11; stroke-linecap: round; }
.lk-bi { stroke: var(--steel-150); stroke-width: 8.6; stroke-linecap: round; }
.lk-bi.coupler { stroke: var(--sel-line); }
.lk-plate { fill: var(--moment-bg); fill-opacity: .6; stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.lk-arm { stroke: var(--ink); stroke-width: .8; }
.lk-pin { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.lk-pt { fill: var(--surface); stroke: var(--x-1e40af, #1e40af); stroke-width: 1.6; }
.lk-ptc { fill: var(--x-1e40af, #1e40af); }
.lk-load { stroke: var(--load); stroke-width: 1.8; fill: none; }
.lk-loadhead { fill: var(--load); }
.lk-spd { stroke: var(--x-6e7177, #6e7177); stroke-width: 1.4; fill: none; }
.lk-spdhead { fill: var(--x-6e7177, #6e7177); }
.lk-vel { stroke: var(--sel); stroke-width: 1.8; }
.lk-velhead { fill: var(--sel); }
.lk-mu { fill: none; stroke-width: 1.6; }
.lk-mu.good { stroke: var(--good); } .lk-mu.warn { stroke: var(--warn); } .lk-mu.bad { stroke: var(--bad); }
.lk-lead { stroke: var(--steel-500); stroke-width: .8; pointer-events: none; }
.lk-leaddot { fill: var(--x-6e7177, #6e7177); pointer-events: none; }
.lk-leg { font-size: 11px; fill: var(--text-3); }

/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-weight: 500; fill: var(--text-2); }
#view .pill.mu rect, #view .pill.vel rect { stroke: var(--x-c9d6f2, #c9d6f2); }
#view .pill.mu text, #view .pill.vel text { fill: var(--x-1e40af, #1e40af); font-weight: 600; }
#view .pill.mu.warn rect { stroke: color-mix(in srgb, var(--amber) 50%, transparent); } #view .pill.mu.warn text { fill: var(--x-9a6a12, #9a6a12); }
#view .pill.mu.bad rect { stroke: color-mix(in srgb, var(--bad) 45%, transparent); } #view .pill.mu.bad text { fill: var(--bad); }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 40%, transparent); }
#view .pill.load text { fill: var(--rust); font-weight: 600; }
#view .pill.editable { cursor: pointer; }
#view .pill.editable:hover rect, #view .pill.editable:focus-visible rect { stroke: var(--sel); }
#view .pill.editable:focus-visible { outline: none; }
.lk-ed { position: absolute; z-index: 20; width: 132px; }
.lk-ed input { box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
input.bad { border-color: var(--bad) !important; }

/* the strip under the drawing */
.lk-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; }
.lk-live .lk-slow { margin-left: auto; color: var(--text-3); font-size: 12px; }
.lk-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }

/* panel */
.lk-seg { margin: 4px 0 6px; }
.lk-seg button { white-space: normal; line-height: 1.25; }

/* chart */
.lk-chseg { flex-wrap: wrap; }
.lk-chseg button[hidden] { display: none; }
.fb-chart .lk-grid { fill: var(--fill-2); }
.fb-chart .lk-ok { fill: var(--good); opacity: .07; }
.fb-chart .lk-lim { fill: var(--bad); opacity: .55; }
.fb-chart .lk-vl { cursor: ew-resize; }
.fb-chart .lk-vline { fill: var(--sel); }
.fb-chart .hit { fill: transparent; }
.fb-chart .pill rect { fill: var(--surface); stroke: var(--sel); }
.fb-chart .pill text { fill: var(--sel); font-weight: 600; }
.fb-chart .halo { paint-order: stroke; stroke: var(--halo); stroke-width: 3.5px; stroke-linejoin: round; }
#chart { touch-action: pan-y; user-select: none; -webkit-user-select: none; }

/* margins table */
.lkms td.chk { white-space: normal; min-width: 260px; }
.lkms td.chk b { font-weight: 500; display: block; }
.lkms td.chk small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.35; }
.lkms td.chk small.cite { font-size: 11px; }
.grp .small-note { line-height: 1.45; }
.grp .small-note sub { font-size: .75em; }
.f > label span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
main.lk .panel-body { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); padding-bottom: 26px; }

@media (max-width: 1040px) { main.lk .work { grid-template-columns: minmax(0, 1fr); } main.lk .panel-body { -webkit-mask-image: none; mask-image: none; } }
@media (max-width: 760px) {
  .lk-chseg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .lk-chseg button { white-space: normal; }
  .lkms td.chk { min-width: 0; }
  .lkms thead { display: none; }
  .lkms, .lkms tbody { display: block; }
  .lkms tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; padding: 8px 6px; border-bottom: 1px solid var(--fill-1); }
  .lkms td { display: block; text-align: left; padding: 0; border: 0; }
  .lkms td.chk { grid-column: 1 / -1; }
  .lkms td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--text-3); }
}

/* 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-1e40af: #789ef5; --x-6e7177: #85827f; --x-9a6a12: #d0a66a; --x-b9c0c8: #44494f; --x-c9d6f2: #313a4c;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e40af: #789ef5; --x-6e7177: #85827f; --x-9a6a12: #d0a66a; --x-b9c0c8: #44494f; --x-c9d6f2: #313a4c;
  }
}
/* theme-auto:end */
