/* GAIL's Dash — "Warm cards v2", the approved mockup. Tokens are the exact
   values from .superpowers/brainstorm/.../warm-cards-v2.html. */
:root {
  --bg: #faf6ef;
  --card: #fff;
  --text: #2b2622;
  --muted: #8a8178;
  --accent: #c1272d;
  --bad: #b3261e;
  --good: #1a7f4b;
  --rule: #f0e9df;
  --track: #eee6da;
  --chev: #d8cfc2;
  --warn-bg: #fff8ec;
  --warn-border: #f0e2c4;
  --warn-label: #a08340;
  --chip-bg: #fdecea;
  --chip-border: #f5c6c0;
  --sub-bg: #f4f0e9;
  --sub-text: #6d655b;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

.wrap { max-width: 520px; margin: 0 auto; }

.top {
  padding: 18px 16px 8px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.brand span { color: var(--accent); }
.greet { font-size: 13px; color: var(--muted); margin-top: 1px; }
.stamp { font-size: 11px; color: var(--muted); }
.stamp.stale { color: var(--bad); font-weight: 600; }

.hero {
  margin: 8px 12px; background: var(--card); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 1px 4px rgba(0, 0, 0, .06); position: relative;
}
.hero-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.hero-value { font-size: 30px; font-weight: 800; }
.hero-delta { font-size: 14px; font-weight: 700; }
.bar { height: 6px; background: var(--track); border-radius: 3px; margin-top: 8px; }
.bar > i { display: block; height: 6px; background: var(--accent); border-radius: 3px; }
.hero-meta {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); margin-top: 4px;
}
.hero-wtd {
  border-top: 1px solid var(--rule); margin-top: 10px; padding-top: 8px;
  display: flex; justify-content: space-between;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 12px; }
.tile { background: var(--card); border-radius: 14px; padding: 12px; position: relative; }
.tl { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.tv { font-size: 20px; font-weight: 800; margin-top: 2px; }
.ts { font-size: 11px; }
.chev { position: absolute; top: 12px; right: 10px; color: var(--chev); font-size: 12px; }

.chip {
  margin-top: 6px; background: var(--chip-bg); color: var(--bad);
  border-radius: 8px; padding: 4px 7px; font-size: 10px; font-weight: 700;
}
.sub {
  margin-top: 6px; background: var(--sub-bg); border-radius: 8px;
  padding: 4px 7px; font-size: 10px; color: var(--sub-text);
}

.forms {
  margin: 6px 12px; background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: 14px; padding: 12px 14px; position: relative;
}
.forms .tl { color: var(--warn-label); }
.forms-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.forms-count { font-size: 20px; font-weight: 800; }
.forms-missing { font-size: 11px; color: var(--muted); }

.estate { margin: 8px 12px 16px; background: var(--card); border-radius: 14px; padding: 12px 14px; }
.estate-row {
  display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px;
  width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left;
}
.estate-row b { font-weight: 700; }

.good { color: var(--good); }
.bad { color: var(--bad); }
.neutral { color: var(--muted); }

/* A source that failed. Grey, legible, and never mistaken for a real zero. */
.tile.dead, .hero.dead { opacity: .55; }
.dead .tv, .dead .hero-value { color: var(--muted); }
.dead-note { font-size: 11px; color: var(--muted); margin-top: 4px; }

button.tile, button.hero, button.forms {
  display: block; width: calc(100% - 24px); border: 0; font: inherit;
  text-align: left; cursor: pointer;
}
button.tile { width: auto; }
.grid button.tile { margin: 0; }

/* Drill-downs */
.head { padding: 16px 16px 8px; display: flex; align-items: center; gap: 10px; }
.back { font-size: 18px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.head h1 { font-size: 18px; font-weight: 800; margin: 0; }
.flags {
  margin: 6px 12px; background: var(--chip-bg); border: 1px solid var(--chip-border);
  border-radius: 14px; padding: 12px 14px;
}
.flags-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--bad); font-weight: 700; margin-bottom: 6px;
}
.flag { font-size: 12px; padding: 3px 0; }
.summary {
  margin: 6px 12px; background: var(--card); border-radius: 14px; padding: 12px 14px;
  display: flex; justify-content: space-around; text-align: center;
}
/* Sub-table heading inside a drill-down — e.g. coffee's per-site rows,
   labelled distinctly from its headline figure when the two are on a
   different basis (WTD-cumulative vs a single derived day). */
.section-title { margin: 10px 12px 4px; }
.summary-value { font-size: 18px; font-weight: 800; }
.summary-note { font-size: 10px; }
.table { margin: 6px 12px 16px; background: var(--card); border-radius: 14px; padding: 6px 14px; }
.table-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  font-size: 12px; border-bottom: 1px solid var(--rule);
}
.table-row:last-of-type { border-bottom: 0; }
.deep-link {
  display: block; text-align: center; font-size: 11px; color: var(--muted);
  padding: 8px 0 6px; text-decoration: none;
}

/* Login */
.login { padding: 60px 24px; text-align: center; }
.login h1 { font-size: 26px; font-weight: 800; }
.login button {
  width: 100%; padding: 14px; border-radius: 12px; border: 0; font-size: 15px;
  font-weight: 700; background: var(--accent); color: #fff; margin-top: 12px; cursor: pointer;
}
.login button.ghost { background: var(--card); color: var(--text); border: 1px solid var(--rule); }
.login button.link {
  background: none; color: var(--muted); font-weight: 600; font-size: 12px;
  box-shadow: none; padding: 10px;
}
.login input {
  width: 100%; padding: 14px; font-size: 22px; text-align: center; letter-spacing: 8px;
  border-radius: 12px; border: 1px solid var(--rule); margin-top: 12px;
}
.login .err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }
