/* Water Works: the demo bench. The two drawing cards (bench view, molecular model) keep their own colours in both
 * themes, like a lit bench and a viewer screen; the bench card, tiles and controls follow the site theme. */
html {
  --ww-accent: #22657a; --ww-accent-ink: #ffffff; --ww-card: #ffffff; --ww-ink: #173745; --ww-line: #93a9b4;
  --ww-panel1: #f2f7f9; --ww-panel2: #e2edf1; --ww-ok: #13704a; --ww-bad: #b3261e; --ww-soft: #4a6170;
}
html[data-theme="dark"] {
  --ww-accent: #7fc6de; --ww-accent-ink: #0f232b; --ww-card: #1f2630; --ww-ink: #e8eef3; --ww-line: #536a76;
  --ww-panel1: #1f2a30; --ww-panel2: #182227; --ww-ok: #4fd08c; --ww-bad: #ff8a80; --ww-soft: #b3c4cf;
}

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

/* drawing cards */
.ww-views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ww-card { margin: 0; min-width: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.ww-card--bench { background: #d3dde3; }
.ww-card--mol { background: #0f2236; }
.ww-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 10px; font-size: 16px; line-height: 1.25; }
.ww-card--bench .ww-card-h { background: #22657a; color: #ffffff; }
.ww-card--mol .ww-card-h { background: #18324c; color: #e8eef3; }
.ww-card-h span { opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ww-svg { display: block; width: 100%; height: auto; }
.ww-svg text { font-family: var(--tlg-font, system-ui, sans-serif); }
.ww-macro text.ww-tag { font-size: 17px; font-weight: 700; fill: #173745; paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.ww-macro text.ww-tag-light { fill: #ffffff; stroke: #5e3f25; }
.ww-macro text.ww-cap { font-size: 16.5px; font-weight: 700; fill: #ffffff; }
.ww-svg text.ww-inset { font-size: 16.5px; font-weight: 700; fill: #e8eef3; }
.ww-svg text.ww-el { font-size: 18px; font-weight: 800; fill: #ffffff; pointer-events: none; }
.ww-svg text.ww-el-h { fill: #22323d; font-size: 17px; }
.ww-svg text.ww-delta { font-size: 17px; font-weight: 800; pointer-events: none; }
.ww-svg text.ww-dp { fill: #9fd8ff; }
.ww-svg text.ww-dm { fill: #ffb3aa; }
.ww-svg text.ww-mol { font-size: 17px; font-weight: 800; fill: #ffd166; pointer-events: none; }
.ww-svg text.ww-badge { font-size: 17px; font-weight: 900; fill: #ffffff; pointer-events: none; }
.ww-atom { cursor: pointer; outline: none; }
.ww-atom:hover .ww-ring, .ww-atom:focus-visible .ww-ring { stroke: #ffffff; }
.ww-atom:focus-visible .ww-ring { stroke: #ffd166; stroke-width: 4; }
.ww-atom[aria-disabled="true"] { cursor: default; }
.ww-atom[aria-disabled="true"]:hover .ww-ring { stroke: transparent; }
.ww-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 3px 10px 5px; color: #e8eef3; font-size: 16px; line-height: 1.25; }
.ww-key { display: inline-block; width: 26px; height: 0; vertical-align: middle; }
.ww-key--cov { border-top: 6px solid #d8e2ea; border-radius: 3px; }
.ww-key--hb { border-top: 3px dashed #ffd166; margin-left: 6px; }

/* tiles (radio groups) */
.ww-reports { display: grid; gap: 6px; min-height: 0; }
.ww-tiles { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 3px; }
.ww-l { font-weight: 800; font-size: 16px; line-height: 1.2; padding: 0; }
.ww-tiles-g { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ww-tiles--mech .ww-tiles-g { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ww-tiles--limits .ww-tiles-g { grid-template-columns: 1fr; gap: 4px; }
.ww-tile { position: relative; display: block; min-width: 0; cursor: pointer; }
.ww-tile input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ww-tile-b { pointer-events: none; display: flex; align-items: center; gap: 6px; height: 100%; min-height: 44px; padding: 4px 8px;
  border: 2px solid var(--ww-line); border-radius: 9px; background: var(--ww-card); color: var(--ww-ink); line-height: 1.2; text-align: left; }
.ww-tile-b::before { content: '○'; font-size: 16px; opacity: .65; flex: none; }
.ww-tile.is-on .ww-tile-b { border-color: var(--ww-accent); background: var(--ww-accent); color: var(--ww-accent-ink); box-shadow: 0 2px 6px rgba(33,87,107,.35); }
.ww-tile.is-on .ww-tile-b::before { content: '●'; opacity: 1; }
.ww-tile input:focus-visible + .ww-tile-b { outline: 3px solid #b77a00; outline-offset: 2px; }
.ww-tile input:disabled { cursor: default; }
.ww-tile input:disabled + .ww-tile-b { opacity: .62; }
.ww-tile.is-on input:disabled + .ww-tile-b { opacity: .88; }

/* bench card panel */
.ww-panel { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; padding: 8px 10px;
  background: linear-gradient(var(--ww-panel1), var(--ww-panel2)); border: 3px solid var(--ww-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.ww-kicker { font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ww-accent); }
.ww-ticket { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; margin: 0; padding: 5px 8px; line-height: 1.25;
  background: var(--ww-card); border: 2px dashed var(--ww-line); border-radius: 10px; }
.ww-ticket dt { font-weight: 800; }
.ww-ticket dd { margin: 0; font-variant-numeric: tabular-nums; }
.ww-links { display: grid; gap: 4px; }
.ww-links-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ww-clear { min-height: 36px; padding: 2px 12px; border: 2px solid var(--ww-line); border-radius: 8px; background: var(--ww-card); color: var(--ww-ink); cursor: pointer; font-weight: 700; }
.ww-clear:disabled { opacity: .55; cursor: default; }
.ww-status { color: var(--ww-soft); font-weight: 600; min-height: 21px; }
.ww-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ww-chips:empty { display: none; }
.ww-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 2px 10px; border: 2px dashed #b88a00; border-radius: 999px;
  background: var(--ww-card); color: var(--ww-ink); cursor: pointer; font-weight: 700; font-variant-numeric: tabular-nums; }
.ww-chip-x { font-size: 16px; opacity: .7; }
.ww-chip.is-ok { border-color: var(--ww-ok); color: var(--ww-ok); border-style: solid; }
.ww-chip.is-bad { border-color: var(--ww-bad); color: var(--ww-bad); border-style: solid; }
.ww-chip:disabled { cursor: default; }
.ww-whylinks { color: var(--ww-bad); font-weight: 700; }
.ww-num { display: grid; gap: 3px; }
.ww-num-in { display: flex; align-items: center; gap: 8px; }
.ww-num-in input { flex: 1 1 0; width: 0; min-width: 0; min-height: 42px; padding: 4px 8px; border: 2px solid var(--ww-line); border-radius: 8px;
  background: var(--ww-card); color: var(--ww-ink); font-variant-numeric: tabular-nums; }
.ww-num-in input:disabled { opacity: .7; }
.ww-unit { font-weight: 700; flex: none; }
.ww :focus-visible { outline: 3px solid #b77a00; outline-offset: 2px; }
.ww-about { margin-top: auto; }
.ww-about summary { font-weight: 700; cursor: pointer; }
.ww-about p { margin-top: 4px; font-size: 16px; }

/* Briefing example */
.ww-ex { max-width: 420px; border-radius: 12px; }
.ww-ex text.ww-inset, .ww-ex text.ww-delta { font-size: 20px; }
.ww-ex text.ww-el { font-size: 20px; }

/* narrower screens: one column, the stage scrolls */
@media (max-width: 900px) {
  .ww { position: static; display: flex; flex-direction: column; height: 100%; overflow: auto; }
  .ww-panel { overflow: visible; flex: none; }
  .ww-main { flex: none; }
}
@media (max-width: 640px) {
  .ww { padding: 6px; }
  .ww-views { grid-template-columns: 1fr; }
  .ww-tiles--mech .ww-tiles-g, .ww-tiles--pred .ww-tiles-g { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .ww * { animation: none !important; transition: none !important; } }
.ww-benchnote { padding: 3px 10px 5px; color: #173745; font-size: 16px; font-weight: 700; line-height: 1.25; }
.ww-svg text.ww-delta, .ww-svg text.ww-mol { paint-order: stroke; stroke: #0f2236; stroke-width: 4px; stroke-linejoin: round; }
.ww-svg text.ww-dim { fill: #9fb6c8; font-weight: 600; }
.ww-leg { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.ww-key--hb { margin-left: 0; }
/* the shell's hint footnote, kickers and badges render at 14 px; keep them at 16 px here (board request filed by Immune Defense) */
body[data-activity="water-works"] .ps-hint-note,
body[data-activity="water-works"] .ps-kicker,
body[data-activity="water-works"] .ps-badge { font-size: 16px; }
.ww-svg .ww-link.is-hl { stroke-width: 6; }
