/* ==========================================================================
   Hearth — design system
   Warm paper, ink, and a single vermilion accent. Display: Bricolage Grotesque.
   ========================================================================== */

:root {
  --bg: #F3F0E8;
  --bg-2: #ECE8DD;
  --surface: #FFFFFF;
  --surface-2: #F7F5EF;
  --surface-3: #EFEBE1;
  --ink: #16150F;
  --ink-2: #57544B;
  --ink-3: #8A867B;
  --line: rgba(22, 21, 15, .09);
  --line-2: rgba(22, 21, 15, .16);
  --accent: #FF4F1A;
  --accent-2: #E8410F;
  --accent-soft: rgba(255, 79, 26, .12);
  --accent-ink: #FFFFFF;
  --lime: #D4F25C;
  --pos: #0F7B55;
  --pos-soft: rgba(15, 123, 85, .12);
  --neg: #C9361F;
  --neg-soft: rgba(201, 54, 31, .1);
  --warn: #B87400;
  --warn-soft: rgba(242, 183, 5, .18);
  --focus: #5B6CFF;
  --shadow-sm: 0 1px 2px rgba(22, 21, 15, .06), 0 1px 1px rgba(22, 21, 15, .04);
  --shadow: 0 1px 2px rgba(22, 21, 15, .05), 0 8px 24px -8px rgba(22, 21, 15, .14);
  --shadow-lg: 0 24px 64px -16px rgba(22, 21, 15, .32), 0 2px 6px rgba(22, 21, 15, .08);
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --sidebar: 252px;
  --gutter: clamp(16px, 3vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F0C; --bg-2: #151512; --surface: #1A1A16; --surface-2: #20201B; --surface-3: #2A2A24;
    --ink: #F3F0E8; --ink-2: #B4AFA3; --ink-3: #7F7B71;
    --line: rgba(243, 240, 232, .08); --line-2: rgba(243, 240, 232, .15);
    --accent: #FF6634; --accent-2: #FF7E52; --accent-soft: rgba(255, 102, 52, .16);
    --pos: #3DD68C; --pos-soft: rgba(61, 214, 140, .13); --neg: #FF6B5B; --neg-soft: rgba(255, 107, 91, .13);
    --warn: #F5B83D; --warn-soft: rgba(245, 184, 61, .15); --focus: #8B98FF;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.8), 0 2px 6px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0F0C; --bg-2: #151512; --surface: #1A1A16; --surface-2: #20201B; --surface-3: #2A2A24;
  --ink: #F3F0E8; --ink-2: #B4AFA3; --ink-3: #7F7B71;
  --line: rgba(243, 240, 232, .08); --line-2: rgba(243, 240, 232, .15);
  --accent: #FF6634; --accent-2: #FF7E52; --accent-soft: rgba(255, 102, 52, .16);
  --pos: #3DD68C; --pos-soft: rgba(61, 214, 140, .13); --neg: #FF6B5B; --neg-soft: rgba(255, 107, 91, .13);
  --warn: #F5B83D; --warn-soft: rgba(245, 184, 61, .15); --focus: #8B98FF;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.8), 0 2px 6px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* --------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -.025em; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }
.icon-lg { width: 24px; height: 24px; flex: none; }

/* --------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 16px 18px; border-right: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 10px 18px; }
.brand img { width: 34px; height: 34px; }
.brand span { font: 700 21px/1 var(--display); letter-spacing: -.04em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; color: var(--ink-2); font-weight: 520; transition: background .2s, color .2s;
  position: relative;
}
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav a[aria-current="page"] .icon { color: var(--accent); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); padding: 18px 12px 6px; font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 14px var(--gutter); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .brand { display: none; padding: 0; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 380px; height: 42px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3);
  text-align: left; transition: border-color .2s, box-shadow .2s;
}
.search-trigger:hover { border-color: var(--ink-3); }
.search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { font: 500 11px/1 var(--mono); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-3); background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 8px var(--gutter) 64px; width: 100%; max-width: 1440px; }
.content.wide { max-width: none; padding-right: 0; }

.tabbar { display: none; }

/* page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 0 26px; }
.page-head .eyebrow { margin-bottom: 10px; }
.page-title { font-size: clamp(34px, 5vw, 56px); font-weight: 680; letter-spacing: -.045em; line-height: .98; }
.page-title em { font-style: normal; color: var(--accent); }
.page-sub { margin-top: 10px; color: var(--ink-2); max-width: 60ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 11.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --------------------------------------------------------------- buttons */
.btn {
  --b-bg: var(--surface); --b-fg: var(--ink); --b-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg); font-weight: 600; font-size: 14.5px; white-space: nowrap;
  text-decoration: none; transition: transform .25s var(--ease), background .2s, border-color .2s, box-shadow .25s, color .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn-primary { --b-bg: var(--ink); --b-fg: var(--bg); --b-bd: var(--ink); }
.btn-primary:hover { --b-bg: var(--accent); --b-bd: var(--accent); --b-fg: #fff; box-shadow: 0 10px 24px -10px var(--accent); }
.btn-accent { --b-bg: var(--accent); --b-fg: #fff; --b-bd: var(--accent); }
.btn-accent:hover { --b-bg: var(--accent-2); --b-bd: var(--accent-2); box-shadow: 0 10px 24px -10px var(--accent); }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; }
.btn-ghost:hover { --b-bg: var(--surface-3); --b-bd: transparent; }
.btn-danger { --b-bg: transparent; --b-fg: var(--neg); --b-bd: color-mix(in srgb, var(--neg) 40%, transparent); }
.btn-danger:hover { --b-bg: var(--neg); --b-fg: #fff; --b-bd: var(--neg); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  border: 1px solid transparent; background: transparent; color: var(--ink-2); transition: background .2s, color .2s, transform .2s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.bordered { border-color: var(--line-2); background: var(--surface); }

/* --------------------------------------------------------------- surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title { font: 650 18px/1.2 var(--display); letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.panel-link { font-size: 13.5px; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; font-weight: 550; }
.panel-link:hover { color: var(--accent); }
.grid { display: grid; gap: 18px; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; min-height: 140px;
}
.stat-label { font-size: 13px; color: var(--ink-2); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.stat-value { font: 650 clamp(28px, 3.2vw, 38px)/1.05 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin-top: auto; }
.stat-foot { font-size: 13px; color: var(--ink-3); }
.stat.feature { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stat.feature .stat-label, .stat.feature .stat-foot { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink); }
.stat.feature .stat-ico { background: var(--accent); color: #fff; }

/* --------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); transition: border-color .2s, box-shadow .2s; font-size: 15px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; 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='%238A867B' 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:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.invalid { border-color: var(--neg); box-shadow: 0 0 0 4px var(--neg-soft); }
.input-money { position: relative; }
.input-money::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; pointer-events: none; }
.input-money .input { padding-left: 28px; font-variant-numeric: tabular-nums; }
.input-amount { font: 650 34px/1 var(--display) !important; letter-spacing: -.03em; height: 68px; }
.input-money.big::before { font-size: 28px; left: 16px; }
.input-money.big .input { padding-left: 38px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; transition: background .2s, border-color .2s; margin: 0; flex: none; cursor: pointer; }
.check input::after { content: ""; width: 11px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .2s var(--ease-spring); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }

.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-3); border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; transition: background .25s, color .25s, box-shadow .25s; }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--sw); position: relative; transition: transform .2s var(--ease-spring); }
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }
.icon-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-choice { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); }
.icon-choice[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.flash { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 520; margin-bottom: 16px; }
.flash.error { background: var(--neg-soft); color: var(--neg); }
.flash.success { background: var(--pos-soft); color: var(--pos); }

/* --------------------------------------------------------------- misc atoms */
.avatar {
  --av: var(--accent); width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--av); color: #fff; font: 700 13px/1 var(--font); letter-spacing: 0; text-transform: uppercase;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.pos { background: var(--pos-soft); color: var(--pos); }
.chip.neg { background: var(--neg-soft); color: var(--neg); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.cat-ico { --c: var(--accent); width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.cat-ico.sm { width: 30px; height: 30px; border-radius: 9px; }
.cat-ico.sm .icon { width: 16px; height: 16px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress > span { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--pc, var(--ink)); border-radius: inherit; transition: width .9s var(--ease); }
.progress.warn > span { --pc: var(--warn); }
.progress.over > span { --pc: var(--neg); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 48px 20px; }
.empty img { width: 200px; }
.empty h3 { font-size: 22px; }
.empty p { color: var(--ink-2); max-width: 42ch; }

.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* list rows */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.row-end b { display: block; font-weight: 650; }
.row-end small { font-size: 12.5px; color: var(--ink-3); }
a.row, button.row { text-decoration: none; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; border-radius: 0; transition: background .15s; }
a.row:hover, button.row:hover { background: var(--surface-2); }
.row.interactive { cursor: pointer; padding-left: 10px; padding-right: 10px; margin: 0 -10px; border-radius: 12px; border-bottom-color: transparent; position: relative; }
.row.interactive::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 1px; background: var(--line); }
.row.interactive:last-child::after { display: none; }
.row.interactive:hover { background: var(--surface-2); }

.date-badge { width: 44px; flex: none; text-align: center; line-height: 1; }
.date-badge small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; }
.date-badge b { display: block; font: 650 20px/1.1 var(--display); }

/* --------------------------------------------------------------- modal */
dialog.modal {
  border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(560px, calc(100vw - 24px)); width: 100%;
  max-height: calc(100dvh - 32px); overflow: visible;
}
dialog.modal.lg { max-width: min(760px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(15, 15, 12, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.modal[open] { animation: modalIn .38s var(--ease); }
dialog.modal[open]::backdrop { animation: fadeIn .3s ease; }
dialog.modal.closing { animation: modalOut .2s ease forwards; }
dialog.modal.closing::backdrop { animation: fadeOut .2s ease forwards; }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.modal-card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100dvh - 32px); overflow: hidden; border: 1px solid var(--line); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 22px 6px 26px; }
.modal-head h2 { font-size: 24px; flex: 1; padding-top: 6px; }
.modal-body { padding: 14px 26px 8px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 16px 26px 22px; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.form-error { color: var(--neg); background: var(--neg-soft); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; font-weight: 550; }

/* --------------------------------------------------------------- toast */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 16px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 550; font-size: 14px;
  animation: toastIn .4s var(--ease-spring);
}
.toast.error { background: var(--neg); color: #fff; }
.toast .icon { color: var(--accent); }
.toast.error .icon { color: #fff; }
.toast button { border: 0; background: rgba(255,255,255,.14); color: inherit; padding: 6px 12px; border-radius: 10px; font-weight: 650; font-size: 13px; }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.95); } }

/* --------------------------------------------------------------- command palette */
.cmdk-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; }
.cmdk-item[aria-selected="true"], .cmdk-item:hover { background: var(--surface-3); }
.cmdk-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); width: 68px; flex: none; }
.cmdk-item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.cmdk-item .m { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* --------------------------------------------------------------- dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hello { font-size: clamp(38px, 6vw, 72px); font-weight: 680; letter-spacing: -.05em; line-height: .95; }
.hello .wave { color: var(--accent); }
.quick { display: flex; gap: 10px; flex-wrap: wrap; }
.due-pill { font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.due-pill.overdue { background: var(--neg-soft); color: var(--neg); }
.due-pill.soon { background: var(--warn-soft); color: var(--warn); }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: var(--ink); transition: stroke-dashoffset 1.2s var(--ease); }
.ring.over .bar { stroke: var(--neg); }
.ring.warn .bar { stroke: var(--warn); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-center b { font: 650 26px/1 var(--display); letter-spacing: -.04em; display: block; }
.ring-center small { font-size: 11.5px; color: var(--ink-3); display: block; margin-top: 2px; }
.pulse { display: flex; gap: 22px; align-items: center; }
.pulse-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pulse-item { display: flex; flex-direction: column; gap: 6px; }
.pulse-item .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.pulse-item .top span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pulse-item .top span:last-child { white-space: nowrap; flex: none; }
.balance-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.balance-box { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.balance-box small { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.balance-box b { display: block; font: 650 24px/1.1 var(--display); letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.activity-item { display: flex; gap: 12px; padding: 10px 0; font-size: 14px; }
.activity-item .icon-wrap { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.activity-item time { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.mini-boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-board { --bc: var(--ink); padding: 14px; border-radius: 16px; background: var(--surface-2); text-decoration: none; display: flex; flex-direction: column; gap: 10px; transition: transform .3s var(--ease), background .2s; min-width: 0; }
.mini-board:hover { transform: translateY(-2px); background: var(--surface-3); }
.mini-board .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------------- boards index */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.board-tile {
  --bc: var(--ink); position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 196px; padding: 20px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none;
  overflow: hidden; isolation: isolate; transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.board-tile::before { content: ""; position: absolute; z-index: -1; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: var(--bc); opacity: .1; transition: transform .6s var(--ease), opacity .3s; }
.board-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.board-tile:hover::before { transform: scale(1.6); opacity: .16; }
.board-tile .b-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--bc); color: #fff; display: grid; place-items: center; }
.board-tile h3 { font-size: 22px; }
.board-tile p { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-tile .meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.board-tile .progress { flex: 1; height: 6px; max-width: 120px; }
.board-tile .progress > span { --pc: var(--bc); }
.board-tile.new { border: 1.5px dashed var(--line-2); background: transparent; align-items: center; justify-content: center; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.board-tile.new:hover { border-color: var(--accent); color: var(--accent); }
.board-tile.new .plus { width: 54px; height: 54px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; transition: transform .4s var(--ease-spring), background .2s, color .2s; }
.board-tile.new:hover .plus { transform: rotate(90deg); background: var(--accent); color: #fff; }

.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tpl { --bc: var(--ink); text-align: left; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--surface); display: flex; gap: 12px; align-items: flex-start; transition: border-color .2s, background .2s; min-width: 0; }
.tpl:hover { border-color: var(--ink-3); }
.tpl[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.tpl .b-ico { width: 36px; height: 36px; border-radius: 11px; background: var(--bc); color: #fff; display: grid; place-items: center; flex: none; }
.tpl b { display: block; font-size: 14.5px; }
.tpl small { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }

/* --------------------------------------------------------------- kanban */
.board-head { display: flex; align-items: center; gap: 14px; padding: 18px var(--gutter) 16px 0; flex-wrap: wrap; }
.board-head .b-ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: var(--bc, var(--ink)); flex: none; }
.board-title-input { font: 680 clamp(26px, 3.4vw, 40px)/1.05 var(--display); letter-spacing: -.04em; border: 0; background: transparent; padding: 2px 6px; margin-left: -6px; border-radius: 10px; min-width: 0; width: 100%; color: var(--ink); text-overflow: ellipsis; }
.board-title-input:hover { background: var(--surface-3); }
.board-title-input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--ink); }
.board-titles { flex: 1 1 280px; min-width: 0; }
.board-desc { color: var(--ink-2); font-size: 14px; padding-left: 0; }
.board-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-input { height: 40px; border-radius: 999px; padding: 0 14px 0 38px; border: 1px solid var(--line-2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A867B' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.5-4.5'/%3E%3C/svg%3E") no-repeat 13px center / 16px; width: 220px; max-width: 100%; }
.filter-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.board-summary { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); padding: 0 var(--gutter) 14px 0; flex-wrap: wrap; }
.board-summary b { color: var(--ink); font-variant-numeric: tabular-nums; }

.kanban {
  display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; overflow-y: hidden; padding: 4px var(--gutter) 28px 2px;
  min-height: calc(100dvh - 240px); scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin;
}
.kanban.dragging { scroll-snap-type: none; }
.k-list {
  flex: 0 0 300px; width: 300px; max-height: calc(100dvh - 210px); display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); scroll-snap-align: start;
  transition: box-shadow .25s, background .25s, transform .25s var(--ease);
}
.k-list.is-over { background: color-mix(in srgb, var(--accent) 7%, var(--bg-2)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.k-list.list-placeholder { background: transparent; border: 2px dashed var(--line-2); box-shadow: none; }
.k-list.list-placeholder > * { visibility: hidden; }
.k-list-head { display: flex; align-items: center; gap: 6px; padding: 12px 10px 8px 14px; cursor: grab; touch-action: none; }
.k-list-head:active { cursor: grabbing; }
.k-list-title { flex: 1; min-width: 0; font: 650 15px/1.2 var(--display); letter-spacing: -.01em; border: 0; background: transparent; padding: 6px 6px; margin-left: -6px; border-radius: 8px; text-overflow: ellipsis; color: var(--ink); cursor: text; }
.k-list-title:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--ink); }
.k-count { font-size: 12px; font-weight: 650; color: var(--ink-3); background: var(--surface); padding: 2px 8px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.k-cards { flex: 1; overflow-y: auto; padding: 4px 10px 6px; display: flex; flex-direction: column; gap: 8px; min-height: 12px; scrollbar-width: thin; }
.k-foot { padding: 6px 10px 10px; }
.add-card-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; transition: background .2s, color .2s; }
.add-card-btn:hover { background: var(--surface); color: var(--ink); }
.add-card-form { display: flex; flex-direction: column; gap: 8px; }
.add-card-form textarea { width: 100%; min-height: 64px; resize: none; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ink); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); font-size: 14.5px; line-height: 1.4; }
.add-card-form textarea:focus { outline: none; }
.add-card-form .row-btns { display: flex; gap: 6px; align-items: center; }

.k-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 11px;
  box-shadow: var(--shadow-sm); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: box-shadow .2s, border-color .2s, transform .25s var(--ease), opacity .2s; -webkit-touch-callout: none;
}
.k-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.k-card:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 1px; }
.k-card.is-done .k-card-title { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.k-card.placeholder { background: transparent; border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: none; }
.k-card.placeholder > * { visibility: hidden; }
.k-card.filtered-out { display: none; }
.k-card.flash-in { animation: cardIn .45s var(--ease-spring); }
@keyframes cardIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.drag-ghost {
  position: fixed; z-index: 500; pointer-events: none; margin: 0; cursor: grabbing;
  box-shadow: 0 22px 48px -12px rgba(22,21,15,.35), 0 0 0 1px var(--line-2); transform-origin: 30% 20%;
  transition: transform .18s var(--ease); will-change: left, top, transform;
}
.drag-ghost.k-card { transform: rotate(3.5deg) scale(1.04); }
.drag-ghost.k-list { transform: rotate(2deg); opacity: .96; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
.k-card-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.k-card-top:empty { display: none; }
.label-chip { height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 650; display: inline-flex; align-items: center; background: color-mix(in srgb, var(--lc) 16%, transparent); color: color-mix(in srgb, var(--lc) 85%, var(--ink)); }
.k-card-title { font-weight: 560; font-size: 14.5px; line-height: 1.38; overflow-wrap: anywhere; padding-right: 22px; }
.k-card-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; font-size: 12px; color: var(--ink-3); align-items: center; }
.k-card-meta:empty { display: none; }
.k-card-meta .m { display: inline-flex; align-items: center; gap: 4px; font-weight: 550; }
.k-card-meta .m .icon { width: 14px; height: 14px; }
.k-card-meta .m.cost { color: var(--ink); font-variant-numeric: tabular-nums; }
.k-card-meta .m.complete { color: var(--pos); }
.prio { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prio.high { background: var(--neg); }
.prio.medium { background: var(--warn); }
.prio.low { background: var(--pos); }
.prio-tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; text-transform: capitalize; }
.k-check {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2);
  background: var(--surface); display: grid; place-items: center; color: transparent; opacity: 0; transition: opacity .2s, background .2s, border-color .2s, color .2s; padding: 0;
}
.k-card:hover .k-check, .k-check:focus-visible, .k-card.is-done .k-check { opacity: 1; }
.k-check:hover { border-color: var(--pos); color: var(--pos); }
.k-card.is-done .k-check { background: var(--pos); border-color: var(--pos); color: #fff; }
.k-check .icon { width: 13px; height: 13px; stroke-width: 2.6; }
@media (hover: none) { .k-check { opacity: 1; } }
.add-list { flex: 0 0 300px; }
.add-list-btn { width: 100%; height: 52px; border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); background: transparent; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; transition: border-color .2s, color .2s, background .2s; }
.add-list-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.add-list-form { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; }

/* card detail */
.card-detail { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 24px; }
.card-detail-title { font: 650 24px/1.2 var(--display); letter-spacing: -.025em; width: 100%; border: 0; background: transparent; padding: 4px 8px; margin-left: -8px; border-radius: 10px; resize: none; overflow: hidden; color: var(--ink); }
.card-detail-title:hover { background: var(--surface-3); }
.card-detail-title:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--ink); }
.card-side { display: flex; flex-direction: column; gap: 14px; }
.section-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink-2); margin: 18px 0 8px; }
.checklist { display: flex; flex-direction: column; gap: 2px; }
.cl-item { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 10px; }
.cl-item:hover { background: var(--surface-2); }
.cl-item .t { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; }
.cl-item.done .t { color: var(--ink-3); text-decoration: line-through; }
.cl-item .icon-btn { opacity: 0; }
.cl-item:hover .icon-btn, .cl-item .icon-btn:focus-visible { opacity: 1; }
@media (hover: none) { .cl-item .icon-btn { opacity: 1; } }
.cl-add { display: flex; gap: 8px; margin-top: 6px; }
.cl-progress { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.cl-progress .progress { flex: 1; height: 6px; }
.cl-progress .progress > span { --pc: var(--pos); }
.logged-note { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--pos-soft); color: var(--pos); font-size: 13.5px; font-weight: 600; }

/* --------------------------------------------------------------- split */
.split-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.group-tile { --gc: var(--ink); display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: transform .45s var(--ease), box-shadow .45s var(--ease); position: relative; overflow: hidden; }
.group-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.group-tile .g-top { display: flex; align-items: center; gap: 12px; }
.g-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--gc); color: #fff; display: grid; place-items: center; flex: none; }
.group-tile h3 { font-size: 20px; }
.group-tile .g-bal { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; }
.group-tile .g-bal b { font: 650 26px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.group-tile .g-bal small { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }

.group-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.group-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 86px; }
.month-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); padding: 18px 0 4px; }
.month-label:first-child { padding-top: 0; }
.exp-amount { text-align: right; flex: none; font-variant-numeric: tabular-nums; min-width: 90px; }
.exp-amount small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 550; }
.exp-amount b { display: block; font-weight: 650; font-size: 15px; }
.exp-mine { text-align: right; min-width: 92px; flex: none; font-variant-numeric: tabular-nums; }
.exp-mine small { display: block; font-size: 12px; font-weight: 600; }
.exp-mine b { display: block; font-weight: 650; }
.settle-row { color: var(--ink-2); }
.settle-row .cat-ico { --c: var(--pos); }
.bal-member { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.bal-member .info { flex: 1; min-width: 0; }
.bal-member .info b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bal-bar { height: 6px; border-radius: 99px; background: var(--surface-3); position: relative; margin-top: 6px; }
.bal-bar > span { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.bal-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1.5px; background: var(--line-2); }
.bal-amt { text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.bal-amt small { display: block; font-size: 11.5px; font-weight: 600; }
.bal-amt b { font-weight: 650; }
.suggestion { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); margin-bottom: 8px; flex-wrap: wrap; }
.suggestion .who { flex: 1; min-width: 140px; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.suggestion .who b { font-weight: 650; }
.all-settled { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--pos-soft); color: var(--pos); font-weight: 600; font-size: 14px; }

.split-people { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.split-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; transition: background .2s; }
.split-person:hover { background: var(--surface-2); }
.split-person .name { flex: 1; min-width: 0; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-person .share { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.split-person .val { width: 110px; flex: none; }
.split-person .val .input { min-height: 38px; padding: 7px 10px; font-size: 14px; text-align: right; }
.split-person.off .name, .split-person.off .share { opacity: .45; }
.split-status { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 12px; margin-top: 8px; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.split-status.ok { background: var(--pos-soft); color: var(--pos); }
.split-status.bad { background: var(--neg-soft); color: var(--neg); }
.member-row { display: flex; gap: 8px; align-items: center; }
.member-row .input { min-height: 42px; }

/* --------------------------------------------------------------- budgets */
.month-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px; }
.month-nav b { min-width: 130px; text-align: center; font-weight: 650; font-size: 14.5px; }
.budget-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.budget-cat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.budget-cat:last-child { border-bottom: 0; }
.budget-cat .progress { grid-column: 2 / 4; }
.budget-cat .nm { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.budget-cat .nm span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-cat .amt { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.budget-cat .amt b { font-weight: 650; }
.budget-cat .amt small { color: var(--ink-3); }
.budget-cat .sub { grid-column: 2 / 4; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); gap: 10px; }
.budget-cat .cat-ico { grid-row: span 3; align-self: start; }
.budget-edit { border: 0; background: none; padding: 0; color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.budget-edit:hover { color: var(--accent); text-decoration-color: currentColor; }
.chart-wrap { position: relative; }
.trend { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 180px; padding-top: 18px; position: relative; }
.trend-col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; cursor: default; position: relative; }
.trend-col .bar { width: 100%; max-width: 44px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--ink) 16%, transparent); transition: height .9s var(--ease), background .2s; min-height: 2px; }
.trend-col.current .bar { background: var(--accent); }
.trend-col:hover .bar, .trend-col:focus-visible .bar { background: var(--ink); }
.trend-col.current:hover .bar { background: var(--accent-2); }
.trend-col small { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.trend-baseline { position: absolute; left: 0; right: 0; bottom: 26px; height: 1px; background: var(--line-2); }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -100%); box-shadow: var(--shadow); opacity: 0; transition: opacity .15s; }
.chart-tip.show { opacity: 1; }
.chart-tip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.tx-source { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.summary-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.table-toggle { font-size: 12.5px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.data-table th { font-size: 12px; color: var(--ink-3); font-weight: 650; }
.data-table td:last-child, .data-table th:last-child { text-align: right; }

/* --------------------------------------------------------------- settings */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.danger-zone { border-color: color-mix(in srgb, var(--neg) 30%, transparent); }
.stat-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-mini div { padding: 12px; border-radius: 14px; background: var(--surface-2); }
.stat-mini b { display: block; font: 650 24px/1 var(--display); }
.stat-mini small { color: var(--ink-3); font-size: 12px; font-weight: 600; }

/* --------------------------------------------------------------- auth */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-form-side { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px); }
.auth-form-wrap { width: 100%; max-width: 420px; margin: auto; padding: 40px 0; }
.auth-form-wrap h1 { font-size: clamp(36px, 5vw, 52px); letter-spacing: -.045em; margin-bottom: 10px; }
.auth-art { position: relative; overflow: hidden; background: var(--ink); color: var(--bg); padding: 48px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 0 0 0 40px; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: url("../img/grain.svg"); opacity: .18; mix-blend-mode: overlay; pointer-events: none; }
.auth-art blockquote { margin: 0; font: 600 clamp(26px, 3vw, 40px)/1.12 var(--display); letter-spacing: -.035em; max-width: 18ch; position: relative; }
.auth-art blockquote em { font-style: normal; color: var(--accent); }
.auth-floats { position: absolute; inset: 0; pointer-events: none; }
.float-card { position: absolute; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 14px 16px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); width: 230px; animation: floaty 7s ease-in-out infinite; }
.float-card small { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.float-card b { display: block; font-weight: 650; }
.float-card .big { font: 650 28px/1 var(--display); letter-spacing: -.03em; margin-top: 4px; }
@keyframes floaty { 50% { transform: translateY(-14px) rotate(var(--r2, 0deg)); } }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* --------------------------------------------------------------- landing */
.landing { overflow-x: clip; }
.l-nav { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); border: 1px solid var(--line); width: min(980px, calc(100% - 24px)); box-shadow: var(--shadow-sm); }
.l-nav .brand { padding: 0; margin-right: auto; }
.l-nav .brand img { width: 30px; height: 30px; }
.l-nav .links { display: flex; gap: 4px; }
.l-nav .links a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 550; font-size: 14px; color: var(--ink-2); }
.l-nav .links a:hover { color: var(--ink); background: var(--surface-3); }
.hero { position: relative; padding: 150px var(--gutter) 40px; max-width: 1360px; margin: 0 auto; }
.hero h1 { font-size: clamp(52px, 10.5vw, 168px); font-weight: 700; letter-spacing: -.065em; line-height: .86; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; animation: rise 1.1s var(--ease) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .08s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .16s; }
.hero h1 .accent { color: var(--accent); }
.hero h1 .outline { -webkit-text-stroke: 2px var(--ink); color: transparent; }
@keyframes rise { from { transform: translateY(105%) rotate(4deg); } }
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin-top: 44px; align-items: end; }
.hero-row p { font-size: clamp(17px, 1.6vw, 21px); color: var(--ink-2); max-width: 40ch; line-height: 1.45; animation: fadeUp 1s .35s var(--ease) both; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; animation: fadeUp 1s .45s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } }
.stage { position: relative; max-width: 1360px; margin: 50px auto 0; padding: 0 var(--gutter); animation: fadeUp 1s .3s var(--ease) both; }
.stage-inner { position: relative; border-radius: 34px; background: var(--ink); padding: clamp(18px, 3vw, 36px); overflow: hidden; isolation: isolate; }
.stage-inner::before { content: ""; position: absolute; inset: 0; background: url("../img/grain.svg"); opacity: .2; mix-blend-mode: overlay; z-index: -1; }
.stage-inner::after { content: ""; position: absolute; width: 60%; aspect-ratio: 1; right: -15%; top: -40%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 55%, transparent), transparent); z-index: -1; filter: blur(10px); }
.demo-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.15fr); gap: 14px; }
.demo-col { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 280px; }
.demo-col h4 { color: #F3F0E8; font: 600 14px/1 var(--display); padding: 6px 4px 6px; display: flex; justify-content: space-between; }
.demo-col h4 span { color: rgba(243,240,232,.5); font-family: var(--font); font-size: 12px; }
.demo-card { background: #FFFDF8; color: #16150F; border-radius: 13px; padding: 11px 12px; font-size: 13.5px; font-weight: 560; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.demo-card .meta { display: flex; gap: 8px; margin-top: 8px; font-size: 11.5px; color: #8A867B; align-items: center; }
.demo-card .meta b { color: #16150F; font-weight: 650; }
.demo-card.lift { animation: lift 6s var(--ease) infinite; position: relative; z-index: 2; }
@keyframes lift { 0%, 20% { transform: none; box-shadow: 0 4px 12px rgba(0,0,0,.2); } 35%, 60% { transform: translate(calc(100% + 26px), 18px) rotate(3deg); box-shadow: 0 30px 50px -10px rgba(0,0,0,.5); } 75%, 100% { transform: none; } }
.demo-split { background: #FFFDF8; color: #16150F; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.demo-split h4 { font: 650 16px/1 var(--display); display: flex; justify-content: space-between; align-items: center; }
.demo-split .p { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.demo-split .p .avatar { box-shadow: none; }
.demo-split .p span:not(.avatar) { flex: 1; font-weight: 550; }
.demo-split .p b { font-variant-numeric: tabular-nums; }
.demo-split .bar { height: 10px; border-radius: 99px; display: flex; overflow: hidden; gap: 2px; }
.demo-split .bar i { display: block; height: 100%; }
.marquee { overflow: hidden; padding: 70px 0 30px; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee .pill { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; border: 1px solid var(--line-2); font: 600 18px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; background: var(--surface); }
.marquee .pill .cat-ico { width: 30px; height: 30px; border-radius: 50%; }
@keyframes marquee { to { transform: translateX(-50%); } }
.section { max-width: 1360px; margin: 0 auto; padding: 90px var(--gutter); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: end; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(38px, 5.6vw, 84px); letter-spacing: -.055em; line-height: .92; }
.section-head p { color: var(--ink-2); font-size: 18px; max-width: 44ch; justify-self: end; }
.features { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.l-feature { grid-column: span 4; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 14px; min-height: 320px; position: relative; overflow: hidden; transition: transform .6s var(--ease); }
.l-feature:hover { transform: translateY(-6px); }
.l-feature.big { grid-column: span 7; }
.l-feature.mid { grid-column: span 5; }
.l-feature.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.l-feature.dark p { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.l-feature.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.l-feature.accent p { color: rgba(255,255,255,.85); }
.l-feature .f-num { font: 500 13px/1 var(--mono); opacity: .6; }
.l-feature h3 { font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -.04em; margin-top: auto; }
.l-feature p { color: var(--ink-2); max-width: 46ch; }
.l-feature .f-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-3); }
.l-feature.dark .f-ico { background: rgba(255,255,255,.1); color: var(--accent); }
.l-feature.accent .f-ico { background: rgba(255,255,255,.18); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.step { border-top: 2px solid var(--ink); padding-top: 22px; }
.step::before { counter-increment: step; content: "0" counter(step); font: 500 14px/1 var(--mono); color: var(--accent); display: block; margin-bottom: 30px; }
.step h3 { font-size: 26px; margin-bottom: 10px; letter-spacing: -.03em; }
.step p { color: var(--ink-2); }
.cta-band { margin: 0 var(--gutter) 30px; border-radius: 36px; background: var(--accent); color: #fff; padding: clamp(40px, 7vw, 100px) clamp(24px, 5vw, 80px); position: relative; overflow: hidden; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: url("../img/grain.svg"); opacity: .25; mix-blend-mode: overlay; z-index: -1; }
.cta-band h2 { font-size: clamp(44px, 8vw, 128px); letter-spacing: -.06em; line-height: .88; max-width: 12ch; }
.cta-band .btn-primary { --b-bg: #16150F; --b-fg: #fff; --b-bd: #16150F; }
.cta-band .btn-primary:hover { --b-bg: #fff; --b-fg: #16150F; --b-bd: #fff; box-shadow: none; }
.cta-band .btn:not(.btn-primary) { --b-bg: transparent; --b-fg: #fff; --b-bd: rgba(255,255,255,.5); }
.cta-band .row-btns { display: flex; gap: 10px; margin-top: 34px; flex-wrap: wrap; }
.l-foot { max-width: 1360px; margin: 0 auto; padding: 30px var(--gutter) 40px; display: flex; justify-content: space-between; gap: 20px; color: var(--ink-3); font-size: 14px; flex-wrap: wrap; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* error page */
.error-page { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-page .code { font: 700 clamp(120px, 24vw, 280px)/.8 var(--display); letter-spacing: -.07em; color: var(--accent); }
.error-page h1 { font-size: clamp(28px, 4vw, 44px); margin: 18px 0 10px; }
.error-page p { color: var(--ink-2); margin-bottom: 24px; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group-layout { grid-template-columns: minmax(0, 1fr); }
  .group-side { position: static; }
  .demo-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-board .demo-col:nth-child(3) { display: none; }
  .l-feature, .l-feature.big, .l-feature.mid { grid-column: span 6; }
}
@media (max-width: 980px) {
  .dash-grid, .budget-layout, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar .brand { display: flex; }
  .topbar .brand span { display: none; }
  .search-trigger { flex: 1; }
  .search-trigger .kbd { display: none; }
  .content { padding-bottom: 110px; }
  .content.wide { padding-right: var(--gutter); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 12px; right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom)); height: 64px; padding: 6px; border-radius: 22px;
    background: color-mix(in srgb, var(--ink) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-lg);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 16px; text-decoration: none; color: color-mix(in srgb, var(--bg) 60%, transparent); font-size: 10.5px; font-weight: 600; transition: background .2s, color .2s; }
  .tabbar a[aria-current="page"] { color: var(--bg); background: rgba(255,255,255,.1); }
  .tabbar a[aria-current="page"] .icon { color: var(--accent); }
  .kanban { padding-right: var(--gutter); min-height: calc(100dvh - 300px); }
  .k-list { flex-basis: 84vw; width: 84vw; max-width: 320px; max-height: calc(100dvh - 260px); }
  .add-list { flex-basis: 84vw; max-width: 320px; }
  .board-head { padding-right: 0; }
  .card-detail { grid-template-columns: minmax(0, 1fr); }
  .split-hero, .summary-band { grid-template-columns: minmax(0, 1fr); }
  .hero-row, .section-head { grid-template-columns: minmax(0, 1fr); }
  .section-head p { justify-self: start; }
  .hero-cta { justify-content: flex-start; }
  .l-nav .links { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .l-feature, .l-feature.big, .l-feature.mid { grid-column: span 12; min-height: 260px; }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .stats { gap: 10px; }
  .stat { min-height: 120px; padding: 14px; }
  .stat-ico { display: none; }
  .form-row, .form-row.three { grid-template-columns: minmax(0, 1fr); }
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .pulse { flex-direction: column; align-items: stretch; }
  .ring { margin: 0 auto; }
  .page-head { padding: 14px 0 20px; }
  .panel { padding: 16px; border-radius: 18px; }
  .modal-head { padding: 18px 16px 4px 20px; }
  .modal-body { padding: 12px 20px 6px; }
  .modal-foot { padding: 14px 20px 18px; }
  dialog.modal { margin: auto auto 0; max-width: 100vw; }
  dialog.modal .modal-card { border-radius: 26px 26px 0 0; max-height: 92dvh; }
  .demo-board { grid-template-columns: minmax(0, 1fr); }
  .demo-board .demo-col:nth-child(2) { display: none; }
  .demo-col { min-height: 0; }
  .demo-card.lift { animation: none; }
  .stat-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exp-mine { display: none; }
  .split-person .val { width: 92px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .hero { padding-top: 120px; }
  .hero h1 .outline { -webkit-text-stroke-width: 1.5px; }
  .mini-boards { grid-template-columns: minmax(0, 1fr); }
  .balance-box b { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (forced-colors: active) {
  .progress > span, .trend-col .bar { background: CanvasText; }
}

/* --------------------------------------------------------------- language switch */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); align-self: flex-start; }
.lang-switch a { text-decoration: none; font: 650 12px/1 var(--font); letter-spacing: .06em; color: var(--ink-3); padding: 6px 10px; border-radius: 999px; transition: background .2s, color .2s; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.l-nav .lang-switch { margin-right: 4px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.segmented .seg-link { text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.segmented .seg-link[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------- receipt scanner */
.scan-zone {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px;
  border: 1.5px dashed var(--line-2); background: var(--surface-2); transition: border-color .2s, background .2s;
}
.scan-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.scan-zone .scan-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--ink); color: var(--bg); flex: none; }
.scan-zone .scan-text { flex: 1; min-width: 0; }
.scan-zone .scan-text b { display: block; font-size: 14.5px; }
.scan-zone .scan-text small { color: var(--ink-3); font-size: 12.5px; display: block; }
.scan-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.scan-zone.busy { border-style: solid; border-color: var(--ink); }
.scan-zone.busy .scan-ico { animation: pulseIco 1.1s ease-in-out infinite; }
@keyframes pulseIco { 50% { transform: scale(.88); background: var(--accent); } }
.scan-progress { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 3px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.scan-progress::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); border-radius: inherit; animation: scanbar 1.2s var(--ease) infinite; }
@keyframes scanbar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.scan-result { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px; border-radius: 18px; background: var(--surface-2); }
.scan-thumb { width: 76px; height: 100px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-3); cursor: zoom-in; }
.scan-meta { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.scan-meta .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.scan-meta .found { font-size: 13px; color: var(--ink-2); }
.scan-items { margin-top: 2px; font-size: 12.5px; }
.scan-items summary { cursor: pointer; color: var(--ink-2); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.scan-items summary::-webkit-details-marker { display: none; }
.scan-items ul { margin-top: 6px; max-height: 160px; overflow: auto; border-top: 1px solid var(--line); }
.scan-items li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.scan-items li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input.autofilled, .select.autofilled { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background-color: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.receipt-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--ink-2); text-decoration: none; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); }
.receipt-link:hover { color: var(--accent); }
.receipt-viewer img { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 14px; background: var(--surface-3); }
@media (max-width: 560px) {
  .scan-zone { flex-wrap: wrap; }
  .scan-actions { width: 100%; }
  .scan-actions .btn { flex: 1; }
}
@media (max-width: 560px) {
  .l-nav { padding-left: 12px; gap: 6px; }
  .l-nav .lang-switch, .l-nav .brand span { display: none; }
  .l-nav .btn-sm { padding: 0 11px; }
}
