/* ═══════════════════════════════════════════════════════════════════════════
   tool-glass.css — the tool surfaces (2026-06-17; redrawn 2026-11-13)
   ---------------------------------------------------------------------------
   Science-tile launchers, the tool pop-up takeover, tool result/metric cards,
   and the flagship modelers (Storm Runoff, Dam Cascade, Compound Flood, hex
   visuals).

   Drawn the Infinimaker way, like the hub panels (tu-atlas.css) and Pulse
   (pulse.css): a raised sheet on paper, a 1px rule, ink for words, and the
   interaction hue for anything you can press. The file used to do the
   opposite on purpose — "every tool glows its OWN science/category color",
   frosted glass at three blur depths, a coloured left edge on every result
   card, a lift on hover. Two hundred tools each glowing their own colour
   meant colour carried no information anywhere a tool appeared, and the
   coloured edge is reserved for status (theme-tokens.css --guide-edge-*).

   The filename stays: index.html links it and every tool module's markup
   carries these selectors. Loaded LAST in index.html, so equal-specificity
   selectors here override the base rules in hydro-dashboards.css and
   components.css without `!important`.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. One accent ────────────────────────────────────────────────────────
   --tool-accent is still defined on the accent-bearing roots because tool
   modules read it from script and inline styles. It is the interaction hue
   now, whatever per-tool colour the module sets upstream. */
.hh-tool-card,
.hh-sci-modal-card,
.scenario-result-card,
.wb-kpi,
.ph-tool-wrap {
  --tool-accent: var(--guide-color-action);
}

/* ── 2. Science-tile launchers (the tool grid) ────────────────────────────
   A tool is a row: its icon, its name, one line of what it does, and the ⓘ
   (layout in hydro-dashboards.css). The card was a 128px tile with a 40px icon
   tile, a category chip repeated under every name inside a group that already
   said it, and a hover arrow; 34 tools made a screen of tiles. The group
   heading is the category. Colour is the action colour on the icon only. */
.hh-tool-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: var(--guide-sp-3);
  row-gap: 2px;
  align-items: center;
  min-height: 0;
  padding: var(--guide-sp-3) var(--guide-sp-4);
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-lg);
  box-shadow: none;
}
.hh-tool-card::before { content: none; }
.hh-tool-card:hover {
  transform: none;
  border-color: var(--guide-color-line-strong);
  box-shadow: none;
}
.hh-tool-card__medallion {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  color: var(--guide-color-action);
  background: none;
  box-shadow: none;
}
.hh-tool-card .guide-info-btn { grid-column: 3; grid-row: 1 / span 2; }
/* Where it computes is a fact, not a decoration: a dot in the corner. */
.hh-tool-card .hh-sci-tile-compute { position: absolute; top: var(--guide-sp-2); right: var(--guide-sp-2); }

