/* SaveUp prototype. One light look: warm off-white surfaces, ink text, one teal accent.
   Status colours are reserved for status and risk. Mobile first; on a wide screen the app
   sits in a phone-sized frame so reviewers on a laptop see what a phone user sees. */
:root {
  --bg: #F6F2EC; --page: #E9E2D8; --surface: #FFFFFF; --sunk: #F1ECE4; --line: #E3DCD2;
  --ink: #10233A; --ink-2: #4A596B; --ink-3: #7D8A98;
  --accent: #0E7C73; --accent-deep: #0A605A; --accent-soft: #E1F1EE; --accent-ink: #FFFFFF;
  --ok: #1F8A4D; --ok-soft: #E2F3E8; --warn: #B06F14; --warn-soft: #FBEEDB; --bad: #C13F39; --bad-soft: #FBE4E2;
  --r: 16px; --r-s: 10px; --tap: 48px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

/* frame */
.frame { position: relative; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.screen { flex: 1; padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; }
.screen.in { opacity: 1; transform: none; }
.screen.tabs { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) {
  body { background: var(--page); display: grid; place-items: center; padding: 24px; min-height: 100vh; }
  .frame { width: 400px; height: min(844px, calc(100vh - 48px)); min-height: 0; border-radius: 40px; overflow: hidden; box-shadow: 0 30px 80px rgba(16,35,58,.22), 0 0 0 10px #16202c; }
  .screen { overflow-y: auto; padding-top: 22px; }
  .frame .nav { position: absolute; }
}

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav button { height: 60px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.nav button svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav button.on { color: var(--accent); }

/* header rows */
.top { display: flex; align-items: center; gap: 8px; min-height: var(--tap); margin: 0 0 14px; }
.top h1 { font-size: 22px; font-weight: 700; margin: 0; flex: 1; letter-spacing: -.01em; }
.top .sub { font-size: 14px; color: var(--ink-2); }
.back { width: var(--tap); height: var(--tap); margin-left: -12px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; }
.back svg { width: 24px; height: 24px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.greet { font-size: 15px; color: var(--ink-2); }
.greet b { display: block; color: var(--ink); font-size: 22px; font-weight: 700; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; font-weight: 700; font-size: 15px; }

/* text */
h2 { font-size: 17px; font-weight: 700; margin: 22px 0 10px; }
h2:first-child { margin-top: 0; }
h2 .more { float: right; font-size: 14px; font-weight: 600; }
p { margin: 0 0 10px; color: var(--ink-2); }
p.lead { color: var(--ink); font-size: 17px; }
.muted { color: var(--ink-3); font-size: 13px; }
.small { font-size: 13.5px; }
a, .link { color: var(--accent-deep); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; min-height: 32px; display: inline-flex; align-items: center; gap: 4px; }
.link::after { content: "\2192"; }
.link.plain::after { content: none; }
.center { text-align: center; }

/* cards and rows */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card.tap { width: 100%; text-align: left; display: block; }
.card.tap:active { background: var(--sunk); }
.card.sunk { background: var(--sunk); border-color: transparent; }
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child, .card > .row:first-of-type { border-top: 0; padding-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; }
.row .s { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.row .v { font-weight: 600; text-align: right; white-space: nowrap; }
.row .v .s { font-weight: 500; }
.row.tap { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.row.tap::after { content: "\203A"; color: var(--ink-3); font-size: 22px; line-height: 1; }
.row.tap:active { opacity: .7; }
.ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); flex: none; font-size: 15px; font-weight: 700; }
.ic svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.points .ic svg { width: 16px; height: 16px; }
.empty .ill svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prog .d svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ic.in { background: var(--ok-soft); color: var(--ok); }
.ic.out { background: var(--sunk); color: var(--ink); }
.ic.pend { background: var(--warn-soft); color: var(--warn); }
.ic.bad { background: var(--bad-soft); color: var(--bad); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 15px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--ink-2); }
.kv b { font-weight: 600; text-align: right; }

/* hero balance */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px 18px 16px; margin-bottom: 12px; }
.hero .lbl { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.hero .big { font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0 6px; }
.hero .split { display: flex; gap: 18px; font-size: 14px; color: var(--ink-2); }
.hero .split b { color: var(--ink); font-weight: 600; }
.hero .delta { font-size: 13.5px; color: var(--ok); font-weight: 600; margin-top: 6px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
.actions.one { grid-template-columns: 1fr; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px 18px; border-radius: 14px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.btn:active { background: var(--accent-deep); }
.btn.sec { background: var(--accent-soft); color: var(--accent-deep); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn:disabled { opacity: .45; }
.btn svg { width: 20px; height: 20px; }
.stack { display: grid; gap: 10px; }
.foot { position: sticky; bottom: 0; margin: 16px -16px -24px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }

/* tags */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.acc { background: var(--accent-soft); color: var(--accent-deep); }
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sample { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; z-index: 2; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

/* notices */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--sunk); font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.notice.warn { background: var(--warn-soft); color: #6C4408; }
.notice.bad { background: var(--bad-soft); color: #7A2622; }
.notice.ok { background: var(--ok-soft); color: #134F2C; }
.notice b { color: inherit; }
.notice .link { color: inherit; }
.notice .ni { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: rgba(0,0,0,.08); }

/* strategy cards */
.strat { display: block; width: 100%; text-align: left; }
.strat .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.strat .name { font-weight: 700; font-size: 16.5px; }
.strat .kind { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.strat .est { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 0; }
.strat .est small { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.strat .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--ink-2); margin-top: 10px; }
.strat .meta span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin: 0 6px 2px 0; }
.strat .meta span:first-child::before { content: none; }
ul.risks { margin: 0; padding-left: 18px; color: var(--ink-2); }
ul.risks li { margin: 6px 0; }
.perf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.perf div { background: var(--sunk); border-radius: 10px; padding: 10px; text-align: center; }
.perf b { display: block; font-size: 17px; }
.perf span { font-size: 12px; color: var(--ink-3); }

/* amount input */
.amount { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px 14px; margin-bottom: 12px; }
.amount label { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.amount .field { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.amount .cur { font-size: 30px; font-weight: 700; color: var(--ink-3); }
.amount input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 36px; font-weight: 700; letter-spacing: -.02em; padding: 0; }
.amount input::placeholder { color: var(--line); }
.amount .max { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--accent-deep); }
.amount .hint { font-size: 13.5px; color: var(--ink-2); display: flex; justify-content: space-between; }
.amount .hint.bad { color: var(--bad); }
.chips { display: flex; gap: 8px; margin-top: 10px; }
.chips button { flex: 1; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; font-size: 14.5px; color: var(--ink-2); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* steps and progress */
.steps { display: flex; gap: 6px; margin: 8px 0 18px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--accent); }
.prog { list-style: none; margin: 0; padding: 0; }
.prog li { display: flex; align-items: center; gap: 12px; min-height: 52px; color: var(--ink-3); }
.prog li .d { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; }
.prog li.done { color: var(--ink); }
.prog li.done .d { background: var(--ok); border-color: var(--ok); color: #fff; }
.prog li.now { color: var(--ink); }
.prog li.now .d { border-color: var(--accent); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 28px; font-size: 14.5px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { content: none; }
.timeline li.done::before { background: var(--ok); }
.timeline li.now::before { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.timeline li.bad::before { background: var(--bad); }
.timeline .s { display: block; font-size: 12.5px; color: var(--ink-3); }

/* option tiles (sign in, recovery, network) */
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; min-height: 64px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 10px; }
.opt .ic { background: var(--sunk); }
.opt .grow { flex: 1; min-width: 0; }
.opt .t { display: block; font-weight: 600; }
.opt .s { display: block; font-size: 13px; color: var(--ink-3); }
.opt:disabled { opacity: .55; }
.opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt .tag { flex: none; }

/* QR and address */
.qr { display: grid; place-items: center; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; }
.qr svg { width: 180px; height: 180px; }
.addr { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; color: var(--ink); background: var(--sunk); padding: 10px 12px; border-radius: 10px; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--sunk) 25%, #E7E1D8 37%, var(--sunk) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; height: 16px; margin: 8px 0; }
.skel.big { height: 40px; width: 60%; }
.skel.card { height: 110px; border-radius: var(--r); margin-bottom: 12px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* empty and status screens */
.empty { text-align: center; padding: 26px 16px; color: var(--ink-2); }
.empty .ill { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 22px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-deep); font-size: 30px; }
.status { text-align: center; padding: 48px 8px 24px; }
.status .ill { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; }
.status .ill.ok { background: var(--ok-soft); color: var(--ok); }
.status .ill.bad { background: var(--bad-soft); color: var(--bad); }
.status .ill.pend { background: var(--warn-soft); color: var(--warn); }
.status .ill svg { width: 44px; height: 44px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.status h1 { font-size: 24px; margin: 0 0 8px; }
.status .big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 10px; }

/* welcome */
.welcome { min-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
@media (min-width: 640px) { .welcome { min-height: calc(844px - 46px); } }
.welcome .art { flex: 1; display: grid; place-items: center; min-height: 220px; }
.coin { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4FB3A8, var(--accent) 60%, var(--accent-deep)); box-shadow: 0 24px 50px rgba(14,124,115,.28); display: grid; place-items: center; color: #fff; font-size: 56px; font-weight: 800; letter-spacing: -.04em; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink); }
.logo span { color: var(--accent); }
.welcome h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; }
.points { list-style: none; margin: 0 0 20px; padding: 0; }
.points li { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; color: var(--ink-2); font-size: 15px; }
.points .ic { width: 32px; height: 32px; border-radius: 10px; font-size: 14px; background: var(--accent-soft); color: var(--accent-deep); }

/* faq */
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; padding: 8px 0; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink-3); font-size: 22px; font-weight: 400; }
details[open] summary::after { content: "\2212"; }
details p { padding-bottom: 12px; font-size: 14.5px; }

/* sheet and toast */
.sheet { position: fixed; inset: 0; background: rgba(16,35,58,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet .panel { width: 100%; max-width: 400px; max-height: 86vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .22s ease; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.seg { display: flex; background: var(--sunk); padding: 3px; border-radius: 10px; margin: 6px 0 12px; }
.seg button { flex: 1; min-height: 36px; border: 0; border-radius: 8px; background: none; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.2); white-space: nowrap; }
/* the reviewer's handle: a small tab hanging from the top edge on phones, a side tab beside the frame on a desktop */
.proto { position: fixed; left: 50%; top: 0; transform: translateX(-50%); z-index: 15; border: 0; border-radius: 0 0 8px 8px; padding: 2px 10px 3px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--ink); color: #fff; opacity: .7; }
.proto:hover, .proto:focus-visible { opacity: 1; }
@media (min-width: 640px) { .proto { left: auto; right: calc(50% - 200px - 64px); top: 50%; transform: rotate(-90deg); border-radius: 0 0 8px 8px; padding: 4px 12px 5px; font-size: 11px; opacity: .9; } }
.off { position: sticky; top: -16px; z-index: 3; margin: -16px -16px 12px; padding: 22px 16px 8px; background: var(--bad); color: #fff; font-size: 13px; font-weight: 600; text-align: center; }

/* tabs inside a screen */
.tabs2 { display: flex; gap: 6px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs2 button { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tabs2 button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.day { font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin: 16px 0 4px; }
.plus { color: var(--ok); }
.minus { color: var(--ink); }
.later-tag { position: absolute; top: 14px; right: 14px; }

/* welcome header with the language switch */
.welcome-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.langbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.langbtn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
/* yearly earnings card on Activity, for tax records */
.taxcard { padding: 14px 16px 8px; }
.taxcard .row { padding-top: 0; }
/* a key/value label never wraps; the value takes the second line instead */
.kv span:first-child { white-space: nowrap; }
/* a link inside a sentence flows with the text instead of sitting on a 32px tap box */
p .link.plain { display: inline; min-height: 0; }
/* numeric values in key/value rows never split from their sign */
.kv b.num { white-space: nowrap; }

/* recovery phrase: numbered words in a grid, never split mid-word */
.phrase { list-style: none; counter-reset: w; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0 0; padding: 0; }
.phrase li { counter-increment: w; background: var(--sunk); border-radius: 10px; padding: 9px 8px; font: 600 14px/1.2 ui-monospace, Menlo, Consolas, monospace; color: var(--ink); white-space: nowrap; }   /* never truncate a recovery word */
.phrase li::before { content: counter(w) ". "; color: var(--ink-3); font-weight: 500; }
/* sheets sit above the test-build banner */
.sheet { z-index: 50; }
body.devpad .sheet .panel { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
