/* ==========================================================================
   PTL Finance — monochrome design system
   ========================================================================== */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --r-xs: 8px; --r-sm: 12px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
  --pad: 22px; --gap: 16px;
  --sb-w: 268px;
  /* Capacitor injects --safe-area-inset-* on Android; browsers use env(). */
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));

  /* Light */
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #e9e9ec;
  --border: #e6e6e9;
  --border-2: #d6d6db;
  --text: #0a0a0b;
  --text-2: #52525b;
  --text-3: #9b9ba3;
  --ink: #0a0a0b;
  --ink-soft: #18181b;
  --on-ink: #fafafa;
  --on-ink-2: #a1a1aa;
  --on-ink-line: rgba(255, 255, 255, .1);
  --scrim: rgba(9, 9, 11, .32);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px -12px rgba(0, 0, 0, .10);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .30), 0 0 0 1px rgba(0, 0, 0, .04);
  --glow: rgba(0, 0, 0, .045);
  --c1: #0a0a0b; --c2: #3f3f46; --c3: #71717a; --c4: #a1a1aa; --c5: #c9c9ce; --c6: #e4e4e7;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #09090b; --surface: #111113; --surface-2: #18181b; --surface-3: #232327;
  --border: #212125; --border-2: #2f2f34;
  --text: #f4f4f5; --text-2: #a1a1aa; --text-3: #5f5f68;
  --ink: #f4f4f5; --ink-soft: #e4e4e7; --on-ink: #09090b; --on-ink-2: #52525b; --on-ink-line: rgba(0, 0, 0, .1);
  --scrim: rgba(0, 0, 0, .6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .06);
  --glow: rgba(255, 255, 255, .05);
  --c1: #fafafa; --c2: #d4d4d8; --c3: #a1a1aa; --c4: #71717a; --c5: #52525b; --c6: #3a3a40;
  color-scheme: dark;
}

[data-theme="graphite"] {
  --bg: #1a1b1e; --surface: #222327; --surface-2: #2a2b30; --surface-3: #34353b;
  --border: #2e2f34; --border-2: #3b3c43;
  --text: #ededef; --text-2: #a6a7ae; --text-3: #6c6d75;
  --ink: #ededef; --ink-soft: #dcdce0; --on-ink: #1a1b1e; --on-ink-2: #5d5e66; --on-ink-line: rgba(0, 0, 0, .1);
  --scrim: rgba(0, 0, 0, .55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  --glow: rgba(255, 255, 255, .05);
  --c1: #f4f4f5; --c2: #cfcfd4; --c3: #a6a7ae; --c4: #7a7b83; --c5: #585960; --c6: #404147;
  color-scheme: dark;
}

[data-theme="midnight"] {
  --bg: #000000; --surface: #0a0a0a; --surface-2: #121212; --surface-3: #1c1c1c;
  --border: #1a1a1a; --border-2: #282828;
  --text: #fafafa; --text-2: #9a9a9a; --text-3: #565656;
  --ink: #fafafa; --ink-soft: #e5e5e5; --on-ink: #000000; --on-ink-2: #555555; --on-ink-line: rgba(0, 0, 0, .1);
  --scrim: rgba(0, 0, 0, .7);
  --shadow-sm: none; --shadow: 0 0 0 1px #1a1a1a; --shadow-lg: 0 0 0 1px #262626, 0 30px 80px -20px #000;
  --glow: rgba(255, 255, 255, .06);
  --c1: #fafafa; --c2: #cfcfcf; --c3: #9a9a9a; --c4: #6e6e6e; --c5: #4a4a4a; --c6: #2e2e2e;
  color-scheme: dark;
}

[data-radius="sharp"] { --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-lg: 10px; --r-xl: 12px; }
[data-radius="soft"]  { --r-xs: 10px; --r-sm: 16px; --r: 22px; --r-lg: 28px; --r-xl: 34px; }
[data-density="compact"] { --pad: 16px; --gap: 12px; }
html[data-font="sm"] { font-size: 14px; }
html[data-font="md"] { font-size: 15px; }
html[data-font="lg"] { font-size: 16.5px; }

[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1rem; line-height: 1.45; letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  transition: background-color .4s var(--ease), color .4s var(--ease);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
.num, .amt { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11"; }
.spacer { flex: 1; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

.ic { width: 1.2em; height: 1.2em; flex: none; display: block; }
.ic-slot { display: inline-flex; }

/* Boot splash */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity .4s var(--ease); }
.boot.out { opacity: 0; pointer-events: none; }
.boot-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--text); animation: pulse 1.2s var(--ease) infinite; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns .45s var(--ease-out); }
.app.collapsed { --sb-w: 84px; }
.app.entering { animation: appIn .7s var(--ease-out) both; }

.main { min-width: 0; display: flex; flex-direction: column; }
.view { padding: 8px clamp(16px, 3.2vw, 40px) calc(48px + var(--sab)); max-width: 1320px; width: 100%; margin: 0 auto; }
.view.enter > * { animation: fadeUp .55s var(--ease-out) both; }
.view.enter > *:nth-child(2) { animation-delay: .05s; }
.view.enter > *:nth-child(3) { animation-delay: .1s; }
.view.enter > *:nth-child(4) { animation-delay: .15s; }
.view.enter > *:nth-child(5) { animation-delay: .2s; }

/* Re-renders after a data change stay still (no replayed entrance animations). */
.view.still *:not(.orb):not(.dot):not(.empty-ic), .view.still *::before { animation: none !important; }
.view.still .spark .line { stroke-dashoffset: 0; }
.view.still .spark .area, .view.still .spark .end { opacity: 1; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px;
  padding: calc(18px + var(--sat)) 14px calc(16px + var(--sab));
  background: var(--surface); border-right: 1px solid var(--border);
  overflow: hidden; z-index: 30;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), transform .45s var(--ease-out);
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px; min-height: 40px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; flex: none; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .5s var(--spring); }
.logo span { width: 14px; height: 14px; border: 2.5px solid var(--on-ink); border-radius: 50%; border-right-color: transparent; transform: rotate(-45deg); }
.brand:hover .logo { transform: rotate(-8deg) scale(1.05); }
.brand-name { font-weight: 650; font-size: 1.02rem; letter-spacing: -.02em; white-space: nowrap; }
.sb-collapse .ic { transition: transform .4s var(--ease-out); }
.collapsed .sb-collapse .ic { transform: rotate(180deg); }

