/* ═══════════════════════════════════════════════════════════════════
   JK FINANCE v2 — built from scratch
   Flat · dark graphite · gold accent · mobile-first · zero glow
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0b0d;
  --panel: #14161b;
  --panel-2: #1b1e25;
  --panel-3: #242832;
  --text: #f3f1ec;
  --muted: #a8a49c;
  --faint: #6e6a64;
  --line: rgba(228,233,244,.09);
  --accent: #e3c693;
  --accent-2: #f2dfc0;
  --accent-dim: rgba(227,198,147,.13);
  --green: #6ac498; --green-dim: rgba(106,196,152,.13);
  --red: #df8b84;   --red-dim: rgba(223,139,132,.13);
  --r: 16px; --r-sm: 12px;
  --ease: cubic-bezier(.22,1,.36,1);
  --spring: cubic-bezier(.34,1.45,.5,1);
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --disp: 'Sora', var(--font);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: 1.45;
  min-height: 100dvh;
}
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Labels & type ─────────────────────────────────────────────── */
.lbl {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
}
.pos { color: var(--green); } .neg { color: var(--red); }
.hint { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.lnk { color: var(--accent); font-size: 12.5px; font-weight: 600; }

/* ── Auth ──────────────────────────────────────────────────────── */
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
}
.auth-card { width: 100%; max-width: 380px; animation: rise .4s var(--ease); }
.auth-logo {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--disp); font-weight: 800; font-size: 22px; color: var(--accent);
}
.auth-title { font-family: var(--disp); font-size: 26px; font-weight: 700; text-align: center; letter-spacing: -.02em; }
.auth-sub { text-align: center; color: var(--faint); font-size: 12px; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; margin: 6px 0 28px; }
.auth-err { background: var(--red-dim); color: var(--red); border-radius: var(--r-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.auth-toggle { display: block; margin: 18px auto 0; color: var(--muted); font-size: 13.5px; }
.auth-toggle b { color: var(--accent); }

/* ── Forms ─────────────────────────────────────────────────────── */
.fg { margin-bottom: 14px; }
.fg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fg2 .fg:first-child { grid-column: auto; }
.flbl { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.fi {
  width: 100%; padding: 13px 14px; font-size: 16px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  outline: none; transition: border-color .18s, box-shadow .18s;
  appearance: none; -webkit-appearance: none;
}
.fi:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
select.fi { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  padding: 14px 18px; border-radius: 14px; font-size: 15px; font-weight: 700;
  transition: transform .13s var(--ease), opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-full { width: 100%; display: block; }
.btn-primary { background: var(--accent); color: #15120c; }
.btn-outline { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.btn-danger { background: var(--red-dim); color: var(--red); margin-top: 10px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ── App shell ─────────────────────────────────────────────────── */
.app { min-height: 100dvh; }
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-row { display: flex; align-items: center; gap: 8px; padding: 12px 16px; max-width: 680px; margin: 0 auto; }
.month-nav {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 16px;
}
.month-nav:active { transform: scale(.92); }
.month-lbl {
  font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text);
  padding: 7px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line);
  min-width: 96px; text-align: center;
}
.top-spacer { flex: 1; }
.cur-toggle {
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--accent);
  padding: 8px 13px; border-radius: 999px; background: var(--accent-dim);
}

main { max-width: 680px; margin: 0 auto; padding: 16px 16px 120px; }
.page { animation: pgIn .26s ease-out; }
@keyframes pgIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 14px;
}
.page .card { animation: cardUp .36s var(--ease) backwards; }
.page .card:nth-of-type(2) { animation-delay: .05s; }
.page .card:nth-of-type(3) { animation-delay: .09s; }
.page .card:nth-of-type(4) { animation-delay: .13s; }
@keyframes cardUp { from { opacity: 0; transform: translateY(10px); } }

.sec { padding: 16px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* ── Hero ──────────────────────────────────────────────────────── */
.hero { padding: 20px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 15px; display: grid; place-items: center;
}
.hero-amt {
  font-family: var(--disp); font-weight: 800;
  font-size: clamp(2.3rem, 10.5vw, 3.1rem);
  letter-spacing: -.05em; line-height: 1.05; margin: 10px 0 6px;
  font-variant-numeric: tabular-nums;
}
.hero-badge { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.hero-badge .jump { color: var(--accent); text-decoration: underline; cursor: pointer; }
.hero-split { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.hs-val { font-family: var(--mono); font-size: 14.5px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ── Quick add ─────────────────────────────────────────────────── */
.qa { display: flex; gap: 10px; padding: 10px; align-items: center; }
.qa-in { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 16px; padding: 6px 8px; }
.qa-in::placeholder { color: var(--faint); }
.qa-go {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent); color: #15120c; font-size: 20px; font-weight: 700;
}
.qa-go:active { transform: scale(.92); }
.qa-hint { font-size: 11px; color: var(--faint); margin: -6px 4px 14px; }

/* ── Stats grid ────────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid2 .card { margin: 0; }
.stat { padding: 14px; }
.stat-val { font-family: var(--mono); font-size: 17px; font-weight: 500; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ── Category bars ─────────────────────────────────────────────── */
.cat-row { margin-bottom: 12px; }
.cat-row:last-child { margin-bottom: 0; }
.cat-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.cat-head .amt { font-family: var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-track { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.cat-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s var(--ease); }

/* ── Transaction rows ──────────────────────────────────────────── */
.txn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--line);
  margin-bottom: 8px; cursor: pointer;
  transition: opacity .15s;
}
.txn:active { opacity: .8; }
.txn-ico {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--panel-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 17px;
}
.txn-mid { flex: 1; min-width: 0; }
.txn-desc { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-sub { font-size: 11.5px; color: var(--faint); font-family: var(--mono); margin-top: 2px; }
.txn-amt { font-family: var(--mono); font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-h { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 18px 4px 10px; }
.day-h:first-child { margin-top: 4px; }

.search { padding: 4px 8px; }
.search-in { width: 100%; background: transparent; border: none; outline: none; color: var(--text); font-size: 16px; padding: 10px 8px; }
.search-in::placeholder { color: var(--faint); }

/* ── Empty state ───────────────────────────────────────────────── */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); font-size: 13.5px; }
.empty .big { font-size: 32px; display: block; margin-bottom: 10px; }
.empty .jump { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* ── Goals ─────────────────────────────────────────────────────── */
.goal { padding: 16px; margin-bottom: 12px; }
.goal-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.goal-ico { font-size: 26px; }
.goal-name { font-weight: 700; font-size: 15.5px; flex: 1; }
.goal-amt { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.goal-track { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; margin-bottom: 12px; }
.goal-fill { height: 100%; border-radius: 99px; background: var(--green); transition: width .6s var(--ease); }
.goal-fill.done { background: var(--accent); }
.goal-foot { display: flex; justify-content: space-between; align-items: center; }
.goal-pct { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.goal-add { font-size: 12.5px; font-weight: 700; color: var(--accent); padding: 7px 14px; border-radius: 999px; background: var(--accent-dim); }

/* ── Reports ───────────────────────────────────────────────────── */
.trend-svg { width: 100%; height: 130px; display: block; }
.split-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.split-name { width: 50px; font-size: 13px; font-weight: 600; }
.split-track { flex: 1; height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.split-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s var(--ease); }
.split-amt { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 86px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── More page ─────────────────────────────────────────────────── */
.more-row { font-size: 14px; color: var(--muted); margin-bottom: 12px; font-family: var(--mono); }
.more-link { display: block; width: 100%; text-align: left; padding: 13px 4px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--line); }
.more-link:last-child { border-bottom: none; }
.vtag { text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: .1em; margin-top: 8px; }

/* ── Bottom nav ────────────────────────────────────────────────── */
.bnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.bni {
  position: relative; flex: 1; max-width: 88px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); padding: 6px 0; min-height: 48px;
  transition: color .2s;
}
.bni .bi { font-size: 19px; line-height: 1; }
.bni.on { color: var(--accent); }
.bni.on::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 99px; background: var(--accent);
}

/* ── FAB ───────────────────────────────────────────────────────── */
.fab {
  position: fixed; right: 18px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 49;
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--accent); color: #15120c; font-size: 26px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  transition: transform .15s var(--spring);
}
.fab:active { transform: scale(.9); }

/* ── Sheets (modals) ───────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,6,8,.62);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
}
.overlay.show { display: flex; animation: ovIn .22s ease-out; }
@keyframes ovIn { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
}
.overlay.show .sheet { animation: sheetUp .34s var(--ease); }
@keyframes sheetUp { from { transform: translateY(44px); opacity: .6; } }
.drag { width: 38px; height: 4px; border-radius: 99px; background: var(--line); margin: 4px auto 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sheet-title { font-family: var(--disp); font-size: 17px; font-weight: 700; }
.x { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: 14px; }

/* Desktop: center sheets */
@media (min-width: 641px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); }
}

/* ── Segments ──────────────────────────────────────────────────── */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--panel-2); border-radius: 13px; padding: 5px; margin-bottom: 16px; }
.seg-b { padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.seg-b.on { background: var(--accent); color: #15120c; }

/* ── Month picker grid ─────────────────────────────────────────── */
.mp-year { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--faint); margin: 14px 0 8px; text-transform: uppercase; }
.mp-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.mp-m { position: relative; padding: 12px 0; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.mp-m:active { transform: scale(.94); }
.mp-m.on { background: var(--accent); color: #15120c; }
.mp-dot { position: absolute; top: 6px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.mp-m.on .mp-dot { background: #15120c; }

/* ── Receipt drop ──────────────────────────────────────────────── */
.rc-drop {
  width: 100%; padding: 36px 18px; border-radius: var(--r);
  border: 1.5px dashed var(--line); background: var(--panel-2);
  color: var(--muted); font-size: 14px; text-align: center; line-height: 1.7;
}

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 200; padding: 11px 20px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: transform .35s var(--spring); pointer-events: none;
  max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--red); color: var(--red); }

/* ── PTR indicator ─────────────────────────────────────────────── */
.ptr-ind { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .15s; }
.ptr-spin { width: 36px; height: 36px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 17px; color: var(--muted); }
.ptr-ind.ready .ptr-spin { color: var(--accent); }
.ptr-ind.loading .ptr-spin { animation: spin .8s linear infinite; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══ Scan review sheet ═══ */
.rv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  margin-bottom: 8px; cursor: pointer; transition: opacity .15s, border-color .15s;
}
.rv-row.off { opacity: .38; }
.rv-row:active { opacity: .7; }
.rv-check {
  width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0;
  border: 1.5px solid var(--accent); color: var(--accent);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.rv-row.off .rv-check { border-color: var(--faint); color: transparent; }
#rv-list { max-height: 42dvh; overflow-y: auto; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.rv-who { margin-bottom: 6px; }

/* ═══ Commercial refinement ═══ */
/* Larger comfortable hero on phones */
@media (max-width: 480px){ .hero { padding: 22px 18px; } }
/* Subtle card depth without glow */
.card { box-shadow: 0 1px 2px rgba(0,0,0,.22); }
.sheet { box-shadow: 0 -8px 32px rgba(0,0,0,.45); }
.fab { box-shadow: 0 8px 24px rgba(0,0,0,.45); }
/* Consistent active states everywhere */
.more-link:active, .txn:active, .goal-add:active, .mp-m:active { opacity: .72; }
/* Smooth color transitions on theme-sensitive elements */
.hs-val, .stat-val { transition: color .25s ease; }
/* Better disabled buttons */
button[disabled] { opacity: .5; pointer-events: none; }
/* Empty states breathe */
.empty { padding: 44px 20px; }

/* ═══ Brand portrait ═══ */
.auth-portrait {
  width: 124px; height: 124px; margin: 0 auto 20px;
  border-radius: 32px; overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
  outline: 3px solid var(--accent-dim);
  outline-offset: 3px;
  display: grid; place-items: center;
  animation: portraitIn .55s var(--spring) backwards;
}
.auth-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
@keyframes portraitIn { from { opacity: 0; transform: scale(.85); } }

.acct-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.acct-img {
  width: 44px; height: 44px; border-radius: 14px; object-fit: cover; object-position: top center;
  border: 1px solid var(--line); background: var(--panel-2);
}
.acct-name { font-weight: 700; font-size: 15px; }

/* ═══ Feature pack v3 ═══ */
.rec-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.rec-txt { flex: 1; font-size: 13px; font-weight: 600; }
.rec-add { font-size: 12.5px; font-weight: 700; color: #15120c; background: var(--accent); padding: 8px 14px; border-radius: 999px; }
.rec-x { color: var(--faint); font-size: 13px; padding: 6px; }

.cat-fill.b-warn { background: #e8b15c; }
.cat-fill.b-over { background: var(--red); }
.b-over { font-size: 10px; font-family: var(--mono); color: var(--red); background: var(--red-dim); padding: 2px 7px; border-radius: 999px; letter-spacing: .06em; text-transform: uppercase; }
.b-del { color: var(--faint); font-size: 11px; padding: 2px 4px; }

.scope-btn { flex-shrink: 0; font-family: var(--mono); font-size: 11px; color: var(--accent); background: var(--accent-dim); padding: 7px 12px; border-radius: 999px; margin-right: 4px; }
.search { display: flex; align-items: center; }

.ins-line { font-size: 13.5px; color: var(--muted); padding: 7px 0; border-bottom: 1px solid var(--line); line-height: 1.5; }
.ins-line:last-child { border-bottom: none; }
.ins-line b { color: var(--text); font-weight: 600; }

/* ═══ Income / expense color identity ═══ */
.txn.t-inc { border-left: 3px solid var(--green); }
.txn.t-exp { border-left: 3px solid color-mix(in srgb, var(--red) 55%, transparent); }
.txn.t-inc .txn-ico { background: var(--green-dim); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.txn.t-exp .txn-ico { background: var(--red-dim); border-color: color-mix(in srgb, var(--red) 18%, transparent); }
.txn-amt.neg { color: var(--red); }
.txn-amt.pos { color: var(--green); }

/* ═══ AI chat ═══ */
.sheet-tall { display: flex; flex-direction: column; height: 78dvh; }
.ai-btn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ai-msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px; }
.ai-bubble {
  max-width: 86%; padding: 11px 14px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.5; margin-bottom: 10px;
  white-space: pre-wrap; word-break: break-word;
  animation: bubIn .25s var(--ease);
}
@keyframes bubIn { from { opacity: 0; transform: translateY(6px); } }
.ai-them { background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; margin-right: auto; }
.ai-me { background: var(--accent); color: #15120c; border-bottom-right-radius: 6px; margin-left: auto; font-weight: 600; }
.ai-suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.ai-chip { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-dim); padding: 8px 13px; border-radius: 999px; }
.ai-bar { display: flex; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ai-in { flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--text); font-size: 16px; outline: none; }
.ai-in:focus { border-color: var(--accent); }
.ai-send { width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: #15120c; font-size: 18px; font-weight: 700; flex-shrink: 0; }

/* ═══ AI model picker ═══ */
.ai-models { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ai-models::-webkit-scrollbar { display: none; }
.ai-model { flex-shrink: 0; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; transition: all .15s; }
.ai-model.on { color: #15120c; background: var(--accent); border-color: transparent; font-weight: 700; }

/* ═══ Review v2: editable + summary ═══ */
.rv-desc { width: 100%; background: transparent; border: none; border-bottom: 1px dashed transparent; color: var(--text); font-size: 14.5px; font-weight: 600; outline: none; padding: 0 0 2px; }
.rv-desc:focus { border-bottom-color: var(--accent); }
.rv-summary { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 10px 4px; border-top: 1px solid var(--line); margin-bottom: 10px; }
.ai-chip-act { color: #15120c; background: var(--accent); }
.rv-dup { font-size: 10px; font-family: var(--mono); color: #e8b15c; background: rgba(232,177,92,.13); padding: 1px 7px; border-radius: 999px; letter-spacing: .05em; text-transform: uppercase; }
.carry-text { margin-bottom: 18px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.carry-text p { margin-bottom: 8px; }
.carry-text b { color: var(--text); }
.carry-net { font-family: var(--disp); font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
/* iOS-safe hidden file input (display:none breaks programmatic clicks on iOS Safari) */
.vhide { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
