/* Midas: dark, minimal, motivating. Gold marks progress and wins. */
:root {
  /* Racing green & tan (a car interior, 1965) + classic gold, in a clean dark mode */
  --racing: #0F3B2E;          /* racing green: brand surfaces, active states */
  --racing-hi: #17513F;
  --racing-deep: #0B2A21;
  --tan: #C89B6A;             /* tan leather: labels, secondary accents */
  --tan-dim: rgba(200, 155, 106, 0.14);
  --gold: #D4AF37;            /* classic gold: progress, wins, primary actions */
  --gold-hi: #E9C960;
  --gold-dim: rgba(212, 175, 55, 0.14);
  --on-gold: #14110A;
  --bg: #090D0B;
  --surface: #101714;
  --surface-2: #16201B;
  --border: #223029;
  --border-hi: #34463C;
  --text: #EEE8DC;
  --muted: #A7A193;
  --faint: #6F6B62;
  --good: #7CC492;
  --good-dim: rgba(124, 196, 146, 0.14);
  --warn: #E59E4C;
  --warn-dim: rgba(229, 158, 76, 0.14);
  --bad: #E2766A;
  --bad-dim: rgba(226, 118, 106, 0.14);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "New York", "Iowan Old Style", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
a { color: var(--gold); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
b { font-weight: 600; }
.num, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.gold { color: var(--gold); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--border); background: var(--bg); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--serif); font-size: 19px; padding: 4px 10px 22px; }
.logo { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(145deg, var(--gold-hi), var(--gold)); color: var(--on-gold); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 16px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-size: 14.5px; }
.side-link svg { width: 18px; height: 18px; flex: none; }
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link.active { background: var(--gold-dim); color: var(--gold-hi); }
.side-sep { height: 1px; background: var(--border); margin: 10px 8px; }
main { padding: 28px 32px 60px; max-width: 980px; width: 100%; outline: none; }
.tabbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.stack { display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.tight { padding: 14px 16px; }
.card h2 { margin-bottom: 4px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.eyebrow { font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
a.card:hover, .clickable:hover { border-color: var(--border-hi); cursor: pointer; }

/* ---------- hero countdown ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 100% 0%, rgba(212, 175, 55, 0.16), transparent 55%), var(--surface); border: 1px solid rgba(212, 175, 55, 0.35); border-radius: 18px; padding: 24px; }
.countdown { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; }
.countdown .big { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--gold-hi); font-variant-numeric: lining-nums tabular-nums; }
.countdown .unit { font-size: 20px; color: var(--text); }
.hero .sub { color: var(--muted); }
.hero .sub b { color: var(--text); }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.hero-stats .value { font-size: 17px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--gold-dim); color: var(--gold-hi); }
.pill.good { background: var(--good-dim); color: var(--good); }
.pill.warn { background: var(--warn-dim); color: var(--warn); }
.pill.bad { background: var(--bad-dim); color: var(--bad); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }

/* ---------- banner ---------- */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--gold-dim); border: 1px solid rgba(212, 175, 55, 0.3); margin-bottom: 14px; flex-wrap: wrap; }
.banner.warn { background: var(--warn-dim); border-color: rgba(224, 162, 76, 0.35); }

/* ---------- progress bars ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); transition: width 0.5s ease; }
.bar.good span { background: var(--good); }
.bar.warn span { background: var(--warn); }
.bar.bad span { background: var(--bad); }
.bar.thin { height: 5px; }

/* ---------- FOO track ---------- */
.foo-track { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-top: 12px; }
.foo-dot { height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--faint); }
.foo-dot.done { background: var(--good-dim); color: var(--good); }
.foo-dot.current { background: var(--gold); color: var(--on-gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.roadmap { display: grid; gap: 10px; }
.road-step { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.road-step .n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--faint); }
.road-step.done .n { background: var(--good-dim); color: var(--good); }
.road-step.current { border-color: rgba(212, 175, 55, 0.5); background: radial-gradient(100% 140% at 0% 0%, rgba(212, 175, 55, 0.1), transparent 60%), var(--surface); }
.road-step.current .n { background: var(--gold); color: var(--on-gold); }

/* ---------- lists ---------- */
.list { display: grid; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); align-items: center; }
.item:last-child { border-bottom: none; }
.item .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font-size: 12.5px; color: var(--muted); }
.item .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.item.clickable { cursor: pointer; border-radius: 8px; }
.item.clickable:hover { background: var(--surface-2); }
.debt { padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); display: grid; gap: 4px; cursor: pointer; }
.debt:hover { border-color: var(--border-hi); }
.debt.target { border-color: var(--gold); background: radial-gradient(120% 160% at 100% 0%, rgba(212, 175, 55, 0.12), transparent 60%), var(--surface-2); }
.debt .rank { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--muted); margin-right: 8px; flex: none; }
.debt.target .rank { background: var(--gold); color: var(--on-gold); }
.debt-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.debt-name { display: flex; align-items: center; font-weight: 600; min-width: 0; }
.debt-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debt-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }

