/* Glass Cannon dashboard. Phone first (375 px), one thumb: every button at least 44 px tall. */
:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --ink: #1b1c1e;
  --muted: #5b5f66;
  --line: #e2e0da;
  --soft: #f0eee9;
  --accent: #1d5c48;
  --accent-ink: #ffffff;
  --good: #1d6f45;   --good-bg: #e3f2e9;
  --warn: #8a4b00;   --warn-bg: #fbeed8;
  --bad: #a3261d;    --bad-bg: #fbe5e2;
  --info: #24518f;   --info-bg: #e5edf8;
  --mute-bg: #ecebe7;
  --focus: #2b6cdf;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517; --card: #1d1f22; --ink: #ecebe8; --muted: #a3a7ad; --line: #34373c; --soft: #25282c;
    --accent: #5fbf97; --accent-ink: #0d1f18;
    --good: #7fd3a5; --good-bg: #1d3528; --warn: #f0b867; --warn-bg: #3a2c16; --bad: #f2948a; --bad-bg: #42201d;
    --info: #9dbcf0; --info-bg: #1d2a40; --mute-bg: #2a2d31; --focus: #8fb4ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141517; --card: #1d1f22; --ink: #ecebe8; --muted: #a3a7ad; --line: #34373c; --soft: #25282c;
  --accent: #5fbf97; --accent-ink: #0d1f18;
  --good: #7fd3a5; --good-bg: #1d3528; --warn: #f0b867; --warn-bg: #3a2c16; --bad: #f2948a; --bad-bg: #42201d;
  --info: #9dbcf0; --info-bg: #1d2a40; --mute-bg: #2a2d31; --focus: #8fb4ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}
a { color: var(--info); }
h1, h2, h3, h4, p { margin: 0; }
[id] { scroll-margin-top: 64px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top, main, .foot { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 14px; }
.top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
h1 { font-size: 20px; letter-spacing: -0.01em; }
.fresh { color: var(--muted); font-size: 14px; }
.stop-slot { flex: 0 0 auto; text-align: right; }
.banner { margin-top: 10px; display: grid; gap: 6px; }
.banner p { padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.banner .bad { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.banner .warn { background: var(--warn-bg); color: var(--warn); }

.jump {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; margin: 8px auto 0; max-width: 920px;
  border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.jump::-webkit-scrollbar { display: none; }
.jump-link {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink);
  text-decoration: none; font-size: 14px;
}

.sec { padding: 22px 0 6px; }
.sec h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.count { font-size: 13px; font-weight: 600; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--mute-bg); color: var(--muted); }
.count.on { background: var(--accent); color: var(--accent-ink); }
.empty { color: var(--muted); }
.loading { padding: 40px 0; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card.urgent { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.target { outline: 3px solid var(--focus); outline-offset: 2px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.eyebrow .muted { font-weight: 400; }
.ask h3 { font-size: 17px; line-height: 1.3; margin: 4px 0 6px; }
.ask > p, .meta p, .does p { margin-top: 6px; }
.does { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.good-text { color: var(--good); }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }

.chip { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.muted { background: var(--mute-bg); color: var(--muted); }

.thing { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.thing img { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.thing-head { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.thing-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.subject { font-size: 14px; font-weight: 600; margin: 4px 0; }
.text { white-space: pre-wrap; font-size: 15px; }
.text.clamp { max-height: 18em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.text.before { color: var(--muted); }
.ba { margin-top: 8px; }
.ba-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-top: 8px; }
.stars { color: var(--warn); font-size: 18px; letter-spacing: 1px; }
.stars .muted { font-size: 14px; letter-spacing: 0; }
.checks { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.replies { margin-top: 8px; font-size: 14px; color: var(--good); }

.btn {
  min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  touch-action: manipulation;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.danger.armed { background: var(--bad); color: #fff; }
.btn.quiet { font-weight: 500; color: var(--muted); }
.btn.reason { font-weight: 500; }
.btn.link { min-height: 44px; border: 0; background: none; color: var(--info); padding: 0 4px; font-weight: 500; text-decoration: underline; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.answer { margin-top: 12px; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reasons { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reasons .small { grid-column: 1 / -1; color: var(--muted); }
.reasons[hidden] { display: none; }
.note-row { margin-top: 10px; display: grid; gap: 8px; }
.note {
  width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-size: 16px; resize: vertical;
}
.flash { margin-top: 8px; color: var(--bad); font-weight: 600; font-size: 14px; }
.sent { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--good-bg); color: var(--good); font-size: 15px; }

.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.goal-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.goal-value { font-size: 22px; font-weight: 700; margin: 2px 0 6px; }
.goal-value .muted { font-size: 14px; font-weight: 500; }
.bar { height: 8px; background: var(--mute-bg); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.wide { height: 10px; margin: 8px 0; }

.receipts { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.receipt { padding: 12px 14px; border-top: 1px solid var(--line); }
.receipt:first-child { border-top: 0; }
.receipt p + p { margin-top: 2px; }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.wf { padding: 0; }
.wf > summary { padding: 14px; min-height: 44px; display: grid; gap: 6px; position: relative; padding-right: 40px; }
.wf > summary::after, .act > summary::after, .more > summary::after {
  content: ""; position: absolute; right: 16px; top: 20px; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s;
}
details[open] > summary::after { transform: rotate(-135deg); top: 24px; }
.wf.health-red { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.wf-name { font-weight: 700; font-size: 16px; }
.wf-sub, .act-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.wf-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.wf-body > p:first-child { margin-top: 12px; }
.wf-body h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 18px 0 8px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.wf-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 14px; }
.migrate { flex: 1 1 220px; display: grid; gap: 6px; }

.act { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--card); }
.act > summary { padding: 10px 40px 10px 12px; min-height: 44px; display: grid; gap: 4px; position: relative; }
.act > summary::after { top: 16px; }
.act[open] > summary::after { top: 20px; }
.act-title { font-weight: 600; font-size: 15px; }
.act-body { padding: 0 12px 12px; }
.comments { margin-top: 10px; font-size: 14px; display: grid; gap: 4px; }
.run { padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.run .chip { margin-right: 4px; }
.more { margin-top: 6px; }
.more > summary { position: relative; min-height: 44px; display: flex; align-items: center; padding-right: 36px; color: var(--info); font-weight: 600; }
.more > summary::after { top: 14px; }
.more[open] > summary::after { top: 18px; }

.build { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: 15px; }
.signin { text-align: center; padding: 60px 0; display: grid; gap: 14px; justify-items: center; }

.foot { padding: 30px 16px 40px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

@media (min-width: 720px) {
  h1 { font-size: 24px; }
  .jump { flex-wrap: wrap; overflow-x: visible; }
  [id] { scroll-margin-top: 130px; }
  .goals { grid-template-columns: repeat(4, 1fr); }
  .buttons { grid-template-columns: repeat(4, auto); justify-content: start; }
  .reasons { grid-template-columns: repeat(5, auto); justify-content: start; }
  .note-row { grid-template-columns: 1fr auto; align-items: start; }
  .card { padding: 18px; }
  .wf > summary { grid-template-columns: 1fr auto; align-items: center; padding: 16px 44px 16px 18px; }
  .wf-body { padding: 0 18px 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