.sb-add { width: 100%; justify-content: flex-start; padding-inline: 14px; height: 44px; }
.sb-nav { position: relative; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
.sb-label { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 16px 12px 6px; white-space: nowrap; transition: opacity .3s; }
.nav-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; white-space: nowrap;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.nav-item .ic { width: 20px; height: 20px; transition: transform .35s var(--spring); }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item:hover .ic { transform: scale(1.08); }
.nav-item.active { color: var(--on-ink); background: transparent; }
.sb-indicator {
  position: absolute; left: 4px; right: 4px; top: 0; height: 42px; border-radius: var(--r-sm);
  background: var(--ink); box-shadow: var(--shadow); opacity: 0; z-index: 0;
  transition: transform .5s var(--ease-out), opacity .3s, height .3s, background-color .4s;
}
.sb-indicator.ready { opacity: 1; }

.sb-foot { display: flex; flex-direction: column; gap: 10px; }
.sb-privacy {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-2); font-size: .86rem; font-weight: 500; white-space: nowrap;
  transition: background-color .25s, color .25s;
}
.sb-privacy:hover { color: var(--text); background: var(--surface-3); }
.sb-privacy .state { margin-left: auto; font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px 2px; border-top: 1px solid var(--border); padding-top: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; font-size: .85rem; flex: none; }
.sb-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-user-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-sub { font-size: .75rem; color: var(--text-3); }

.collapsed .lbl, .collapsed .brand-name, .collapsed .sb-user-meta, .collapsed .sb-privacy .state, .collapsed .sb-privacy .lbl { opacity: 0; pointer-events: none; width: 0; overflow: hidden; }
.collapsed .sb-label { opacity: 0; height: 18px; padding: 0; }
.collapsed .sb-head { flex-direction: column; }
.collapsed .sb-add { justify-content: center; padding: 0; }
.collapsed .nav-item, .collapsed .sb-privacy { justify-content: center; padding: 0; gap: 0; }
.collapsed .sb-user { flex-direction: column; }
.lbl { transition: opacity .25s var(--ease); }

.sb-scrim { display: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: calc(14px + var(--sat)) clamp(16px, 3.2vw, 40px) 14px; max-width: 1320px; width: 100%; margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.tb-title { flex: 1; min-width: 0; }
.tb-title h1 { font-size: 1.55rem; font-weight: 650; letter-spacing: -.035em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title p { color: var(--text-3); font-size: .85rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title.swap h1, .tb-title.swap p { animation: titleIn .5s var(--ease-out) both; }
.tb-actions { display: flex; align-items: center; gap: 8px; }
.only-mobile { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  --h: 40px; position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: var(--r-sm); font-weight: 550; font-size: .92rem; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .25s var(--ease), color .25s, box-shadow .25s, opacity .2s, border-color .25s;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.97); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--ink-soft); box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--border-2); background: var(--surface-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); }
.btn-danger:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-lg { --h: 50px; padding: 0 22px; font-size: 1rem; border-radius: var(--r); }
.btn-sm { --h: 32px; padding: 0 12px; font-size: .82rem; border-radius: var(--r-xs); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  position: relative; overflow: hidden; width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center;
  border-radius: var(--r-sm); color: var(--text-2); transition: background-color .25s, color .25s, transform .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn.bordered { border: 1px solid var(--border); background: var(--surface); }

.link-btn { color: var(--text-2); font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; transition: color .2s, gap .25s var(--ease); }
.link-btn:hover { color: var(--text); gap: 7px; }
.link-btn .ic { width: 16px; height: 16px; }

.ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); background: currentColor; opacity: .18; animation: ripple .6s var(--ease-out) forwards; }

