/* Monat — tokens and components from the Claude Design file. Hairlines, not cards. */

:root {
  color-scheme: light;
  --bg: #F5F2EC;
  --ink: #1B1916;
  --ink2: #6B665E;
  --ink3: #9A948A;
  --line: rgba(27, 25, 22, 0.14);
  --fill: rgba(27, 25, 22, 0.075);
  --over: oklch(0.54 0.18 32);
  --close: oklch(0.74 0.14 78);
  --c-rent: oklch(0.45 0.035 255);
  --c-groc: oklch(0.60 0.10 145);
  --c-car: oklch(0.55 0.085 235);
  --c-eat: oklch(0.64 0.10 55);
  --c-subs: oklch(0.53 0.085 310);
  --c-health: oklch(0.63 0.08 192);
  --c-misc: oklch(0.62 0.045 80);
  --c-x: oklch(0.56 0.10 355);
  --knob-off: #FFFFFF;
  --seg-shadow: 0 0 0 0.5px var(--line), 0 1px 3px rgba(0, 0, 0, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #000000;
    --ink: #F3F0EA;
    --ink2: #9D978E;
    --ink3: #6E6A63;
    --line: rgba(243, 240, 234, 0.16);
    --fill: rgba(243, 240, 234, 0.11);
    --over: oklch(0.70 0.17 32);
    --close: oklch(0.83 0.13 82);
    --c-rent: oklch(0.74 0.045 255);
    --c-groc: oklch(0.75 0.11 145);
    --c-car: oklch(0.72 0.09 235);
    --c-eat: oklch(0.76 0.10 55);
    --c-subs: oklch(0.72 0.09 310);
    --c-health: oklch(0.77 0.08 192);
    --c-misc: oklch(0.76 0.045 80);
    --c-x: oklch(0.72 0.10 355);
  }
}

* { -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  letter-spacing: -0.2px; user-select: none; -webkit-user-select: none;
}
button { appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer; }
button:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
input, textarea { user-select: text; -webkit-user-select: text; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
h1, h2, p { margin: 0; font: inherit; }

#app { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; overflow: hidden; }
.scroller {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; box-sizing: border-box;
  padding-top: var(--safe-top); padding-bottom: calc(86px + var(--safe-bottom));
  scrollbar-width: none; overscroll-behavior-x: none;
}
.scroller::-webkit-scrollbar { display: none; }
.pad { padding: 0 20px; }

/* Type */
.large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.8px; }
.title2 { font-size: 28px; font-weight: 700; letter-spacing: -0.6px; }
.body { font-size: 17px; line-height: 1.4; text-wrap: pretty; }
.callout { font-size: 15px; color: var(--ink2); }
.foot { font-size: 13px; color: var(--ink2); line-height: 1.4; }
.label { font-size: 13px; color: var(--ink2); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0; }
.cents { color: var(--ink3); font-weight: 500; }
.ink2 { color: var(--ink2); }
.ink3 { color: var(--ink3); }

/* Navigation */
.nav { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 8px; }
.back { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px 0 4px; font-size: 17px; }
.nav-btn { height: 44px; display: flex; align-items: center; padding: 0 12px; font-size: 17px; }

/* Section headers */
.section { display: flex; align-items: baseline; justify-content: space-between; margin-top: 30px; padding-bottom: 6px; border-bottom: 0.5px solid var(--line); }
.section h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.section .aside { font-size: 13px; color: var(--ink2); display: flex; gap: 12px; }
.caps { font-size: 13px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ink2); margin-top: 32px; padding-bottom: 6px; border-bottom: 0.5px solid var(--line); }
.group-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 0.5px solid var(--line); font-size: 15px; font-weight: 600; }
.group-head span + span { font-size: 13px; color: var(--ink2); font-weight: 400; }

