/* Decay Dispatcher: the dispatch room of an isotope courier service. Scene drawn by art.js (colors from the --dd-* properties below). */
html {
  --dd-wall1: #dfe9ec; --dd-wall2: #c4d5da; --dd-seam: #93aab2;
  --dd-lead1: #7d8a92; --dd-lead2: #48545b; --dd-glass1: #f2fbfc; --dd-glass2: #bfe0e6;
  --dd-pipe1: #8d9aa3; --dd-pipe2: #e4eaee; --dd-pipe-line: #2c3a41; --dd-bin1: #f6f8f9; --dd-bin2: #d7dfe3;
  --dd-lit: #f2b418; --dd-gamma: #c79400; --dd-ink: #142a31;
  --dd-accent: #21576b; --dd-ok: #13704a; --dd-bad: #b3261e;
  --dd-panel-bg1: #f5f9fa; --dd-panel-bg2: #e5eff2; --dd-panel-ink: #142a31;
  --dd-btn: #ffffff; --dd-btn-line: #8aa3ab; --dd-on: #21576b; --dd-on-ink: #ffffff;
  --dd-ticket: #fffdf3; --dd-ticket-ink: #2a2414; --dd-ticket-line: #b59a5e;
}
html[data-theme="dark"] {
  --dd-wall1: #1d2b30; --dd-wall2: #152126; --dd-seam: #3c525a;
  --dd-lead1: #5b6970; --dd-lead2: #323c42; --dd-glass1: #3d5a62; --dd-glass2: #1d3036;
  --dd-pipe1: #4c5a62; --dd-pipe2: #93a3ac; --dd-pipe-line: #0b1418; --dd-bin1: #33434a; --dd-bin2: #26333a;
  --dd-lit: #ffcd45; --dd-gamma: #ffd34d; --dd-ink: #e8f2f5;
  --dd-accent: #7cc6dc; --dd-ok: #4fd08c; --dd-bad: #ff8a80;
  --dd-panel-bg1: #1b272b; --dd-panel-bg2: #152024; --dd-panel-ink: #e8f2f5;
  --dd-btn: #10191c; --dd-btn-line: #4f6a73; --dd-on: #7cc6dc; --dd-on-ink: #0b1c22;
  --dd-ticket: #2c2820; --dd-ticket-ink: #f4efe3; --dd-ticket-line: #9c845a;
}

/* ── layout ── */
.dd { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 10px;
  color: var(--tlg-text); font-size: 16px; }
.dd input, .dd button { font: inherit; }
.dd-controls { display: flex; flex-direction: column; gap: 7px; min-height: 0; overflow: auto; padding: 10px 12px;
  background: linear-gradient(var(--dd-panel-bg1), var(--dd-panel-bg2)); color: var(--dd-panel-ink); border: 3px solid var(--dd-accent);
  border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.dd-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.dd-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--dd-accent); }