/* ---------- Cards ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--pad); box-shadow: var(--shadow-sm);
  transition: background-color .4s var(--ease), border-color .4s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
}
.card.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
  transition: opacity .35s;
}
.card.spot:hover::before { opacity: 1; }
.card.lift:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-weight: 600; font-size: .98rem; letter-spacing: -.015em; }
.card-sub { color: var(--text-3); font-size: .8rem; margin-top: 2px; }

.grid { display: grid; gap: var(--gap); }
.mt { margin-top: var(--gap); }

/* ---------- Dashboard ---------- */
.dash-hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gap); }
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: calc(var(--pad) + 6px);
  background: var(--ink); color: var(--on-ink); min-height: 300px; display: flex; flex-direction: column;
  box-shadow: var(--shadow); isolation: isolate;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .6; pointer-events: none;
  background-image: linear-gradient(var(--on-ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--on-ink-line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse at 85% 0%, #000 0%, transparent 65%); mask-image: radial-gradient(ellipse at 85% 0%, #000 0%, transparent 65%);
}
.hero .orb { position: absolute; z-index: -1; width: 340px; height: 340px; right: -120px; top: -160px; border-radius: 50%; background: var(--on-ink); opacity: .07; filter: blur(30px); animation: drift 14s ease-in-out infinite alternate; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--on-ink-2); font-weight: 500; }
.hero-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--on-ink); animation: pulse 2.4s ease-in-out infinite; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--on-ink) 18%, transparent); color: var(--on-ink); font-size: .8rem; font-weight: 500;
  background: color-mix(in srgb, var(--on-ink) 6%, transparent); transition: background-color .25s, transform .2s;
}
.chip-btn:hover { background: color-mix(in srgb, var(--on-ink) 14%, transparent); }
.chip-btn:active { transform: scale(.96); }
.chip-btn .ic { width: 15px; height: 15px; }
.hero-amount { font-size: clamp(2.3rem, 5.2vw, 3.6rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.05; margin-top: 22px; }
.hero-delta { margin-top: 10px; font-size: .86rem; color: var(--on-ink-2); display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: color-mix(in srgb, var(--on-ink) 10%, transparent); color: var(--on-ink); }
.pill .ic { width: 13px; height: 13px; }
.spark { margin: 18px -6px 0; height: 82px; flex: 1; min-height: 70px; color: var(--on-ink); }
.spark svg { width: 100%; height: 100%; overflow: visible; }
.spark .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.4s var(--ease-out) .15s forwards; }
.spark .area { fill: url(#sparkFill); opacity: 0; animation: fadeIn 1s var(--ease) .6s forwards; }
.spark .end { fill: currentColor; opacity: 0; animation: popIn .5s var(--spring) 1.3s forwards; transform-box: fill-box; transform-origin: center; }
.hero-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--on-ink-line); }
.hero-stat .k { font-size: .78rem; color: var(--on-ink-2); display: flex; align-items: center; gap: 6px; }
.hero-stat .k .ic { width: 14px; height: 14px; }
.hero-stat .v { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; margin-top: 3px; }

.reveal-overlay {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; color: var(--on-ink);
  background: color-mix(in srgb, var(--ink) 35%, transparent); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s;
}
.hero:hover .reveal-overlay, .reveal-overlay:focus-visible { opacity: 1; }
.reveal-cta { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 99px; background: var(--on-ink); color: var(--ink); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); transform: translateY(6px); transition: transform .35s var(--spring); }
.hero:hover .reveal-cta { transform: none; }
.reveal-cta .ic { width: 18px; height: 18px; }