/* ── 3. Tool pop-up takeover (science modal) ──────────────────────────────── */
/* A scrim, not a blur: the page behind is context, not decoration. */
.hh-sci-modal-backdrop {
  background: var(--guide-scrim, rgba(17, 27, 36, 0.55));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.hh-sci-modal-card {
  background: var(--guide-color-raised);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid var(--guide-color-line);
  box-shadow: var(--guide-shadow-overlay);
}
.hh-sci-modal-card::before { content: none; }
.hh-sci-modal-head {
  background: transparent;
  border-bottom-color: var(--guide-color-line);
}

/* ── 4. Tool result / metric cards (gridded) ──────────────────────────────── */
.scenario-result-card,
.wb-kpi,
.guide-calc-result-card {
  background: var(--guide-color-raised);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid var(--guide-color-line);
  box-shadow: none;
}
.scenario-result-card::before { content: none; }
.scenario-result-card:hover,
.wb-kpi:hover,
.guide-calc-result-card:hover {
  border-color: var(--guide-color-line-strong);
  box-shadow: none;
}
/* Crisp, aligned metric numerals. */
.wb-kpi-val,
.guide-calc-result-val {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ── 5. Storm Runoff Modeler — .hr-* chrome ───────────────────────────────── */
/* (Inline styles are stripped from hydraulic-routing.js so these apply.)
   The three mode tabs are the Infinimaker segmented control: a recessed
   track, the chosen one a raised sheet in ink. */
.hr-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  margin-bottom: 14px;
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-lg, 12px);
}
.hr-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  border: 0;
  border-radius: var(--guide-radius-md, 8px);
  background: transparent;
  color: var(--guide-color-ink-soft);
  transition: background var(--guide-dur-fast, 140ms) var(--guide-ease-out, ease),
    color var(--guide-dur-fast, 140ms) var(--guide-ease-out, ease);
}
.hr-tab i { width: 20px; height: 20px; }
.hr-tab:hover { color: var(--guide-color-ink); }
.hr-tab--active {
  color: var(--guide-color-ink);
  background: var(--guide-color-raised);
  box-shadow: var(--guide-shadow-raised);
}
.hr-tab--active i { color: var(--guide-color-action); }
.hr-tab:focus-visible {
  outline: 2px solid var(--guide-color-action);
  outline-offset: 2px;
}
.hr-tab-label { font-size: var(--guide-fs-sm); font-weight: 700; line-height: 1.2; }
.hr-tab-desc { font-size: var(--guide-fs-2xs); color: var(--guide-color-ink-soft); line-height: 1.25; }

.hr-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px;
  border-radius: var(--guide-radius-lg, 12px);
  border: 1px solid var(--guide-color-line);
  background: var(--guide-color-raised);
}
@media (max-width: 640px) {
  .hr-panel { grid-template-columns: 1fr; }
}

/* Presets are choices, so they wear the choice styling: outlined, ink-soft,
   the interaction hue on hover. */
.hr-preset {
  font-size: var(--guide-fs-xs);
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--guide-radius-pill, 999px);
  border: 1px solid var(--guide-color-line);
  background: var(--guide-color-raised);
  color: var(--guide-color-ink-soft);
  transition: border-color var(--guide-dur-fast, 140ms) var(--guide-ease-out, ease),
    color var(--guide-dur-fast, 140ms) var(--guide-ease-out, ease);
}
.hr-preset:hover {
  border-color: var(--guide-color-action);
  color: var(--guide-color-action);
}

/* ── 6. Hex visuals — container chrome only (cell fills stay data-driven) ──── */
.hex-grid-svg {
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-lg, 12px);
  background: var(--guide-color-raised);
  box-shadow: none;
}
.hex-layer-btn {
  border: 1px solid var(--guide-color-line);
  background: var(--guide-color-raised);
  transition: border-color var(--guide-dur-fast, 140ms) var(--guide-ease-out, ease),
    background var(--guide-dur-fast, 140ms) var(--guide-ease-out, ease);
}
/* The one colour kept: --lc is the layer's own map colour, so the active
   button matches the legend — that is information, not decoration. */
.hex-layer-btn.active {
  border-color: color-mix(in srgb, var(--lc, var(--guide-color-action)) 60%, transparent);
  background: color-mix(in srgb, var(--lc, var(--guide-color-action)) 10%, var(--guide-color-raised));
  color: var(--guide-color-ink);
}
.hex-tooltip {
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  box-shadow: var(--guide-shadow-raised);
  color: var(--guide-color-ink);
}

/* ── 7. Compound Flood — de-inlined metric + breakdown surfaces ───────────── */
.cf-breakdown {
  padding: 8px;
  border-radius: var(--guide-radius-md, 8px);
  border: 1px solid var(--guide-color-line);
  background: var(--guide-color-paper-2);
}

/* ── 8. Launcher quick-action tiles ───────────────────────────────────────── */
.quick-action {
  background: var(--guide-color-raised);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
