/* VELOCITY — the dashboard: HUD, the three columns, panels, rows, the
 * biomarker tracker, actions, the year's queue, the trees, connections,
 * and the year turning.
 */

/* ============ grid ============ */
.dashboard {
  display: grid;
  grid-template-columns: minmax(300px, 26fr) minmax(0, 44fr) minmax(0, 30fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "hud hud hud" "body center right";
  gap: var(--gutter);
  max-width: 1780px;
  height: 100%;
  min-height: 720px; /* a shorter window scrolls the page instead of squeezing it */
  margin: 0 auto;
  padding: 14px var(--page-margin) 16px;
}
.dashboard-screen { overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
body.m .dashboard-screen { overflow: hidden; }
.hud { grid-area: hud; }
.col-body { grid-area: body; }
.col-center { grid-area: center; }
.col-right { grid-area: right; }
.col { display: flex; flex-direction: column; gap: var(--gutter); min-height: 0; min-width: 0; }

/* entering the dashboard: the instrument assembles itself */
.dash-enter .hud { animation: dash-drop 700ms var(--ease-out) backwards; }
.dash-enter .panel { animation: panel-in 760ms var(--ease-out) backwards; }
.dash-enter .col-body .panel { animation-delay: 120ms; }
.dash-enter .col-center > :nth-child(1) { animation-delay: 200ms; }
.dash-enter .col-center > :nth-child(2) { animation-delay: 270ms; }
.dash-enter .col-center > :nth-child(3) { animation-delay: 340ms; }
.dash-enter .col-right > :nth-child(1) { animation-delay: 260ms; }
.dash-enter .col-right > :nth-child(2) { animation-delay: 330ms; }
.dash-enter .col-right > :nth-child(3) { animation-delay: 400ms; }
.dash-enter .col-right > :nth-child(4) { animation-delay: 470ms; }
@keyframes dash-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(18px) scale(0.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ============ panels ============ */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(21, 32, 50, 0.84) 0%, rgba(12, 19, 31, 0.88) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-panel);
  padding: 12px var(--panel-pad) var(--panel-pad);
  min-height: 0;
  flex: none;
}
.panel::before { /* a hairline of light along the top edge */
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(170, 215, 255, 0.28), transparent);
}
.panel-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font: 650 calc(10.5px * var(--text-scale))/1.4 var(--font-sans);
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text-2);
  margin: -1px 0 10px; padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
  min-height: 34px;
}
.panel-label .pl-l { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--text); }
.panel-label .pl-l .ico {
  width: 24px; height: 24px; padding: 5px; border-radius: 8px; vertical-align: middle;
  color: var(--hue, var(--accent));
  background: color-mix(in srgb, var(--hue, var(--accent)) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue, var(--accent)) 30%, transparent), 0 0 14px color-mix(in srgb, var(--hue, var(--accent)) 18%, transparent);
}
.panel-label .btn { text-transform: none; letter-spacing: 0; margin: -6px -6px -6px 0; }
.hue-body { --hue: var(--c-body); }
.hue-tech { --hue: var(--c-tech); }
.hue-world { --hue: var(--c-world); }
.hue-money { --hue: var(--c-money); }
.hue-energy { --hue: var(--c-energy); }
.hue-people { --hue: var(--c-people); }
.hue-teal { --hue: var(--teal); }

.panel-fill { flex: 1 1 0; overflow: hidden; display: flex; flex-direction: column; min-height: 150px; }
.list-scroll { overflow-y: auto; scrollbar-width: none; flex: 1 1 auto; min-height: 0; }
.list-scroll::-webkit-scrollbar { display: none; }
.dot-sep { margin: 0 4px; color: var(--text-4); }