.side-stack { display: grid; gap: var(--gap); grid-template-rows: 1fr 1fr; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-k { color: var(--text-2); font-size: .85rem; font-weight: 500; }
.stat-ic { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.stat-ic .ic { width: 18px; height: 18px; }
.stat-v { font-size: 1.85rem; font-weight: 650; letter-spacing: -.04em; line-height: 1.1; margin-top: auto; }
.stat-s { color: var(--text-3); font-size: .8rem; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--gap); margin-top: var(--gap); }

/* Masked amounts */
.amt.masked { letter-spacing: .12em; color: inherit; opacity: .9; }
.sensitive { transition: filter .6s var(--ease), opacity .6s var(--ease); }
body.masked .sensitive { filter: blur(9px) grayscale(1); opacity: .45; pointer-events: none; }
.amt.revealing { animation: unblur .7s var(--ease-out) both; }

/* ---------- Progress & budgets ---------- */
.bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit; background: var(--text); transform-origin: left; animation: grow 1.1s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms + .1s); }
.bar.warn > i { background: var(--text-2); }
.bar.over > i { background: repeating-linear-gradient(-45deg, var(--text) 0 6px, var(--text-2) 6px 12px); }
.bar.thin { height: 6px; }
.bar.on-ink { background: color-mix(in srgb, var(--on-ink) 15%, transparent); }
.bar.on-ink > i { background: var(--on-ink); }

.b-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); animation: fadeUp .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.b-row:first-child { border-top: 0; padding-top: 2px; }
.b-name { font-weight: 550; font-size: .92rem; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.b-meta { font-size: .78rem; color: var(--text-3); font-weight: 450; }
.b-left { text-align: right; }
.b-left .v { font-weight: 650; font-size: .98rem; letter-spacing: -.02em; }
.b-left .k { font-size: .72rem; color: var(--text-3); }

.cat-ic { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none; transition: transform .35s var(--spring), background-color .3s; }
.cat-ic .ic { width: 19px; height: 19px; }

.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.budget-card { cursor: pointer; text-align: left; width: 100%; display: flex; flex-direction: column; gap: 14px; animation: fadeUp .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.budget-card:hover .cat-ic { transform: rotate(-6deg) scale(1.06); }
.bc-top { display: flex; align-items: center; gap: 12px; }
.bc-name { font-weight: 600; flex: 1; min-width: 0; }
.bc-name small { display: block; color: var(--text-3); font-weight: 450; font-size: .78rem; margin-top: 1px; }
.bc-pct { font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.bc-pct.over { background: var(--text); color: var(--bg); }
.bc-left { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bc-left .v { font-size: 1.6rem; font-weight: 650; letter-spacing: -.04em; }
.bc-left .k { color: var(--text-3); font-size: .82rem; }
.bc-foot { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-2); }
.add-card { border-style: dashed; background: transparent; box-shadow: none; display: grid; place-items: center; min-height: 190px; color: var(--text-2); gap: 10px; text-align: center; }
.add-card:hover { color: var(--text); border-color: var(--border-2); background: var(--surface); }
.add-card .cat-ic { margin: 0 auto 8px; }

.summary-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.summary-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.ring { width: 132px; height: 132px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .val { stroke: var(--text); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease-out); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .center b { font-size: 1.5rem; font-weight: 650; letter-spacing: -.04em; display: block; }
.ring .center > div > span { font-size: .72rem; color: var(--text-3); }
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.kv .k { font-size: .8rem; color: var(--text-3); }
.kv .v { font-size: 1.35rem; font-weight: 650; letter-spacing: -.035em; margin-top: 4px; }

/* Donut */
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; }
.donut { width: 170px; height: 170px; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut circle.seg { fill: none; stroke-width: 4.6; animation: segIn 1.1s var(--ease-out) both; animation-delay: calc(var(--i) * 80ms); transition: stroke-width .25s var(--ease); cursor: pointer; }
.donut circle.seg:hover { stroke-width: 5.8; }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut .center b { font-size: 1.15rem; font-weight: 650; letter-spacing: -.03em; display: block; }
.donut .center > div > span { font-size: .72rem; color: var(--text-3); }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; font-size: .86rem; animation: fadeUp .5s var(--ease-out) both; animation-delay: calc(var(--i) * 50ms + .2s); }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend-row .p { color: var(--text-3); font-size: .78rem; font-variant-numeric: tabular-nums; }

/* ---------- Transactions ---------- */
.tx-list { display: flex; flex-direction: column; }
.tx {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 10px 10px; margin: 0 -10px; width: calc(100% + 20px); border-radius: var(--r);
  transition: background-color .2s var(--ease), transform .2s var(--ease);
  animation: fadeUp .45s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 14) * 35ms);
}
.tx:hover { background: var(--surface-2); }
.tx:hover .cat-ic { transform: scale(1.06); background: var(--surface); }
.tx:active { transform: scale(.995); }
.tx-main { min-width: 0; display: flex; flex-direction: column; }
.tx-title { font-weight: 550; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: .78rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-weight: 600; font-size: .95rem; letter-spacing: -.015em; white-space: nowrap; }
.tx-amt.expense { color: var(--text-2); }
.tx-amt.income { color: var(--text); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0 6px; font-size: .78rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.day-head:first-child { padding-top: 0; }
.day-head .amt { text-transform: none; letter-spacing: 0; font-weight: 500; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: var(--gap); }
.search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 40px; }

.month-sw { display: inline-flex; align-items: center; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); }
.month-sw .icon-btn { width: 32px; height: 32px; border-radius: var(--r-xs); }
.month-sw .icon-btn .ic { width: 16px; height: 16px; }
.month-sw span { min-width: 128px; text-align: center; font-weight: 600; font-size: .88rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--gap); }