table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th { text-align: left; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--border); }
table.simple td { padding: 10px 6px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
table.simple td.r, table.simple th.r { text-align: right; }

/* ---------- budget ---------- */
.assign { text-align: center; padding: 22px; }
.assign .value { font-family: var(--serif); font-size: 44px; line-height: 1.1; margin: 6px 0; font-variant-numeric: lining-nums tabular-nums; }
.assign.zero .value { color: var(--good); }
.assign.over .value { color: var(--bad); }
.equation { display: flex; justify-content: center; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.bline { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.bline:last-child { border-bottom: none; }
.bline .name { font-weight: 500; }
.bline .meta { font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; }
.bline .bar { grid-column: 1 / -1; margin-top: 2px; }
.bline .fixed { text-align: right; font-variant-numeric: tabular-nums; padding-right: 4px; }
.bline.system .name { color: var(--gold-hi); }
.group-label { margin: 6px 0 2px; }

/* ---------- forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; color: var(--text); }
.btn:hover { border-color: var(--border-hi); }
.btn.primary { background: linear-gradient(145deg, var(--gold-hi), var(--gold)); color: var(--on-gold); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger-ghost { background: transparent; color: var(--bad); border-color: transparent; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px; border-radius: 8px; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.field { display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.field > span { font-weight: 500; }
.input-wrap { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; }
.input-wrap:focus-within, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.input-wrap input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--text); font: inherit; font-size: 16px; padding: 10px 0; outline: none; }
.prefix, .suffix { color: var(--faint); }
.prefix { margin-right: 4px; }
.suffix { margin-left: 6px; }
select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; outline: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=date] { color-scheme: dark; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; flex-wrap: wrap; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.check .help { flex-basis: 100%; margin-left: 28px; }
.help { color: var(--faint); font-size: 12.5px; font-weight: 400; }
.inline-money { width: 120px; }
.inline-money .input-wrap { padding: 0 10px; }
.inline-money input { padding: 7px 0; font-size: 15px; text-align: right; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.chip.on { background: var(--gold-dim); border-color: rgba(212, 175, 55, 0.5); color: var(--gold-hi); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); letter-spacing: 0.02em; }
.tag.biz { background: var(--tan-dim); color: var(--tan); }
.tag.card { background: var(--bad-dim); color: #F0A398; }
.tag.cash { background: var(--good-dim); color: var(--good); }
.biz-toggle { border: 1px dashed var(--border); background: transparent; color: var(--faint); border-radius: 6px; font-size: 11px; padding: 2px 7px; cursor: pointer; }
.biz-toggle.on { border-style: solid; background: var(--tan-dim); color: var(--tan); border-color: transparent; }
input[type=range] { width: 100%; accent-color: var(--gold); }

/* ---------- modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.62); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade 0.15s ease; }
.sheet { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; animation: rise 0.2s ease; }
.form { padding: 20px; display: grid; gap: 14px; }
.fields { display: grid; gap: 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 4px; }
.form-error { color: var(--bad); font-size: 13.5px; }
.confirm-msg { font-size: 16px; }
.intro { font-size: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* ---------- celebration ---------- */
.sheet-celebrate { border-color: rgba(212, 175, 55, 0.5); }
.celebrate { padding: 28px 24px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.celebrate h2 { font-family: var(--serif); font-size: 26px; color: var(--gold-hi); }
.celebrate p { color: var(--muted); max-width: 360px; }
.celebrate .btn { margin-top: 10px; }
.burst { position: relative; width: 100px; height: 100px; display: grid; place-items: center; }
.medal { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; color: var(--on-gold); background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 60%, #9C7A1E); box-shadow: 0 0 40px rgba(212, 175, 55, 0.45); animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
.coin { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--gold-hi); opacity: 0; animation: coin 1.1s ease-out var(--d) forwards; }
@keyframes pop { from { transform: scale(0.3); } }
@keyframes coin { 0% { transform: translate(0, 0) scale(0.4); opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 160px)) scale(1); opacity: 0; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--surface-2); border: 1px solid var(--border); padding: 11px 18px; border-radius: 12px; opacity: 0; transition: 0.25s ease; z-index: 60; font-size: 14px; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- chart ---------- */
.chart { position: relative; margin-top: 6px; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .area { fill: var(--gold); opacity: 0.16; }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.chart .marker { fill: var(--gold-hi); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; top: 4px; pointer-events: none; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; min-width: 130px; }
.tip-date { color: var(--muted); }
.tip-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-paid { color: var(--gold-hi); margin-top: 2px; }

/* ---------- check-in ---------- */
.step-card { display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-dim); color: var(--gold-hi); display: grid; place-items: center; font-weight: 700; }
.step-body { display: grid; gap: 10px; min-width: 0; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }

/* ---------- Alfred ---------- */
.alfred { display: grid; gap: 14px; }
.msg { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; color: var(--on-gold); background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold)); }
.bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 14px 16px; min-width: 0; }
.bubble.you { border-radius: 16px 4px 16px 16px; background: var(--surface-2); }
.msg.you { grid-template-columns: 1fr; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; margin-bottom: 10px; }
.verdict.go { background: var(--good-dim); color: var(--good); }
.verdict.save { background: var(--gold-dim); color: var(--gold-hi); }
.verdict.wait { background: var(--warn-dim); color: var(--warn); }
.verdict.no { background: var(--bad-dim); color: var(--bad); }
.alfred-headline { font-size: 16px; line-height: 1.5; }
.alfred-points { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); }
.alfred-points b { color: var(--text); }
.compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.compare .card { background: var(--bg); padding: 12px; }
.checks { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; }
.ask-row { display: flex; gap: 8px; }
.ask-row .input-wrap { flex: 1; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: rgba(9, 13, 11, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--faint); font-size: 11px; background: none; border: none; cursor: pointer; }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: var(--gold-hi); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid2.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3.keep { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding: 20px; }
  .countdown .big { font-size: 54px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats > :last-child { grid-column: 1 / -1; }
  h1 { font-size: 23px; }
  .compare { grid-template-columns: 1fr; }
  .backdrop { align-items: end; padding: 0; }
  .sheet { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .bline { grid-template-columns: minmax(0, 1fr) 110px; }
  .road-step { grid-template-columns: 40px 1fr; }
  .road-step > :last-child { grid-column: 2; }
}

/* links styled as cards keep normal text color */
a.card { color: var(--text); display: block; }
.pill { white-space: nowrap; }


/* ===== Theme accents: racing green, tan, classic gold ===== */
.eyebrow { color: var(--tan); }
.logo { background: var(--racing); color: var(--gold-hi); box-shadow: inset 0 0 0 1.5px var(--gold); }
.side-link.active { background: var(--racing); color: var(--text); }
.side-link.active svg { color: var(--gold-hi); }
.hero { background: radial-gradient(120% 140% at 100% 0%, rgba(212, 175, 55, 0.12), transparent 55%), linear-gradient(160deg, var(--racing) 0%, var(--racing-deep) 55%, var(--surface) 100%); border-color: rgba(212, 175, 55, 0.4); }
.hero-stats { border-top-color: rgba(200, 155, 106, 0.22); }
.hero .sub { color: #C9C2B2; }
.pill { background: rgba(9, 13, 11, 0.45); color: var(--tan); box-shadow: inset 0 0 0 1px rgba(200, 155, 106, 0.35); }
.pill.neutral { box-shadow: none; }
.banner { background: linear-gradient(120deg, rgba(15, 59, 46, 0.75), rgba(15, 59, 46, 0.35)); border-color: rgba(200, 155, 106, 0.3); }
.btn { background: var(--surface-2); }
.btn:not(.primary):not(.ghost):not(.danger-ghost):hover { background: var(--racing); border-color: var(--racing-hi); }
.chip.on { background: var(--racing); border-color: var(--racing-hi); color: var(--text); }
.debt.target { background: radial-gradient(120% 160% at 100% 0%, rgba(212, 175, 55, 0.10), transparent 60%), linear-gradient(160deg, rgba(15, 59, 46, 0.55), var(--surface-2)); }
.road-step.current { background: linear-gradient(120deg, rgba(15, 59, 46, 0.7), var(--surface) 70%); }
.road-step.done .n, .foo-dot.done { background: rgba(15, 59, 46, 0.9); color: var(--tan); }
.step-num { background: var(--racing); color: var(--gold-hi); }
.tag.cash { background: rgba(15, 59, 46, 0.9); color: var(--good); }
.chart .marker { fill: var(--tan); stroke: var(--surface); }
.tip-paid { color: var(--tan); }
.bline.system .name { color: var(--tan); }
.assign { background: linear-gradient(180deg, rgba(15, 59, 46, 0.45), var(--surface) 70%); }
.sheet { border-color: var(--border-hi); }
.sheet-celebrate { background: radial-gradient(100% 80% at 50% 0%, rgba(15, 59, 46, 0.9), var(--surface) 75%); }
.tab.active svg { color: var(--gold-hi); }
.tab.active { color: var(--text); }
.bubble { border-color: var(--border); }
.bubble.you { background: linear-gradient(160deg, rgba(15, 59, 46, 0.55), var(--surface-2)); }

/* ===== Guided check-in ===== */
.found { background: linear-gradient(160deg, rgba(15, 59, 46, 0.65), var(--surface) 75%); }
.found-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 12px 0 10px; }
.found-row div { display: grid; gap: 2px; }
.found-row b { font-size: 20px; font-variant-numeric: tabular-nums; }
.found-row span { font-size: 12px; color: var(--muted); }
.qdots { display: flex; gap: 6px; justify-content: center; }
.qdot { width: 26px; height: 5px; border-radius: 99px; background: var(--surface-2); }
.qdot.done { background: var(--tan); }
.qdot.on { background: var(--gold); }
.qcard { display: grid; gap: 12px; padding: 22px; }
.qcard h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; }
.qcard .why { margin-top: -6px; }
.qbody { display: grid; gap: 14px; }
.qnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.qnav .btn { min-width: 120px; padding: 11px 18px; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--bg); }
.choice:hover { border-color: var(--border-hi); }
.choice:has(input:checked) { border-color: var(--gold); background: linear-gradient(120deg, rgba(15, 59, 46, 0.7), var(--bg)); }
.choice input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--gold); flex: none; }
.choice span { display: grid; gap: 2px; }
.choice b { font-weight: 500; }
.choice small { color: var(--muted); font-size: 12.5px; }
.list.compact .item { padding: 8px 2px; }
.list.scroll { max-height: 220px; overflow-y: auto; padding-right: 4px; }
.reveal { display: grid; gap: 10px; }
.cat-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.cat-row .field > span:empty { display: none; }
.breakdown { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-size: 14px; }
.breakdown .total { padding-top: 8px; border-top: 1px solid var(--border); font-size: 15px; }
.plan-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.plan-list li::marker { color: var(--gold); }
@media (max-width: 860px) {
  .found-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qcard { padding: 18px; }
  .qnav .btn { min-width: 0; flex: 1; }
}

