/* Torque Balancer: a mobile & crane workshop. Scenes by art.js; colors from the --tb-* properties below (light and dark). */
html {
  --tb-wall1: #e9e1d2; --tb-wall2: #d9cdb8; --tb-peg: #b3a58c; --tb-tool: #55616a; --tb-bubble: #9fd36a; --tb-sky: #cfe6f2; --tb-hill: #7fae7a; --tb-frame: #7b5b3a;
  --tb-floor1: #a7a49d; --tb-floor2: #84817a; --tb-line: #22313a; --tb-cable: #36434b; --tb-tick: #22313a; --tb-dim: #4b5a63; --tb-pivot: #c0392b;
  --tb-slider: #f2c75c; --tb-weight: #c4570f; --tb-torque: #7b3fb5; --tb-key: #13704a; --tb-card: #ffffff; --tb-brick: #b3563e; --tb-mortar: #e3d6c6;
  --tb-label: #172c3a; --tb-ink: #172c3a; --tb-panel1: #f6fafb; --tb-panel2: #e7f0f3; --tb-accent: #245e76; --tb-ok: #13704a; --tb-bad: #b3261e;
  --tb-chip: #ffffff; --tb-chip-on: #d6eaf2; --tb-chip-line: #93aab4;
}
html[data-theme="dark"] {
  --tb-wall1: #2b2822; --tb-wall2: #221f1a; --tb-peg: #4a4438; --tb-tool: #8f9ba3; --tb-bubble: #7fb84f; --tb-sky: #1d2f3d; --tb-hill: #2f5a3a; --tb-frame: #5e4630;
  --tb-floor1: #3f3d39; --tb-floor2: #2c2b28; --tb-line: #0b1216; --tb-cable: #b5c0c7; --tb-tick: #e8eef1; --tb-dim: #b5c3cb; --tb-pivot: #e2574c;
  --tb-slider: #f2c75c; --tb-weight: #ff9a4d; --tb-torque: #c8a2ff; --tb-key: #4fd08c; --tb-card: #18242b; --tb-brick: #7a3a2a; --tb-mortar: #3d342c;
  --tb-label: #e8eef1; --tb-ink: #e6eef1; --tb-panel1: #1d2a31; --tb-panel2: #17222a; --tb-accent: #7cc4dc; --tb-ok: #4fd08c; --tb-bad: #ff8a80;
  --tb-chip: #142027; --tb-chip-on: #20414e; --tb-chip-line: #4f6974;
}
.tb { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 10px; color: var(--tb-ink); font-size: 16px; box-sizing: border-box; overflow: hidden; }
.tb *, .tb *::before { box-sizing: border-box; }
.tb input, .tb button { font: inherit; }
.tb-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding: 10px 14px;
  background: linear-gradient(var(--tb-panel1), var(--tb-panel2)); border: 3px solid var(--tb-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.tb-bench { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; overflow: auto; }
.tb-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tb-accent); }
.tb-step { display: grid; gap: 6px; padding: 8px 0 4px; border-top: 1px solid var(--tb-chip-line); }
.tb-step-b { display: grid; gap: 8px; }
.tb-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.tb-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--tb-accent); color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .tb-n { color: #0f2229; }
.tb-step.is-sealed .tb-step-h::after { content: '🔒 sealed'; font-size: 16px; font-weight: 700; color: var(--tb-dim); }
.tb-mark { margin-left: auto; font-weight: 800; font-size: 18px; }
.tb-mark.is-ok { color: var(--tb-ok); } .tb-mark.is-bad { color: var(--tb-bad); }
.tb-row { display: grid; gap: 4px; }
.tb-row-l { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-weight: 700; line-height: 1.25; }
.tb-unit { font-weight: 600; color: var(--tb-dim); }
.tb-inrow { display: flex; align-items: center; gap: 8px; }
.tb-inrow input { flex: 1; min-width: 0; min-height: 44px; font-size: 18px; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--tb-chip-line); background: var(--tb-chip); color: var(--tb-ink); }
.tb-inrow input:disabled { opacity: .7; }
.tb-fmark { flex: none; font-weight: 800; color: var(--tb-key); white-space: nowrap; font-size: 16px; }
.tb-range { width: 100%; min-height: 32px; accent-color: var(--tb-accent); font-size: 16px; }
.tb-chips { display: grid; gap: 6px; }
.tb-chip { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--tb-chip-line); background: var(--tb-chip); color: var(--tb-ink); font-size: 16px; font-weight: 700; text-align: left; cursor: pointer; }
.tb-chip.is-on { background: var(--tb-chip-on); border-color: var(--tb-accent); box-shadow: inset 0 0 0 1px var(--tb-accent); }
.tb-chip.is-on::before { content: '●'; margin-right: 8px; color: var(--tb-accent); }
.tb-chip:disabled { cursor: default; opacity: .85; }
.tb-chip.is-key { border-color: var(--tb-ok); } .tb-chip.is-wrong { border-color: var(--tb-bad); border-style: dashed; }
.tb-chip-m { font-weight: 800; } .tb-chip.is-key .tb-chip-m { color: var(--tb-ok); } .tb-chip.is-wrong .tb-chip-m { color: var(--tb-bad); }
.tb-runbar { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 4px; }
.tb-run, .tb-revise { min-height: 48px; border-radius: 10px; font-size: 17px; font-weight: 800; cursor: pointer; }
.tb-run { background: var(--tb-accent); color: #fff; border: 0; }
html[data-theme="dark"] .tb-run { color: #0f2229; }
.tb-revise { background: var(--tb-chip); color: var(--tb-ink); border: 2px solid var(--tb-chip-line); }
.tb-run:disabled, .tb-revise:disabled { opacity: .5; cursor: default; }
.tb-status { margin: 0; line-height: 1.4; color: var(--tb-dim); }
.tb-ticket { padding: 8px 12px; border-radius: 10px; background: var(--tb-card); border: 2px dashed var(--tb-chip-line); line-height: 1.4; }
.tb-card { border-radius: 14px; overflow: hidden; border: 3px solid var(--tb-accent); background: var(--tb-card); box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.tb-scene { overflow-x: auto; overflow-y: hidden; touch-action: pan-y; }
.tb-scene:focus-visible, .tb :focus-visible { outline: 3px solid #dd9823; outline-offset: 2px; }
.tb-svg { display: block; width: 100%; min-width: 480px; height: auto; max-height: 60vh; }
.tb-svg .tb-t { font: 700 23px var(--tlg-font, system-ui, sans-serif); fill: var(--tb-label); paint-order: stroke; stroke: var(--tb-card); stroke-width: 4px; stroke-linejoin: round; }
.tb-svg .tb-t-small { font-size: 22px; font-weight: 600; }
.tb-svg .tb-t-on { fill: #ffffff; stroke: none; }
.tb-svg .tb-t-dark { fill: #2a1d05; stroke: none; }
.tb-svg .tb-t-sign { fill: #f6e7b8; stroke: none; letter-spacing: .08em; }
.tb-svg .tb-t-key { fill: var(--tb-key); }
.tb-svg .tb-t-torque { fill: var(--tb-torque); }
.tb-svg .tb-t-dim { fill: var(--tb-dim); }
.tb-svg .tb-t-ruler { font-size: 23px; font-weight: 600; fill: var(--tb-dim); }
.tb-svg [data-drag] { cursor: grab; }
.tb-svg .tb-parked { opacity: .55; }
.tb-svg .tb-arc { animation: tb-pop .35s ease-out; }
.tb-svg .tb-ghost { animation: tb-pop .5s ease-out; }
@keyframes tb-pop { from { opacity: 0; } to { opacity: 1; } }
.tb-obs { margin: 0; padding: 8px 12px; min-height: 3em; line-height: 1.45; font-weight: 700; border-top: 2px solid var(--tb-chip-line); }
.tb-about { padding: 0 4px; } .tb-about summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; } .tb-about p { line-height: 1.5; margin: 0 0 8px; }
.tb-ex { border-collapse: collapse; width: 100%; } .tb-ex caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
.tb-ex th, .tb-ex td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--tlg-border, #c8d3d9); font-size: 16px; }
/* the shell's own 14 px start/hint texts (shell request logged 2026-10-21) */
body[data-activity="torque-balancer"] .ps-hint-note, body[data-activity="torque-balancer"] .ps-kicker, body[data-activity="torque-balancer"] .ps-badge { font-size: 16px; }
@media (max-width: 900px) {
  .tb { position: static; grid-template-columns: 1fr; overflow: visible; padding: 8px; }
  .tb-bench { order: -1; overflow: visible; }
  .tb-panel { overflow: visible; }
  .tb-svg { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { .tb *, .tb-svg * { animation: none !important; transition: none !important; } }