.share-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); animation: fadeUp .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.share-row:first-child { border-top: 0; padding-top: 0; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 42px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-bottom: 8px; animation: float 4s ease-in-out infinite; }
.empty-ic .ic { width: 26px; height: 26px; }
.empty h3 { font-size: 1rem; font-weight: 600; }
.empty p { color: var(--text-3); font-size: .88rem; max-width: 320px; }
.empty .btn { margin-top: 10px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: .8rem; font-weight: 550; color: var(--text-2); }
.hint { font-size: .78rem; color: var(--text-3); }
.input, .select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border-2);
  outline: none; transition: border-color .2s, box-shadow .2s, background-color .3s; -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { border-color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 8%, transparent); }
.select { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
input[type="date"].input { padding-right: 10px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.amount-field { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 18px 10px 8px; border-bottom: 1px solid var(--border); transition: border-color .25s; }
.amount-field:focus-within { border-color: var(--text); }
.amount-field .cur { font-size: 1.6rem; font-weight: 600; color: var(--text-3); }
.amount-field input { field-sizing: content; min-width: 4ch; border: 0; outline: 0; background: transparent; font-size: 2.8rem; font-weight: 650; letter-spacing: -.045em; width: 100%; max-width: 280px; text-align: center; font-variant-numeric: tabular-nums; padding: 0; }
.amount-field input::placeholder { color: var(--text-3); }

/* Segmented */
.seg { --n: 2; --idx: 0; position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); padding: 4px; background: var(--surface-2); border-radius: var(--r-sm); border: 1px solid var(--border); isolation: isolate; }
.seg button { position: relative; z-index: 1; height: 34px; border-radius: calc(var(--r-sm) - 4px); font-size: .86rem; font-weight: 550; color: var(--text-2); transition: color .3s var(--ease); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; padding: 0 10px; }
.seg button .ic { width: 16px; height: 16px; }
.seg button.on { color: var(--text); }
.seg .seg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: calc(var(--r-sm) - 4px); background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); transform: translateX(calc(100% * var(--idx))); transition: transform .45s var(--ease-out); }
.seg.seg-ink .seg-thumb { background: var(--ink); box-shadow: var(--shadow); }
.seg.seg-ink button.on { color: var(--on-ink); }
.seg.seg-lg button { height: 40px; }

/* Chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: .84rem; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: all .25s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip .count { font-size: .72rem; opacity: .7; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.cat-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); font-size: .76rem; font-weight: 500; color: var(--text-2); text-align: center; transition: all .25s var(--ease); animation: popIn .35s var(--spring) both; animation-delay: calc(var(--i) * 25ms); }
.cat-opt span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cat-opt .cat-ic { width: 36px; height: 36px; }
.cat-opt:hover { border-color: var(--border-2); color: var(--text); }
.cat-opt.on { border-color: var(--text); color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.cat-opt.on .cat-ic { background: var(--ink); color: var(--on-ink); }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-opt { height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-2); transition: all .2s var(--ease); }
.icon-opt:hover { color: var(--text); border-color: var(--border-2); }
.icon-opt.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); transform: scale(1.04); }
.icon-opt .ic { width: 19px; height: 19px; }

/* Switch */
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); transition: background-color .3s var(--ease), border-color .3s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .4s var(--spring), width .2s; }
.switch input:checked ~ .track { background: var(--ink); border-color: var(--ink); }
.switch input:checked ~ .knob { transform: translateX(18px); background: var(--on-ink); }
.switch input:active ~ .knob { width: 26px; }
.switch input:checked:active ~ .knob { transform: translateX(14px); }
.switch input:focus-visible ~ .track { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(16px, 3vw, 36px); align-items: start; }
.set-nav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px; }
.set-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; font-size: .9rem; transition: all .2s var(--ease); white-space: nowrap; }
.set-link .ic { width: 18px; height: 18px; }
.set-link:hover { color: var(--text); background: var(--surface-2); }
.set-link.on { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.set-body { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.set-body > * { animation: fadeUp .5s var(--ease-out) both; }
.set-body > *:nth-child(2) { animation-delay: .06s; }
.set-body > *:nth-child(3) { animation-delay: .12s; }
.set-body > *:nth-child(4) { animation-delay: .18s; }
.set-section-title { font-size: 1.15rem; font-weight: 650; letter-spacing: -.025em; }
.set-section-sub { color: var(--text-3); font-size: .86rem; margin-top: 3px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.set-row:first-of-type { border-top: 0; padding-top: 4px; }
.set-row .t { font-weight: 550; font-size: .93rem; }
.set-row .d { color: var(--text-3); font-size: .8rem; margin-top: 2px; }
.set-row .ctrl { flex: none; display: flex; align-items: center; gap: 8px; }
.set-row .ctrl .select { width: auto; min-width: 150px; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.theme-opt { text-align: left; display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); transition: all .3s var(--ease); }
.theme-opt:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-opt.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.theme-opt .nm { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; font-size: .86rem; font-weight: 550; }
.theme-opt .nm .ck { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-2); display: grid; place-items: center; transition: all .3s var(--spring); }
.theme-opt.on .nm .ck { background: var(--text); border-color: var(--text); color: var(--bg); }
.theme-opt .nm .ck .ic { width: 12px; height: 12px; opacity: 0; transform: scale(.4); transition: all .3s var(--spring); }
.theme-opt.on .nm .ck .ic { opacity: 1; transform: none; }
.tp { height: 84px; border-radius: calc(var(--r) - 6px); overflow: hidden; display: grid; grid-template-columns: 28% 1fr; border: 1px solid rgba(128, 128, 128, .18); }
.tp .s { padding: 8px 6px; display: flex; flex-direction: column; gap: 4px; }
.tp .s i { height: 5px; border-radius: 3px; display: block; }
.tp .m { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.tp .m .h { height: 26px; border-radius: 5px; }
.tp .m .r { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; }
.tp .m .r i { border-radius: 5px; display: block; }
.tp.sys { position: relative; }
.tp.sys::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 50%, #0b0b0c 50%); mix-blend-mode: normal; opacity: .92; }

.danger-card { border-color: var(--border-2); }
.drop {
  border: 1.5px dashed var(--border-2); border-radius: var(--r-lg); padding: 34px 20px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; transition: all .3s var(--ease); background: var(--surface-2);
}
.drop:hover, .drop.over { border-color: var(--text); background: var(--surface); transform: scale(1.005); }
.drop .empty-ic { animation: none; background: var(--surface); }
.drop.over .empty-ic { animation: bounce .8s var(--spring) infinite; }

.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.export-card { display: flex; flex-direction: column; gap: 12px; }
.export-card .cat-ic { margin-bottom: 4px; }
.export-card p { color: var(--text-3); font-size: .85rem; flex: 1; }

.kbd { font-size: .72rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; color: var(--text-2); overflow-x: auto; white-space: pre; }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .3s var(--ease) both; }
.modal {
  position: relative; width: min(520px, 100%); max-height: min(88dvh, 860px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: modalIn .45s var(--ease-out) both; overflow: hidden;
}
.modal.sm { width: min(400px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 6px 22px; }
.modal-head h2 { font-size: 1.1rem; font-weight: 650; letter-spacing: -.025em; }
.modal-body { padding: 12px 22px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 18px calc(14px + var(--sab)); border-top: 1px solid var(--border); background: var(--surface); }
.modal-root.closing .modal-backdrop { animation: fadeOut .25s var(--ease) both; }
.modal-root.closing .modal { animation: modalOut .25s var(--ease) both; }
.modal .grabber { display: none; }

.confirm-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); margin: 4px auto 0; }
.confirm-ic .ic { width: 24px; height: 24px; }
.confirm-text { text-align: center; }
.confirm-text h3 { font-size: 1.1rem; font-weight: 650; letter-spacing: -.02em; }
.confirm-text p { color: var(--text-2); font-size: .9rem; margin-top: 6px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px 11px 13px; border-radius: 99px; background: var(--ink); color: var(--on-ink); font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn .5s var(--spring) both; white-space: nowrap; }
.toast .ic { width: 17px; height: 17px; }
.toast.out { animation: toastOut .3s var(--ease) both; }

/* ---------- Lock screen ---------- */
.lock { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); transition: opacity .55s var(--ease), transform .6s var(--ease-out), filter .55s var(--ease); }
.lock.leaving { opacity: 0; transform: scale(1.04); filter: blur(8px); pointer-events: none; }
.lock.entering { animation: fadeIn .4s var(--ease) both; }
.lock-art {
  position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink);
  padding: calc(40px + var(--sat)) clamp(28px, 4vw, 56px) 40px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate;
}
.lock-art::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--on-ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--on-ink-line) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse at 30% 40%, #000 10%, transparent 70%);
  animation: gridPan 30s linear infinite;
}
.lock-art .orb { position: absolute; z-index: -1; border-radius: 50%; background: var(--on-ink); filter: blur(60px); opacity: .09; }
.lock-art .orb.a { width: 420px; height: 420px; left: -120px; bottom: -140px; animation: drift 16s ease-in-out infinite alternate; }
.lock-art .orb.b { width: 300px; height: 300px; right: -60px; top: 10%; animation: drift 12s ease-in-out -4s infinite alternate-reverse; opacity: .06; }
.lock-art .brand-name { font-size: 1.1rem; }
.lock-art .logo { background: var(--on-ink); }
.lock-art .logo span { border-color: var(--ink); border-right-color: transparent; }
.lock-clock { font-size: clamp(4rem, 9vw, 7.5rem); font-weight: 600; letter-spacing: -.06em; line-height: .95; font-variant-numeric: tabular-nums; }
.lock-date { font-size: 1.05rem; color: var(--on-ink-2); margin-top: 14px; }
.lock-quote { max-width: 380px; color: var(--on-ink-2); font-size: .92rem; }
.lock-quote b { color: var(--on-ink); font-weight: 600; display: block; font-size: 1.25rem; letter-spacing: -.025em; margin-bottom: 6px; }
.lock-panel { position: relative; display: grid; place-items: center; padding: calc(32px + var(--sat)) 24px calc(32px + var(--sab)); overflow-y: auto; }
.lock-card { width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.lock-card > * { animation: fadeUp .6s var(--ease-out) both; }
.lock-card > *:nth-child(2) { animation-delay: .06s; }
.lock-card > *:nth-child(3) { animation-delay: .12s; }
.lock-card > *:nth-child(4) { animation-delay: .18s; }
.lock-card > *:nth-child(5) { animation-delay: .24s; }
.lock-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); font-size: 1.3rem; font-weight: 600; margin-bottom: 12px; box-shadow: var(--shadow); position: relative; }
.lock-avatar::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--border-2); animation: ringPulse 2.6s ease-out infinite; }
.lock-card h2 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.035em; }
.lock-card .sub { color: var(--text-3); font-size: .9rem; }
.lock-mobile-time { display: none; }
.lock-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.lock-steps i { width: 6px; height: 6px; border-radius: 99px; background: var(--border-2); transition: all .45s var(--ease-out); }
.lock-steps i.on { width: 22px; background: var(--text); }
.onb-feature { display: flex; gap: 12px; text-align: left; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); width: 100%; }
.onb-feature:first-child { border-top: 0; }
.onb-feature .cat-ic { width: 36px; height: 36px; }
.onb-feature b { font-weight: 600; font-size: .9rem; display: block; }
.onb-feature span { color: var(--text-3); font-size: .82rem; }
.lock-card .stack { width: 100%; text-align: left; margin-top: 18px; }
.lock-card .btn-block { margin-top: 8px; }
.lock-foot { margin-top: 18px; font-size: .8rem; color: var(--text-3); }

