/* Float Factory: the hull test bay. The tank scene (activity.js) keeps its own light colors in both themes, like a
 * lit test bay; the work-order panel and controls follow the site theme. */
html {
  --ff-accent: #245b70; --ff-accent-ink: #ffffff; --ff-card: #ffffff; --ff-ink: #173745; --ff-line: #9fb2bc;
  --ff-panel1: #f3f7f9; --ff-panel2: #e3edf1; --ff-ok: #13704a; --ff-bad: #b3261e; --ff-lock: #6b4a00;
}
html[data-theme="dark"] {
  --ff-accent: #7fc6de; --ff-accent-ink: #10242c; --ff-card: #1f2630; --ff-ink: #e8eef3; --ff-line: #4f6470;
  --ff-panel1: #1f2a30; --ff-panel2: #182227; --ff-ok: #4fd08c; --ff-bad: #ff8a80; --ff-lock: #f4d35e;
}

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

/* scene */
.ff-tank { flex: none; min-width: 0; overflow: auto; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.18); background: #c9d3d9; }
.ff-svg { display: block; width: 100%; min-width: 600px; height: auto; }
.ff-svg text { font-family: var(--tlg-font, system-ui, sans-serif); fill: #1d2a36; }
.ff-svg .ff-ro-k { fill: #7fc6de; font-weight: 800; letter-spacing: .06em; }
.ff-svg .ff-ro-dim { fill: #b9c8d4; }
.ff-svg .ff-ro { fill: #e9f5ee; font-variant-numeric: tabular-nums; }
.ff-svg .ff-ro-state { fill: #f4d35e; }
.ff-svg .ff-tag { fill: #1d2a36; font-weight: 700; paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.ff-svg text[fill="#e8eef3"] { fill: #e8eef3; }
.ff-stamp rect { stroke: currentColor; }
.ff-stamp.is-ok { color: #13704a; } .ff-stamp.is-bad { color: #b3261e; }
.ff-stamp text { fill: currentColor !important; }
.ff-tank:focus-visible { outline: 3px solid #b77a00; outline-offset: 2px; }

/* bench controls */
.ff-bench { display: grid; grid-template-columns: minmax(0, 1fr) 180px; grid-template-areas: "mat mat" "sl run"; gap: 6px 10px; align-items: end; }
.ff-tiles--material { grid-area: mat; }
.ff-slider { grid-area: sl; display: grid; gap: 2px; min-width: 0; }
.ff-run { grid-area: run; }
.ff-slider-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ff-out { font-weight: 700; font-variant-numeric: tabular-nums; }
.ff-l { font-weight: 700; font-size: 16px; line-height: 1.2; padding: 0; }
.ff input[type=range] { width: 100%; min-height: 36px; margin: 0; accent-color: var(--ff-accent); cursor: pointer; }
.ff-run { min-height: 48px; padding: 6px 12px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 800 !important;
  background: linear-gradient(#2f7591, #1d4c5e); color: #fff; box-shadow: 0 3px 0 #123542, 0 4px 8px rgba(0,0,0,.2); }
.ff-run:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #123542; }
.ff-run:disabled { background: #8a9aa2; box-shadow: none; cursor: default; }
.ff-observation { min-height: 42px; font-size: 16px; font-weight: 600; }

/* tiles (radio groups) */
.ff-tiles { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 3px; }
.ff-tiles-g { display: grid; grid-auto-columns: minmax(0, 1fr); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 6px; }
.ff-tiles--why .ff-tiles-g { grid-auto-flow: row; grid-template-columns: 1fr; gap: 4px; }
.ff-tile { position: relative; display: block; min-width: 0; cursor: pointer; }
.ff-tile input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ff-tile-b { pointer-events: none; }
.ff-tile-b { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 3px 6px;
  border: 2px solid var(--ff-line); border-radius: 9px; background: var(--ff-card); color: var(--ff-ink); line-height: 1.15; text-align: center; }
.ff-tile-b span { display: grid; text-align: left; }
.ff-tile-b small { font-size: 16px; opacity: .85; font-variant-numeric: tabular-nums; }
.ff-tiles--why .ff-tile-b { justify-content: flex-start; text-align: left; min-height: 38px; }
.ff-sw { width: 30px; height: 22px; flex: none; }
.ff-tile.is-on .ff-tile-b { border-color: var(--ff-accent); background: var(--ff-accent); color: var(--ff-accent-ink); box-shadow: 0 2px 6px rgba(33,87,107,.35); }
.ff-tile.is-on .ff-tile-b::before { content: '●'; font-size: 16px; }
.ff-tile:not(.is-on) .ff-tile-b::before { content: '○'; font-size: 16px; opacity: .6; }
.ff-tile input:focus-visible + .ff-tile-b { outline: 3px solid #b77a00; outline-offset: 2px; }
.ff-tile input:disabled { cursor: default; }
.ff-tile input:disabled + .ff-tile-b { opacity: .62; }
.ff-tile.is-on input:disabled + .ff-tile-b { opacity: .85; }

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

/* Briefing example */
.ff-ex { display: block; width: 100%; max-width: 460px; height: auto; }
.ff-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) {
  .ff { position: static; display: flex; flex-direction: column; height: 100%; overflow: auto; }
  .ff-panel { overflow: visible; }
  .ff-left { flex: none; }
  .ff-tank { max-width: 100%; }
}
@media (max-width: 480px) {
  .ff { padding: 6px; }
  .ff-bench { grid-template-columns: 1fr; grid-template-areas: "mat" "sl" "run"; }
  .ff-tiles--material .ff-tiles-g { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .ff * { animation: none !important; transition: none !important; } }