/* ===== Alfred floating widget: gold outline, racing-green interior ===== */
main { padding-bottom: 120px; }
.alfred-dock { position: fixed; right: 22px; bottom: 22px; z-index: 45; display: flex; align-items: flex-end; gap: 14px; pointer-events: none; }
.alfred-dock > * { pointer-events: auto; }
.alfred-fab { flex: none; width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--gold); cursor: pointer;
  background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 65%, #9C7A1E); color: var(--racing);
  font-family: var(--serif); font-size: 27px; font-weight: 700; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 0 5px rgba(212, 175, 55, 0.12); transition: transform 0.15s ease; }
.alfred-fab:hover { transform: translateY(-2px) scale(1.03); }
.alfred-bubble { position: relative; width: 268px; padding: 14px 30px 12px 16px; border: 1.5px solid var(--gold); border-radius: 18px 18px 4px 18px;
  background: linear-gradient(160deg, var(--racing) 0%, var(--racing-deep) 100%); color: var(--text); font-size: 14px; line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); margin-bottom: 18px; animation: rise 0.35s ease; }
.alfred-bubble b { color: var(--gold-hi); }
.alfred-bubble::after { content: ''; position: absolute; right: -8px; bottom: 12px; width: 13px; height: 13px; background: var(--racing-deep);
  border-top: 1.5px solid var(--gold); border-right: 1.5px solid var(--gold); transform: rotate(45deg); }
