/* Louis Finance interface system · RC31 working build */
:root {
  --bg:#f3f6f7; --surface:#fff; --surface2:#f6f8f9;
  --ink:#182932; --muted:#667983; --line:#dce5e8;
  --accent:#126b61; --accent-light:#e7f4f0; --hero:#142b35;
  --gold:#d6b172; --red:#b9504c; --yellow:#a7762e; --green:#177865;
  --shadow:0 16px 42px rgba(23,48,60,.055); --radius:16px;
}
html[data-theme=dark] {
  --bg:#101a22; --surface:#17252e; --surface2:#1d3039;
  --ink:#edf4f3; --muted:#a6b9bd; --line:#32434b;
  --accent:#71d7bd; --accent-light:#1d3c39; --hero:#142b35;
  --gold:#e1c28d; --red:#f0938a; --yellow:#e5bb78; --green:#80d9b8;
  --shadow:0 14px 40px rgba(0,0,0,.12);
}
body {font-size:15px;line-height:1.58;letter-spacing:.003em}
h1,h2,h3,h4 {color:var(--ink);letter-spacing:-.035em}
h1 {font-size:34px;font-weight:700;line-height:1.18}
h2 {font-size:23px;font-weight:680;line-height:1.25}
h3 {font-size:17px;font-weight:650;line-height:1.35}
small {font-size:12px}
.eyebrow {font-size:11px;font-weight:750;letter-spacing:.16em;text-transform:uppercase;margin-bottom:8px}
label {font-size:13px;font-weight:600;gap:7px}
input,select,textarea {border-radius:11px;padding:12px 14px;min-height:44px;border-color:var(--line);background:var(--surface);font-size:14px}
textarea {min-height:84px}
input:focus,select:focus,textarea:focus {box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 15%,transparent)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {outline:3px solid var(--gold);outline-offset:2px}
.primary,.secondary,.text-button,.icon-button {font-weight:650;border-radius:10px}
.primary {background:#146f63;color:#fff;min-height:44px;padding:10px 18px;box-shadow:0 5px 13px rgba(18,107,97,.12)}
.secondary {min-height:44px;padding:10px 16px}
.text-button {font-size:13px}
.icon-button {width:42px;height:42px;font-size:22px}
.shell {grid-template-columns:250px minmax(0,1fr)}
.sidebar {padding:26px 17px 20px;background:var(--surface);box-shadow:6px 0 30px rgba(19,46,56,.025)}
.brand {gap:12px;margin-bottom:37px;padding:0 9px}
.brand-mark.small {height:43px;width:43px;border-radius:12px;background:#142f37;box-shadow:0 6px 18px rgba(11,44,47,.17)}
.brand strong {font-size:17px;letter-spacing:.015em;font-weight:750;line-height:1.2}
.brand small {font-size:10px;letter-spacing:.08em;margin-top:3px}
.nav-label {font-size:10px;font-weight:750;letter-spacing:.14em;margin:0 13px 12px;text-transform:uppercase}
.sidebar nav {gap:3px;scrollbar-width:thin;scrollbar-color:var(--line) transparent;padding-right:2px}
.nav-item {min-height:43px;padding:10px 13px;border-radius:10px;font-size:14px;font-weight:530;color:var(--muted);transition:background .16s,color .16s,transform .16s}
.nav-item:hover {transform:translateX(2px);color:var(--ink)}
.nav-item.active {background:var(--accent-light);color:var(--accent);font-weight:750;box-shadow:inset 3px 0 0 var(--accent)}
.nav-icon,.nav-icon svg {width:19px;height:19px}
.local-badge {font-size:11px;letter-spacing:.04em;margin-bottom:12px}
.owner {padding-top:16px}
.owner strong {font-size:12px;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.owner small {font-size:11px}
.avatar {height:36px;width:36px;background:var(--accent-light);color:var(--accent)}
.main {max-width:1630px;padding:0 clamp(24px,3.3vw,58px)}
.topbar {height:72px;gap:18px}
.breadcrumbs {font-size:12px;letter-spacing:.015em;font-weight:600}
.signed-in-account {font-size:11px;color:var(--muted);margin-top:3px}
.search-button {min-height:40px;min-width:235px;justify-content:space-between;border-radius:10px;padding:9px 13px;font-size:12px}
.search-button kbd {font-size:11px}
.page-head {padding:32px 0 23px;align-items:flex-end}
.page-head .muted {font-size:14px;margin-top:9px;max-width:700px}
.page-head #page-actions {display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.demo-strip {align-items:flex-start;gap:9px;border:1px solid var(--line);background:color-mix(in srgb,var(--surface) 74%,var(--bg));border-radius:10px;padding:10px 13px;margin:0 0 24px;font-size:11px;line-height:1.4}
.demo-strip #sync-time {font-size:11px;text-align:right}
.page-footer {font-size:11px;letter-spacing:.035em;padding:23px 0 29px}
.panel,.account-card {border-radius:var(--radius);box-shadow:var(--shadow);padding:24px}
.panel+.panel {margin-top:18px}
.panel-head {margin-bottom:19px;align-items:flex-start}
.panel-head p {font-size:12px;line-height:1.45;margin-top:5px}
.kpi-grid {gap:14px;margin:18px 0 24px}
.kpi {min-height:125px;padding:20px 21px;border-radius:15px;box-shadow:var(--shadow);transition:transform .18s,border-color .18s,box-shadow .18s}
.kpi:hover {transform:translateY(-2px);border-color:color-mix(in srgb,var(--accent) 45%,var(--line));box-shadow:0 20px 35px rgba(17,58,64,.09)}
.kpi-label {font-size:12px;font-weight:620;margin-bottom:12px}
.kpi strong {font-size:clamp(24px,2vw,32px);font-weight:720;letter-spacing:-.045em;font-variant-numeric:tabular-nums;line-height:1.16}
.kpi small {font-size:11px;line-height:1.4;margin-top:10px}
.wealth-hero,.money-now,.v2-hero {background:radial-gradient(circle at 95% 3%,rgba(121,204,178,.17) 0,transparent 38%),linear-gradient(130deg,#162c39,#154a49 82%,#216458);border-radius:18px;box-shadow:0 22px 55px rgba(17,48,56,.15)}
.wealth-hero {min-height:255px;padding:31px 34px}
.wealth-hero .eyebrow,.wealth-hero .hero-title {color:#c3dbd8}
.hero-amount {font-size:clamp(40px,4vw,58px);font-weight:700;letter-spacing:-.055em;margin:16px 0 21px}
.hero-amount small {color:#c6d8d6;font-size:14px}
.hero-bottom {gap:28px;padding-top:16px}
.hero-bottom span {font-size:11px;color:#b5cfca}
.hero-bottom strong {font-size:19px;font-weight:670}
.money-now {padding:30px 32px}
.money-now p,.money-now>small {color:#bfd8d5;font-size:12px}
.money-now h2 {font-size:20px;color:#fff}
.money-now>strong {font-size:clamp(38px,3.5vw,54px);letter-spacing:-.055em;margin:16px 0 11px}
.v2-hero h2,.v2-hero h3 {color:#fff}
.tabs {gap:3px;border-color:var(--line);margin-bottom:20px}
.tab {font-size:14px;font-weight:600;padding:11px 17px;min-height:44px}
.tab.active {font-weight:750}
.toolbar {gap:11px;margin-bottom:19px}
.toolbar label {font-size:12px;min-width:135px}
.toolbar input,.toolbar select {font-size:14px;padding:10px 12px;min-height:44px}
.list-row {padding:16px 0;gap:15px}
.list-row strong {font-size:14px;font-weight:650}
.list-row small {font-size:12px;margin-top:2px}
.list-row .amount {font-size:17px;font-weight:700;font-variant-numeric:tabular-nums}
.table-wrap {border-radius:11px;border:1px solid var(--line)}
.table-wrap table {border-collapse:collapse;width:100%}
.table-wrap th {background:var(--surface2);color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.02em}
.table-wrap th,.table-wrap td {padding:12px 13px;border-bottom:1px solid var(--line)}
.table-wrap tbody tr:hover {background:var(--surface2)}
.account-card h3 {font-size:17px;font-weight:720}
.account-card .bank-label {font-size:12px;margin:5px 0 18px}
.account-card .balance {font-size:32px;font-weight:730;letter-spacing:-.05em;font-variant-numeric:tabular-nums}
.account-card .account-stats {gap:13px;margin:21px 0 13px;padding-top:16px}
.account-stats span {font-size:12px}
.account-stats strong {font-size:15px;font-weight:680}
.account-card.credit {background:linear-gradient(150deg,var(--surface),color-mix(in srgb,var(--accent-light) 45%,var(--surface)))}
#view>.empty {min-height:300px;border:1px solid var(--line);border-radius:18px;background:radial-gradient(circle at 50% 10%,var(--accent-light),transparent 42%),var(--surface);display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:var(--shadow);padding:35px 24px}
.empty strong {font-size:18px;font-weight:710}
.empty p {font-size:13px;line-height:1.6}
.empty .primary {margin-top:3px}
/* Authentication should carry the same visual identity as the application. */
.auth-layout {background:var(--bg)}
.auth-art {background:radial-gradient(circle at 88% 4%,rgba(128,211,184,.18),transparent 36%),linear-gradient(145deg,#102a36,#15544d);padding:clamp(34px,5vw,78px)}
.auth-art h1 {font-family:inherit;font-size:clamp(48px,5vw,76px);font-weight:720;letter-spacing:-.07em;line-height:1.06;color:#fff}
.auth-art .eyebrow {font-size:11px;color:#b2d7ca}
.auth-art .auth-copy {font-size:15px;line-height:1.85;color:#d1e3df}
.auth-card {background:var(--surface);border:1px solid var(--line);border-radius:20px;max-width:460px;padding:clamp(28px,3.5vw,48px);box-shadow:0 30px 70px rgba(15,44,49,.09)}
.auth-card h2 {font-size:32px}
.auth-card>.muted {font-size:14px}
.auth-card>.note {font-size:12px}
/* The assistant stays available and leaves the main page visible. */
.ai-fab {background:#153d40;border:1px solid #76bfa745;box-shadow:0 12px 32px rgba(9,46,49,.23);font-size:20px}
.ai-fab small {font-size:12px;font-weight:700}
.ai-drawer {border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 65px rgba(12,39,48,.2);background:var(--surface)}
.ai-drawer header {padding:17px 19px;background:var(--surface2);border-radius:18px 18px 0 0}
.ai-drawer header strong {font-size:16px}
.ai-drawer header small {font-size:11px;line-height:1.4}
.ai-thread {font-size:14px;line-height:1.55}
.ai-compose {border-top:1px solid var(--line)}
.ai-quick button {border-radius:999px;min-height:33px;font-size:12px}
.ai-input-row textarea {font-size:14px}
/* Trading has a focused, separate workstation canvas. */
body:has(.trade-workspace) {background:#0c1720;color:#edf4f5}
body:has(.trade-workspace) .main {max-width:none;padding:0 clamp(16px,2.3vw,42px)}
body:has(.trade-workspace) .topbar {border-bottom-color:#263b46;color:#d9e9e8}
body:has(.trade-workspace) .breadcrumbs,body:has(.trade-workspace) .signed-in-account {color:#9eb4bd}
body:has(.trade-workspace) .breadcrumbs span {color:#e9f3f2}
body:has(.trade-workspace) .search-button,body:has(.trade-workspace) .topbar .icon-button {background:#172833;border-color:#304550;color:#d4e5e5}
body:has(.trade-workspace) .demo-strip {background:#14232d;border-color:#2a3c48;color:#aac0c5}
body:has(.trade-workspace) .page-footer {border-color:#293d47;color:#a4b9c0}
.trade-workspace {--trade-bg:#101f2a;--trade-panel:#172a35;--trade-line:#304650;--trade-ink:#eaf3f4;--trade-muted:#a8bec5;background:linear-gradient(165deg,#11252f,#0e1d27 55%,#10242b);border:1px solid #2b444e;border-radius:18px;padding:clamp(18px,2vw,30px);box-shadow:0 26px 64px rgba(0,0,0,.16);color:var(--trade-ink);font-size:14px}
.trade-workspace h2,.trade-workspace h3,.trade-workspace h4 {color:var(--trade-ink)}
.trade-workspace-head {padding-bottom:23px;border-bottom:1px solid var(--trade-line)}
.trade-workspace-head small {font-size:11px;font-weight:750;color:#80d6c6}
.trade-workspace-head h2 {font-size:clamp(31px,3vw,44px);font-weight:740;letter-spacing:-.055em;margin:8px 0 9px}
.trade-workspace-head h2 span {color:#9db4be;font-weight:560}
.trade-workspace-head p {font-size:13px;color:var(--trade-muted)}
.trade-workspace .primary {background:#58c9ae;color:#10282a;box-shadow:none}
.trade-workspace .secondary,.trade-workspace .text-button {background:#203641;border-color:#38515a;color:#e7f4f3}
.trade-workspace button {min-height:43px}
.trade-source-grid {gap:10px;margin:20px 0 7px}
.trade-source-card {padding:14px;border-radius:11px;background:#172c36;border-color:#36515a;transition:transform .16s,background .16s,border-color .16s}
.trade-source-card:hover {transform:translateY(-2px);background:#203b45;border-color:#69bba9}
.trade-source-card span {font-size:12px;color:#b3c8cb}
.trade-source-card strong {font-size:15px;font-weight:740;margin:4px 0}
.trade-source-card small {font-size:11px;color:#9fb8bf}
.trade-source-card.current strong {color:#7ee0c4}
.trade-source-card.stale strong,.trade-source-card.dated strong {color:#f1c67d}
.trade-layout {grid-template-columns:minmax(215px,258px) minmax(0,1fr);gap:15px;margin-top:20px}
.trade-watch,.trade-main {border-color:var(--trade-line);border-radius:13px;background:#172a35}
.trade-watch {padding:16px}
.trade-watch h3 {font-size:13px;letter-spacing:.035em;margin-bottom:15px;color:#bad0d4}
.trade-watch-row {border-radius:9px;min-height:54px}
.trade-watch-row.active,.trade-watch-row:hover {background:#234640;border-color:#568c7d}
.trade-tabs {gap:3px;padding:10px;border-bottom:1px solid var(--trade-line);background:#172a35}
.trade-tabs button {font-size:13px;font-weight:660;border-radius:8px;padding:8px 14px}
.trade-tabs button.active {background:#2b5a52;color:#f4fffc}
.trade-panel {padding:clamp(17px,2vw,27px)}
.trade-source-line {font-size:12px;color:#b6c8cb;line-height:1.45}
.trade-source-line .attention {color:#f1c67d}
.trade-quote-grid {gap:14px}
.trade-quote-primary,.trade-quote-secondary,.trade-inline-panel,.trade-metrics>div {border-color:#38515a;border-radius:11px;background:#1d3440;padding:20px}
.trade-quote-primary>strong {font-size:clamp(50px,5vw,76px);font-weight:730;letter-spacing:-.07em;color:#8ae4c7;line-height:1.05;margin:7px 0}
.trade-quote-primary>small,.trade-quote-primary>p {font-size:12px;color:#b0c7ca}
.trade-quote-secondary .detail-list span {color:#b0c7ca}
.trade-inline-panel h3 {font-size:16px}
.trade-metrics strong {font-size:24px;font-weight:730}
.trade-decision-grid p,.trade-evidence-grid section {background:#1b313c;border-color:#38515a;border-radius:10px}
.trade-decision-grid span {font-size:12px}
.trade-decision-grid strong {font-size:14px}
.trade-chart svg {background:#172d37}
.trade-chart svg line {stroke:#345361}
.trade-chart svg polyline {stroke:#73d5b6}
.trade-entry {background:linear-gradient(125deg,#122b38,#1c4a49);border:1px solid #3b645f;border-radius:16px;padding:24px}
.trade-entry small {font-size:11px;color:#98d7c7}
.trade-entry h2 {font-size:24px;color:#fff}
.trade-entry p {font-size:14px;color:#c7dbda}
.trade-entry .text-button {background:#79d9bd;color:#10312f;font-weight:750}
body:has(.trade-workspace) .ai-drawer {background:#172a35;color:#eaf4f3;border-color:#37505a}
body:has(.trade-workspace) .ai-drawer header {background:#203943;border-color:#37505a}
body:has(.trade-workspace) .ai-drawer header strong {color:#f3fbfa}
body:has(.trade-workspace) .ai-drawer header small {color:#b4c9cc}
/* Tablet and handset: readable, full-width, touch-friendly controls. */
@media(max-width:1050px) {
  .shell {grid-template-columns:215px minmax(0,1fr)}
  .sidebar {padding:22px 11px 16px}
  .main {padding:0 24px}
  .page-head {align-items:flex-start}
  .search-button {min-width:0}
}
@media(max-width:760px) {
  body {font-size:15px}
  .sidebar {display:none}
  .shell {display:block}
  .main {padding:0 16px}
  .topbar {height:64px;min-height:64px;gap:8px}
  .breadcrumbs {font-size:11px}
  .signed-in-account {font-size:10px}
  .top-tools {gap:3px}
  .search-button {min-width:42px;width:42px;height:42px;padding:0;justify-content:center}
  .search-button>span {display:none}
  .search-button kbd {border:0;font-family:inherit;font-size:18px}
  .search-button kbd::before {content:'⌕'}
  .search-button kbd {font-size:0}
  .search-button kbd::before {font-size:25px;line-height:1}
  .mobile-nav {display:block;margin-top:14px}
  .mobile-nav select {font-size:14px;font-weight:650;min-height:46px;padding:10px 13px}
  .page-head {padding:25px 0 18px;gap:14px;align-items:flex-start;flex-wrap:wrap}
  .page-head h1 {font-size:30px}
  .page-head .muted {font-size:13px;max-width:100%;line-height:1.5}
  .page-head #page-actions {justify-content:flex-start;width:100%}
  .page-head #page-actions button {min-height:43px}
  .demo-strip {padding:10px 12px;margin-bottom:17px;flex-wrap:wrap;font-size:11px}
  .demo-strip #sync-time {margin-left:15px;text-align:left;width:100%}
  .panel,.account-card {padding:19px;border-radius:14px}
  .kpi-grid {gap:10px}
  .kpi {min-height:115px;padding:16px}
  .kpi-label {font-size:12px}
  .kpi strong {font-size:clamp(21px,6vw,29px)}
  .wealth-hero,.money-now,.v2-hero {border-radius:16px;margin:0;box-shadow:0 16px 30px rgba(14,54,57,.13)}
  .wealth-hero {padding:24px;min-height:225px}
  .hero-amount {font-size:clamp(36px,9vw,49px)}
  .hero-bottom strong {font-size:16px}
  .money-now {padding:24px}
  .money-now>strong {font-size:clamp(36px,9vw,48px)}
  .tabs {flex-wrap:nowrap;overflow:auto;scrollbar-width:none}
  .tab {white-space:nowrap;min-height:46px}
  .toolbar label {min-width:125px}
  .toolbar input,.toolbar select {font-size:16px}
  .bottom-nav {height:70px;padding-bottom:env(safe-area-inset-bottom);box-sizing:content-box;background:color-mix(in srgb,var(--surface) 96%,transparent);border-top:1px solid var(--line);box-shadow:0 -12px 30px rgba(18,47,55,.06)}
  .bottom-nav a,.bottom-nav button {min-height:56px;font-size:11px;font-weight:620;gap:3px;position:relative}
  .bottom-nav a.active::before {content:'';position:absolute;top:0;width:26px;height:3px;background:var(--accent);border-radius:0 0 3px 3px}
  .bottom-nav span {font-size:20px}
  .ai-drawer {bottom:78px;right:8px;left:auto;width:calc(100vw - 16px);height:min(60dvh,550px);border-radius:16px}
  .ai-drawer.open {bottom:78px;height:min(60dvh,550px)}
  .ai-drawer header {border-radius:16px 16px 0 0}
  .auth-art {min-height:230px;padding:28px}
  .auth-art h1 {font-size:clamp(34px,10vw,46px)}
  .auth-card {margin:0 auto 28px;border-radius:18px;padding:29px 24px}
  body:has(.trade-workspace) .main {padding:0 10px}
  body:has(.trade-workspace) .topbar {height:62px;min-height:62px}
  body:has(.trade-workspace) .demo-strip {margin:10px 0 14px}
  .trade-workspace {padding:14px;border-radius:13px;min-height:calc(100dvh - 170px);font-size:14px}
  .trade-workspace-head {gap:13px}
  .trade-workspace-head h2 {font-size:32px}
  .trade-workspace-head p {font-size:12px}
  .trade-workspace-head .button-row {gap:6px}
  .trade-workspace-head .button-row button {font-size:12px;min-height:42px;padding:8px}
  .trade-source-grid {gap:8px;margin-top:16px}
  .trade-source-card {flex-basis:142px;min-height:83px;padding:12px}
  .trade-layout {grid-template-columns:1fr;gap:12px;margin-top:14px}
  .trade-watch {padding:10px}
  .trade-panel {padding:14px}
  .trade-tabs {padding:8px}
  .trade-tabs button {min-height:46px;font-size:13px}
  .trade-quote-primary>strong {font-size:clamp(50px,13vw,65px)}
  .trade-depth {grid-template-columns:1fr}
  .trade-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
  .trade-evidence-grid {grid-template-columns:1fr}
  body:has(.trade-workspace) .bottom-nav {background:#142630;border-top-color:#36505a}
  body:has(.trade-workspace) .bottom-nav a,body:has(.trade-workspace) .bottom-nav button {color:#b4c9cc}
  body:has(.trade-workspace) .bottom-nav a.active {color:#85dbbf}
}
@media(max-width:390px) {
  .main {padding:0 13px}
  .page-head h1 {font-size:27px}
  .kpi {padding:14px}
  .kpi strong {font-size:21px}
  body:has(.trade-workspace) .main {padding:0 7px}
  .trade-workspace {padding:11px}
  .trade-source-card {flex-basis:132px}
}
@media(prefers-reduced-motion:reduce) {
  .nav-item,.kpi,.trade-source-card {transition:none}
}
/* Compact header: keep account, actions and page switch on separate non-overlapping rows. */
@media(max-width:760px) {
  .topbar,body:has(.trade-workspace) .topbar {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;height:70px;min-height:70px;flex-wrap:nowrap}
  .header-identity,body:has(.trade-workspace) .header-identity {grid-column:1;grid-row:1;min-width:0;flex-basis:auto;margin-right:0}
  .top-tools,body:has(.trade-workspace) .top-tools {grid-column:2;grid-row:1;gap:1px;margin:0}
  .signed-in-account,body:has(.trade-workspace) .signed-in-account {max-width:142px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-logout {min-height:40px;padding:6px 8px;font-size:11px}
  .topbar .icon-button {height:40px;width:36px;font-size:20px}
  .mobile-nav {margin-top:12px}
}
.trade-source-grid {scrollbar-width:none}
.trade-source-grid::-webkit-scrollbar,.trade-tabs::-webkit-scrollbar {display:none}
body:has(.trade-workspace) .signed-in-account,body:has(.trade-workspace) #current-account {color:#afc6ca}
@media(max-width:760px) {
  .ai-drawer,.ai-drawer.open {width:calc(100% - 16px);right:8px;left:auto}
}
@media(max-width:900px) and (min-width:761px) {
  .shell {display:block}
  .sidebar {display:none}
  .main {max-width:none;padding:0 24px}
  .mobile-nav {display:block;margin-top:14px}
  .mobile-nav select {font-size:14px;font-weight:650;min-height:44px}
  .page-head {padding-top:25px}
}


/* Source-first account review: book balance and bank evidence stay separate. */
.account-review {display:flex;flex-direction:column;gap:12px;min-width:0}
.account-review-heading {display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.account-review-heading h3 {margin:0}
.account-review-heading small {color:var(--muted)}
.account-review-amount,.account-review-source {padding:15px 16px;border:1px solid var(--line);border-radius:13px;background:var(--surface2)}
.account-review-amount>span,.account-review-source>span {display:block;color:var(--muted);font-size:12px;font-weight:650}
.account-review-amount>strong,.account-review-source>strong {display:block;margin:4px 0;font-size:clamp(23px,2.3vw,31px);letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.account-review-amount>small,.account-review-source>small,.account-review-warning {display:block;color:var(--muted);font-size:11px;line-height:1.5}
.account-review-source {background:var(--accent-light);border-color:color-mix(in srgb,var(--accent) 18%,var(--line))}
.account-review-baseline {margin:0;padding:9px 2px;font-size:12px;color:var(--muted)}
.account-review .button-row {margin-top:auto;display:flex;flex-wrap:wrap;gap:7px}
.account-review .button-row button {min-height:42px}
@media(max-width:680px){
 .account-review {gap:10px}
 .account-review .button-row button {flex:1 1 44%}
 .account-review .button-row button:first-child {flex-basis:100%}
}

/* The assistant reports its real capability before any question is sent. */
.ai-connection {padding:10px 16px;background:var(--accent-light);color:var(--accent);font-size:12px;line-height:1.5;border-bottom:1px solid var(--line)}
.ai-connection.limited {background:color-mix(in srgb,var(--gold) 12%,var(--surface2));color:var(--ink)}
.ai-fab {min-width:110px;min-height:54px;padding:0 16px;display:flex;align-items:center;justify-content:center;gap:7px;border-radius:999px;letter-spacing:.01em}
.ai-fab:hover,.ai-fab:focus-visible {transform:translateY(-2px);box-shadow:0 18px 40px rgba(9,46,49,.29)}
.ai-drawer {overflow:hidden}
.ai-thread {scrollbar-color:var(--line) transparent}
@media(max-width:680px){
 .ai-connection {font-size:11px;padding:8px 13px}
 .ai-fab {display:none}
 .ai-drawer {max-height:calc(100dvh - 160px)}
}

/* Keep the assistant composer inside an iPhone viewport, including while the keyboard is open. */
@media (max-width: 680px) {
  .ai-drawer {box-sizing:border-box;max-width:calc(100vw - 16px);min-width:0;}
  .ai-drawer.keyboard-open {max-height:none !important;overflow:hidden;}
  .ai-drawer header,.ai-compose,.ai-thread {min-width:0;}
  .ai-thread {min-height:0;overscroll-behavior:contain;}
  .ai-input-row {display:grid;grid-template-columns:minmax(0,1fr) 42px 42px 54px;align-items:end;gap:6px;min-width:0;}
  .ai-input-row textarea {box-sizing:border-box;width:100%;min-width:0;max-width:100%;font-size:16px;}
  .ai-input-row .ai-voice-button {box-sizing:border-box;width:42px;min-width:0;padding:5px;}
  .ai-input-row [data-action="ai-send"] {box-sizing:border-box;width:54px;min-width:0;padding:5px;white-space:nowrap;word-break:keep-all;writing-mode:horizontal-tb;}
  .ai-drawer.keyboard-open .ai-compose {padding-bottom:max(8px,env(safe-area-inset-bottom));}
}
.account-ledger-row {display:flex;width:100%;align-items:center;justify-content:space-between;gap:14px;padding:13px 3px;border:0;border-top:1px solid var(--line);background:transparent;color:var(--ink);text-align:left;cursor:pointer}
.account-ledger-row span {display:grid;gap:3px;min-width:0}
.account-ledger-row strong {font-size:14px}
.account-ledger-row small {color:var(--muted);font-size:11px}
.account-ledger-row b {font-size:19px;font-variant-numeric:tabular-nums;white-space:nowrap}
.account-ledger-home>.text-button {margin-top:12px}
@media(max-width:680px){.account-ledger-row b{font-size:17px}.account-ledger-row strong{font-size:13px}}

/* Keep modal fields and save controls visible when an iPhone keyboard reduces the visual viewport. */
@media (max-width: 680px) {
  dialog.mobile-keyboard-open {position:fixed;margin-top:0;margin-bottom:0;overflow:auto;overscroll-behavior:contain;}
  dialog input:not([type="checkbox"]),dialog select,dialog textarea {font-size:16px;}
}
