/* ============================================================
   ARCUS — Goal execution platform
   Cloud-suite aesthetic: atmospheric themes + frosted glass
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
  /* Night (default tokens) — shelf cloud over a sleeping street */
  --bg-0: #0b1120;
  --bg-1: #131c30;
  --bg-2: #1e293b;
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --ink-faint: #94a3b8;

  /* "beacon" = Arcus progress accent (shared token name with sister apps) */
  --beacon: #10b981;
  --beacon-bright: #34d399;
  --beacon-ink: #04140d;

  --accent-cool: #38bdf8;
  --warn: #fbbf24;

  --glass: rgba(15, 23, 42, 0.5);
  --glass-strong: rgba(15, 23, 42, 0.78);
  --glass-hi: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.2);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);

  --danger: #f87171;
  --amber-wash: rgba(16, 185, 129, 0.12);
  --amber-border: rgba(52, 211, 153, 0.4);
  --warn-wash: rgba(251, 191, 36, 0.12);
  --warn-border: rgba(251, 191, 36, 0.4);
  --track: rgba(255, 255, 255, 0.1);

  /* Scene colors */
  --sky-top: #05080f;
  --sky-mid: #0e1626;
  --sky-horizon: #2b3a52;
  --gap-light: #3d4d68;
  --storm-top: #070b14;
  --storm-bottom: #1a2234;
  --shelf-lit: #5f6c86;
  --shelf-mid: #343f55;
  --shelf-shadow: #1a2232;
  --shelf-under: #101724;
  --tree-far: #0c141e;
  --tower: #3b4658;
  --house-wall: #283041;
  --house-roof: #121823;
  --garage: #1d2431;
  --door: #0e131b;
  --window: #fbbf24;
  --lawn: #12301f;
  --lawn-fore: #081a10;
  --road: #262c36;
  --tree: #143322;
  --tree-dark: #0a1c14;
  --trunk: #1b1712;
  --mulch: #160f0c;
  --star-opacity: 0.8;
  --moon-opacity: 0.55;

  --radius: 12px;
  --radius-sm: 8px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;

  --rail-w: 248px;

  /* Semantic color — used for meaning only */
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --ok-wash: rgba(52, 211, 153, 0.12);
  --bad-wash: rgba(248, 113, 113, 0.12);
  --accent: #93c5fd;
  --accent-line: rgba(147, 197, 253, 0.45);
  --progress: #e2e8f0;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --panel: rgba(15, 23, 42, 0.32);
  --hover: rgba(255, 255, 255, 0.04);
  --input: rgba(2, 6, 23, 0.35);
  --seg-active: rgba(255, 255, 255, 0.12);
  --primary-bg: #f1f5f9;
  --primary-ink: #0f172a;
}

/* Twilight — warm light glowing under the shelf */
html.twilight {
  --bg-0: #1c2540;
  --bg-1: #2a3357;
  --bg-2: #3a4063;
  --ink: #f8fafc;
  --ink-soft: #dbe2f0;
  --ink-faint: #aeb8d0;

  --glass: rgba(26, 30, 54, 0.46);
  --glass-strong: rgba(26, 30, 54, 0.76);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-strong: rgba(255, 255, 255, 0.26);
  --shadow: 0 18px 50px -22px rgba(20, 12, 40, 0.6);

  --sky-top: #262940;
  --sky-mid: #55526f;
  --sky-horizon: #eeb385;
  --gap-light: #ffcf9a;
  --storm-top: #22223a;
  --storm-bottom: #4c4763;
  --shelf-lit: #cfaea8;
  --shelf-mid: #7a6d85;
  --shelf-shadow: #3d3955;
  --shelf-under: #332f48;
  --tree-far: #2b3536;
  --tower: #4a4658;
  --house-wall: #c3b2a3;
  --house-roof: #39333f;
  --garage: #8c7f72;
  --door: #3a2f2a;
  --window: #ffd27a;
  --lawn: #4d6a39;
  --lawn-fore: #2c4224;
  --road: #8a8290;
  --tree: #3e5a33;
  --tree-dark: #23361f;
  --trunk: #3a2c22;
  --mulch: #3b2a22;
  --star-opacity: 0.18;
  --moon-opacity: 0;

  --panel: rgba(30, 32, 58, 0.3);
  --input: rgba(15, 15, 35, 0.35);
  --progress: #f1f5f9;
}

