/* MGV Financial — Mind & Growth Valley brand: warm cream, deep navy, golden mountain. Light is the default. */
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
:root {
  --navy: #071c30; --navy-2: #0d263e; --navy-3: #142e46;
  --gold: #e7af49; --gold-light: #f8d992; --gold-soft: #fbf0d9;
  --cream: #f8f2eb;
  --brand: #0d263e;          /* primary actions: MGV navy */
  --brand-ink: #fdf8f1;
  --brand-soft: #fbf0d9;     /* warm gold wash for highlights */
  --accent: #e7af49;
  --bg: #f8f2eb;
  --surface: #fffdf9;
  --surface-2: #f3ebe0;
  --ink: #102036;
  --ink-2: #4a5568;
  --ink-3: #7b8494;
  --line: #e8dfd2;
  --good: #3f7d5c;
  --warn: #b7791f;
  --bad: #b4443a;
  --info: #2f5f8a;
  --c1: #234e70; --c2: #e7af49; --c3: #5a8f7b; --c4: #a8645c; --c5: #7a6aa8; --c6: #c0583f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 32, 54, .05), 0 6px 18px rgba(16, 32, 54, .06);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
/* Dark theme only when chosen in Settings (or "match my system" on a dark device). */
:root[data-theme="dark"] {
  --brand: #e7af49; --brand-ink: #071c30; --brand-soft: #1d3247; --accent: #f2bb56;
  --bg: #071c30; --surface: #0d263e; --surface-2: #142e46;
  --ink: #f8f2eb; --ink-2: #c9ced6; --ink-3: #95a0ae; --line: #1f3a55;
  --good: #7cc49b; --warn: #f2bb56; --bad: #f08c80; --info: #8db4ec;
  --c1: #8db4ec; --c2: #f2bb56; --c3: #8cc7b0; --c4: #e3a49b; --c5: #b3a6e0; --c6: #f08c80;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
.card h2, .welcome h2 { font-family: var(--serif); font-weight: 600; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-2); } .small { font-size: .85rem; } .tiny { font-size: .78rem; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 75%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: block; flex: none; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.15; }
.brand-name small { display: block; font-family: var(--font); font-weight: 500; color: var(--ink-3); font-size: .72rem; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; font-size: .75rem; color: var(--ink-3); }
main { padding: 24px clamp(16px, 3vw, 40px) 96px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 0; }
.tabbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--ink-3); text-decoration: none; padding: 4px; position: relative; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .badge { position: absolute; top: 0; right: 22%; }
  main { padding-top: 16px; }
}

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.dash { grid-template-columns: repeat(12, 1fr); }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1100px) { .span-4 { grid-column: span 6; } .span-8 { grid-column: span 12; } }
@media (max-width: 700px) { .dash > * { grid-column: span 12 !important; } }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.big { font-size: 2.1rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kpi .label { font-size: .8rem; color: var(--ink-2); }
.kpi .value { font-size: 1.25rem; font-weight: 650; }
.empty { text-align: center; padding: 28px 12px; color: var(--ink-2); }
.empty svg { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 8px; }
.callout { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.learn-link { font-size: .8rem; color: var(--ink-3); text-decoration: none; border-bottom: 1px dotted var(--ink-3); }
.learn-link:hover { color: var(--brand); border-color: var(--brand); }

/* Buttons and forms */
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1.3; }
button:hover, .btn:hover { background: var(--surface-2); }
.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.danger { color: var(--bad); }
.ghost { border-color: transparent; background: transparent; }
.icon-btn { padding: 6px; border-radius: 8px; }
.icon-btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: .85rem; font-weight: 550; color: var(--ink-2); margin-bottom: 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .78rem; color: var(--ink-3); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .row, .row-3 { grid-template-columns: 1fr; } }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 550; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); margin: 6px 0; }
.errors { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); border-radius: 8px; padding: 8px 12px; font-size: .9rem; margin-bottom: 12px; }

/* Lists and tables */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { font-size: .8rem; color: var(--ink-3); }
.list button.rowbtn { all: unset; display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; }
.list button.rowbtn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 75%, transparent); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--ink-2); font-size: .8rem; }
td.r, th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.pill.info { background: color-mix(in srgb, var(--info) 13%, transparent); color: var(--info); }
.badge { background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }

/* Progress */
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar.over > span { background: var(--bad); }
.bar.near > span { background: var(--warn); }

/* Alerts */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 8px; align-items: flex-start; }
.alert .ico { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert.critical { border-left: 4px solid var(--bad); }
.alert.warning { border-left: 4px solid var(--warn); }
.alert.info { border-left: 4px solid var(--info); }
.alert .grow { flex: 1; }
.alert .title { font-weight: 600; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface-2); text-align: center; font-size: .75rem; font-weight: 600; color: var(--ink-2); padding: 6px 0; }
.cal .day { background: var(--surface); min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; border: 0; text-align: left; font: inherit; color: inherit; border-radius: 0; }
.cal .day:hover { background: var(--surface-2); }
.cal .day.out { background: var(--bg); color: var(--ink-3); }
.cal .day.today .n { background: var(--brand); color: var(--brand-ink); border-radius: 99px; padding: 0 7px; }
.cal .n { font-size: .8rem; font-weight: 600; align-self: flex-start; }
.cal .ev { font-size: .72rem; padding: 2px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); border-left: 3px solid var(--ink-3); }
.cal .ev.bill { border-color: var(--c2); } .cal .ev.pay { border-color: var(--good); } .cal .ev.rem { border-color: var(--c3); } .cal .ev.goal { border-color: var(--c4); }
.cal .ev.paid { text-decoration: line-through; opacity: .6; }
.cal .more { font-size: .7rem; color: var(--ink-3); }
@media (max-width: 700px) { .cal .day { min-height: 58px; } .cal .ev { font-size: 0; height: 6px; padding: 0; } .cal .more { display: none; } }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--ink-2); margin: 10px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-2); font: 11px var(--font); }
.chart .axis line, .chart .grid line { stroke: var(--line); }
.chart .zero { stroke: var(--ink-3); }
.chart-values { margin-top: 8px; }
.chart-values summary { cursor: pointer; font-size: .8rem; color: var(--ink-3); }
.chart-tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .8rem; padding: 6px 9px; border-radius: 7px; z-index: 60; white-space: nowrap; transform: translate(-50%, -110%); }

/* Modal and toast */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, 94vw); max-height: 92vh; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(10, 20, 15, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: space-between; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; }
.toast button { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); padding: 4px 10px; }
@media (max-width: 900px) { .toasts { bottom: 84px; } }
.fab { position: fixed; right: 20px; bottom: 20px; border-radius: 999px; padding: 14px 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); z-index: 15; }
@media (max-width: 900px) { .fab { bottom: 84px; } }