/* PIN pad */
.pinpad { display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: 22px; width: 100%; }
.pin-dots { display: flex; gap: 16px; height: 16px; align-items: center; }
.pin-dots span { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--border-2); transition: all .3s var(--spring); }
.pin-dots span.on { background: var(--text); border-color: var(--text); transform: scale(1.12); }
.pinpad.ok .pin-dots span { background: var(--text); border-color: var(--text); animation: okPop .5s var(--spring) both; animation-delay: calc(var(--i) * 40ms); }
.pinpad.shake .pin-dots { animation: shake .45s var(--ease) both; }
.pinpad.shake .pin-dots span { border-color: var(--text-2); }
.pin-msg { min-height: 20px; font-size: .84rem; color: var(--text-2); margin-top: -10px; transition: opacity .3s; }
.keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; }
.key {
  position: relative; overflow: hidden; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 500; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), background-color .2s, border-color .2s; font-variant-numeric: tabular-nums;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.key small { display: block; font-size: .55rem; letter-spacing: .14em; color: var(--text-3); font-weight: 600; margin-top: -4px; }
.key > span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.key:hover { background: var(--surface-2); border-color: var(--border-2); }
.key:active, .key.pressed { transform: scale(.9); background: var(--surface-3); }
.key.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.key.ghost:hover { background: var(--surface-2); }
.key .ic { width: 26px; height: 26px; }
.key.bio .ic { width: 30px; height: 30px; }
.key[disabled] { opacity: .35; pointer-events: none; }
.bio-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .86rem; font-weight: 500; padding: 8px 14px; border-radius: 99px; transition: all .2s; }
.bio-btn:hover { color: var(--text); background: var(--surface-2); }
.bio-btn .ic { width: 18px; height: 18px; }
.bio-hero { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: var(--surface-2); margin: 6px auto 10px; position: relative; }
.bio-hero .ic { width: 40px; height: 40px; }
.bio-hero::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1.5px solid var(--text); opacity: 0; animation: ringPulse 2.2s ease-out infinite; }

