/* vibration isolation and dampers — on top of calc.css */
main.dp .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.dp .stage-bar .hist { margin-left: auto; }
main.dp .card.stage { overflow: visible; }
.tabs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dp-mode button { white-space: nowrap; }
#view { display: block; width: 100%; height: auto; flex: none; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.6; }
#view .handle:hover .knob, #view .handle:focus-visible .knob { stroke-width: 2.4; }
#view .handle:focus-visible { outline: none; }
#view .handle:focus-visible .hit { stroke: var(--sel); stroke-width: 1.2; stroke-dasharray: 3 2; }

/* drawing language */
.dp-title { font-weight: 600; fill: var(--text); font-size: 12px; }
.dp-title2 { fill: var(--text-3); font-size: 12px; }
.dp-note { fill: var(--text-3); font-size: 11.5px; }
.dp-body { fill: var(--steel-100); stroke: var(--ink); stroke-width: 1.2; }
.dp-skid { fill: var(--steel-300); stroke: var(--ink); stroke-width: .8; }
.dp-abs { fill: var(--sel-line); stroke: var(--ink); stroke-width: 1.2; }
.dp-rotor { fill: var(--x-e3e8f1, #e3e8f1); stroke: var(--moment); stroke-width: 1.1; }
.dp-unb { fill: var(--load); }
.dp-cl { stroke: var(--text-3); stroke-width: .7; stroke-dasharray: 10 3 2 3; fill: none; pointer-events: none; }
.dp-cg { fill: var(--surface); stroke: var(--ink); stroke-width: 1; }
.dp-cgq { fill: var(--ink); }
.dp-ground { stroke: var(--steel-700); stroke-width: 1.2; }
.dp-hatch { stroke: var(--steel-550); stroke-width: .8; }
.dp-mplate { fill: var(--steel-300); stroke: var(--ink); stroke-width: .8; }
.dp-coil { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.dp-rubber { fill: var(--steel-350); stroke: var(--ink); stroke-width: .9; }
.dp-rubber.dark { fill: var(--steel-500); }
.dp-mesh { fill: var(--steel-100); stroke: var(--ink); stroke-width: .9; }
.dp-meshl { stroke: var(--steel-550); stroke-width: .7; fill: none; }
.dp-mnt { fill: var(--surface); stroke: var(--ink); stroke-width: 1.3; }
.dp-mnt.sel { stroke: var(--sel); stroke-width: 2; }
.dp-mnt.bad { stroke: var(--bad); }
.dp-mnum { font-size: 10.5px; font-weight: 600; fill: var(--text); pointer-events: none; }
.dp-lead { stroke: var(--x-b9c0c8, #b9c0c8); stroke-width: .8; }
.dp-ext { stroke: var(--steel-500); stroke-width: .7; }
.dp-dim { stroke: var(--x-6e7177, #6e7177); stroke-width: .8; }
.dp-dimhead { fill: var(--x-6e7177, #6e7177); }
.dp-dash { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.dp-load { stroke: var(--load); stroke-width: 1.8; }
.dp-loadhead { fill: var(--load); }
.dp-react { stroke: var(--text-2); stroke-width: 1.8; }
.dp-reacthead { fill: var(--text-2); }
#view .pill.react rect { stroke: var(--steel-350); }
#view .pill.react text { fill: var(--text-2); font-weight: 600; }

/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-weight: 500; fill: var(--text-2); }
#view .pill.mass rect { stroke: var(--x-b9c0c8, #b9c0c8); }
#view .pill.mass text { fill: var(--text); font-weight: 600; }
#view .pill.res rect { stroke: var(--x-c9d6f2, #c9d6f2); }
#view .pill.res text { fill: var(--x-1e40af, #1e40af); font-weight: 600; }
#view .pill.res.bad rect { stroke: color-mix(in srgb, var(--bad) 45%, transparent); }
#view .pill.res.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; }
.dp-ed { position: absolute; z-index: 20; width: 132px; }
.dp-ed input { box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
input.bad { border-color: var(--bad) !important; }

/* mode chips under the drawing */
.dp-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.dp-chips[hidden] { display: none; }
.dp-chl { font-size: 12px; color: var(--text-3); margin-right: 4px; }
.dp-chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: baseline; font-variant-numeric: tabular-nums; }
.dp-chips button b { font-weight: 600; color: var(--text); }
.dp-chips button span { color: var(--text-3); }
.dp-chips button[aria-pressed="true"] { border-color: var(--sel); background: var(--sel-bg); }
.dp-chips button[aria-pressed="true"] b { color: var(--sel); }

/* panel */
.dp-seg { margin: 4px 0 6px; }
.dp-seg button { white-space: normal; line-height: 1.25; }
.dp-name { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 13px; font-weight: 500; }
.dp-lay { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.dp-list { display: grid; gap: 8px; }
.dp-item { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px; }
.dp-item.sel { border-color: var(--sel); background: var(--surface-2); }
.dp-item-h { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.dp-num { width: 22px; height: 22px; border-radius: 50%; border: 1.3px solid var(--ink); display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
.dp-iname { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; font-size: 13px; font-weight: 500; background: none; }
.dp-iname:hover { border-color: var(--line); }
.dp-iname:focus { border-color: var(--text-2); background: var(--surface); }
.dp-add { margin-top: 8px; }
.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; }

/* margins and modes tables */
.dpms td.chk { white-space: normal; min-width: 260px; }
.dpms td.chk b { font-weight: 500; display: block; }
.dpms td.chk small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.35; }
.dpms td.chk small.cite { font-size: 11px; }
.dpmodes td { font-variant-numeric: tabular-nums; }

/* chart */
#chart { display: block; width: 100%; height: auto; user-select: none; touch-action: pan-y; }
#chart .handle { cursor: ew-resize; }
#chart .hit { fill: transparent; }
.dp-ok { fill: var(--good-bg); opacity: .55; }
.dp-c1 { fill: none; stroke: var(--sel); stroke-width: 2; stroke-linejoin: round; }
.dp-c2 { fill: none; stroke: var(--steel-500); stroke-width: 1.4; stroke-dasharray: 5 3; }
.dp-h1 { stroke: var(--text-4); stroke-width: 1; }
.dp-ht { stroke: var(--good); stroke-width: 1.2; stroke-dasharray: 6 3; }
.dp-vl { stroke: var(--load); stroke-width: 1.4; }
.dp-op { fill: var(--load); stroke: var(--halo); stroke-width: 1.5; }
.dp-mt { stroke: var(--moment); stroke-width: 1.4; }
.ch-l.dp-c1-l { fill: var(--sel); font-weight: 500; }
.ch-l.dp-c2-l { fill: var(--x-6e7177, #6e7177); }
.ch-l.dp-ht-l { fill: var(--good); }
.ch-l.dp-h1-l { fill: var(--x-6e7177, #6e7177); }
#chart .pill rect { fill: var(--surface); stroke: color-mix(in srgb, var(--load) 45%, transparent); }
#chart .pill text { fill: var(--rust); font-weight: 600; }

@media (max-width: 1040px) {
  main.dp .work { grid-template-columns: minmax(0, 1fr); }
  main.dp .panel { contain: none; }
}
@media (max-width: 640px) {
  .dp-mode { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .dp-mode button { white-space: normal; padding: 4px 6px; }
  .dpms td.chk { min-width: 0; }
  .dp-chips button span { display: none; }
}
.dpms .ms-n { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.dp-grid { fill: var(--fill-1); }
/* the panel scrolls inside the stage's height: fade its lower edge so a cut-off row reads as "more below" */
main.dp .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; }
/* phones: the tables become stacked cards, never a sideways scroll */
@media (max-width: 760px) {
  .dpms, .dpmodes, .dpms tbody, .dpmodes tbody { display: block; }
  .dpms thead, .dpmodes thead { display: none; }
  .dpms tbody tr, .dpmodes 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); }
  .dpms td, .dpmodes td { border: 0; padding: 2px 0; text-align: left; white-space: normal; }
  .dpms td.chk { grid-column: 1 / -1; }
  .dpms td[data-l]::before, .dpmodes td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--text-3); }
  .dpmodes td:nth-child(2) { grid-column: 2 / -1; }
  main.dp .panel-body { -webkit-mask-image: none; mask-image: none; }
}

/* round 2: the drawing gets the full width; the inputs sit under it in columns */
main.dp .work { grid-template-columns: minmax(0, 1fr); }
main.dp .panel { contain: none; }
main.dp .panel-body { -webkit-mask-image: none; mask-image: none; padding-bottom: 16px; columns: 3 300px; column-gap: 28px; }
main.dp .panel-body .grp { break-inside: avoid; }
main.dp .panel-body .grp + .grp { border-top: 0; }
main.dp .panel-body .grp:has(.dp-fams), main.dp .panel-body .grp:has(.dp-kinds) { column-span: all; }
main.dp .tabs.three { max-width: 520px; }
.dp-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin: 2px 0 10px; }
.dp-kind { display: grid; justify-items: center; gap: 2px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 8px 7px; cursor: pointer; font-size: 12px; color: var(--text-2); }
.dp-kind[aria-pressed="true"], .dp-fam[aria-pressed="true"] { border-color: var(--sel); background: var(--sel-bg); color: var(--text); }
.dp-fams { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 2px 0 10px; }
.dp-fam { display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto auto auto; column-gap: 8px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px 7px 6px; cursor: pointer; color: var(--text-2); }
.dp-fam svg { grid-row: 1 / span 4; align-self: center; }
.dp-fn { font-size: 12.5px; font-weight: 500; color: var(--text); line-height: 1.25; }
.dp-fz { font-size: 12px; color: var(--sel); font-weight: 500; }
.dp-fd { font-size: 11.5px; color: var(--text-2); line-height: 1.3; }
.dp-fc { font-size: 10.5px; color: var(--text-3); line-height: 1.3; }
@media (max-width: 640px) { main.dp .panel-body { columns: 1; } .dp-fams { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* machine drawing */
.dp-skid { fill: var(--steel-300); stroke: var(--ink); stroke-width: .9; }
.dp-skidl { stroke: var(--steel-500); stroke-width: .7; }
.dp-skidp { fill: var(--steel-100); stroke: var(--ink); stroke-width: 1.1; }
.dp-motor { fill: var(--steel-250); stroke: var(--ink); stroke-width: 1.1; }
.dp-fin { stroke: var(--steel-500); stroke-width: .7; }
.dp-foot { fill: var(--x-cfd5dc, #cfd5dc); stroke: var(--ink); stroke-width: .8; }
.dp-guard { fill: var(--x-f6e7b8, #f6e7b8); stroke: var(--ink); stroke-width: .9; }
.dp-casing { fill: var(--x-e3e8f1, #e3e8f1); stroke: var(--moment); stroke-width: 1.2; }
.dp-pipe { fill: var(--steel-150); stroke: var(--ink); stroke-width: .9; }
.dp-flange { fill: var(--x-cfd5dc, #cfd5dc); stroke: var(--ink); stroke-width: .9; }
.dp-rad { fill: var(--steel-100); stroke: var(--ink); stroke-width: 1; }
.dp-exh { fill: none; stroke: var(--steel-700); stroke-width: 3; stroke-linecap: round; }
.dp-belt { stroke: var(--steel-700); stroke-width: 1.2; }
.dp-vane { stroke: var(--moment); stroke-width: 1.1; }
.dp-hub { fill: var(--surface); stroke: var(--moment); stroke-width: 1; }
.dp-rotor { fill: var(--sel-bg); stroke: var(--moment); stroke-width: 1.2; }
.dp-housing { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.dp-dashc { fill: var(--steel-150); stroke: var(--ink); stroke-width: .9; }
.dp-ring { fill: var(--steel-500); stroke: var(--ink); stroke-width: .6; }
.dp-stud { fill: var(--steel-500); stroke: var(--ink); stroke-width: .6; }
.dp-free { fill: none; stroke: var(--x-b9c0c8, #b9c0c8); stroke-width: .9; stroke-dasharray: 3 3; }
.dp-ghost { fill: none; stroke: var(--x-b9c0c8, #b9c0c8); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.dp-outline { fill: none; stroke-width: 1.4; stroke-opacity: .55; pointer-events: none; }
.dp-chips button { position: relative; padding-left: 20px; }
.dp-chips button::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--mc, var(--sel)); }
.dp-chips button[aria-pressed="true"] { border-color: var(--mc, var(--sel)); }
.dp-chips button[aria-pressed="true"] b { color: var(--mc, var(--sel)); }
.dp-mtl { font-size: 11px; font-weight: 600; }
main.dp > .panel { min-height: 0; }
.dp-tr { fill: var(--surface-2); stroke: var(--line); }
.dp-tr0 { stroke: var(--steel-300); stroke-width: 1; stroke-dasharray: 3 3; }
.dp-trl { fill: none; stroke-width: 1.8; }
.dp-trc { stroke: var(--load); stroke-width: 1.2; stroke-opacity: .7; }
.dp-cyl { fill: var(--steel-150); stroke: var(--ink); stroke-width: 1.2; }
.dp-oil { fill: var(--x-f3d9a4, #f3d9a4); stroke: none; }
.dp-piston { fill: var(--steel-500); stroke: var(--ink); stroke-width: .9; }
.dp-orifice { fill: var(--surface); }
.dp-rod { fill: var(--steel-300); stroke: var(--ink); stroke-width: .8; }
.dp-eye { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; }
.dp-slider { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.dp-slider[hidden] { display: none; }
.dp-slider input[type=range] { width: 260px; max-width: 100%; accent-color: var(--sel); }
.dp-slider output { font-weight: 600; color: var(--text); min-width: 46px; }
.dp-hd { stroke: var(--purple); stroke-width: 1.2; stroke-dasharray: 2 3; }
.ch-l.dp-hd-l { fill: var(--purple); }
.dp-fix { fill: var(--surface); stroke: var(--purple); stroke-width: 1.6; }
#chart2wrap { margin-top: 18px; }
#chart2wrap[hidden] { display: none; }
#chart2 { display: block; width: 100%; height: auto; }
.dp-fv { stroke: var(--load); stroke-width: 3; stroke-linecap: round; }
.dp-loop { fill: color-mix(in srgb, var(--load) 12%, transparent); stroke: var(--load); stroke-width: 1.8; }
.ch-l.dp-loop-l { fill: var(--rust); }
.dp-cap { margin: 8px 0 0; line-height: 1.5; }
.dp-cap span { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin: 0 6px 0 2px; }
.dp-k1 { background: var(--load); }
.dp-k2 { background: color-mix(in srgb, var(--load) 35%, transparent); height: 8px !important; }
.dp-k3 { background: var(--steel-500); }

/* 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-8fb44a: #b2d27e; --x-b45309: #ea9567; --x-b9c0c8: #44494f;
    --x-be185d: #ee829f; --x-c9d6f2: #313a4c; --x-cfd5dc: #373b40; --x-e3e8f1: #2c2f34; --x-f3d9a4: #443309;
    --x-f6e7b8: #382e0c;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e40af: #789ef5; --x-6e7177: #85827f; --x-8fb44a: #b2d27e; --x-b45309: #ea9567; --x-b9c0c8: #44494f;
    --x-be185d: #ee829f; --x-c9d6f2: #313a4c; --x-cfd5dc: #373b40; --x-e3e8f1: #2c2f34; --x-f3d9a4: #443309;
    --x-f6e7b8: #382e0c;
  }
}
/* theme-auto:end */