/* Day — the photo: bright gray storm light, crisp green lawns */
html.day {
  --bg-0: #e2e8f0;
  --bg-1: #eef2f6;
  --bg-2: #f8fafc;
  --ink: #1e293b;
  --ink-soft: #334155;
  --ink-faint: #64748b;

  --beacon: #059669;
  --beacon-bright: #10b981;
  --beacon-ink: #ffffff;

  --accent-cool: #0284c7;
  --warn: #b45309;

  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-hi: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-border-strong: rgba(148, 163, 184, 0.5);
  --shadow: 0 18px 50px -24px rgba(30, 41, 59, 0.4);

  --danger: #dc2626;
  --amber-wash: rgba(16, 185, 129, 0.12);
  --amber-border: rgba(5, 150, 105, 0.4);
  --warn-wash: rgba(245, 158, 11, 0.14);
  --warn-border: rgba(217, 119, 6, 0.4);
  --track: rgba(15, 23, 42, 0.1);

  --sky-top: #5c6877;
  --sky-mid: #9aa7b6;
  --sky-horizon: #dde5ec;
  --gap-light: #f1f5f9;
  --storm-top: #59626e;
  --storm-bottom: #aab3be;
  --shelf-lit: #eef1f5;
  --shelf-mid: #aab3bf;
  --shelf-shadow: #66717e;
  --shelf-under: #59636f;
  --tree-far: #3b5537;
  --tower: #8a929c;
  --house-wall: #ebe6de;
  --house-roof: #4a4e56;
  --garage: #c8c2b8;
  --door: #3b3f46;
  --window: #6f8296;
  --lawn: #4f9b3a;
  --lawn-fore: #3a7c2a;
  --road: #b8bbc0;
  --tree: #3f7a2e;
  --tree-dark: #24502a;
  --trunk: #5a4330;
  --mulch: #4a3428;
  --star-opacity: 0;
  --moon-opacity: 0;

  --ok: #047857;
  --warn: #b45309;
  --bad: #b91c1c;
  --ok-wash: rgba(4, 120, 87, 0.1);
  --bad-wash: rgba(185, 28, 28, 0.08);
  --accent: #1d4ed8;
  --accent-line: rgba(29, 78, 216, 0.35);
  --progress: #1e293b;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.18);
  --panel: rgba(255, 255, 255, 0.5);
  --hover: rgba(15, 23, 42, 0.035);
  --input: rgba(255, 255, 255, 0.8);
  --seg-active: #ffffff;
  --primary-bg: #0f172a;
  --primary-ink: #ffffff;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Scenic backdrop: arcus over the neighborhood ---------- */
.scenic-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.scenic-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    var(--sky-top) 0%,
    var(--sky-mid) 30%,
    var(--sky-horizon) 52%,
    var(--sky-horizon) 100%);
  transition: background 0.6s ease;
}
.scenic-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scenic-scene path,
.scenic-scene ellipse,
.scenic-scene polygon,
.scenic-scene rect { transition: fill 0.6s ease; }

