/* Starling Command. Tokens from brand/palette.css. */
:root {
  --navy: #1b2a4a;
  --orange: #e48b59;
  --orange-2: #ed7b46;
  --link: #b4532a;
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #111827;
  --muted: #53617a;
  --line: #e5e7eb;
  --good: #1f7a4d;
  --bad: #b42318;
  --run: #9a5b13;
  --font-head: "Gloock", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1829; --card: #18243d; --text: #eef1f6; --muted: #a3afc4; --line: #2a3a5a;
    --link: #f0a57a; --good: #5cc98f; --bad: #ff8a80; --run: #f3b664; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 108px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font-body); -webkit-text-size-adjust: 100%; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; margin: 0; letter-spacing: .005em; }
code { font-size: .88em; background: color-mix(in srgb, var(--muted) 12%, transparent); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
a { color: var(--link); }
.muted { color: var(--muted); font-size: 13px; }

.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 2; }
.top-in { display: flex; align-items: center; gap: 10px; height: 56px; }
.top h1 { font-size: 21px; flex: 1; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #d7deea; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #9aa6bb; }
.live[data-state="on"] i { background: #5cc98f; box-shadow: 0 0 0 3px rgb(92 201 143 / .25); }
.live[data-state="off"] i { background: var(--orange); }

.tabs { display: flex; gap: 4px; position: sticky; top: 56px; z-index: 1; background: var(--bg); padding-top: 10px; padding-bottom: 10px; overflow-x: auto; }
.tabs a { text-decoration: none; color: var(--text); font-weight: 500; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); white-space: nowrap; }

main { display: grid; gap: 18px; padding-bottom: 24px; }
@media (min-width: 900px) {
  main { grid-template-columns: 1fr 1fr; align-items: start; }
  #money { grid-column: 1 / -1; }
}
section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.sec-head h2 { font-size: 24px; }

/* Money */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.tile b { display: block; font: 400 clamp(20px, 6vw, 30px)/1.15 var(--font-head); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile span { font-size: 12px; color: var(--muted); }
.goal { margin: 14px 0 4px; font-size: 14px; }
.bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }
.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 18px 16px; text-align: center; }
.empty b { display: block; font: 400 26px/1.2 var(--font-head); margin-bottom: 4px; }
.sources { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.sources li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; flex-wrap: wrap; }
.pill { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.ok { color: var(--good); } .pill.no { color: var(--muted); } .pill.bad { color: var(--bad); } .pill.run { color: var(--run); }
.days { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.days li { display: grid; grid-template-columns: 82px 1fr auto; gap: 8px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
h3 { font-size: 17px; margin: 18px 0 6px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.n, .table th.n { text-align: right; }
.scroll { overflow-x: auto; }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 560px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed li.new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--orange) 22%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .feed li.new { animation: none; } html { scroll-behavior: auto; } }
.feed .when { font-size: 12px; color: var(--muted); grid-row: span 2; min-width: 44px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.feed .who { font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.feed .what { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Learning */
.lbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; min-width: 60px; background: color-mix(in srgb, var(--muted) 15%, transparent); }
.lbar .w { background: var(--good); } .lbar .m { background: var(--orange); } .lbar .f { background: var(--bad); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 8px; overflow-wrap: anywhere; }
.list li b { font-weight: 600; font-size: 14px; }

.foot { padding-bottom: 28px; }

/* Login */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login form { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; width: 100%; max-width: 360px; display: grid; gap: 10px; }
.login h1 { font-size: 26px; }
.login input { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.login button { font: 600 15px var(--font-body); padding: 11px; border: 0; border-radius: 8px; background: var(--orange); color: var(--text); cursor: pointer; }
.login .warn { color: var(--bad); margin: 0; }
