/* Finance web UI: a minimal port of protos/c. System fonts, one serif for the headline amount. */

@font-face {
  font-family: "Source Serif 4 Subhead";
  src: url("/static/fonts/SourceSerif4Subhead-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b0b0c; --muted: #7c8286; --faint: #a9aeb1; --line: #eceeee;
  --canvas: #f1f3f3; --card: #fff; --tile: #eef0f0; --press: #e4e7e7;
  --ok: #2fae6b; --warn: #e9a23b;
  --serif: "Source Serif 4 Subhead", ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum";
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.view { position: relative; max-width: 440px; margin: 0 auto; padding: 14px 18px 150px; }

/* ── theme: colour washes behind the headline. Unsettled; swap or delete freely. ── */
.wash { position: absolute; inset: 0 0 auto 0; height: 440px; pointer-events: none; opacity: 0;
  -webkit-mask-image: linear-gradient(#000 20%, transparent); mask-image: linear-gradient(#000 20%, transparent); }
.tab-expenses .wash { opacity: .85; background: radial-gradient(110% 70% at 15% 0%, #ffd3bd, transparent 62%), radial-gradient(100% 75% at 95% 0%, #ffd9ee, transparent 60%); }
.tab-investments .wash { opacity: .85; background: radial-gradient(110% 70% at 15% 0%, #c6efd9, transparent 62%), radial-gradient(100% 75% at 95% 0%, #cfe2ff, transparent 60%); }
/* ── end theme ── */

.head { padding: 0 6px; text-align: center; }
.label { font-size: 15px; color: var(--muted); font-weight: 450; margin-top: 52px; }
.big { font-family: var(--serif); font-weight: 600; font-size: 42px; line-height: 1.05; letter-spacing: -0.02em;
  font-feature-settings: "lnum", "tnum"; margin-top: 12px; }
.big.sm { font-size: 38px; }
.sub { font-size: 14px; color: var(--muted); margin-top: 12px; line-height: 1.4; }

.seg { display: flex; gap: 4px; margin: 52px 0 14px; padding: 4px; border-radius: 14px; background: var(--press); }
.seg a { flex: 1; text-align: center; font-size: 14px; font-weight: 550; padding: 9px 0; border-radius: 10px; color: var(--muted); }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.card { background: var(--card); border-radius: 22px; padding: 4px 0; overflow: hidden; }
.gap { height: 44px; }
.empty { text-align: center; color: var(--muted); font-size: 14px; margin: 32px 0; }

.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; position: relative; width: 100%;
  border: 0; background: none; text-align: left; }
.row + .row::before, form + .row::before, .row + form .row::before { content: ""; position: absolute; top: 0; left: 74px; right: 0; height: 1px; background: var(--line); }
a.row:active, button.row:active { background: var(--canvas); }
.row .ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--tile); color: #4b5054;
  display: grid; place-items: center; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.row .ic.tint { background: hsl(var(--h) 85% 95%); color: hsl(var(--h) 62% 44%); }
.row .ic.day { display: flex; flex-direction: column; overflow: hidden; color: var(--ink);
  background: linear-gradient(#fff 30%, #f1f2f3); border-radius: 10px; width: 40px; height: 40px; margin: 0 2px;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.08), 0 4px 8px -3px rgba(0,0,0,.16); }
.row .ic.day small { flex: none; width: 100%; height: 13px; line-height: 13.5px; text-align: center; font-size: 8px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: #f0463c; border-bottom: .5px solid rgba(0,0,0,.07); }
.row .ic.day b { flex: 1; display: grid; place-items: center; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; padding-bottom: 1px; }
.row .ic.day.today small { color: #fff; background: linear-gradient(#ff5a50, #ee3b31); }
.row .l { min-width: 0; flex: 1; display: block; }
.row .n { display: block; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .m { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .a { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; }
.row .chev { flex: none; display: grid; margin-left: -4px; }

.back { display: grid; place-items: center; width: 44px; height: 44px; margin: 8px 0 -36px; border-radius: 13px; background: var(--press); }
.back:active { opacity: .6; }

.alloc { display: flex; gap: 3px; height: 8px; margin: 32px 40px 0; }
.alloc i { border-radius: 4px; background: var(--ink); }
.alloc i:nth-child(2) { opacity: .45; } .alloc i:nth-child(3) { opacity: .2; } .alloc i:nth-child(n+4) { opacity: .1; }

/* ── tab bar ── */
.tabs { position: fixed; inset: auto 0 0 0; z-index: 5; padding: 28px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(241,243,243,0), var(--canvas) 45%); }
.tabs-in { display: flex; max-width: 400px; margin: 0 auto; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; color: var(--faint); }
.tabs .g { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.tabs a.on { color: var(--ink); }
.tabs a.on .g { background: var(--ink); color: #fff; }

/* ── account ── */
.who .avatar { display: grid; place-items: center; width: 56px; height: 56px; margin: 24px auto 12px; border-radius: 50%;
  background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: 24px; font-weight: 600; }
.sec { margin: 24px 6px 8px; font-size: 13px; font-weight: 550; color: var(--muted); }
.val { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 450; color: var(--muted); }
.dot { display: block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.dot.warn { background: var(--warn); }
.acct .card { border-radius: 18px; padding: 2px 0; }
.acct .row { padding: 11px 16px; gap: 12px; min-height: 46px; cursor: default; }
.acct button.row { cursor: pointer; }
.acct .row + .row::before, .acct form + .row::before, .acct .row + form .row::before { left: 52px; }
.acct .row .ic { width: 24px; height: 24px; border-radius: 0; background: none; color: var(--ink); }
.acct .row .n { font-size: 15px; }
.acct .row .m { font-size: 12.5px; margin-top: 1px; white-space: normal; overflow-wrap: anywhere; }
.acct form { margin: 0; position: relative; }
.signout { --h: 4; }
.signout .n, .signout .ic { color: hsl(var(--h) 62% 44%); }
.copy { display: block; min-width: 64px; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--tile);
  font-size: 13px; font-weight: 550; cursor: pointer; }
.copy:active { background: var(--press); }
.copy.done { color: var(--muted); }

/* ── sign in ── */
.signin { padding-top: 40px; }
.btn { display: block; width: 100%; padding: 15px 18px; border: 0; border-radius: 14px; background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 550; cursor: pointer; }
.btn:disabled { opacity: .5; }
.claim { display: grid; gap: 14px; }
.claim label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--muted); }
.claim input { font: inherit; font-size: 16px; color: var(--ink); padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.msg { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px; }
.msg.err { color: hsl(4 62% 44%); }
