/* Half-Life Hourglass: the isotope desk (a decay hourglass of parent/daughter dots beside the parent-fraction graph).
   Scene by art.js; colors from the --hh-* properties below (light and dark). */
html {
  --hh-wall1: #eef4f6; --hh-wall2: #dbe7ec; --hh-bench1: #8a6a4f; --hh-bench2: #604632; --hh-line: #22313a;
  --hh-glass1: rgba(236, 248, 252, .72); --hh-glass2: rgba(170, 205, 220, .75); --hh-card: #ffffff; --hh-grid: #b7c6cd;
  --hh-curve: #2f7f9a; --hh-accent: #21576b; --hh-label: #22313a; --hh-ink: #15242b;
  --hh-panel-bg1: #f4f9fa; --hh-panel-bg2: #e4eff2; --hh-ok: #13704a; --hh-bad: #b3261e; --hh-chip: #ffffff; --hh-chip-on: #d6ecf2;
}
html[data-theme="dark"] {
  --hh-wall1: #1b2429; --hh-wall2: #141b1f; --hh-bench1: #4f3a2a; --hh-bench2: #33251a; --hh-line: #a9bcc6;
  --hh-glass1: rgba(120, 160, 180, .22); --hh-glass2: rgba(150, 190, 210, .4); --hh-card: #1f2a30; --hh-grid: #4b5d66;
  --hh-curve: #7cc7df; --hh-accent: #8fd3ea; --hh-label: #e3eef2; --hh-ink: #e6f0f3;
  --hh-panel-bg1: #1e282d; --hh-panel-bg2: #172024; --hh-ok: #4fd08c; --hh-bad: #ff8a80; --hh-chip: #172024; --hh-chip-on: #1f4452;
}
.hh { position: absolute; inset: 0; display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 12px; padding: 10px; color: var(--tlg-text); font-size: 16px; }
.hh input, .hh button { font: inherit; }
.hh-controls { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding: 8px 12px;
  background: linear-gradient(var(--hh-panel-bg1), var(--hh-panel-bg2)); color: var(--hh-ink); border: 3px solid var(--hh-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.hh-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; overflow: auto; }
.hh-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--hh-accent); }
.hh-step { display: grid; gap: 4px; }
.hh-step-b { display: grid; gap: 4px; }
.hh-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.hh-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--hh-accent); color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .hh-n { color: #0f1d22; }
.hh-step.is-done .hh-n { background: var(--hh-ok); }
.hh-mark { margin-left: auto; font-weight: 800; white-space: nowrap; }
.hh-mark.is-ok, .hh-fmark.is-ok { color: var(--hh-ok); }
.hh-mark.is-bad, .hh-fmark.is-bad { color: var(--hh-bad); }
.hh-cap { font-size: 16px; opacity: .9; }
/* the decay clock */
.hh-clock { display: grid; gap: 2px; padding: 6px 8px; border-radius: 10px; background: var(--hh-chip); border: 2px solid var(--hh-grid); }
.hh-clock-h { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.hh-clock-v { font-weight: 800; color: var(--hh-accent); white-space: nowrap; font-size: 18px; }
.hh-clock.is-unset .hh-clock-v { font-weight: 600; font-style: italic; color: var(--hh-ink); opacity: .8; font-size: 16px; }
.hh-clock input { width: 100%; min-height: 32px; margin: 0; accent-color: var(--hh-accent); cursor: pointer; }
.hh-clock.is-unset input { opacity: .6; }
.hh-clock input:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.hh-ticks { display: flex; justify-content: space-between; font-size: 16px; padding: 0 3px; margin-top: -4px; }
/* number entry */
.hh-num { display: grid; gap: 2px; }
.hh-num-l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-weight: 700; line-height: 1.2; }
.hh-fmark { font-weight: 800; }
.hh-num-row { display: flex; align-items: center; gap: 6px; }
.hh-num input { flex: 1 1 auto; min-width: 0; font-size: 18px; min-height: 42px; padding: 3px 8px; border: 2px solid #7e939c; border-radius: 8px; background: #fff; color: #15242b; }
html[data-theme="dark"] .hh-num input { background: #10181c; color: #eef5f7; border-color: #6d8792; }
.hh-num input:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.hh-unit { flex: none; min-width: 42px; font-weight: 700; }
/* what stays the same: radio chips */
.hh-chips { display: grid; gap: 4px; }
.hh-chip { position: relative; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 4px 28px 4px 8px; border: 2px solid #9fb2ba; border-radius: 10px;
  background: var(--hh-chip); color: var(--hh-ink); font-size: 16px; line-height: 1.15; text-align: left; cursor: pointer; }
html[data-theme="dark"] .hh-chip { border-color: #4f6670; }
.hh-chip-i { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; }
.hh-chip.is-on .hh-chip-i { background: radial-gradient(circle, var(--hh-accent) 0 45%, transparent 50%); border-color: var(--hh-accent); }
.hh-chip:hover:not(:disabled) { border-color: var(--hh-accent); }
.hh-chip:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.hh-chip.is-on { border-color: var(--hh-accent); background: var(--hh-chip-on); font-weight: 700; box-shadow: inset 0 0 0 1px var(--hh-accent); }
.hh-chip-m { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-weight: 800; }
.hh-chip.is-key { border-color: var(--hh-ok); box-shadow: inset 0 0 0 2px var(--hh-ok); }
.hh-chip.is-key .hh-chip-m { color: var(--hh-ok); }
.hh-chip.is-wrong { border-color: var(--hh-bad); border-style: dashed; }
.hh-chip.is-wrong .hh-chip-m { color: var(--hh-bad); }
.hh-chip:disabled { cursor: default; opacity: 1; }
.hh.is-locked .hh-clock input, .hh.is-locked .hh-num input { cursor: default; }
/* right column */
.hh-brief { flex: none; padding: 5px 12px; border: 2px solid var(--hh-accent); border-radius: 12px; background: var(--hh-panel-bg1); color: var(--hh-ink); }
.hh-brief p { margin: 0; line-height: 1.4; }
.hh-iso { font-size: 18px; }
.hh-badge { display: inline-block; padding: 0 8px; border-radius: 6px; background: #f6c21a; color: #3b2a00; font-weight: 800; border: 1.5px solid #7a4f00; }
.hh-sub { font-size: 16px; opacity: .92; }
.hh-scene { flex: none; border-radius: 12px; overflow: hidden; border: 2px solid var(--hh-line); }
.hh-svg { display: block; width: 100%; height: auto; }
.hh-lbl, .hh-tick, .hh-plaque, .hh-note, .hh-tag-t { font-family: var(--tlg-font); font-size: 17px; font-weight: 700; fill: var(--hh-label); }
.hh-tick { font-weight: 600; }
.hh-note { font-size: 16px; font-weight: 600; font-style: italic; opacity: .85; }
.hh-plaque { font-size: 16px; fill: #3b2a00; }
.hh-tag-t { fill: #fff; }
html[data-theme="dark"] .hh-tag-t { fill: #0f1d22; }
.hh-p { transition: opacity .3s ease, transform .3s ease; }
.hh-p.is-gone { opacity: 0; }
.hh-d { opacity: 0; transition: opacity .3s ease; }
.hh-d.is-on { opacity: 1; }
.hh-p.is-instant, .hh-d.is-instant { transition: opacity .12s linear; }
.hh-readout { flex: none; padding: 6px 12px; border-radius: 10px; background: var(--hh-panel-bg2); color: var(--hh-ink); }
.hh-readout p { margin: 0 0 3px; line-height: 1.35; }
.hh-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; font-size: 16px; }
.hh-legend span { white-space: nowrap; }
.hh-key-p { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6c2, #f6c21a 45%, #b8790a); border: 1px solid #7a4f00; }
.hh-key-d { display: inline-block; width: 10px; height: 10px; margin: 0 2px; transform: rotate(45deg); background: linear-gradient(135deg, #d7dee4, #6f7c87); border: 1px solid var(--hh-line); }
.hh-halvings { font-weight: 600; }
.hh-about { flex: none; padding: 4px 10px; border: 1px solid var(--tlg-border); border-radius: 8px; }
.hh-about summary { cursor: pointer; min-height: 32px; font-weight: 700; display: flex; align-items: center; }
.hh-about p { margin: 4px 0; }
.hh-ex { border-collapse: collapse; font-size: 16px; }
.hh-ex caption { text-align: left; font-weight: 700; margin-bottom: 4px; }
.hh-ex th, .hh-ex td { padding: 3px 8px; border-bottom: 1px solid var(--tlg-border); text-align: left; }
.hh-ex-n { margin: 6px 0 0; font-size: 16px; }
@media (max-width: 900px) {
  .hh { position: static; grid-template-columns: 1fr; }
  .hh-controls, .hh-right { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .hh *, .hh *::before { animation: none !important; transition: none !important; } }