/* Rows */
.kv { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 50px; border-bottom: 0.5px solid var(--line); font-size: 17px; width: 100%; }
.kv > :last-child { font-size: 15px; color: var(--ink2); text-align: right; }
.cat-row { display: block; width: 100%; padding: 13px 0 15px; border-bottom: 0.5px solid var(--line); }
.grid-row { display: grid; grid-template-columns: 28px 1fr auto; column-gap: 12px; align-items: center; }
.cat-row .name { font-size: 17px; font-weight: 500; }
.cat-row .note { display: flex; align-items: center; gap: 5px; font-size: 13px; margin-top: 1px; }
.cat-row .fig { text-align: right; }
.cat-row .fig .e { font-size: 17px; font-weight: 600; }
.cat-row .fig .c { font-size: 13px; font-weight: 500; color: var(--ink2); }
.tx-row { display: grid; grid-template-columns: 28px 1fr auto; column-gap: 12px; align-items: center; min-height: 58px; border-bottom: 0.5px solid var(--line); width: 100%; }
.tx-row.plain { grid-template-columns: 1fr auto; min-height: 56px; }
.tx-row .m { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-row .sub { font-size: 13px; color: var(--ink2); margin-top: 1px; }
.amt .e { font-size: 17px; font-weight: 500; }
.amt .c { font-size: 13px; color: var(--ink2); }

/* Progress bar with threshold notch and overspend lap */
.bar { position: relative; height: 5px; margin: 11px 0 0 40px; }
.bar > i { position: absolute; display: block; }
.bar .track { inset: 0; border-radius: 3px; background: var(--fill); box-sizing: border-box; }
.bar .track.due { background: transparent; border: 1px dashed var(--ink3); }
.bar .fill { left: 0; top: 0; bottom: 0; border-radius: 3px; }
.bar .tick { top: -1px; bottom: -1px; width: 2px; background: var(--bg); }
.bar .lap { left: 0; top: -6px; height: 3px; border-radius: 2px; background: var(--over); }

/* Controls */
.toggle { width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; flex: none; transition: background .2s; }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: var(--knob-off); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform .2s; }
.toggle[aria-checked="true"] { background: var(--ink); }
.toggle[aria-checked="true"] .knob { background: var(--bg); transform: translateX(20px); }
.seg { position: relative; display: grid; height: 44px; align-items: center; margin-top: 6px; }
.seg::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; bottom: 6px; border-radius: 9px; background: var(--fill); }
.seg button { position: relative; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 2px; }
.seg button span { width: 100%; text-align: center; padding: 5px 0; border-radius: 7px; font-size: 15px; }
.seg button[aria-pressed="true"] span { font-weight: 600; background: var(--bg); box-shadow: var(--seg-shadow); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 8px 0; box-sizing: border-box; border-bottom: 0.5px solid var(--line); }
.switch-row .t { font-size: 17px; }
.switch-row .s { font-size: 13px; color: var(--ink2); margin-top: 2px; line-height: 1.35; text-wrap: pretty; }
.chip { height: 44px; display: flex; align-items: center; flex: none; }
.chip span { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; font-size: 15px; white-space: nowrap; box-shadow: inset 0 0 0 0.5px var(--line); }
.chip[aria-pressed="true"] span { background: var(--ink); color: var(--bg); }
.chip .count { font-size: 13px; opacity: 0.7; }
.primary { margin-top: 14px; width: 100%; height: 50px; border-radius: 12px; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 600; }
.primary:disabled { background: var(--fill); color: var(--ink2); cursor: default; }
.stepper { display: flex; align-items: center; }
.stepper button { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--ink2); }
.dashed { border-radius: 50%; border: 1.5px dashed var(--ink3); box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.inbox-link { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; border-top: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line); }

/* Charts scale with the column; the design draws them at 353 pt. */
.chart { display: block; width: 100%; height: auto; font-family: inherit; }

/* Chrome */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(49px + var(--safe-bottom)); background: var(--bg); border-top: 0.5px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 4; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 7px; height: 49px; box-sizing: border-box; color: var(--ink3); position: relative; }
.tabbar button[aria-current="page"] { color: var(--ink); }
.tabbar .tl { font-size: 10px; font-weight: 600; letter-spacing: 0.1px; }
.badge { position: absolute; top: 2px; left: 50%; margin-left: 7px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-sizing: border-box; border: 1.5px solid var(--bg); }
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(61px + var(--safe-bottom)); z-index: 7; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 4px 6px 4px 16px; display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; line-height: 1.3; animation: rise .25s cubic-bezier(.2, .8, .2, 1); }
.toast span { flex: 1; padding: 8px 0; }
.toast button { height: 44px; display: flex; align-items: center; padding: 0 10px; font-weight: 600; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--fill); border-top-color: var(--ink); box-sizing: border-box; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 32px; text-align: center; font-size: 15px; color: var(--ink2); line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