/* ============ the HUD ============ */
.hud {
  position: sticky; top: 0; z-index: 6; /* a scrolled page keeps it */
  display: flex; align-items: center; gap: 16px;
  height: 66px; padding: 0 10px 0 14px;
  background: linear-gradient(180deg, rgba(22, 34, 53, 0.95), rgba(12, 19, 31, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-panel);
  min-width: 0;
}
.hud { overflow: hidden; }
.hud::after { /* a slow light running along the bottom edge */
  content: ''; position: absolute; left: 0; bottom: 0; width: 30%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(47, 227, 203, 0.8) 50%, transparent 100%);
  animation: hud-run 9s linear infinite;
  animation-play-state: paused;
  opacity: 0;
  will-change: transform;
}
@keyframes hud-run { from { transform: translateX(-110%); } to { transform: translateX(440%); } }
.hud-brand { display: flex; align-items: center; gap: 10px; padding-right: 16px; border-right: 1px solid var(--line-soft); height: 38px; flex: none; }
.logo { display: block; filter: drop-shadow(0 0 8px rgba(47, 227, 203, 0.45)); }
.hud-word { font: 700 14px/1 var(--font-display); letter-spacing: 0.32em; color: #fff; margin-right: -0.32em; }
.hud-clock { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 0 1 auto; }
.hud-year {
  display: block;
  font: 700 calc(36px * var(--text-scale))/1 var(--font-display);
  letter-spacing: -0.03em; color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(47, 227, 203, 0.28);
}
.hud-sub { display: flex; align-items: center; gap: 5px; font: 650 calc(11px * var(--text-scale))/1.4 var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.hud-sub .fx-roll { height: 1.4em; line-height: 1.4; }
.hud-sub .fx-roll-inner > span { height: 1.4em; line-height: 1.4; }
.hud-res-row { display: flex; gap: 8px; margin-left: auto; flex: none; }
.hud-res {
  --rc: var(--c-energy);
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 7px; min-width: 136px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(4, 9, 16, 0.5), rgba(4, 9, 16, 0.3));
  border: 1px solid var(--line-soft);
  cursor: default;
  transition: border-color 200ms var(--ease-out), background 200ms var(--ease-out);
}
.hud-res:hover { border-color: color-mix(in srgb, var(--rc) 40%, transparent); }
.hud-res .hr-ico {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
  color: var(--rc);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 30%, transparent), color-mix(in srgb, var(--rc) 10%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 40%, transparent), 0 0 18px color-mix(in srgb, var(--rc) 22%, transparent);
}
.hr-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hr-txt small { font: 650 calc(9px * var(--text-scale))/1.2 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.hr-v { font: 650 calc(17px * var(--text-scale))/1.1 var(--font-mono); color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hr-of { font-size: calc(11px * var(--text-scale)); font-weight: 500; color: var(--text-3); margin-left: 1px; }
.hud-res.warn { border-color: rgba(255, 77, 94, 0.5); background: rgba(255, 77, 94, 0.08); }
.hud-res.warn .hr-v { color: var(--danger-ink); }
.r-money { --rc: var(--c-money); }
.hud-navs { display: flex; gap: 4px; padding-left: 10px; border-left: 1px solid var(--line-soft); flex: none; }
.hud-nav {
  appearance: none; display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 11px; border-radius: 11px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-2); font: 600 calc(12.5px * var(--text-scale))/1 var(--font-sans);
  cursor: pointer;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.hud-nav:hover { background: var(--hover); color: #fff; border-color: var(--line); }
.hud-nav:hover .ico { color: var(--accent); filter: drop-shadow(0 0 6px var(--accent-glow)); }
.hud-nav.focused { border-color: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--accent-glow); }
.hud-menu { gap: 5px; padding: 0 9px; }

/* ============ rows & costs ============ */
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: 9px;
  border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom-color: transparent; }
.row-name { flex: 1 1 auto; font: 500 calc(13px * var(--text-scale))/1.4 var(--font-sans); color: var(--text); min-width: 0; }
.row-cost { font: 500 calc(11.5px * var(--text-scale))/1.4 var(--font-mono); color: var(--text-3); white-space: nowrap; }
.row.disabled { opacity: 0.4; pointer-events: none; }
.row.selected { background: rgba(47, 227, 203, 0.07); }
.action-row { cursor: pointer; border-bottom-color: transparent; transition: background 140ms var(--ease-out), border-color 140ms var(--ease-out), transform 180ms var(--ease-out); }
.action-row:hover { background: var(--hover); }
.action-row.focused { background: var(--hover-2); box-shadow: 0 0 0 1px var(--accent) inset; }
.action-row.focused .row-name { color: #fff; }
.action-row .glyph { width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; border-radius: 8px; color: var(--pc, var(--accent)); background: color-mix(in srgb, var(--pc, var(--accent)) 13%, transparent); }

.costs { display: inline-flex; gap: 5px; flex: none; }
.cost {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 calc(11px * var(--text-scale))/1 var(--font-mono);
  padding: 4px 7px 4px 6px; border-radius: 7px;
  background: var(--well-2); color: var(--text-3);
  min-width: 38px; justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.cost .ico { opacity: 0.9; }
.cost.c-energy { color: var(--c-energy-ink); background: rgba(255, 148, 70, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 148, 70, 0.18); }
.cost.c-money { color: var(--c-money-ink); background: rgba(247, 192, 74, 0.1); box-shadow: inset 0 0 0 1px rgba(247, 192, 74, 0.18); min-width: 52px; }
.cost.zero { color: var(--text-4); background: var(--well-2); box-shadow: none; }

/* ============ biomarker tracker ============ */
.bio-panel { display: flex; flex-direction: column; min-height: 0; container-type: inline-size; }
.bio-scroll { overflow-y: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; min-height: 0; }
.bio-scroll::-webkit-scrollbar { display: none; }
.bio-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(70px, 1.25fr) calc(118px * var(--text-scale)) 64px;
  align-items: center; gap: 12px;
  padding: 4px 10px 4px 12px;
  min-height: 34px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 9px;
  cursor: pointer;
  transition: background 140ms var(--ease-out);
}
.bio-row::before { content: ''; position: absolute; left: 2px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: transparent; }
.bio-row.st-warning::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.bio-row.st-critical::before { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.bio-row.st-terminal::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: glow-pulse 1.4s ease-in-out infinite; --gp-lo: 0.5; --gp-hi: 1; }
.bio-row.st-terminal { background: rgba(255, 77, 94, 0.06); }
.bio-row:hover { background: var(--hover); }
.bio-row:last-child { border-bottom: none; }
.bio-row.focused { background: var(--hover-2); box-shadow: 0 0 0 1px var(--accent) inset; }
/* the narrow body column: name, range, reading; the trend once there is room */
.bio-panel.compact .bio-row { grid-template-columns: minmax(0, 1fr) minmax(52px, 0.75fr) auto; gap: 10px; min-height: 30px; padding-top: 2px; padding-bottom: 2px; }
.bio-panel.compact .bio-spark { display: none; }
@container (min-width: 440px) {
  .bio-panel.compact .bio-row { grid-template-columns: minmax(0, 1fr) minmax(60px, 0.8fr) auto 52px; }
  .bio-panel.compact .bio-spark { display: flex; }
}
.bio-row.bio-hi { animation: row-hi 1500ms var(--ease-out); }
.bio-row.fx-changed { animation: row-changed 1500ms var(--ease-out) var(--fx-delay, 0ms) backwards; }
@keyframes row-hi { 0%, 55% { background: rgba(47, 227, 203, 0.14); box-shadow: 0 0 0 1px var(--accent) inset; } 100% { background: transparent; box-shadow: 0 0 0 1px transparent inset; } }
@keyframes row-changed { 0% { background: transparent; } 25% { background: rgba(127, 243, 226, 0.12); } 100% { background: transparent; } }
.bio-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.bio-main { font: 550 calc(13px * var(--text-scale))/1.4 var(--font-sans); color: var(--text); overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 3.2em; }
.bio-name { align-items: center; gap: 7px; }
.bio-ico { display: flex; flex: none; color: var(--text-3); }
.bio-ico .ico { width: calc(20px * var(--text-scale)); height: calc(20px * var(--text-scale)); }
.bio-row.st-warning .bio-ico { color: var(--amber-ink); }
.bio-row.st-critical .bio-ico { color: var(--orange); }
.bio-row.st-terminal .bio-ico { color: var(--danger-ink); }
.bio-read { display: flex; align-items: baseline; justify-content: flex-end; white-space: nowrap; min-width: 0; }
.bio-value { font: 650 calc(15px * var(--text-scale))/1.2 var(--font-mono); color: #fff; font-variant-numeric: tabular-nums; }
.bio-value.warning { color: var(--amber-ink); }
.bio-value.critical { color: var(--orange); text-shadow: 0 0 10px rgba(255, 138, 61, 0.45); }
.bio-value.terminal { color: var(--danger-ink); text-shadow: 0 0 12px rgba(255, 77, 94, 0.6); }
.bio-glyph { font-family: var(--font-sans); font-size: calc(10px * var(--text-scale)); color: var(--danger); margin-left: 4px; }
.bio-unit { font: 400 calc(10.5px * var(--text-scale))/1 var(--font-sans); color: var(--text-3); margin-left: 4px; }
.bio-spark { justify-self: end; display: flex; }
.bio-spark svg { display: block; }
.bio-delta { font: 600 calc(10px * var(--text-scale))/1 var(--font-mono); color: var(--text-3); white-space: nowrap; margin-left: 6px; }
.bio-delta:empty { display: none; }
.bio-delta.fx-pop { animation: pop-in 460ms var(--ease-spring) var(--fx-delay, 0ms) backwards; }
/* range bar: healthy band, warning margins, critical zone, marker */
.bio-bar { position: relative; height: 6px; border-radius: 3px; background: var(--track); display: block; }
.bio-seg { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.bio-seg.ok { background: linear-gradient(90deg, rgba(61, 220, 151, 0.28), rgba(61, 220, 151, 0.42), rgba(61, 220, 151, 0.28)); }
.bio-seg.warn { background: rgba(245, 181, 68, 0.2); }
.bio-seg.crit { background: rgba(255, 77, 94, 0.24); }
.bio-mark {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 10px var(--mk, var(--c-body));
}
.bio-mark.healthy { background: var(--c-body); --mk: var(--c-body); }
.bio-mark.warning { background: var(--amber); --mk: var(--amber); }
.bio-mark.critical { background: var(--orange); --mk: var(--orange); }
.bio-mark.terminal { background: var(--danger); --mk: var(--danger); }

/* sparklines */
.spark-line { fill: none; stroke: var(--spark, var(--c-body-ink)); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--spark, var(--c-body)); opacity: 0.12; stroke: none; }
.spark-flat { stroke: var(--text-4); stroke-width: 1; stroke-dasharray: 2 3; }
.spark-end { fill: #fff; filter: drop-shadow(0 0 3px var(--spark, var(--c-body))); }
.bio-row.st-warning { --spark: var(--amber); }
.bio-row.st-critical { --spark: var(--orange); }
.bio-row.st-terminal { --spark: var(--danger); }

/* ============ action pills — queue an action from wherever it makes sense ============ */
.act-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  appearance: none;
  font: 600 calc(12px * var(--text-scale))/1.3 var(--font-sans);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px 6px 7px;
  cursor: pointer;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out), box-shadow 200ms var(--ease-out);
  white-space: nowrap;
}
.act-pill .pill-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--pc, var(--accent)); background: color-mix(in srgb, var(--pc, var(--accent)) 16%, transparent); }
.act-pill:hover { border-color: color-mix(in srgb, var(--pc, var(--accent)) 55%, transparent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), 0 0 16px color-mix(in srgb, var(--pc, var(--accent)) 16%, transparent); }
.act-pill:active { transform: translateY(0) scale(0.98); }
.act-pill .cost { font: 500 calc(10.5px * var(--text-scale))/1.3 var(--font-mono); color: var(--text-3); background: none; padding: 0; min-width: 0; box-shadow: none; }
.act-pill .cost.is-queued { font: 700 calc(9.5px * var(--text-scale))/1.3 var(--font-sans); text-transform: uppercase; letter-spacing: 0.12em; }
.act-pill.queued { background: linear-gradient(180deg, rgba(47, 227, 203, 0.2), rgba(47, 227, 203, 0.08)); border-color: rgba(47, 227, 203, 0.6); color: var(--teal-ink); box-shadow: 0 0 16px rgba(47, 227, 203, 0.18); }
.act-pill.queued .pill-ico, .act-pill.queued .cost { color: var(--teal-ink); }
.act-pill.queued .pill-ico { background: rgba(47, 227, 203, 0.2); }
.act-pill.disabled { opacity: 0.4; pointer-events: none; }
.act-pill.focused { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ============ actions ============ */
.chip, .m-chip {
  font: 600 calc(11.5px * var(--text-scale))/1.5 var(--font-mono);
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--well-2);
  color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  cursor: default;
  font-variant-numeric: tabular-nums;
}
.chip .ico, .m-chip .ico { opacity: 0.9; }
.chip.h-money, .m-chip.h-money { background: rgba(247, 192, 74, 0.12); color: var(--c-money-ink); box-shadow: inset 0 0 0 1px rgba(247, 192, 74, 0.2); }
.chip.h-energy, .m-chip.h-energy { background: rgba(255, 148, 70, 0.12); color: var(--c-energy-ink); box-shadow: inset 0 0 0 1px rgba(255, 148, 70, 0.2); }
.chip.h-people, .m-chip.h-people { background: rgba(244, 114, 182, 0.12); color: var(--c-people-ink); box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.2); }
.chip.warn, .m-chip.warn { background: rgba(255, 77, 94, 0.16); color: var(--danger-ink); box-shadow: inset 0 0 0 1px rgba(255, 77, 94, 0.4); }
.chip.neg { opacity: 0.85; }
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; flex: 1 1 auto; min-width: 56px; }
.meter-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 3px; background: linear-gradient(90deg, #FF7A2E, #FFC08A); box-shadow: 0 0 10px rgba(255, 148, 70, 0.6); }
.meter-fill.over { background: repeating-linear-gradient(-45deg, var(--danger) 0 5px, #FF8A95 5px 10px); }

.atabs { display: flex; gap: 3px; margin-bottom: 8px; padding: 3px; background: var(--well); border: 1px solid var(--line-soft); border-radius: 12px; flex: none; }
.atab {
  flex: 1 1 0; min-width: 0;
  appearance: none; background: none; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 650 calc(12px * var(--text-scale))/1 var(--font-sans);
  color: var(--text-3);
  padding: 8px 8px;
  border-radius: 9px;
  white-space: nowrap;
  transition: color 160ms var(--ease-out), background 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.atab:hover { color: var(--text); background: var(--hover); }
.atab.active {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tabc) 26%, transparent), color-mix(in srgb, var(--tabc) 10%, transparent));
  border-color: color-mix(in srgb, var(--tabc) 45%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tabc) 18%, transparent);
}
.atab.active .ico { color: var(--tabc); }
.atab .cnt { font: 650 10px var(--font-mono); background: var(--well-2); border-radius: 8px; padding: 2px 6px; color: var(--text-3); }
.atab.active .cnt { background: color-mix(in srgb, var(--tabc) 30%, transparent); color: #fff; }
.atab.none:not(.active) { opacity: 0.55; }
.atab.focused { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.action-list { padding-right: 2px; }
.action-list.swap-in > * { animation: list-in 320ms var(--ease-out) backwards; }
.action-list.swap-in > :nth-child(2) { animation-delay: 25ms; } .action-list.swap-in > :nth-child(3) { animation-delay: 50ms; }
.action-list.swap-in > :nth-child(4) { animation-delay: 75ms; } .action-list.swap-in > :nth-child(5) { animation-delay: 100ms; }
.action-list.swap-in > :nth-child(n+6) { animation-delay: 125ms; }
@keyframes list-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.action-list .a-row { padding: 7px 8px 7px 7px; margin-bottom: 3px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.018); }
.action-list .a-row:hover { background: var(--hover); border-color: var(--line); transform: translateX(2px); }
.a-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.a-row .row-name { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-row .why { color: var(--amber-ink); font: 600 calc(11px * var(--text-scale))/1.3 var(--font-sans); padding-left: 15px; }
.a-row.disabled .why { opacity: 1; }
.a-row .brings { color: var(--text-3); font: 500 calc(11px * var(--text-scale))/1.3 var(--font-sans); padding-left: 15px; }
.path-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
.a-add {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 16px/1 var(--font-sans); color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  opacity: 0; transform: scale(0.6) rotate(-90deg);
  transition: opacity 160ms var(--ease-out), transform 260ms var(--ease-spring);
}
.a-row:hover .a-add, .a-row.focused .a-add { opacity: 1; transform: none; }

/* ============ the year's queue ============ */
.queue {
  border-color: rgba(47, 227, 203, 0.2);
  background: linear-gradient(180deg, rgba(14, 38, 44, 0.7) 0%, rgba(12, 19, 31, 0.9) 60%);
}
.queue::before { background: linear-gradient(90deg, transparent, rgba(127, 243, 226, 0.55), transparent); }
.q-count { font: 650 calc(10px * var(--text-scale))/1 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; background: rgba(47, 227, 203, 0.14); color: var(--teal-ink); border-radius: 999px; padding: 4px 9px; }
.q-list { display: flex; flex-direction: column; gap: 2px; max-height: 168px; overflow-y: auto; scrollbar-width: none; }
.q-list::-webkit-scrollbar { display: none; }
.q-row { padding: 5px 8px; background: rgba(47, 227, 203, 0.035); border: 1px solid rgba(47, 227, 203, 0.08) !important; }
.q-row .verb { color: var(--text-3); }
.q-tag { flex: none; white-space: nowrap; font: 600 calc(9.5px * var(--text-scale))/1 var(--font-sans); letter-spacing: 0.04em; color: var(--c-world-ink); background: color-mix(in srgb, var(--c-world) 14%, transparent); border-radius: 999px; padding: 3px 7px; }
.q-x { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 500 15px/1 var(--font-sans); color: var(--text-2); opacity: 0; transition: opacity 140ms var(--ease-out), background 140ms var(--ease-out); }
.q-row:hover .q-x { opacity: 1; background: rgba(255, 77, 94, 0.18); color: var(--danger-ink); }
.q-row:hover .row-name { text-decoration: line-through; text-decoration-color: rgba(255, 122, 135, 0.6); }
.q-fixed { cursor: default; background: rgba(255, 255, 255, 0.02); border-color: var(--line-soft) !important; }
.q-fixed:hover { background: rgba(255, 255, 255, 0.02); }
.q-fixed:hover .row-name { text-decoration: none; }
.q-new { animation: q-in 620ms var(--ease-out) both; }
@keyframes q-in {
  0% { opacity: 0; transform: translateY(-8px) scale(0.97); background: rgba(47, 227, 203, 0.35); box-shadow: 0 0 24px rgba(47, 227, 203, 0.5); }
  45% { opacity: 1; transform: none; background: rgba(47, 227, 203, 0.18); }
  100% { background: rgba(47, 227, 203, 0.035); box-shadow: none; }
}
.q-money {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px;
  margin-top: 10px; padding: 8px 12px;
  border-radius: 11px; background: var(--well); border: 1px solid var(--line-soft);
  font: 500 calc(12px * var(--text-scale))/1.35 var(--font-sans); color: var(--text-3);
}
.q-money > .ico { align-self: center; color: var(--c-money-ink); flex: none; }
.qm-from { font: 650 calc(14px * var(--text-scale))/1.2 var(--font-mono); color: #fff; font-variant-numeric: tabular-nums; }
.qm-arrow { color: var(--text-4); }
.qm-endw { cursor: default; white-space: nowrap; }
.qm-end { font: 700 calc(15px * var(--text-scale))/1.2 var(--font-mono); color: var(--c-money-ink); font-variant-numeric: tabular-nums; }
.qm-parts { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 0 2px; font: 550 calc(11.5px * var(--text-scale))/1.35 var(--font-mono); white-space: nowrap; }
.qm-in { color: var(--c-body-ink); cursor: default; }
.qm-out { color: var(--text-2); cursor: default; }
.queue-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.q-status { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.q-flag { display: inline-flex; align-items: center; gap: 6px; font: 650 calc(12.5px * var(--text-scale))/1 var(--font-sans); }
.q-flag.ok { color: var(--teal-ink); }
.q-flag.over { color: var(--danger-ink); }
.q-flag.idle { color: var(--c-energy-ink); cursor: default; }
.q-energy { display: inline-flex; align-items: center; gap: 2px; color: var(--c-energy-ink); opacity: 0.85; }

/* End the year: the one big button */
.btn-endturn {
  position: relative; overflow: hidden;
  min-width: 206px; height: 58px;
  padding: 0 10px 0 20px;
  border-radius: 15px;
  justify-content: space-between; gap: 14px;
  flex: none;
}
.btn-endturn .et-label { font: 700 calc(21px * var(--text-scale))/1 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }
.btn-endturn .et-arrow { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(3, 38, 33, 0.14); box-shadow: inset 0 0 0 1px rgba(3, 38, 33, 0.18); font-size: 17px; }
.btn-endturn::after { /* a sheen that passes every few seconds */
  content: ''; position: absolute; top: 0; bottom: 0; width: 60%; left: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-140%) skewX(-18deg);
  animation: sheen 5.5s var(--ease-in-out) 1.5s infinite;
  pointer-events: none;
  will-change: transform;
}
@keyframes sheen { 0%, 70% { transform: translateX(-140%) skewX(-18deg); } 100% { transform: translateX(240%) skewX(-18deg); } }
.btn-endturn:hover .et-arrow { background: rgba(3, 38, 33, 0.24); }
.btn-endturn.blocked { filter: saturate(0.25) brightness(0.8); }
.btn-endturn.blocked::after { display: none; }
.queue-foot { position: relative; }
.queue.has-queue .queue-foot::after { /* the button breathes when there is a year to close */
  content: ''; position: absolute; right: 0; top: 50%; width: 206px; height: 58px; margin-top: -29px; border-radius: 15px; pointer-events: none; z-index: -1;
  box-shadow: 0 0 34px 6px rgba(47, 227, 203, 0.4);
  animation: glow-pulse 2.6s ease-in-out infinite; --gp-lo: 0.2; --gp-hi: 1;
  will-change: opacity;
}

/* ============ routine ============ */
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(calc(120px * var(--text-scale)), calc((100% - 5px) / 2)), 1fr)); gap: 5px; } /* two across, one when narrow */
.rt-item {
  display: flex; flex-direction: row; align-items: center; gap: 9px; min-width: 0;
  padding: 6px 9px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.022); border: 1px solid var(--line-soft);
  transition: background 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