.bubble-x { position: absolute; top: 4px; right: 8px; background: none; border: none; color: var(--tan); font-size: 18px; line-height: 1; cursor: pointer; padding: 4px; }
.bubble-x:hover { color: var(--text); }
.bubble-cta { margin-top: 8px; padding: 0; background: none; border: none; color: var(--gold-hi); font-weight: 600; cursor: pointer; font-size: 14px; }
.alfred-panel { position: fixed; right: 22px; bottom: 22px; z-index: 46; width: 410px; max-height: min(740px, calc(100vh - 44px)); display: flex; flex-direction: column;
  border: 1.5px solid var(--gold); border-radius: 20px; background: var(--surface); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65); overflow: hidden; animation: rise 0.2s ease; }
.alfred-panel > header { display: flex; gap: 12px; align-items: center; padding: 14px 14px 14px 16px; background: linear-gradient(160deg, var(--racing), var(--racing-deep)); border-bottom: 1px solid rgba(212, 175, 55, 0.4); }
.alfred-panel > header > div { flex: 1; }
.alfred-panel > header small { display: block; color: var(--tan); font-size: 12px; }
.alfred-body { overflow-y: auto; padding: 14px; display: grid; gap: 14px; align-content: start; overscroll-behavior: contain; }
.alfred-body .msg { grid-template-columns: 32px 1fr; gap: 10px; }
.alfred-body .msg.you { grid-template-columns: 1fr; }
.alfred-body .avatar, .alfred-panel > header .avatar { width: 32px; height: 32px; font-size: 15px; }
.alfred-body .bubble:not(.you) { border: 1.5px solid var(--gold); background: linear-gradient(160deg, rgba(15, 59, 46, 0.95), var(--racing-deep)); }
.alfred-body .alfred-points.small { font-size: 12.5px; margin-top: 8px; }
.alfred-body .compare { grid-template-columns: 1fr; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(9, 13, 11, 0.45); }
.alfred-body .alfred-headline { font-size: 15px; }
@media (max-width: 860px) {
  .alfred-dock { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); gap: 10px; }
  .alfred-fab { width: 52px; height: 52px; font-size: 23px; }
  .alfred-bubble { width: min(240px, calc(100vw - 100px)); font-size: 13.5px; margin-bottom: 14px; }
  .alfred-panel { left: 0; right: 0; bottom: 0; width: 100%; max-height: 90vh; border-radius: 20px 20px 0 0; border-bottom: none; z-index: 55; padding-bottom: env(safe-area-inset-bottom); }
  main { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
}