.scenic-stars {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30%;
  opacity: var(--star-opacity);
  transition: opacity 0.6s ease;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 40%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 28% 62%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 44% 30%, #fff, transparent),
    radial-gradient(1px 1px at 58% 56%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 72% 36%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 86% 60%, #fff, transparent),
    radial-gradient(1px 1px at 94% 24%, #fff, transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: calc(var(--star-opacity) * 0.55); } to { opacity: var(--star-opacity); } }

.celestial {
  position: absolute;
  top: 4%; right: 12%;
  width: 120px; height: 120px;
  display: grid;
  place-items: center;
  transition: opacity 0.6s ease;
}
.celestial--moon { opacity: var(--moon-opacity); }
.celestial__glow {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  filter: blur(26px);
  background: radial-gradient(circle, rgba(226,232,240,0.45), transparent 70%);
}
.celestial__disc {
  position: relative;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #ffffff, #dbe4f0 55%, #aab6c9);
  box-shadow: 0 0 36px rgba(203,213,236,0.5);
}


/* ---------- App shell ---------- */
.shell { display: flex; flex-direction: column; height: 100vh; }
.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 14px 14px;
}

/* ---------- Top bar ---------- */
.topbar {
  flex: none;
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--ink); border-color: var(--glass-border-strong); }
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}
.crumb__item {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.crumb__item:hover { color: var(--ink); }
.crumb__item.is-current { color: var(--ink); font-weight: 600; }
.crumb__home { font-weight: 800; letter-spacing: 0.16em; color: var(--ink); font-size: 0.8rem; }
.crumb__sep { color: var(--ink-faint); font-size: 0.8rem; }

/* Shared glass surfaces */
.rail, .canvas {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 0;
}

/* ---------- Rail ---------- */
.rail { display: flex; flex-direction: column; gap: 18px; padding: 16px 12px; overflow-y: auto; }
.rail__brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: inherit; text-decoration: none; }
.brand__emblem { width: 44px; height: 30px; flex: none; }
.brand__name { display: block; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.95rem; }
.brand__tag { display: block; font-size: 0.7rem; color: var(--ink-faint); margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}
.nav__item svg { width: 18px; height: 18px; flex: none; }
.nav__item:hover { background: var(--glass-hi); color: var(--ink); }
.nav__item.is-active { background: var(--glass-hi); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); font-weight: 600; }
.nav__badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  background: var(--bad-wash);
  color: var(--bad);
}
.rail__section { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.rail__label, .eyebrow, .group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.rail__label { padding: 0 10px; }
.rail-goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.rail-goal {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.82rem;
}
.rail-goal:hover { background: var(--glass-hi); color: var(--ink); }
.rail-goal.is-active { background: var(--glass-hi); color: var(--ink); }
.rail-goal__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-goal__pct { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); }
.rail-goal .meter { grid-column: 1 / -1; }
.rail-goals__empty { padding: 6px 10px; font-size: 0.8rem; color: var(--ink-faint); }
.rail__version { margin: auto 0 0; padding: 0 10px; font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint); }