/* ---------- View transitions (theme switch) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: themeReveal .7s var(--ease-out); }

/* ---------- Keyframes ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes titleIn { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes appIn { from { opacity: 0; transform: scale(.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.95); } }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.92); } }
@keyframes ringPulse { 0% { transform: scale(.95); opacity: .7; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.15); } }
@keyframes gridPan { to { background-position: 44px 44px, 44px 44px; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes segIn { from { stroke-dasharray: 0 999; } }
@keyframes unblur { from { filter: blur(10px); opacity: 0; transform: translateY(4px); } to { filter: none; opacity: 1; transform: none; } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); } }
@keyframes okPop { 50% { transform: scale(1.4); } }
@keyframes themeReveal { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 50%)); } to { clip-path: circle(var(--vt-r, 150%) at var(--vt-x, 50%) var(--vt-y, 50%)); } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .dash-hero { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
}
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); --sb-w: 288px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--sb-w), 86vw); transform: translateX(-104%); box-shadow: none; border-right: 0; border-radius: 0 var(--r-xl) var(--r-xl) 0; visibility: hidden; transition: transform .45s var(--ease-out), visibility 0s linear .45s, box-shadow .3s; }
  .app.sb-open .sidebar { transform: none; box-shadow: var(--shadow-lg); visibility: visible; transition: transform .45s var(--ease-out), visibility 0s, box-shadow .3s; }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); }
  .app.sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .sb-collapse { display: none !important; }
  .app.collapsed .lbl, .app.collapsed .brand-name, .app.collapsed .sb-user-meta, .app.collapsed .sb-privacy .state, .app.collapsed .sb-privacy .lbl { opacity: 1; width: auto; pointer-events: auto; }
  .app.collapsed .sb-label { opacity: 1; height: auto; padding: 16px 12px 6px; }
  .app.collapsed .sb-head, .app.collapsed .sb-user { flex-direction: row; }
  .app.collapsed .nav-item, .app.collapsed .sb-privacy { justify-content: flex-start; padding: 0 12px; gap: 12px; }
  .app.collapsed .sb-privacy { padding: 10px 12px; gap: 10px; }
  .app.collapsed .sb-add { justify-content: flex-start; padding: 0 14px; }
  .only-mobile { display: inline-grid !important; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
  .set-link { flex: none; }
  .lock { grid-template-columns: minmax(0, 1fr); }
  .lock-art { display: none; }
  .lock-mobile-time { display: block; font-size: .85rem; color: var(--text-3); margin-bottom: 26px; font-variant-numeric: tabular-nums; }
}
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .tb-add { width: 40px; padding: 0; }
  .tb-title h1 { font-size: 1.3rem; }
  .side-stack { grid-template-columns: 1fr; }
  .summary-row, .kv-grid { grid-template-columns: 1fr 1fr; }
  .summary-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .hero { min-height: 0; border-radius: var(--r-lg); }
  .row-2 { grid-template-columns: 1fr; }
  .set-row { flex-wrap: wrap; }
  .set-row:has(.switch) { flex-wrap: nowrap; }
  .summary-row > :nth-child(3):last-child { grid-column: span 2; }
  .set-row .ctrl .select { min-width: 130px; }
  .modal-root { padding: 0; place-items: end stretch; }
  .modal, .modal.sm { width: 100%; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0; animation: sheetIn .45s var(--ease-out) both; }
  .modal-root.closing .modal { animation: sheetOut .3s var(--ease) both; }
  .modal .grabber { display: block; width: 38px; height: 4px; border-radius: 99px; background: var(--border-2); margin: 8px auto 0; }
  .modal-head { padding-top: 10px; }
  .keys { grid-template-columns: repeat(3, 68px); gap: 12px 20px; }
  .key { width: 68px; height: 68px; }
  .toasts { bottom: calc(20px + var(--sab)); }
}
@media (hover: none) {
  .reveal-overlay { opacity: 1; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; align-items: end; justify-items: end; padding: 18px; }
  .reveal-cta { transform: none; padding: 10px 14px; font-size: .82rem; }
  .card.lift:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}