.rt-item.insp-link:hover { background: var(--hover); border-color: var(--line); }
.rt-item.focused { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.rt-item.wide { grid-column: 1 / -1; }
.rt-l { display: flex; flex: none; color: var(--text-3); transition: color 140ms var(--ease-out); }
.rt-l .ico { width: calc(21px * var(--text-scale)); height: calc(21px * var(--text-scale)); }
.rt-item.insp-link:hover .rt-l, .rt-item.focused .rt-l { color: var(--teal-ink); }
.rt-e { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; font: 500 calc(11px * var(--text-scale))/1 var(--font-mono); color: var(--c-energy-ink); flex: none; }
.rt-v { display: flex; align-items: center; gap: 6px; min-width: 0; font: 600 calc(13px * var(--text-scale))/1.25 var(--font-sans); color: #fff; white-space: nowrap; }
.rt-item:not(.wide) .rt-v { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.rt-item.wide .rt-v { flex: 1 1 auto; white-space: normal; }
.rt-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-4); }
.rt-dot.good { background: var(--c-body); box-shadow: 0 0 6px var(--c-body); }
.rt-dot.neutral { background: var(--text-3); }
.rt-dot.warn { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.rt-dot.bad { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.rt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rt-move { font: 650 calc(9.5px * var(--text-scale))/1 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-ink); flex: none; }
.rt-home.moving { border-color: rgba(47, 227, 203, 0.35); background: rgba(47, 227, 203, 0.06); }
.home-e { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font: 500 calc(12px * var(--text-scale))/1 var(--font-mono); color: var(--c-energy-ink); flex: none; }
.stack-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.stack-chip { font: 550 calc(11px * var(--text-scale))/1 var(--font-sans); color: var(--c-body-ink); background: rgba(61, 220, 151, 0.1); box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.2); padding: 5px 8px; border-radius: 999px; cursor: pointer; }
.stack-chip.off { color: var(--text-4); background: var(--well-2); box-shadow: none; text-decoration: line-through; }
.stack-chip.insp-link:hover { box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.6); }
.stack-chip.focused { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px var(--accent-glow); }
.stack-chip.habit-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); background: var(--well-2); box-shadow: inset 0 0 0 1px var(--line); }
.stack-chip.habit-chip.insp-link:hover { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); }
.bio-row.bio-link, .insp-link { cursor: pointer; }