/* ===== Lock screen ===== */
body.locked { overflow: hidden; }
body.locked .layout, body.locked .tabbar, body.locked #alfred-root { visibility: hidden; }
.lock { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 0%, rgba(23, 81, 63, 0.9), transparent 60%), linear-gradient(180deg, var(--racing-deep), var(--bg) 70%); }
.lock-card { width: min(340px, 100%); display: grid; justify-items: center; gap: 14px; text-align: center; }
.lock-logo { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(212, 175, 55, 0.5); }
.lock h1 { font-family: var(--serif); font-size: 30px; color: var(--gold-hi); letter-spacing: 0.02em; }
.lock-msg { color: var(--text); font-size: 15.5px; min-height: 22px; }
.lock-msg.err { color: var(--bad); }
.lock-sub { color: var(--muted); font-size: 12.5px; max-width: 300px; }
.pin-dots { display: flex; gap: 14px; margin: 6px 0 8px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--tan); transition: background 0.12s ease; }
.pin-dots span.on { background: var(--gold); border-color: var(--gold); }
.pin-dots.shake { animation: shake 0.35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; justify-content: center; }
.keypad button { width: 76px; height: 76px; border-radius: 50%; border: 1px solid rgba(200, 155, 106, 0.28); background: rgba(15, 59, 46, 0.55);
  color: var(--text); font-size: 28px; font-weight: 400; cursor: pointer; display: grid; place-items: center; transition: background 0.1s ease; }
.keypad button:active, .keypad button:hover { background: var(--racing-hi); }
.keypad button[data-key="back"] { background: none; border: none; font-size: 22px; color: var(--tan); }
.keypad button:disabled { opacity: 0.35; cursor: not-allowed; }
.keypad .kp-face { border-color: var(--gold); color: var(--gold-hi); background: none; }
.keypad .kp-face svg { width: 34px; height: 34px; }
.lock-actions { display: grid; gap: 10px; width: 100%; margin-top: 8px; }
.lock-actions .btn { padding: 13px; }
.lock-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(212, 175, 55, 0.2); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-height: 700px) { .keypad { grid-template-columns: repeat(3, 66px); gap: 10px 20px; } .keypad button { width: 66px; height: 66px; font-size: 24px; } .lock-logo { width: 60px; height: 60px; } }