/* ---------- Canvas & views ---------- */
.canvas { overflow-y: auto; padding: 24px 28px 40px; outline: none; }
.view { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.view__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.view__title { margin: 0; font-size: 1.55rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.view__sub { margin: 4px 0 0; color: var(--ink-faint); font-size: 0.86rem; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--focus { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.grid--tight { gap: 20px; }
.grid--auto:empty { display: none; }
.grid--2 > :only-child { grid-column: 1 / -1; }

.panel {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 0;
}
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section__title { margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.count { font-family: var(--font-mono); font-weight: 500; color: var(--ink-faint); letter-spacing: 0; margin-left: 4px; }
.empty-note { margin: 0; color: var(--ink-faint); font-size: 0.85rem; line-height: 1.5; }
.footnote { margin: 12px 0 0; font-size: 0.74rem; color: var(--ink-faint); line-height: 1.45; }
.muted { color: var(--ink-faint); }
.small { font-size: 0.76rem; }
.nowrap { white-space: nowrap; }
.is-ok { color: var(--ok); }
.is-bad { color: var(--bad); }
.est {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: 1px;
}
.link { color: var(--ink); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.link--muted { color: var(--ink-soft); font-weight: 500; }

/* Meter */
.meter { position: relative; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--progress); transition: width 0.4s ease; }
.meter.is-complete > span { background: var(--ok); }
.meter.is-unknown > span { display: none; }
.meter--lg { height: 10px; }
.meter--xs { height: 3px; }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ink-soft);
  background: var(--glass-hi);
  border: 1px solid var(--line);
}
.chip--ok { color: var(--ok); background: var(--ok-wash); border-color: transparent; }
.chip--warn { color: var(--warn); background: var(--warn-wash); border-color: transparent; }
.chip--bad { color: var(--bad); background: var(--bad-wash); border-color: transparent; }
.chip--accent { color: var(--accent); border-color: var(--accent-line); background: transparent; }
.chip--muted { color: var(--ink-faint); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.prio i { width: 7px; height: 7px; border-radius: 2px; background: var(--ink-faint); opacity: 0.6; }
.prio--critical { color: var(--bad); }
.prio--critical i { background: var(--bad); opacity: 1; }
.prio--high { color: var(--warn); }
.prio--high i { background: var(--warn); opacity: 1; }
.prio--medium i { opacity: 0.9; }
.due { font-size: 0.76rem; color: var(--ink-soft); white-space: nowrap; }
.due--warn { color: var(--warn); font-weight: 600; }
.due--bad { color: var(--bad); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); opacity: 0.5; flex: none; margin-top: 6px; }
.dot--ok { background: var(--ok); opacity: 1; }
.dot--warn { background: var(--warn); opacity: 1; }
.dot--bad { background: var(--bad); opacity: 1; }

/* Focus panel */
.focus-panel { display: flex; flex-direction: column; gap: 12px; border-color: var(--accent-line); }
.focus-panel__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.focus-panel__tools { display: flex; gap: 4px; }
.focus-panel__title { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.25; }
.focus-panel__link { color: var(--ink); text-decoration: none; }
.focus-panel__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.focus-panel__path { font-size: 0.8rem; margin-top: -6px; }
.focus-panel__figure { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.figure { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.figure__label { color: var(--ink-soft); font-size: 0.9rem; }
.figure__pct { margin-left: auto; font-family: var(--font-mono); color: var(--ink-soft); }
.focus-panel__lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--ink-soft); }
.focus-panel__milestone { font-size: 0.86rem; color: var(--ink-soft); }
.focus-panel__milestone .eyebrow { margin-right: 6px; }
.focus-panel__actions { display: flex; flex-direction: column; gap: 6px; }
.focus-panel__buttons { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.focus-panel--empty p { margin: 8px 0 0; color: var(--ink-soft); }
.why { display: flex; flex-wrap: wrap; gap: 6px; }
.why--small .chip { font-size: 0.68rem; }

/* Portfolio */
.pf { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.pf__head { display: flex; justify-content: space-between; align-items: baseline; }
.pf__label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.pf__pct { font-family: var(--font-mono); font-size: 0.9rem; }
.pf__nums { font-size: 0.86rem; color: var(--ink-soft); }
.pf__nums strong { color: var(--ink); }
.pf__goals { font-size: 0.76rem; color: var(--ink-faint); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.stats dt { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); }
.stats dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats small { font-size: 0.78rem; font-weight: 500; color: var(--ink-faint); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 6px 4px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-goal { min-width: 220px; }
.cell-sub { display: block; font-size: 0.76rem; color: var(--ink-faint); margin-top: 2px; }
.cell-progress { min-width: 150px; }
.cell-progress .meter { display: inline-block; width: calc(100% - 46px); vertical-align: middle; }
.cell-pct { display: inline-block; width: 42px; text-align: right; font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-soft); vertical-align: middle; }
.cell-notes { color: var(--ink-soft); max-width: 280px; }
.table--history td { padding: 8px 4px; }
.table--history tr.is-corrected td { color: var(--ink-faint); }
.table--history tr.is-corrected td.num { text-decoration: line-through; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list__item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.list__item:last-child { border-bottom: none; }
.list__date { width: 78px; flex: none; font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.list__date small { display: block; font-weight: 500; font-size: 0.7rem; color: var(--ink-faint); }
.list__date.is-warn { color: var(--warn); }
.list__date.is-bad { color: var(--bad); }
.list__body { flex: 1 1 auto; min-width: 0; color: var(--ink-soft); line-height: 1.45; }
.list__kind { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-right: 4px; }

/* Checklists (milestones / actions) */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: none; }
.check-row__box { padding-top: 2px; }
.check-row__box input { width: 16px; height: 16px; accent-color: var(--ok); cursor: pointer; }
.check-row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.check-row__title { font-size: 0.88rem; font-weight: 500; overflow-wrap: anywhere; }
.check-row__desc { font-size: 0.8rem; color: var(--ink-soft); }
.check-row__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.76rem; align-items: center; }
.check-row.is-done .check-row__title { color: var(--ink-faint); text-decoration: line-through; }
.group-label { margin: 10px 0 2px; }
.group-label:first-child { margin-top: 0; }

.row-tools { display: flex; gap: 2px; opacity: 0.55; transition: opacity 0.15s ease; }
.check-row:hover .row-tools, .sub-row:hover .row-tools, .list__item:hover .tool, .row-tools:focus-within { opacity: 1; }
.tool {
  width: 26px; height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: none;
  color: var(--ink-soft);
  font-size: 0.8rem;
  cursor: pointer;
}
.tool:hover { border-color: var(--line-strong); color: var(--ink); }
.tool:disabled { opacity: 0.25; cursor: default; }
.tool--go { color: var(--ok); }

/* Subordinate goals */
.sub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sub-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sub-row:last-child { border-bottom: none; }
.sub-row__rank {
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
  cursor: grab;
}
.sub-row.is-focus .sub-row__rank { border-color: var(--accent); color: var(--accent); }
.sub-row.is-complete .sub-row__title .link { color: var(--ink-faint); }
.sub-row.is-dragging { opacity: 0.4; }
.sub-row.is-drop-target { box-shadow: inset 0 2px 0 var(--accent); }
.sub-row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sub-row__meter { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.sub-row__meter .meter { width: 160px; flex: none; }
.sub-row__meter .cell-pct { width: auto; }

/* Rank list (Focus view) */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.rank-row:last-child { border-bottom: none; }
.rank-row__n { font-family: var(--font-mono); color: var(--ink-faint); padding-top: 2px; }
.rank-row.is-focus .rank-row__n { color: var(--accent); font-weight: 700; }
.rank-row__title { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.rank-row__body .why { margin-top: 8px; }
.rank-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.score { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; }

/* Explorer */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .field__input { width: auto; }
.toolbar__search { flex: 1 1 220px; min-width: 160px; }
.tree { display: flex; flex-direction: column; }
.tree-head, .tree-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 90px 170px 100px;
  gap: 12px;
  align-items: center;
}
.tree-head { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); padding: 0 4px 8px; border-bottom: 1px solid var(--line); }
.tree-row { padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 0.86rem; }
.tree-row:hover { background: var(--hover); }
.tree-row:last-child { border-bottom: none; }
.tree-row.is-context { opacity: 0.55; }
.tree-row.is-complete .link { color: var(--ink-faint); }
.tree-row__name { display: flex; align-items: flex-start; gap: 6px; padding-left: calc(var(--depth) * 22px); min-width: 0; }
.tree-row__text { min-width: 0; }
.caret {
  width: 18px; height: 18px;
  flex: none;
  margin-top: 1px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-faint);
  position: relative;
}
.caret::before {
  content: "";
  position: absolute;
  left: 6px; top: 5px;
  border: 4px solid transparent;
  border-left: 6px solid currentColor;
  transition: transform 0.15s ease;
  transform-origin: 3px 4px;
}
.caret.is-open::before { transform: rotate(90deg); }
.caret--leaf::before { display: none; }
.caret:hover { color: var(--ink); }

/* Goal detail */
.view__head--goal { align-items: flex-start; }
.goal-head { min-width: 0; flex: 1 1 420px; }
.goal-head__parent { font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 4px; }
.goal-head__chips { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; }
.goal-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.description { margin: -4px 0 0; color: var(--ink-soft); line-height: 1.55; font-size: 0.92rem; white-space: pre-wrap; max-width: 75ch; }
.instrument { display: flex; flex-direction: column; gap: 14px; }
.instrument__main { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.readout { display: flex; flex-direction: column; }
.readout__value { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.readout__label { font-size: 0.76rem; color: var(--ink-faint); margin-top: 4px; }
.readout--right { text-align: right; }
.readout--right .readout__value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 20px; margin: 0; }
.facts dt { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.facts dd { margin: 3px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts--terms { margin-bottom: 14px; }
.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: none; }
.kv dt { color: var(--ink-soft); font-size: 0.86rem; }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv dd small { display: block; color: var(--ink-faint); font-size: 0.74rem; }
.kv .is-emphasis dt { color: var(--ink); font-weight: 600; }
.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.notes li { font-size: 0.82rem; color: var(--ink-soft); padding-left: 12px; border-left: 2px solid var(--line-strong); line-height: 1.45; }
.notes li.notes__warn { border-left-color: var(--warn); }
.notes li.notes__bad { border-left-color: var(--bad); color: var(--ink); }
.panel > .notes { margin-top: 12px; }
.chart { margin: 0 0 14px; }
.chart svg { width: 100%; height: 140px; display: block; }
.chart__line { fill: none; stroke: var(--progress); stroke-width: 2; }
.chart__target { stroke: var(--ink-faint); stroke-dasharray: 4 4; stroke-width: 1; }
.chart figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 0.74rem; color: var(--ink-faint); font-family: var(--font-mono); margin-top: 4px; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form .field__input { flex: 1 1 auto; min-width: 0; }

/* More menu */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.menu__list button {
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}
.menu__list button:hover { background: var(--hover); }
.menu__list .is-danger { color: var(--bad); }

/* Empty state */
.view--empty { min-height: 60vh; justify-content: center; }
.empty { max-width: 560px; margin: 0 auto; text-align: center; }
.empty__title { margin: 0 0 12px; font-size: 2rem; font-weight: 800; letter-spacing: -0.01em; }
.empty__text { margin: 0 0 22px; color: var(--ink-soft); line-height: 1.6; }
.empty__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.form__section { border: none; margin: 0; padding: 0 0 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.form__section:last-of-type { border-bottom: none; }
.form__section legend { padding: 0 0 8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.form__section legend em, .field__label em { font-style: normal; font-weight: 400; color: var(--ink-faint); text-transform: none; letter-spacing: 0; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.form__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form__actions { display: flex; justify-content: flex-end; gap: 8px; }
.form__actions--stack { flex-direction: column; align-items: stretch; }
.form__error { margin: 0; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bad-wash); color: var(--bad); font-size: 0.84rem; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--narrow { max-width: 220px; }
.field__label { font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); }
.field__label em { margin-left: 4px; }
.field__input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--input);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.88rem;
}
.field__input:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
.field__input--area { resize: vertical; min-height: 60px; line-height: 1.45; }
html:not(.day) select.field__input option { background: #1e293b; color: #f8fafc; }
.field__hint { margin: -4px 0 0; font-size: 0.76rem; color: var(--ink-faint); line-height: 1.45; }
.field__hint:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.82rem; color: var(--ink-soft); line-height: 1.45; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check strong { color: var(--ink); font-weight: 600; }
[data-debt] { display: flex; flex-direction: column; gap: 12px; }
.preview { margin: 0; font-size: 0.84rem; color: var(--ink-soft); line-height: 1.5; min-height: 1.2em; }
.choice__text p { margin: 0 0 8px; line-height: 1.5; color: var(--ink-soft); }
.choice__text strong { color: var(--ink); }
.choice__note { font-size: 0.82rem; color: var(--ink-faint) !important; }

.seg { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--glass-hi); border: 1px solid var(--line); }
.seg__btn {
  flex: 1 1 0;
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-active { background: var(--seg-active); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.seg--inline { flex: none; }

/* ---------- Shared suite components (from Anvil) ---------- */
.btn {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover {
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn--ghost { background: var(--glass-hi); }
.btn--beacon {
  background: linear-gradient(120deg, var(--beacon), var(--beacon-bright));
  border-color: transparent;
  color: var(--beacon-ink);
  box-shadow: 0 8px 20px -8px var(--beacon);
}
.btn--beacon:hover { filter: brightness(1.06); }
.btn--kiosk {
  border-color: var(--amber-border);
  color: var(--beacon-bright);
}
.btn--danger {
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
}
.btn--danger:hover { background: rgba(248, 113, 113, 0.12); }
.btn--tiny {
  font-size: 0.72rem;
  padding: 5px 10px;
}
.btn kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.8;
}


/* ---------- Modals (settings / about) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 18, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--glass-strong);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border);
}
.modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.modal__close {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal__close:hover { border-color: var(--glass-border-strong); }

.settings-content { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.settings-group { display: flex; flex-direction: column; gap: 8px; }
.settings-divider { height: 1px; background: var(--glass-border); }
.settings-row__label { font-weight: 700; font-size: 0.9rem; }
.settings-row__desc { font-size: 0.78rem; color: var(--ink-faint); line-height: 1.4; }
.settings-privacy {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
  line-height: 1.4;
}
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-actions .btn { flex: 1 1 auto; }
.settings-actions--compact .btn { flex: 1 1 140px; }

/* Encrypted cloud sync */
.cloud-data-field { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.cloud-data-field__label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.cloud-phrase-entry { display: flex; gap: 6px; }
.cloud-data-field__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.cloud-data-field__input:focus { outline: none; border-color: var(--beacon); }
.cloud-phrase-entry__toggle {
  flex: none;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.cloud-phrase-entry__toggle:hover { border-color: var(--glass-border-strong); color: var(--ink); }
.cloud-phrase-output {
  margin: 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--amber-border);
  background: var(--amber-wash);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.cloud-remember-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.cloud-data-status {
  margin: 2px 0 0;
  min-height: 1em;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-faint);
}
.cloud-data-status--info { color: var(--accent-cool); }
.cloud-data-status--success { color: var(--beacon-bright); }
html.day .cloud-data-status--success { color: var(--beacon); }
.cloud-data-status--error { color: var(--danger); }

.theme-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.theme-chip {
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.theme-chip:hover { border-color: var(--glass-border-strong); transform: translateY(-1px); }
.theme-chip.is-active {
  border-color: var(--beacon);
  background: var(--amber-wash);
  color: var(--beacon-bright);
  box-shadow: 0 0 0 1px var(--beacon) inset;
}
html.day .theme-chip.is-active { color: var(--beacon); }

.about-content { padding: 18px; text-align: center; }
.about-content__name {
  margin: 4px 0 2px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.about-content__version {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--beacon-bright);
}
html.day .about-content__version { color: var(--beacon); }
.about-content__description {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border-strong);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}


/* ---------- Arcus overrides of shared components (restrained) ---------- */
.btn { padding: 7px 13px; border-color: var(--line-strong); font-size: 0.82rem; text-decoration: none; }
.btn:hover { transform: none; border-color: var(--ink-faint); }
.btn--primary { background: var(--primary-bg); color: var(--primary-ink); border-color: transparent; }
.btn--primary:hover { border-color: transparent; filter: brightness(0.95); }
.btn--sm { padding: 4px 10px; font-size: 0.76rem; }
.btn--quiet { background: none; border-color: transparent; color: var(--ink-soft); }
.btn--quiet:hover { color: var(--ink); border-color: var(--line-strong); }
.btn--danger { color: var(--bad); border-color: var(--bad-wash); }
.btn:focus-visible, .tool:focus-visible, .seg__btn:focus-visible, .nav__item:focus-visible, .caret:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal__card { max-width: 460px; }
.modal__card.modal__card--wide { max-width: 640px; }
.theme-chip.is-active { border-color: var(--accent); background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
html.day .theme-chip.is-active { color: var(--ink); }
.cloud-data-status--success, html.day .cloud-data-status--success { color: var(--ok); }
.cloud-phrase-output { border-color: var(--warn); background: transparent; }
.about-content__version, html.day .about-content__version { color: var(--ink-soft); }
.cloud-data-field__input:focus { border-color: var(--accent); }

/* ---------- Scrollbars ---------- */
.rail::-webkit-scrollbar, .canvas::-webkit-scrollbar, .modal__card::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.rail::-webkit-scrollbar-thumb, .canvas::-webkit-scrollbar-thumb, .modal__card::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
  .grid--focus { grid-template-columns: 1fr; }
  .tree-head, .tree-row { grid-template-columns: minmax(0, 1fr) 140px 84px 150px; }
  .tree-head > :nth-child(5), .tree-row > :nth-child(5) { display: none; }
}
@media (max-width: 960px) {
  :root { --rail-w: 210px; }
  .grid--2 { grid-template-columns: 1fr; }
  .canvas { padding: 20px; }
}
@media (max-width: 760px) {
  .shell { height: auto; min-height: 100vh; }
  .app { grid-template-columns: 1fr; padding: 0 10px 10px; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px; }
  .rail__section, .rail__version { display: none; }
  .nav { flex-direction: row; flex: 1 1 auto; }
  .nav__item { padding: 6px 8px; }
  .canvas { padding: 16px; }
  .topbar { padding: 10px; }
  #topNewBtn { display: none; }
  .crumb__item { max-width: 120px; }
  .view__title { font-size: 1.3rem; }
  .readout__value { font-size: 1.7rem; }
  .figure { font-size: 1.5rem; }
  .tree-head { display: none; }
  .tree-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .tree-row > :nth-child(3), .tree-row > :nth-child(4), .tree-row > :nth-child(5) { display: none; }
  .tree-row .cell-progress .meter { display: none; }
  .sub-row__meter .meter { width: 90px; }
  .form__row--3 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(5), .table td:nth-child(5) { display: none; }
  .table--history th:nth-child(3), .table--history td:nth-child(3), .table--history th:nth-child(4), .table--history td:nth-child(4) { display: none; }
  .row-tools { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