.zone-bar { position: relative; height: 6px; border-radius: 3px; background: var(--track); display: block; }
.zone-seg { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.zone-seg.good { background: rgba(61, 220, 151, 0.4); }
.zone-seg.neutral { background: rgba(150, 190, 235, 0.14); }
.zone-seg.warn { background: rgba(245, 181, 68, 0.3); }
.zone-seg.bad { background: rgba(255, 138, 61, 0.42); }
.zone-mark { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff; border: 2px solid var(--zc, var(--text-2)); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 10px var(--zc, transparent); }
.zone-mark.good { --zc: var(--c-body); }
.zone-mark.warn { --zc: var(--amber); }
.zone-mark.bad { --zc: var(--orange); }
.mix-bar { position: relative; display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--track); }
.mix-cardio { background: linear-gradient(90deg, rgba(47, 227, 203, 0.55), rgba(47, 227, 203, 0.8)); height: 100%; }
.mix-strength { background: linear-gradient(90deg, rgba(255, 148, 70, 0.8), rgba(255, 148, 70, 0.55)); height: 100%; border-left: 2px solid var(--bg-1); }

/* ============ right column: the trees, people ============ */
.tech-panel { --spark: var(--c-tech); }
.gap-viz { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 4px; cursor: default; }
.gv-row { display: grid; grid-template-columns: calc(64px * var(--text-scale)) minmax(0, 1fr) calc(26px * var(--text-scale)); align-items: center; gap: 10px; }
.gv-l { white-space: nowrap; font: 550 calc(12px * var(--text-scale))/1.2 var(--font-sans); color: var(--text-2); }
.gv-track { position: relative; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.gv-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.gv-fill.world { background: linear-gradient(90deg, rgba(167, 139, 250, 0.5), var(--c-tech)); box-shadow: 0 0 10px rgba(167, 139, 250, 0.5); }
.gv-fill.you { background: linear-gradient(90deg, rgba(47, 227, 203, 0.5), var(--accent)); box-shadow: 0 0 10px rgba(47, 227, 203, 0.5); }
.gv-gap { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, rgba(245, 181, 68, 0.6) 0 2px, transparent 2px 5px); border-radius: 0 4px 4px 0; }
.gv-n { font: 650 calc(13px * var(--text-scale))/1 var(--font-mono); text-align: right; color: #fff; }
.gap-line {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 2px; padding: 9px 12px;
  border-radius: 11px;
  background: linear-gradient(90deg, rgba(245, 181, 68, 0.12), rgba(245, 181, 68, 0.03));
  box-shadow: inset 0 0 0 1px rgba(245, 181, 68, 0.18);
  font: 650 calc(12px * var(--text-scale))/1.2 var(--font-sans); color: var(--text);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.gap-n { font: 700 calc(22px * var(--text-scale))/1 var(--font-display); color: var(--amber-ink); display: inline-block; text-shadow: 0 0 14px rgba(245, 181, 68, 0.5); letter-spacing: 0; }
.gap-n.fx-flash { animation: flash-num 900ms var(--ease-out); }
.gap-path { margin-left: auto; font: 550 calc(11px * var(--text-scale))/1 var(--font-sans); color: var(--text-3); text-transform: capitalize; letter-spacing: 0; }
.tree-btn { margin-top: 12px; width: 100%; justify-content: flex-start; }

.people-fx { margin: 0 0 10px; font: 450 calc(12.5px * var(--text-scale))/1.5 var(--font-sans); color: var(--text-2); cursor: default; }
.people-fx b { font-weight: 650; color: var(--c-people-ink); }
.people-btn { width: 100%; justify-content: flex-start; }
.people-btn .nav-arrow { margin-left: auto; }
.people-list { display: flex; flex-direction: column; gap: 2px; }
.conn-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--line-soft); }
.conn-row:last-child { border-bottom: none; }
.conn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.conn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.conn-name { font: 650 calc(14px * var(--text-scale))/1.3 var(--font-sans); color: var(--text); }
.conn-role { font: 500 calc(11.5px * var(--text-scale))/1.4 var(--font-sans); color: var(--text-3); }
.conn-met { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 3px; font: 500 calc(11.5px * var(--text-scale))/1.4 var(--font-sans); color: color-mix(in srgb, var(--nh) 55%, var(--text-2)); }
.conn-blurb { margin-top: 5px; font-size: calc(12px * var(--text-scale)); line-height: 1.5; }
.conn-text .p-credit { margin-top: 5px; }
.conn-age { color: var(--text-3); }
/* the field's pace of aging, above the list; and the preserved and the dead below the living */
.people-pace { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 6px 6px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line-soft); cursor: default; }
.people-pace .caps { font-size: calc(10px * var(--text-scale)); letter-spacing: 0.14em; color: var(--text-3); }
.people-pace b { font: 650 calc(15px * var(--text-scale))/1 var(--font-mono); color: var(--c-people-ink); }
.people-pace { column-gap: 22px; }
.pp-item, .pp-group { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.pp-group { column-gap: 22px; }
.people-sep { margin: 16px 6px 2px; font-size: calc(10px * var(--text-scale)); letter-spacing: 0.16em; color: var(--text-3); }
.conn-died .conn-name, .conn-preserved .conn-name { color: var(--text-2); }
.p-fate { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); }
.p-fate.cold { color: color-mix(in srgb, #9fd4ff 70%, var(--text-2)); }
.p-card .p-fate { font: 500 calc(12px * var(--text-scale))/1.4 var(--font-sans); }
.p-av.gone img, .p-av.gone .p-ini { filter: grayscale(1) brightness(0.8); }
.p-av.gone { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 0 3px var(--line-strong); }
.p-av.cold img { filter: saturate(0.35) brightness(0.95); }
.p-av.cold::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 40%, transparent 45%, rgba(170, 215, 255, 0.35) 100%), linear-gradient(160deg, rgba(190, 230, 255, 0.28), rgba(120, 170, 230, 0.12)); }
.p-av.cold { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(160, 210, 255, 0.6), 0 0 14px rgba(140, 200, 255, 0.35); }