/* ticket */
.dd-ticket { display: grid; gap: 3px; padding: 8px 12px; border-radius: 10px; background: var(--dd-ticket); color: var(--dd-ticket-ink);
  border: 2px dashed var(--dd-ticket-line); box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.dd-ticket p { margin: 0; }
.dd-ticket-l { font-size: 16px; font-weight: 600; opacity: .85; }
.dd-ticket-v { font-size: 22px; font-weight: 800; line-height: 1.2; }
.dd-tnuc { white-space: nowrap; }
.dd-arrow { font-weight: 600; opacity: .7; }
.dd-ticket-n { font-size: 16px; font-weight: 600; line-height: 1.3; }
.dd-ticket-note { font-size: 16px; font-style: italic; opacity: .85; line-height: 1.3; }

/* element chart */
.dd-chart-w { display: grid; gap: 3px; }
.dd-chart-l { margin: 0; font-size: 16px; font-weight: 700; }
.dd-chart { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.dd-el { display: grid; justify-items: center; padding: 2px 0 3px; border-radius: 6px; border: 2px solid var(--dd-btn-line); background: var(--dd-btn); line-height: 1.05; }
.dd-el-z { font-size: 16px; opacity: .85; }
.dd-el-s { font-size: 17px; font-weight: 800; }

/* steps */
.dd-step { display: grid; gap: 6px; }
.dd-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.dd-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--dd-accent);
  color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .dd-n { color: #0b1c22; }
.dd-step-h.is-done .dd-n { background: var(--dd-ok); }

/* mechanism radio cards */
.dd-mech { display: grid; gap: 5px; }
.dd-mech-b { text-align: left; min-height: 44px; padding: 6px 10px 6px 34px; border-radius: 10px; border: 2px solid var(--dd-btn-line);
  background: var(--dd-btn); color: var(--dd-panel-ink); font-size: 16px; line-height: 1.25; cursor: pointer; position: relative; touch-action: manipulation; }
.dd-mech-b::before { content: ''; position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; margin-top: -9px; border-radius: 50%;
  border: 2px solid currentColor; }
.dd-mech-b.is-on { border-color: var(--dd-on); box-shadow: inset 0 0 0 2px var(--dd-on); font-weight: 700; }
.dd-mech-b.is-on::before { background: radial-gradient(circle, currentColor 0 45%, transparent 50%); }

/* A and Z entry (one row in the console: heading, A box, Z box) */
.dd-console .dd-step--az { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.dd-console .dd-step--az .dd-az { grid-template-columns: auto auto; }
.dd-console .dd-step--az .dd-az-f { grid-template-columns: auto 110px; align-items: center; gap: 6px; }
.dd-step--az .dd-az-l { font-size: 20px; font-weight: 800; }
.dd-az { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dd-az-f { display: grid; gap: 2px; }
.dd-az-l { font-size: 16px; font-weight: 700; }
.dd-num { width: 100%; min-height: 44px; font-size: 20px; font-weight: 700; padding: 4px 10px; border: 2px solid var(--dd-btn-line); border-radius: 8px;
  background: var(--dd-btn); color: var(--dd-panel-ink); }
.dd-num:disabled { opacity: 1; }
.dd-num:focus-visible, .dd-mech-b:focus-visible, .dd-chutes-b:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }

/* scene */
.dd-scene { flex: 1 1 auto; min-height: 150px; display: flex; }
.dd-svg { display: block; width: 100%; height: 100%; border-radius: 14px; border: 3px solid var(--dd-pipe-line);
  box-shadow: 0 3px 8px rgba(0,0,0,.16); font-family: var(--tlg-font, Arial, sans-serif); background: var(--dd-wall2); }
.dd-core-t { font-size: 21px; font-weight: 800; fill: var(--dd-ink); paint-order: stroke; stroke: var(--dd-glass1); stroke-width: 4px; }
.dd-model-t { font-size: 19px; font-style: italic; fill: var(--dd-ink); opacity: .8; }
.dd-bin-sym { font-size: 26px; font-weight: 900; fill: var(--dd-ink); }
.dd-bin-t { font-size: 20px; font-weight: 700; fill: var(--dd-ink); }
.dd-badge { font-size: 21px; font-weight: 900; fill: var(--dd-ink); }
.dd-lamp { fill: #6f7c84; transition: fill .2s; }
.dd-chute-lit { opacity: 0; transition: opacity .2s; }
.dd-chute.is-sel .dd-chute-lit { opacity: .9; }
.dd-chute.is-sel .dd-lamp { fill: var(--dd-lit); }
.dd-chute[data-chute="alpha"].is-sel .dd-lamp { fill: #e2553a; }
.dd-chute[data-chute="beta-minus"].is-sel .dd-lamp { fill: #3d8be0; }
.dd-chute[data-chute="beta-plus"].is-sel .dd-lamp { fill: #f09a2a; }
.dd-fly-t { font-size: 22px; font-weight: 900; fill: var(--dd-ink); paint-order: stroke; stroke: var(--dd-glass1); stroke-width: 4px; }
.dd-stamp rect { stroke-width: 3; fill: #fff; }
.dd-stamp text { font-size: 21px; font-weight: 900; }
.dd-stamp.is-ok rect { stroke: var(--dd-ok); } .dd-stamp.is-ok text { fill: var(--dd-ok); }
.dd-stamp.is-bad rect { stroke: var(--dd-bad); } .dd-stamp.is-bad text { fill: var(--dd-bad); }
html[data-theme="dark"] .dd-stamp rect { fill: #11191c; }

/* reveal: flight down the chute, the nucleus pulses as it changes */
.dd-fly { animation: dd-fly 1.05s cubic-bezier(.4,.1,.6,1) 1 both; }
@keyframes dd-fly {
  0% { transform: translate(var(--x0), var(--y0)) scale(.6); opacity: 0; }
  12% { opacity: 1; }
  35% { transform: translate(var(--x1), var(--y1)) scale(1); }
  80% { transform: translate(var(--x2), var(--y2)) scale(1); opacity: 1; }
  100% { transform: translate(var(--x3), var(--y2)) scale(.7); opacity: 0; }
}
.dd-chute.is-firing .dd-chute-lit { animation: dd-fire .9s ease-out 1; }
@keyframes dd-fire { 0%, 100% { opacity: .9; } 40% { opacity: .2; } }
.dd-core.is-pulse { animation: dd-pulse .5s ease-out 1; }
@keyframes dd-pulse { 0% { opacity: .35; } 100% { opacity: 1; } }
.dd-stamp { transition: opacity .25s; }
.dd-svg.is-still .dd-fly, .dd-svg.is-still .dd-core, .dd-svg.is-still .dd-chute-lit, .dd-svg.is-still .dd-stamp { animation: none; transition: none; }

/* console: the chute buttons */
.dd-console { display: grid; gap: 6px; }
.dd-chute-row { display: grid; gap: 4px; }
.dd-chutes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dd-chutes-b { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 4px 8px; border-radius: 10px;
  border: 2px solid var(--dd-btn-line); background: var(--dd-btn); color: var(--dd-panel-ink); cursor: pointer; touch-action: manipulation; }
.dd-chutes-b.is-on { background: var(--dd-on); color: var(--dd-on-ink); border-color: var(--dd-on); box-shadow: 0 0 0 3px var(--dd-lit); }
.dd-chip-l { font-size: 16px; font-weight: 700; }
.dd-chutes-b:disabled, .dd-mech-b:disabled { cursor: default; opacity: 1; }
.dd.is-locked .dd-chutes-b:not(.is-on), .dd.is-locked .dd-mech-b:not(.is-on) { opacity: .6; }

/* nuclide notation: A over Z before the symbol */
.dd-nuc { display: inline-flex; align-items: center; gap: 2px; line-height: 1; white-space: nowrap; }
.dd-az-st { display: inline-grid; justify-items: end; font-size: 16px; font-weight: 700; gap: 2px; }
.dd-sym { font-size: 26px; font-weight: 800; }
.dd-chutes-b .dd-sym { font-size: 22px; }
.dd-mark { font-size: 18px; vertical-align: super; }
.dd-unk { opacity: .7; font-weight: 600; }
.dd-nuc.is-entry .dd-az-st { color: var(--dd-accent); }
.dd-chutes-b.is-on .dd-nuc.is-entry .dd-az-st { color: inherit; }

/* ledger: equation + balance board */
.dd-ledger { display: grid; gap: 4px; padding: 6px 12px; border-radius: 12px; border: 2px solid var(--dd-btn-line);
  background: linear-gradient(var(--dd-panel-bg1), var(--dd-panel-bg2)); color: var(--dd-panel-ink); }
.dd-eq { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; min-height: 44px; }
.dd-op { font-size: 24px; font-weight: 700; }
.dd-step-arrow { display: inline-flex; flex-direction: column; align-items: center; gap: 0; font-size: 22px; }
.dd-step-p .dd-sym { font-size: 20px; }
.dd-step-p .dd-az-st { font-size: 16px; }
.dd-bal { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.dd-bal-r { margin: 0; font-size: 16px; line-height: 1.3; }
.dd-bal-m { font-weight: 800; white-space: nowrap; }
.dd-bal-r.is-even .dd-bal-m { color: var(--dd-ok); }
.dd-bal-r.is-off .dd-bal-m { color: var(--dd-bad); }

.dd-readout { margin: 0; font-size: 16px; font-weight: 600; min-height: 1.3em; }
.dd-model { margin: auto 0 0; font-size: 16px; opacity: .85; font-style: italic; line-height: 1.25; }

/* Briefing example */
.dd-ex { border-collapse: collapse; width: 100%; font-size: 17px; }
.dd-ex caption { text-align: left; font-weight: 800; margin-bottom: 6px; }
.dd-ex th, .dd-ex td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--tlg-border, #ccc); }

@media (max-width: 900px) {
  .dd { position: static; grid-template-columns: 1fr; }
  .dd-controls { overflow: visible; }
  .dd-scene { display: block; }
  .dd-svg { height: auto; }
  .dd-bal { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .dd-chutes { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dd *, .dd-fly { transition: none !important; animation: none !important; }
}
