/* Work & Power Gym: the mechanics station. The scene (activity.js) keeps its own lit-gym colors in both themes; the
 * work-order panel and the controls follow the site theme. */
html {
  --wg-accent: #8a3f1c; --wg-accent-ink: #ffffff; --wg-card: #ffffff; --wg-ink: #2a211c; --wg-line: #b5a69b;
  --wg-panel1: #faf6f2; --wg-panel2: #f0e7df; --wg-ok: #13704a; --wg-bad: #b3261e; --wg-lock: #6b4a00; --wg-key: #fff4c2;
}
html[data-theme="dark"] {
  --wg-accent: #f0a77e; --wg-accent-ink: #2a1408; --wg-card: #262220; --wg-ink: #f1e9e3; --wg-line: #6b5d54;
  --wg-panel1: #2b2522; --wg-panel2: #211c1a; --wg-ok: #4fd08c; --wg-bad: #ff8a80; --wg-lock: #f4d35e; --wg-key: #4a3f17;
}

.wg { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 10px; padding: 8px 10px;
  color: var(--wg-ink); font-size: 16px; overflow: hidden; }
.wg *, .wg *::before, .wg *::after { box-sizing: border-box; }
.wg p { margin: 0; line-height: 1.3; }
.wg input, .wg button, .wg output { font: inherit; font-size: 16px; }
.wg-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }

/* scene */
.wg-scene { flex: none; min-width: 0; overflow: auto; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.2); background: #d9cfc4; }
.wg-svg { display: block; width: 100%; height: auto; }
.wg-svg text { font-family: var(--tlg-font, system-ui, sans-serif); fill: #2a211c; }
.wg-svg .wg-tag { font-weight: 700; paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.wg-svg .wg-tag-dark { font-weight: 700; fill: #ffffff; paint-order: stroke; stroke: #1c1714; stroke-width: 4px; stroke-linejoin: round; }
.wg-svg .wg-ro-k { fill: #ffd166; font-weight: 800; letter-spacing: .06em; }
.wg-svg .wg-ro-dim { fill: #c9d4dc; }
.wg-svg .wg-ro { fill: #b8f5c9; font-variant-numeric: tabular-nums; }
.wg-svg .wg-ro-state { fill: #ffd166; font-weight: 700; }
.wg-svg .wg-ro-key { fill: #ffffff; font-weight: 700; font-variant-numeric: tabular-nums; }
.wg-svg .wg-note { fill: #f5efe9; }
.wg-stamp.is-ok { color: #13704a; } .wg-stamp.is-bad { color: #b3261e; }
.wg-stamp rect { stroke: currentColor; }
.wg-stamp text { fill: currentColor !important; }
.wg-scene:focus-visible { outline: 3px solid #b77a00; outline-offset: 2px; }

.wg-ro-list { display: none; font-weight: 600; padding: 4px 8px; border-radius: 8px; background: #0e1a1f; color: #b8f5c9; font-variant-numeric: tabular-nums; }
.wg.is-narrow .wg-ro-list { display: block; }

/* bench (lift settings + run) */
.wg-bench { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-end; }
.wg-bench .wg-tiles { flex: 1 0 170px; }
.wg-bench .wg-tiles--time { flex: 1 0 290px; }
.wg-bench .wg-tile-b { gap: 4px; padding: 3px 4px; white-space: nowrap; }
.wg-run { flex: 0 0 auto; min-height: 48px; padding: 6px 16px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 800 !important;
  background: linear-gradient(#a3502a, #6f2f12); color: #fff; box-shadow: 0 3px 0 #4a1e0a, 0 4px 8px rgba(0,0,0,.2); }
.wg-run:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #4a1e0a; }
.wg-run:disabled { background: #8f8580; box-shadow: none; cursor: default; }
.wg-bench--record .wg-run { flex: 0 0 auto; }
.wg-bench-note { flex: 1 1 220px; align-self: center; }
.wg-observation { min-height: 42px; font-weight: 600; }
.wg-equations { font-weight: 600; padding: 3px 8px; border-left: 4px solid var(--wg-accent); background: var(--wg-card); border-radius: 0 8px 8px 0; }

/* tiles (radio groups) */
.wg-tiles { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 3px; }
.wg-tiles-g { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; }
.wg-tiles--meaning .wg-tiles-g { grid-auto-flow: row; grid-template-columns: 1fr; gap: 4px; }
.wg-tile { position: relative; display: block; min-width: 0; cursor: pointer; }
.wg-tile input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wg-tile-b { pointer-events: none; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 3px 6px;
  border: 2px solid var(--wg-line); border-radius: 9px; background: var(--wg-card); color: var(--wg-ink); line-height: 1.15; text-align: center; }
.wg-tiles--meaning .wg-tile-b { justify-content: flex-start; text-align: left; min-height: 40px; padding: 3px 8px; }
.wg-tile.is-on .wg-tile-b { border-color: var(--wg-accent); background: var(--wg-accent); color: var(--wg-accent-ink); box-shadow: 0 2px 6px rgba(110,48,18,.35); }
.wg-tile.is-on .wg-tile-b::before { content: '●'; font-size: 16px; }
.wg-tile:not(.is-on) .wg-tile-b::before { content: '○'; font-size: 16px; opacity: .6; }
.wg-tile.is-key:not(.is-on) .wg-tile-b { background: var(--wg-key); border-style: dashed; border-color: var(--wg-ok); }
.wg-tile input:focus-visible + .wg-tile-b { outline: 3px solid #b77a00; outline-offset: 2px; }
.wg-tile input:disabled { cursor: default; }
.wg-tile input:disabled + .wg-tile-b { opacity: .62; }
.wg-tile.is-on input:disabled + .wg-tile-b, .wg-tile.is-key input:disabled + .wg-tile-b { opacity: .9; }

/* panel */
.wg-panel { display: flex; flex-direction: column; gap: 5px; min-height: 0; overflow: auto; padding: 8px 10px;
  background: linear-gradient(var(--wg-panel1), var(--wg-panel2)); border: 3px solid var(--wg-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.wg-kicker, .wg-k2 { font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--wg-accent); }
.wg-ticket { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 8px; margin: 0; padding: 5px 8px; line-height: 1.22;
  background: var(--wg-card); border: 2px dashed var(--wg-line); border-radius: 10px; }
.wg-ticket dt { font-weight: 800; }
.wg-ticket dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wg-lock { font-style: italic; color: var(--wg-lock); min-height: 21px; }
.wg-reports { display: grid; gap: 6px; }
.wg-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px; }
.wg-num { display: grid; gap: 2px; align-content: end; min-width: 0; }
.wg-l { font-weight: 700; font-size: 16px; line-height: 1.2; padding: 0; }
.wg-num-in { display: flex; align-items: center; gap: 6px; }
.wg-num-in input { flex: 1 1 0; width: 0; min-width: 0; min-height: 42px; padding: 4px 8px; border: 2px solid var(--wg-line); border-radius: 8px;
  background: var(--wg-card); color: var(--wg-ink); font-variant-numeric: tabular-nums; }
.wg-num-in input:disabled { opacity: .75; }
.wg-unit { font-weight: 700; min-width: 1.4em; }
.wg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.wg-head .wg-l { min-width: 0; }
.wg-tiles legend { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.wg-mark { font-weight: 800; line-height: 1.2; white-space: nowrap; }
.wg-mark.is-ok { color: var(--wg-ok); } .wg-mark.is-bad { color: var(--wg-bad); }
.wg :focus-visible { outline: 3px solid #b77a00; outline-offset: 2px; }
.wg-verdict { font-weight: 800; padding: 4px 8px; border-radius: 8px; border: 2px solid currentColor; }
.wg-verdict.is-ok { color: var(--wg-ok); } .wg-verdict.is-bad { color: var(--wg-bad); }
.wg-about summary { font-weight: 700; cursor: pointer; }
.wg-about p { margin-top: 4px; }
.is-assess .wg-verdict, .is-assess .wg-mark { display: none; }

/* Briefing example */
.wg-ex { display: block; width: 100%; max-width: 460px; height: auto; }
.wg-ex text { font-family: var(--tlg-font, system-ui, sans-serif); font-weight: 700; }

/* narrower screens: one column, the page scrolls; the diagram scrolls sideways (focusable) */
@media (max-width: 900px) {
  .wg { position: static; display: flex; flex-direction: column; height: 100%; overflow: auto; }
  .wg-panel { overflow: visible; flex: none; }
  .wg-left { flex: none; }
  .wg-scene { max-width: 100%; }
}
@media (max-width: 480px) {
  .wg { padding: 6px; }
  .wg-bench .wg-tiles, .wg-bench .wg-tiles--time { flex-basis: 100%; }
  .wg-run { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .wg * { animation: none !important; transition: none !important; } }