/* a person's face: the photo framed on the face, or their initials */
.p-av {
  --av: 44px;
  position: relative; flex: none; width: var(--av); height: var(--av); border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--nh) 70%, #fff 10%), color-mix(in srgb, var(--nh) 40%, #000 30%));
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 0 3px color-mix(in srgb, var(--nh) 55%, transparent), 0 0 14px color-mix(in srgb, var(--nh) 30%, transparent);
}
.p-av img { width: 100%; height: 100%; object-fit: cover; object-position: var(--fx) var(--fy); transform-origin: var(--ox) var(--oy); transform: scale(var(--z)); display: block; }
.p-ini { font: 700 calc(var(--av) * 0.36)/1 var(--font-display); letter-spacing: 0.02em; color: #fff; }
.p-link { display: inline-flex; align-items: center; gap: 5px; flex: none; font: 550 calc(11.5px * var(--text-scale))/1.3 var(--font-mono); color: var(--text-2); text-decoration: none; padding: 3px 8px 3px 6px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); white-space: nowrap; transition: color 140ms var(--ease-out), border-color 140ms var(--ease-out), background 140ms var(--ease-out); }
.p-link:hover, .p-link.focused, .p-link:focus-visible { color: #fff; border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); outline: none; }
.p-link.p-x svg { color: #fff; }
.p-credit { font: 450 calc(10px * var(--text-scale))/1.4 var(--font-sans); color: var(--text-4); text-decoration: none; }
.p-credit:hover { color: var(--text-3); text-decoration: underline; }
.p-strength { display: inline-flex; gap: 3px; }
.p-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.p-dot.on { background: var(--nh); box-shadow: 0 0 6px color-mix(in srgb, var(--nh) 60%, transparent); }
/* the panel's row of faces, the newest first */
.p-faces { appearance: none; border: none; background: none; padding: 2px 0 10px 4px; margin: 0; display: flex; align-items: center; cursor: pointer; width: 100%; }
.p-faces .p-av { margin-left: -6px; box-shadow: 0 0 0 2px var(--panel-bg, #0d1626), 0 0 0 3px color-mix(in srgb, var(--nh) 55%, transparent); transition: transform 160ms var(--ease-out); }
.p-faces .p-av:hover { transform: translateY(-2px); z-index: 1; }
.p-faces:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-glow); border-radius: 12px; }
.p-more { margin-left: 8px; font: 600 calc(11px * var(--text-scale))/1 var(--font-mono); color: var(--text-3); }
/* a contact on a card: face, name, role, how you met, where to find them */
.p-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin: 0 0 20px; background: rgba(2, 7, 13, 0.5); border: 1px solid color-mix(in srgb, var(--nh) 30%, var(--line)); border-radius: 16px; }
.p-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-name { font: 650 calc(15px * var(--text-scale))/1.3 var(--font-sans); color: #fff; }
.p-role { font: 500 calc(12px * var(--text-scale))/1.4 var(--font-sans); color: var(--text-3); }
.p-met { font: 500 calc(12px * var(--text-scale))/1.4 var(--font-sans); color: color-mix(in srgb, var(--nh) 55%, var(--text-2)); }
.p-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }

/* ============ the year turning ============ */
.year-turn { position: fixed; inset: 0; z-index: 45; pointer-events: none; --step: 118ms; --beat: 860ms; }
.yt-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, rgba(3, 9, 16, 0.5), rgba(2, 5, 10, 0.88) 75%); opacity: 0; animation: fade-in 260ms var(--ease-out) forwards; }
.yt-core { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.yt-kicker { font: 700 calc(11px * var(--text-scale))/1 var(--font-sans); letter-spacing: 0.42em; margin-right: -0.42em; text-transform: uppercase; color: var(--teal-ink); opacity: 0; animation: rise-in 420ms var(--ease-out) 60ms forwards; }
.yt-years { position: relative; height: 1.1em; width: 3.3em; overflow: hidden; font: 700 calc(128px * var(--text-scale))/1.1 var(--font-display); letter-spacing: -0.04em; text-align: center; color: #fff; font-variant-numeric: tabular-nums; -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent); }
.yt-roll { display: flex; flex-direction: column; animation: yt-roll 620ms cubic-bezier(0.7, 0, 0.2, 1) 260ms both; }
.yt-from, .yt-to { display: block; height: 1.1em; }
.yt-from { color: rgba(255, 255, 255, 0.5); }
.yt-to { text-shadow: 0 0 44px rgba(47, 227, 203, 0.75), 0 0 12px rgba(127, 243, 226, 0.5); }
@keyframes yt-roll { 0% { transform: translateY(0); filter: blur(0); } 50% { filter: blur(2.5px); } 100% { transform: translateY(-50%); filter: none; } }
.yt-steps { position: relative; height: 1.5em; width: 380px; overflow: hidden; text-align: center; font: 650 calc(11px * var(--text-scale))/1.5 var(--font-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-2); }
.yt-step { position: absolute; left: 0; right: 0; top: 0; opacity: 0; animation: yt-step var(--step) var(--ease-in-out) calc(var(--i) * var(--step)) both; }
.yt-step:last-child { animation-name: yt-step-last; animation-duration: calc(var(--step) * 2); color: #fff; }
@keyframes yt-step { 0% { opacity: 0; transform: translateY(100%); } 25%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-100%); } }
@keyframes yt-step-last { 0% { opacity: 0; transform: translateY(100%); } 100% { opacity: 1; transform: none; } }
.yt-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; display: flex; gap: 3px; }
.yt-seg { flex: 1; background: linear-gradient(90deg, var(--accent-2), #B8FFF4); box-shadow: 0 0 10px var(--accent); transform: scaleX(0); transform-origin: left; animation: yt-fill calc(var(--beat) * 2.4 / 7) linear calc(var(--i) * var(--beat) * 2.4 / 7) forwards; }
@keyframes yt-fill { to { transform: scaleX(1); } }
.year-turn.settle .yt-veil { animation: fade-out 460ms var(--ease-in-out) forwards; opacity: 1; }
.year-turn.settle .yt-core { animation: yt-core-out 460ms var(--ease-in-out) forwards; }
@keyframes yt-core-out { to { opacity: 0; transform: translate(-50%, -50%) scale(1.1); filter: blur(8px); } }
.year-turn.out { animation: fade-out 380ms var(--ease-out) forwards; }
.year-turn.ending .yt-kicker { color: var(--amber-ink); }
.year-turn.ending.settle .yt-veil, .year-turn.ending.settle .yt-core { animation: none; opacity: 1; }
/* while the year turns, the instrument answers: panels catch the light */
body.year-turning .panel { transition: box-shadow 400ms var(--ease-out); }

/* ============ shorter / narrower desktop windows ============ */
@media (min-width: 1024px) and (max-height: 880px) {
  .dashboard { padding-top: 10px; padding-bottom: 12px; gap: 12px; }
  .col { gap: 12px; }
  .hud { height: 58px; }
  .hud-year { font-size: calc(30px * var(--text-scale)); }
  .panel { padding: 10px 14px 12px; }
  .panel-label { margin-bottom: 8px; padding-bottom: 7px; min-height: 30px; }
  .bio-row { min-height: 30px; padding-top: 2px; padding-bottom: 2px; }
  .rt-item { padding: 5px 8px 6px; }
  .btn-endturn { height: 52px; }
  .q-money { margin-top: 8px; padding: 6px 10px; }
  .queue-foot { margin-top: 10px; }
}
/* a short window: "This year" (and End) stays in reach at the bottom while the page scrolls */
@media (min-width: 1024px) and (max-height: 760px) {
  .col-center .queue { position: sticky; bottom: 8px; z-index: 4; background: linear-gradient(180deg, rgb(15, 36, 44) 0%, rgb(12, 19, 31) 60%); box-shadow: var(--shadow-panel), 0 -16px 30px -10px rgba(2, 6, 12, 0.85); }
  .q-list { max-height: 116px; }
}
@media (min-width: 1024px) and (max-width: 1500px) {
  .hud-word { display: none; }
  .hud-brand { padding-right: 12px; }
  .hud-res { min-width: 0; padding-right: 10px; }
}
@media (min-width: 1024px) and (max-width: 1120px) {
  .hud-nav span { display: none; }
  .hud-nav { padding: 0 9px; }
}
@media (min-width: 1024px) and (max-width: 1340px) {
  .dashboard { grid-template-columns: minmax(270px, 26fr) minmax(0, 44fr) minmax(0, 30fr); --page-margin: 16px; }
  .hud-res { gap: 8px; }
  .bio-row { grid-template-columns: minmax(0, 1fr) minmax(56px, 1fr) calc(110px * var(--text-scale)) 50px; gap: 8px; }
  .bio-spark svg { width: 50px; }
  .atab { font-size: calc(11px * var(--text-scale)); gap: 4px; padding: 7px 4px; }
  .atab .cnt { display: none; }
  .btn-endturn { min-width: 170px; }
}
body.year-turning .hud::after { opacity: 0.9; animation-play-state: running; animation-duration: 1.1s; }
.bio-row.bio-lit { background: rgba(61, 220, 151, 0.08); box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.25); }

/* the forecast ghost: where a choice takes a marker next year */
.bio-ghost { position: absolute; top: -3px; bottom: -3px; border-radius: 4px; pointer-events: none; animation: ghost-in 260ms var(--ease-out) backwards; }
.bio-ghost.good { background: linear-gradient(90deg, rgba(61, 220, 151, 0.12), rgba(61, 220, 151, 0.35)); box-shadow: inset 0 0 0 1px rgba(111, 240, 184, 0.55); }
.bio-ghost.bad { background: linear-gradient(90deg, rgba(245, 181, 68, 0.12), rgba(245, 181, 68, 0.38)); box-shadow: inset 0 0 0 1px rgba(255, 203, 107, 0.6); }
.bio-ghost[data-dir="l"].good { background: linear-gradient(270deg, rgba(61, 220, 151, 0.12), rgba(61, 220, 151, 0.35)); }
.bio-ghost[data-dir="l"].bad { background: linear-gradient(270deg, rgba(245, 181, 68, 0.12), rgba(245, 181, 68, 0.38)); }
.bio-ghost::after { content: ''; position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px dashed #fff; opacity: 0.9; }
.bio-ghost[data-dir="r"]::after { left: 100%; }
.bio-ghost[data-dir="l"]::after { left: 0; }
@keyframes ghost-in { from { opacity: 0; } to { opacity: 1; } }
.bio-delta.fc-good { color: var(--c-body-ink); font-weight: 700; }
.bio-delta.fc-bad { color: var(--amber-ink); font-weight: 700; }
.bio-row.fc { background: rgba(127, 200, 255, 0.04); }
.orl-ghost { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; border-radius: 2px; animation: ghost-in 260ms var(--ease-out) backwards; }
.orl-ghost.good { background: var(--c-body-ink); box-shadow: 0 0 6px var(--c-body); }
.orl-ghost.bad { background: var(--amber-ink); box-shadow: 0 0 6px var(--amber); }

/* routine editor: the markers' year ahead */
.bm-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: 8px; }
.bp-row { display: grid; grid-template-columns: calc(84px * var(--text-scale)) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font: 550 calc(12px * var(--text-scale))/1.2 var(--font-sans); color: var(--text-2); }
.bp-row .bio-bar { height: 5px; }
.bp-row .bio-mark { width: 9px; height: 9px; }
.bp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-name .ico, .op-name .ico { color: var(--text-3); margin-right: 6px; vertical-align: -4px; }
.bp-v b { color: #fff; }
.bp-row.changed .bp-v b { color: var(--teal-ink); }
body.m .bm-preview { grid-template-columns: 1fr; }

/* ============ what you carry: conditions, under the vitals ============ */
.bp-conds { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; flex: none; max-height: 58px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.bp-conds-l { font-size: calc(9px * var(--text-scale)); color: var(--text-3); margin-right: 2px; }
.cond-chip {
  --cc: var(--text-3);
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 9px 4px 7px; border-radius: 999px;
  font: 600 calc(11.5px * var(--text-scale))/1.3 var(--font-sans); color: var(--text);
  background: color-mix(in srgb, var(--cc) 9%, rgba(4, 9, 16, 0.45));
  border: 1px solid color-mix(in srgb, var(--cc) 38%, transparent);
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.cond-chip:hover, .cond-chip.focused { border-color: var(--cc); transform: translateY(-1px); }
.cond-chip.focused { box-shadow: 0 0 0 2px var(--accent-glow); }
.cc-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--cc); box-shadow: 0 0 7px var(--cc); }
.cc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cc-tail { font: 600 calc(10px * var(--text-scale))/1 var(--font-mono); color: var(--text-3); white-space: nowrap; }
.cc-glyph { font: 600 9px/1 var(--font-sans); color: var(--danger); }
.cond-chip.t-good { --cc: var(--c-body); }
.cond-chip.t-neutral { --cc: var(--text-3); }
.cond-chip.t-warn { --cc: var(--amber); }
.cond-chip.t-bad { --cc: var(--orange); }
.cond-chip.t-bad .cc-dot { border-radius: 2px; }
.cond-chip.t-mortal { --cc: var(--danger); background: rgba(255, 77, 94, 0.1); }
.cond-chip.t-mortal .cc-tail { color: var(--danger-ink); }
.cond-chip.t-mortal .cc-dot { animation: glow-pulse 1.4s ease-in-out infinite; --gp-lo: 0.45; --gp-hi: 1; }
.cond-chip.cond-new { animation: pop-in 520ms var(--ease-spring) backwards; }

/* a decision holds the year: the End button becomes the way to it */
.q-flag.wait { color: var(--teal-ink); }
.queue-foot:has(.btn-decide)::after { content: ''; position: absolute; right: 0; top: 50%; width: 206px; height: 58px; margin-top: -29px; border-radius: 15px; pointer-events: none; z-index: -1; box-shadow: 0 0 34px 6px rgba(47, 227, 203, 0.4); animation: glow-pulse 1.6s ease-in-out infinite; --gp-lo: 0.2; --gp-hi: 1; will-change: opacity; }
@media (min-width: 1024px) and (max-height: 880px) { .bp-conds { margin-top: 6px; gap: 4px; } .cond-chip { padding: 3px 8px 3px 6px; } }