/* Onboarding and lessons */
.welcome { max-width: 620px; margin: 6vh auto; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; padding-left: 40px; position: relative; margin-bottom: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.lesson h3 { margin-top: 1rem; }
.lesson .example { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.disclaimer { font-size: .78rem; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 16px; }

/* Print (PDF reports) */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .sidebar, .tabbar, .fab, .no-print, .toasts, dialog { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .print-only { display: block; }
  .chart text { fill: #333; }
}

/* First-run welcome uses the whole page */
body.welcome-mode .sidebar, body.welcome-mode .tabbar { display: none; }
body.welcome-mode .shell { grid-template-columns: 1fr; }

/* Icons inside buttons and links stay small */
button svg, .btn svg { width: 18px; height: 18px; flex: none; }
.page-head .btn-row { flex-wrap: wrap; }

/* Welcome: navy hero band with the golden mountain, warm cream form below */
.welcome { max-width: 680px; margin: 3vh auto 6vh; }
.welcome-hero { background: radial-gradient(120% 140% at 85% 0%, #1b3a57 0%, var(--navy-2) 45%, var(--navy) 100%); color: #f8f2eb; border-radius: 22px 22px 0 0; padding: 32px 32px 28px; }
.welcome-logo { display: block; width: 116px; height: auto; margin-bottom: 6px; }
.welcome-org { margin: 0 0 14px; color: var(--gold-light); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.welcome-hero h1 { color: #fffdf9; font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin-bottom: 10px; }
.welcome-lead { color: #d9dee6; font-size: 1.02rem; max-width: 52ch; }
.welcome-points { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.welcome-points li { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: #cfd6e0; }
.welcome-points img { flex: none; width: 36px; height: 36px; }
.welcome-points strong { display: block; color: var(--gold-light); font-weight: 600; margin-bottom: 2px; }
@media (max-width: 620px) { .welcome-points { grid-template-columns: 1fr; } .welcome-hero { padding: 26px 22px 22px; } }
.welcome-card { border-radius: 0 0 22px 22px; border-top: 0; padding: 26px 32px 28px; }
@media (max-width: 620px) { .welcome-card { padding: 22px; } }
.welcome-card h2 { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 1.15rem; }
.welcome-card h2:first-of-type { margin-top: 4px; }
.step { width: 28px; height: 28px; border-radius: 50%; background: var(--gold-soft); color: #8a5a10; font: 700 .85rem var(--font); display: inline-grid; place-items: center; flex: none; }
:root[data-theme="dark"] .step { background: var(--brand-soft); color: var(--gold); }
.primary { box-shadow: 0 2px 0 rgba(7, 28, 48, .12); }

/* Programmatic focus on the main area (after navigation) should not draw an outline */
main:focus { outline: none; }

/* Mind & Growth Valley logo lockup, as on mindgrowthvalley.com: golden mountain + serif wordmark + tagline on navy */
.mgv-lockup { display: inline-flex; align-items: center; gap: 12px; }
.mgv-lockup img { width: 66px; height: auto; flex: none; }
.mgv-word { display: block; font: 500 1.12rem/1.15 var(--serif); letter-spacing: -.02em; color: #fffdf9; white-space: nowrap; }
.mgv-sub { display: block; margin-top: 3px; font: 700 .52rem/1.6 var(--font); letter-spacing: .26em; text-transform: uppercase; color: #f5f1e9; white-space: nowrap; }
.brand-panel { display: block; background: var(--navy); border-radius: 14px; padding: 14px 14px 12px; text-decoration: none; margin-bottom: 6px; }
.brand-panel .mgv-lockup img { width: 54px; }
.brand-panel .mgv-word { font-size: .98rem; }
.brand-panel .mgv-sub { font-size: .46rem; letter-spacing: .2em; }
.brand-app { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; padding: 6px 10px 12px; color: var(--ink); }
.brand-app small { display: block; font: 500 .72rem var(--font); color: var(--ink-3); letter-spacing: .02em; }
.welcome-brand { margin-bottom: 14px; }
.welcome-brand .mgv-lockup img { width: 92px; }
.welcome-brand .mgv-word { font-size: 1.5rem; }
.welcome-brand .mgv-sub { font-size: .62rem; }
.welcome-org { margin-top: 0; }
/* Sidebar is narrow: stack the mountain above the wordmark */
.sidebar .brand-panel { padding: 16px 14px 14px; }
.sidebar .brand-panel .mgv-lockup { flex-direction: column; align-items: flex-start; gap: 8px; }
.sidebar .brand-panel .mgv-lockup img { width: 64px; }
.sidebar .brand-panel .mgv-word { font-size: 1.06rem; }
.sidebar .brand-panel .mgv-sub { font-size: .47rem; letter-spacing: .15em; }
/* Phones: the sidebar is hidden, so show the logo in a slim navy top bar */
.mobile-brand { display: none; }
@media (max-width: 900px) {
  .mobile-brand { display: flex; align-items: center; justify-content: space-between; background: var(--navy); padding: 10px 16px; position: sticky; top: 0; z-index: 25; }
  .mobile-brand .mgv-lockup img { width: 46px; }
  .mobile-brand .mgv-word { font-size: .95rem; }
  .mobile-brand .mgv-sub { font-size: .44rem; letter-spacing: .16em; }
  .mobile-brand .app-tag { font: 600 .72rem var(--font); color: var(--gold-light); text-align: right; line-height: 1.2; }
}
@media print { .mobile-brand { display: none !important; } }

/* ================= v0.2: Where am I today? ================= */
.nav-sep { margin: 14px 10px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.nav a.nav-add { background: var(--gold); color: var(--navy); font-weight: 700; margin: 4px 0; }
.nav a.nav-add:hover { background: var(--gold-light); color: var(--navy); }
.tabbar a.tab-add { margin-top: -22px; color: var(--ink); font-weight: 700; }
.tab-add-btn { width: 56px; height: 56px; border-radius: 50%; background: var(--gold); color: var(--navy); display: flex; align-items: center; justify-content: center; border: 4px solid var(--bg); box-shadow: 0 6px 16px rgba(7,28,48,.22); }
.tabbar .tab-add-btn svg { width: 28px; height: 28px; stroke-width: 2.4; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 700; }
body.flow-mode .tabbar, body.flow-mode .mobile-brand { display: none; }
body.flow-mode main, body.welcome-mode main { padding: 0 0 32px; max-width: 560px; margin: 0 auto; }
@media (min-width: 901px) { body.flow-mode main { padding-top: 24px; } body.flow-mode .flow, body.flow-mode .picture { border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: var(--bg); } }

.plain-h { font-family: var(--font) !important; font-weight: 700 !important; font-size: 1rem; margin: 0 0 6px; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.home { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.home-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.home-hello { font-size: 1.55rem; margin: 0; }
.streak-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--gold-soft); color: #7a4d08; border-radius: 20px; padding: 6px 11px; font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.streak-chip svg { width: 16px; height: 16px; }
.big-ring { align-self: center; width: 240px; height: 240px; border-radius: 50%; text-decoration: none; display: flex; align-items: center; justify-content: center; margin: 6px 0 2px;
  background: conic-gradient(var(--gold) 0 var(--deg), rgba(231,175,73,.22) var(--deg) 360deg); box-shadow: 0 14px 34px rgba(7,28,48,.28); transition: transform .15s ease; }
.big-ring:hover { transform: scale(1.02); } .big-ring:active { transform: scale(.98); }
.big-ring-inner { width: 218px; height: 218px; border-radius: 50%; background: radial-gradient(120% 120% at 30% 20%, #1b3a57 0%, var(--navy-2) 55%, var(--navy) 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.big-ring-title { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; line-height: 1.12; color: #fffdf9; }
.big-ring-sub { font-size: .8rem; font-weight: 600; color: var(--gold); display: inline-flex; gap: 4px; align-items: center; }
.big-ring-sub svg { width: 15px; height: 15px; stroke-width: 2.4; }
.big-ring:not(.is-done) .big-ring-inner { animation: ringPulse 2.8s ease-in-out infinite; }
@keyframes ringPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(231,175,73,0); } 50% { box-shadow: 0 0 0 8px rgba(231,175,73,.18); } }
@media (prefers-reduced-motion: reduce) { .big-ring:not(.is-done) .big-ring-inner { animation: none; } .big-ring { transition: none; } }
.meter { align-self: center; display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-2); }
.meter-bar { width: 96px; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; display: block; }
.meter-bar > span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.cond-tag { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cond-tag > span { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.cond-tag.good { color: var(--good); } .cond-tag.warn { color: var(--warn); } .cond-tag.bad { color: var(--bad); }
.cond-head { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.25; margin: 4px 0 2px; }
.todo-list, .bill-list, .pm-list, .rules, .more-list, .added-list { list-style: none; margin: 0; padding: 0; }
.todo-list a { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.todo-list li:first-child a { border-top: 0; }
.todo-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gold); flex: none; }
.todo-list a > span:nth-child(2) { flex: 1; }
.todo-pct { font-size: .78rem; color: #7a4d08; background: var(--gold-soft); border-radius: 10px; padding: 2px 8px; }
.todo-list svg { width: 18px; height: 18px; color: var(--ink-3); }
.bill-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.bill-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; }
.bill-ic svg { width: 19px; height: 19px; }
.bill-name { flex: 1; display: flex; flex-direction: column; font-size: .85rem; } .bill-name strong { font-size: .95rem; }

/* Flows: check-in, add, picture */
.flow { display: flex; flex-direction: column; min-height: 100vh; }
@media (min-width: 901px) { .flow { min-height: auto; } }
.flow-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--navy); color: #fffdf9; }
.flow-x { color: #fffdf9; display: flex; padding: 4px; border-radius: 8px; }
.flow-x svg { width: 24px; height: 24px; }
.dots { display: flex; gap: 6px; align-items: center; }
.dots span { width: 8px; height: 8px; border-radius: 4px; background: rgba(255,253,249,.25); }
.dots span.on { width: 24px; background: var(--gold); } .dots span.done { background: var(--gold); }
.flow-kicker { background: var(--navy); color: var(--gold); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 0 20px 16px; }
.flow-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.flow-h { font-size: 1.85rem; line-height: 1.18; margin: 0; }
.btn-big { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; font: 700 1.02rem var(--font); text-decoration: none; cursor: pointer; border: 0; padding: 0 18px; }
.btn-big svg { width: 22px; height: 22px; stroke-width: 2.2; }
.btn-big.primary { background: var(--navy); color: #fffdf9; } .btn-big.primary:hover { background: var(--navy-3); }
.btn-big.gold { background: var(--gold); color: var(--navy); } .btn-big.gold:hover { background: var(--gold-light); }
.btn-big.outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
:root[data-theme="dark"] .btn-big.primary { background: var(--gold); color: var(--navy); }
.center-link { text-align: center; color: var(--ink-2); font-size: .92rem; font-weight: 600; }
.linkish { background: none; border: 0; text-decoration: underline; cursor: pointer; font: inherit; color: var(--ink-2); padding: 6px; }
.fix-card { border: 2px solid var(--gold); display: flex; flex-direction: column; gap: 12px; }
.fix-label { font-weight: 700; font-size: 1rem; }
.big-input { height: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 16px; font: 600 1.6rem var(--serif); color: var(--ink); width: 100%; }
.hintbox { background: var(--gold-soft); border-radius: 12px; padding: 12px; font-size: .92rem; line-height: 1.45; color: #102036; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.added-list li { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 6px; }
.added-list li > span:nth-child(2) { flex: 1; }
.ok-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--good); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.ok-dot svg { width: 16px; height: 16px; stroke-width: 2.6; }

.adder { display: flex; flex-direction: column; gap: 10px; }
.adder-amount { text-align: center; }
.adder-amount output { display: block; font: 600 2.8rem/1.1 var(--serif); color: var(--ink); }
.adder-amount.bank-box { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border: 2px solid var(--gold); border-radius: 18px; padding: 12px 16px; }
.bank-box > svg { width: 28px; height: 28px; color: #8a5a10; }
.bank-box output { font-size: 2.3rem; }
.acct-pick select { border: 0; background: transparent; font: inherit; color: var(--ink-2); text-decoration: underline; padding: 0; min-height: 0; width: auto; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.tiles.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { min-height: 70px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 600 .74rem var(--font); color: var(--ink); cursor: pointer; padding: 6px 2px; }
.tile svg { width: 25px; height: 25px; }
.tile[aria-pressed="true"], .seg3 button[aria-pressed="true"], .chip[aria-pressed="true"], .bill-chip.on .bill-toggle { background: var(--gold-soft); border: 2px solid var(--gold); color: #102036; }
.seg3 { display: flex; gap: 8px; }
.seg3 button { flex: 1; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font: 600 .9rem var(--font); color: var(--ink); cursor: pointer; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.keypad button { height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font: 600 1.4rem var(--font); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.keypad button:active { background: var(--gold-soft); }
.keypad svg { width: 24px; height: 24px; }
.seg-dark { display: flex; background: rgba(255,253,249,.12); border-radius: 12px; padding: 3px; }
.seg-dark a, .seg-dark button { border: 0; border-radius: 9px; background: transparent; color: #fffdf9; font: 600 .9rem var(--font); padding: 8px 14px; text-decoration: none; cursor: pointer; }
.seg-dark [aria-pressed="true"] { background: var(--gold); color: var(--navy); font-weight: 700; }

.pic-head { background: radial-gradient(130% 120% at 85% 0%, #1b3a57 0%, var(--navy-2) 50%, var(--navy) 100%); color: #fffdf9; padding: 14px 20px 22px; }
.pic-top { display: flex; justify-content: space-between; align-items: center; }
.kicker { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; }
.kicker svg { width: 15px; height: 15px; } .kicker.good { color: var(--good); }
.cond-tag.on-dark { margin-top: 14px; background: rgba(255,253,249,.1); border-radius: 20px; padding: 5px 12px; }
.cond-tag.on-dark.good { color: #9fdcb8; } .cond-tag.on-dark.warn { color: var(--gold-light); } .cond-tag.on-dark.bad { color: #f6b3aa; }
.pic-h { color: #fffdf9; font-size: 1.85rem; margin: 10px 0 8px; }
.pic-sum { color: #d9dee6; font-size: .88rem; margin: 0; } .pic-sum strong { color: var(--gold); }
.climb-chip { display: flex; align-items: center; gap: 10px; background: var(--gold-soft); border-radius: 14px; padding: 10px 14px; font-weight: 600; color: #102036; text-decoration: none; font-size: .92rem; }
.climb-chip span { flex: 1; } .climb-chip strong { color: #7a4d08; } .climb-chip svg { width: 22px; height: 22px; color: #8a5a10; }
.pm-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.pm-list li > span:nth-child(2) { flex: 1; }
.pm { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.pm.plus { background: var(--good); } .pm.minus { background: var(--bad); }
.pm-list li:has(.plus) strong { color: var(--good); } .pm-list li:has(.minus) strong { color: var(--bad); }
.picture .meter { align-self: stretch; } .picture .meter-bar { flex: 1; width: auto; }

/* The Climb */
.climb { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.climb-head { background: radial-gradient(130% 120% at 80% 0%, #1b3a57 0%, var(--navy-2) 50%, var(--navy) 100%); border-radius: 22px; padding: 18px 20px 20px; color: #fffdf9; }
.climb-pts { font: 600 1.9rem var(--serif); margin-top: 8px; }
.climb-next { color: #d9dee6; margin: 0 0 14px; }
.levels { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.levels li { display: flex; align-items: center; gap: 12px; }
.lv-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,253,249,.35); flex: none; }
.lv-dot svg { width: 17px; height: 17px; stroke-width: 2.4; }
.levels .done .lv-dot { background: var(--good); border-color: var(--good); color: #fff; }
.levels .here .lv-dot { background: var(--gold); border-color: var(--gold); color: var(--navy); box-shadow: 0 0 0 5px rgba(231,175,73,.3); }
.lv-name { flex: 1; font: 600 1.1rem var(--serif); } .levels .todo .lv-name { color: #c9ced6; }
.lv-tag { font-size: .78rem; font-weight: 700; color: #c9ced6; } .levels .here .lv-tag { color: var(--gold); }
.reward { border: 2px solid var(--gold); display: flex; flex-direction: column; gap: 6px; }
.reward-h { font-size: 1.3rem; margin: 0; }
.rules li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.rules li span { flex: 1; } .rules svg { width: 20px; height: 20px; color: #8a5a10; } .rules strong { color: #7a4d08; }
:root[data-theme="dark"] .rules svg, :root[data-theme="dark"] .rules strong { color: var(--gold); }
.soon { border-style: dashed; }

/* More */
.more-card { padding: 4px 16px; }
.more-list a { display: flex; align-items: center; gap: 14px; padding: 12px 0; color: var(--ink); text-decoration: none; }
.more-list li + li a { border-top: 1px solid var(--line); }
.more-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; }
.more-ic svg { width: 21px; height: 21px; }
.more-t { flex: 1; display: flex; flex-direction: column; } .more-t span { font-size: .84rem; color: var(--ink-2); }
.more-list > li > a > svg { width: 18px; height: 18px; color: var(--ink-3); }

/* Setup */
.setup { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.setup-brand { background: var(--navy); padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; }
.setup-brand .mgv-word { font-size: .95rem; } .setup-brand .mgv-sub { font-size: .44rem; letter-spacing: .16em; }
.setup-brand .app-tag { font: 600 .78rem var(--font); color: var(--gold); }
.setup-steps { display: flex; align-items: center; gap: 6px; padding: 18px 20px 0; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.setup-steps span { margin-right: 6px; }
.setup-steps i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); }
.setup-steps i.on { width: 26px; background: var(--gold); } .setup-steps i.done { background: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; } .chips.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.chip { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font: 600 .92rem var(--font); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.chip-date { position: relative; } .chip-date svg { width: 20px; height: 20px; }
.chip-date input { border: 0; background: transparent; font: inherit; color: var(--ink); width: 130px; min-height: 0; padding: 0; }
.bill-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bill-chip { display: flex; flex-direction: column; gap: 6px; }
.bill-toggle { min-height: 52px; padding: 0 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font: 600 .9rem var(--font); color: var(--ink); display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.bill-toggle svg { width: 20px; height: 20px; flex: none; } .bill-toggle > span:nth-of-type(1) { flex: 1; }
.bill-chip.on .plus { display: none; } .plus svg { color: var(--ink-3); }
.bill-fields { display: grid; grid-template-columns: 1fr; gap: 6px; }
.bill-fields input, .bill-fields select, .other-bill input, .other-bill select { min-height: 42px; border-radius: 10px; }
.other-bill { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; }
.sumline { display: flex; justify-content: space-between; background: var(--surface); border-radius: 14px; padding: 12px 14px; font-size: .92rem; color: var(--ink-2); } .sumline strong { color: var(--ink); }
body.welcome-mode .mobile-brand { display: none; }
[hidden] { display: none !important; }
