:root {
  --ink: #0f1c24;
  --muted: #5a6d78;
  --paper: #eef3f6;
  --panel: #f7fafc;
  --line: #c5d2db;
  --accent: #0d7a6f;
  --accent-soft: #d4efeb;
  --danger: #b42318;
  --gain: #0d7a6f;
  --loss: #b42318;
  --font: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(720px 420px at 90% -10%, #c8e8e3 0%, transparent 55%),
    radial-gradient(640px 380px at -5% 20%, #d6e4f0 0%, transparent 50%),
    linear-gradient(180deg, #e8eef2 0%, var(--paper) 40%, #e4ebf0 100%);
}

.shell {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.15rem 4rem;
}

.brand {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2rem, 7vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.login-shell {
  max-width: 24rem;
  padding-top: 14vh;
}

.lede, .why, .depot-hint, .goal-hint {
  color: var(--muted);
  line-height: 1.5;
  margin: 0.5rem 0 0;
}

.login-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

input[type="password"] {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--panel);
  font: inherit;
}

button {
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: 0.55rem;
  background: var(--ink);
  color: #f4f8fa;
  padding: 0.65rem 1rem;
}

button.ghost {
  background: transparent;
  color: var(--ink);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.day-label {
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.mast-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.depot {
  padding: 1.25rem 0 1.35rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.35rem;
}

.depot-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.depot-value {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(2.1rem, 8vw, 2.85rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.depot-sub {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.depot-sub .sep { margin: 0 0.35rem; opacity: 0.5; }
.depot-sub .gain { color: var(--gain); font-weight: 650; }
.depot-sub .loss { color: var(--loss); font-weight: 650; }

.depot-hint {
  font-size: 0.88rem;
  max-width: 34rem;
}

.today {
  margin-bottom: 1.75rem;
}

.phase {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.headline {
  margin: 0;
  font-weight: 750;
  font-size: clamp(1.25rem, 3.8vw, 1.65rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.system-pills {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.system-pills li {
  margin: 0;
  padding: 0.35rem 0.65rem;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
}

.system-pills li.warn {
  background: #fde8e6;
  color: var(--danger);
}

h2 {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.stats, .open-block, .ledger-block, .story-block, .thesis-block, .controls-block, .watch-live {
  margin-bottom: 1.85rem;
}

.watch-live {
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}

.watch-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.watch-live.is-stale .watch-kicker,
.watch-live.is-off .watch-kicker {
  color: var(--muted);
}

.watch-live.is-stale .watch-headline {
  color: var(--danger);
}

.watch-headline {
  margin: 0;
  font-weight: 750;
  font-size: clamp(1.15rem, 3.2vw, 1.45rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.watch-detail {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.watch-meta {
  margin: 0.55rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.watch-ticks {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.watch-ticks li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.35rem 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.watch-ticks .w-when {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 0.15rem;
}

.watch-ticks .w-title {
  font-weight: 700;
}

.watch-ticks .w-detail {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.85rem;
}

.watch-ticks .empty {
  color: var(--muted);
  padding: 0.75rem 0;
  grid-column: 1 / -1;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 560px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.stat .label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.stat .value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
}

.goal-hint { font-size: 0.9rem; }

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain-list li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.plain-list .name {
  font-weight: 700;
}

.plain-list .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.trade-list {
  display: grid;
  gap: 0;
}

.trade {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.trade .name { font-weight: 700; }
.trade .meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.88rem;
}
.trade .result {
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
}
.trade .result.gain { color: var(--gain); }
.trade .result.loss { color: var(--loss); }
.trade .empty {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 0.5rem 0;
}

.story p {
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

.thesis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}

.thesis-grid .k {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.thesis-text {
  margin: 0 0 0.55rem;
  line-height: 1.5;
}

.thesis-text.muted { color: var(--muted); }

.sources {
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}

.sources li { margin: 0 0 0.35rem; font-size: 0.9rem; }
.sources a { color: var(--accent); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.timeline li {
  position: relative;
  padding: 0 0 1rem 1rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.timeline .t-title { font-weight: 700; }
.timeline .t-detail { color: var(--muted); font-size: 0.92rem; }
.timeline .t-ts {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.control-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.error { color: var(--danger); }
.note { color: var(--accent); }
.banner { margin: 0 0 1rem; }
.muted { color: var(--muted); }

[hidden] { display: none !important; }
