/* ============================= TOKENS ============================= */
:root{
  color-scheme: light;
  --page:            #f9f9f7;
  --surface:          #fcfcfb;
  --surface-raised:   #ffffff;
  --ink:              #0b0b0b;
  --ink-secondary:    #52514e;
  --ink-muted:        #898781;
  --gridline:         #e1e0d9;
  --baseline:         #c3c2b7;
  --border:           rgba(11,11,11,0.10);
  --success-text:     #2f6b46;

  --accent:           #b76e3d;
  --accent-strong:    #8f5228;
  --accent-wash:      #f3e7db;

  --cat-alimentari:   #232a33;
  --cat-trasporti:    #b76e3d;
  --cat-casa:         #5a6b78;
  --cat-svago:        #8a5a3f;
  --cat-salute:       #8f4a5a;
  --cat-shopping:     #6b7a4f;
  --cat-abbonamenti:  #4a4a63;
  --cat-altro:        #6f6b63;

  --inc-stipendio:    #3f8f5f;
  --inc-freelance:    #4f8f8a;
  --inc-regali:       #b78a3f;
  --inc-rimborsi:     #5a7a8f;
  --inc-investimenti: #6a5a8f;
  --inc-altro:        #7a7568;

  --good:             #3f8f5f;
  --warning:          #b8862f;
  --serious:          #a8583e;
  --critical:         #a83e32;

  --font-display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius-card: 18px;
  --radius-control: 12px;
  --radius-pill: 999px;
  --shadow-raised: 0 1px 2px rgba(11,11,11,0.06), 0 8px 24px rgba(11,11,11,0.08);
  --shadow-sheet: 0 -8px 32px rgba(11,11,11,0.18);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme: dark;
    --page:            #0d0d0d;
    --surface:          #1a1a19;
    --surface-raised:   #232322;
    --ink:              #ffffff;
    --ink-secondary:    #c3c2b7;
    --ink-muted:        #898781;
    --gridline:         #2c2c2a;
    --baseline:         #383835;
    --border:           rgba(255,255,255,0.10);
    --success-text:     #5fbf8a;

    --accent:           #d1875a;
    --accent-strong:    #e8a878;
    --accent-wash:      rgba(209,135,90,0.16);

    --good:             #5fbf8a;
    --warning:          #d9a855;
    --serious:          #cf7f60;
    --critical:         #d1685a;

    --cat-alimentari:   #4a5568;
    --cat-trasporti:    #d1875a;
    --cat-casa:         #8291a0;
    --cat-svago:        #b0805f;
    --cat-salute:       #c0788a;
    --cat-shopping:     #9aab7a;
    --cat-abbonamenti:  #8484a8;
    --cat-altro:        #a29c90;

    --inc-stipendio:    #5aab7a;
    --inc-freelance:    #6bb0a8;
    --inc-regali:       #d1a85a;
    --inc-rimborsi:     #7a9fb0;
    --inc-investimenti: #8f7ab0;
    --inc-altro:        #a29c8c;

    --shadow-raised: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
    --shadow-sheet: 0 -8px 32px rgba(0,0,0,0.5);
  }
}
:root[data-theme="dark"]{
  color-scheme: dark;
  --page:            #0d0d0d;
  --surface:          #1a1a19;
  --surface-raised:   #232322;
  --ink:              #ffffff;
  --ink-secondary:    #c3c2b7;
  --ink-muted:        #898781;
  --gridline:         #2c2c2a;
  --baseline:         #383835;
  --border:           rgba(255,255,255,0.10);
  --success-text:     #5fbf8a;

  --accent:           #d1875a;
  --accent-strong:    #e8a878;
  --accent-wash:      rgba(209,135,90,0.16);

  --good:             #5fbf8a;
  --warning:          #d9a855;
  --serious:          #cf7f60;
  --critical:         #d1685a;

  --cat-alimentari:   #4a5568;
  --cat-trasporti:    #d1875a;
  --cat-casa:         #8291a0;
  --cat-svago:        #b0805f;
  --cat-salute:       #c0788a;
  --cat-shopping:     #9aab7a;
  --cat-abbonamenti:  #8484a8;
  --cat-altro:        #a29c90;

  --inc-stipendio:    #5aab7a;
  --inc-freelance:    #6bb0a8;
  --inc-regali:       #d1a85a;
  --inc-rimborsi:     #7a9fb0;
  --inc-investimenti: #8f7ab0;
  --inc-altro:        #a29c8c;

  --shadow-raised: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-sheet: 0 -8px 32px rgba(0,0,0,0.5);
}

/* ============================= RESET / BASE ============================= */
*, *::before, *::after{ box-sizing: border-box; }
html, body{ height: 100%; height: 100dvh; background: var(--page); }
body{
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button{ font-family: inherit; }
input, select, textarea{ font-family: inherit; }
h1,h2,h3,h4{ font-family: var(--font-display); margin: 0; text-wrap: balance; }
p{ margin: 0; }
.num{ font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================= AUTH SCREEN ============================= */
.auth-screen{
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 32px; text-align: center; background: var(--page);
}
.auth-screen[hidden]{ display: none; }
.auth-logo{ width: 72px; height: 72px; border-radius: 22px; box-shadow: var(--shadow-raised); }
.auth-screen h1{ font-size: 22px; }
.auth-screen p{ font-size: 13.5px; color: var(--ink-secondary); max-width: 280px; line-height: 1.5; }
.google-btn{
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--ink);
  font-weight: 600; font-size: 14px; padding: 13px 24px; border-radius: 14px; cursor: pointer;
  box-shadow: var(--shadow-raised);
}
.google-btn svg{ width: 20px; height: 20px; }
.google-btn:disabled{ opacity: 0.6; cursor: default; }
.auth-status{ font-size: 12.5px; color: var(--ink-muted); min-height: 16px; }

/* ============================= APP SHELL ============================= */
#app{
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  display: flex;
  flex-direction: column;
  background: var(--page);
}
#app[hidden]{ display: none; }

.offline-banner{
  background: var(--warning);
  color: #2a1e00;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  padding: 7px 16px;
}
.offline-banner[hidden]{ display: none; }

.topbar{
  flex-shrink: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 8px 12px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}
.month-nav-btn{
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.month-nav-btn:active{ background: var(--border); }
.month-label{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.month-label-wrap{ text-align: center; flex: 1; min-width: 0; }
.month-today-hint{
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  color: var(--accent);
  margin-top: 1px;
  cursor: pointer;
}
.account-btn{
  width: 34px; height: 34px; border-radius: 50%; border: none; padding: 0;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  overflow: hidden;
}
.account-btn img{ width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

main#views{
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.view{ display: none; }
.view.active{ display: block; animation: fadein 0.18s ease; }
@keyframes fadein{ from{ opacity: 0; transform: translateY(4px); } to{ opacity: 1; transform: none; } }

nav.tabbar{
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}
.tab-btn{
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 10px;
  cursor: pointer;
}
.tab-btn svg{ width: 21px; height: 21px; }
.tab-btn.active{ color: var(--accent); }
.tab-btn:active{ background: var(--border); }

.fab{
  position: absolute;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: var(--shadow-raised);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 6;
}
.fab:active{ transform: scale(0.96); }

/* ============================= CARDS / COMPONENTS ============================= */
.card{
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 18px;
}
.card + .card{ margin-top: 12px; }
.section-title{
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 2px 10px;
}
.section-title:first-child{ margin-top: 2px; }

.hero-amount{
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.hero-label{ font-size: 13px; color: var(--ink-secondary); font-weight: 500; margin-bottom: 6px; }
.hero-sub{ font-size: 13px; color: var(--ink-secondary); margin-top: 8px; }
.hero-amount.positive{ color: var(--good); }
.hero-amount.negative{ color: var(--critical); }
.hero-split{ display:flex; gap:18px; margin-top:10px; }
.hero-split-item{ display:flex; align-items:center; gap:6px; font-size:12.5px; color: var(--ink-secondary); }
.hero-split-item b{ color: var(--ink); font-weight:700; }
.hero-split-dot{ width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.hero-split-item.income .hero-split-dot{ background: var(--good); }
.hero-split-item.expense .hero-split-dot{ background: var(--critical); }

.meter-track{
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--gridline);
  overflow: hidden;
  margin-top: 10px;
}
.meter-fill{ height: 100%; border-radius: var(--radius-pill); transition: width 0.25s ease; }
.meter-fill.good{ background: var(--good); }
.meter-fill.warning{ background: var(--warning); }
.meter-fill.critical{ background: var(--critical); }
.meter-fill.neutral{ background: var(--accent); opacity: 0.55; }

.status-row{ display:flex; align-items:center; gap:5px; font-size:12px; font-weight:600; margin-top:7px; }
.status-row svg{ width:13px; height:13px; flex-shrink:0; }
.status-row.good{ color: var(--success-text); }
.status-row.warning{ color: #7a5400; }
.status-row.critical{ color: var(--critical); }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .status-row.warning{ color: var(--warning); }
}
:root[data-theme="dark"] .status-row.warning{ color: var(--warning); }

.banner-cta{
  display:flex; align-items:center; gap:12px;
  background: var(--accent-wash);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-top: 12px;
}
.banner-cta p{ font-size: 13px; font-weight: 500; flex: 1; line-height: 1.4; }
.banner-cta button{
  border: none; background: var(--accent); color:#fff; font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-pill); cursor: pointer; white-space: nowrap;
}

.mini-cat-row{ display:flex; align-items:center; gap:10px; padding: 9px 0; }
.mini-cat-row + .mini-cat-row{ border-top: 1px solid var(--border); }
.cat-dot{ width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.mini-cat-name{ flex:1; font-size:13.5px; font-weight:500; }
.mini-cat-amount{ font-size: 13.5px; font-weight: 600; }

.tx-row{
  display:flex; align-items:center; gap:11px; padding:11px 0; cursor:pointer;
}
.tx-row + .tx-row{ border-top: 1px solid var(--border); }
.tx-icon{
  width:36px; height:36px; border-radius:11px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size: 15px; font-weight: 700; color:#fff;
}
.tx-main{ flex:1; min-width:0; }
.tx-title{ font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tx-sub{ font-size:12px; color: var(--ink-muted); margin-top:1px; }
.tx-amount{ font-size:14.5px; font-weight:600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space:nowrap; }
.tx-amount.income{ color: var(--good); }

.day-heading{
  font-size: 12px; font-weight: 700; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 18px 2px 6px;
}
.day-heading:first-child{ margin-top: 0; }

.type-toggle{ display:flex; background: var(--gridline); border-radius:12px; padding:3px; gap:3px; margin-bottom:12px; }
.type-toggle-btn{
  flex:1; border:none; background:transparent; padding:9px; border-radius:9px;
  font-size:13px; font-weight:600; color: var(--ink-secondary); cursor:pointer;
}
.type-toggle-btn.active{ background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-raised); }

.chip-row{ display:flex; gap:8px; overflow-x:auto; padding: 2px 2px 12px; margin: 0 -2px; }
.chip-row::-webkit-scrollbar{ display:none; }
.chip{
  flex-shrink:0; border:1px solid var(--border); background: var(--surface);
  color: var(--ink-secondary); font-size:12.5px; font-weight:600;
  padding:7px 13px; border-radius: var(--radius-pill); cursor:pointer;
  display:flex; align-items:center; gap:6px; white-space:nowrap;
}
.chip.active{ background: var(--ink); color: var(--page); border-color: var(--ink); }
.chip .cat-dot{ width:8px; height:8px; }

.empty-state{
  text-align:center; padding: 40px 20px; color: var(--ink-muted);
}
.empty-state svg{ width:40px; height:40px; margin-bottom:12px; opacity:0.5; }
.empty-state p{ font-size:13.5px; font-weight:500; line-height:1.5; }
.empty-state button{
  margin-top:16px; border:none; background: var(--accent); color:#fff;
  font-size:13px; font-weight:600; padding:10px 18px; border-radius: var(--radius-pill); cursor:pointer;
}

.bar-chart-row{ margin-bottom: 13px; }
.bar-chart-row:last-child{ margin-bottom: 0; }
.bar-chart-head{ display:flex; justify-content:space-between; font-size:12.5px; font-weight:600; margin-bottom:5px; }
.bar-chart-head .pct{ color: var(--ink-muted); font-weight:500; margin-left:6px; }
.bar-track{ height:10px; border-radius: var(--radius-pill); background: var(--gridline); overflow:hidden; }
.bar-fill{ height:100%; border-radius: var(--radius-pill); }

.trend-wrap{ margin-top: 4px; }
.trend-wrap svg{ width:100%; height:auto; display:block; overflow:visible; }
.trend-legend{ display:flex; gap:14px; font-size:11.5px; font-weight:600; color: var(--ink-secondary); margin-bottom:10px; }
.trend-legend-item{ display:flex; align-items:center; gap:5px; }
.trend-legend-item .dot{ width:8px; height:8px; border-radius:50%; }
.trend-legend-item .dot.expense{ background: var(--critical); }
.trend-legend-item .dot.income{ background: var(--good); }
.trend-tooltip{
  position:absolute; pointer-events:none; background: var(--ink); color: var(--page);
  font-size:11.5px; font-weight:600; padding:5px 9px; border-radius:8px; white-space:nowrap;
  transform: translate(-50%,-130%); z-index: 4; font-family: var(--font-mono);
}

.stat-tiles{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top:12px; }
.stat-tile{ background: var(--surface); border:1px solid var(--border); border-radius:14px; padding:12px 14px; }
.stat-tile-label{ font-size:11.5px; color: var(--ink-muted); font-weight:600; }
.stat-tile-value{ font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size:18px; font-weight:600; margin-top:3px; }

.budget-row{ padding: 14px 0; }
.budget-row + .budget-row{ border-top: 1px solid var(--border); }
.budget-row-head{ display:flex; align-items:center; gap:9px; margin-bottom:8px; }
.budget-row-head .mini-cat-name{ font-weight:600; font-size:14px; }
.budget-input-wrap{ display:flex; align-items:center; gap:6px; }
.budget-input-wrap span{ font-size:13px; color: var(--ink-muted); }
.budget-input{
  width: 84px; border:1px solid var(--border); background: var(--surface-raised);
  border-radius:10px; padding:6px 9px; font-size:13.5px; color: var(--ink);
  font-family: var(--font-mono); text-align:right;
}
.budget-input:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.budget-meter-line{ font-size:12px; color: var(--ink-secondary); margin-top:8px; }

.recurring-row{ padding:13px 0; display:flex; align-items:center; gap:12px; }
.recurring-row + .recurring-row{ border-top:1px solid var(--border); }
.recurring-main{ flex:1; min-width:0; }
.recurring-title{ font-size:14px; font-weight:600; }
.recurring-sub{ font-size:12px; color:var(--ink-muted); margin-top:2px; }
.switch{
  width:40px; height:24px; border-radius: var(--radius-pill); background: var(--gridline);
  position:relative; cursor:pointer; flex-shrink:0; border:none; padding:0;
}
.switch.on{ background: var(--accent); }
.switch::after{
  content:""; position:absolute; width:18px; height:18px; border-radius:50%;
  background:#fff; top:3px; left:3px; transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch.on::after{ transform: translateX(16px); }
.recurring-add-btn{
  border:none; color: var(--accent); font-weight:600; font-size:13px;
  background: transparent; cursor:pointer; padding:8px 12px; border-radius:10px;
  border:1px solid var(--border);
}

.pending-item{ display:flex; align-items:center; gap:10px; padding:10px 0; }
.pending-item + .pending-item{ border-top:1px solid var(--border); }
.pending-item .btn-small{
  border:none; background: var(--accent); color:#fff; font-size:12px; font-weight:600;
  padding:7px 12px; border-radius: var(--radius-pill); cursor:pointer; flex-shrink:0;
}

.btn-primary{
  width:100%; border:none; background: var(--accent); color:#fff; font-weight:600;
  font-size:15px; padding:14px; border-radius:14px; cursor:pointer; margin-top: 6px;
}
.btn-primary:active{ background: var(--accent-strong); }
.btn-ghost{
  width:100%; border:1px solid var(--border); background:transparent; color: var(--ink);
  font-weight:600; font-size:14px; padding:12px; border-radius:14px; cursor:pointer;
}
.btn-danger{
  width:100%; border:none; background: var(--critical); color:#fff; font-weight:600;
  font-size:14.5px; padding:13px; border-radius:14px; cursor:pointer;
}
.link-btn{ border:none; background:transparent; color: var(--accent); font-weight:600; font-size:12.5px; cursor:pointer; padding: 4px 0; }

/* ============================= SHEET (bottom modal) ============================= */
.sheet-overlay{
  position: fixed; inset: 0; background: rgba(11,11,11,0.45);
  display:flex; align-items:flex-end; justify-content:center; z-index: 20;
}
.sheet-overlay[hidden]{ display:none; }
.sheet{
  width:100%; max-width:560px; max-height: 88vh; overflow-y:auto; overflow-x:hidden;
  background: var(--surface-raised); border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-sheet);
  animation: sheetup 0.2s ease;
}
@keyframes sheetup{ from{ transform: translateY(24px); opacity: 0.4; } to{ transform:none; opacity:1; } }
.sheet-handle{ width:36px; height:4px; background: var(--gridline); border-radius:2px; margin: 8px auto 14px; }
.sheet h3{ font-size:17px; margin-bottom: 16px; }
.field{ margin-bottom: 14px; }
.field label{ display:block; font-size:12.5px; font-weight:600; color: var(--ink-secondary); margin-bottom:6px; }
.field input, .field textarea{
  width:100%; min-width:0; border:1px solid var(--border); background: var(--page);
  border-radius:12px; padding:12px 13px; font-size:15px; color: var(--ink);
}
.field input:focus, .field textarea:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.field textarea{ resize:none; min-height: 60px; font-family: var(--font-body); }
.amount-field input{ font-family: var(--font-mono); font-size:22px; font-weight:600; text-align:left; }
.cat-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:8px; }
.cat-opt{
  display:flex; flex-direction:column; align-items:center; gap:5px;
  border:1.5px solid var(--border); border-radius:13px; padding:9px 4px; cursor:pointer;
  background: var(--page);
}
.cat-opt.selected{ border-color: var(--accent); background: var(--accent-wash); }
.cat-opt .cat-dot{ width:16px; height:16px; }
.cat-opt span{ font-size:10px; font-weight:600; text-align:center; line-height:1.2; color: var(--ink-secondary); }
.cat-opt-add{ border-style: dashed; }
.cat-dot-add{
  width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background: var(--page); border:1.5px dashed var(--ink-muted); color: var(--ink-muted);
  font-size:12px; font-weight:700; line-height:1;
}
.new-cat-form{ margin-top:10px; padding:12px; border:1px solid var(--border); border-radius:13px; background: var(--page); }
.new-cat-form[hidden]{ display:none; }
.new-cat-form-row{ display:flex; align-items:center; gap:10px; }
.new-cat-name{
  flex:1; border:1px solid var(--border); background: var(--surface-raised);
  border-radius:12px; padding:11px 12px; font-size:14px; color: var(--ink);
}
.new-cat-name:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.new-cat-color{
  width:40px; height:40px; padding:0; border:1px solid var(--border); border-radius:10px;
  background:none; cursor:pointer; flex-shrink:0;
}
.new-cat-actions{ display:flex; gap:8px; margin-top:10px; }
.new-cat-actions button{ flex:1; margin:0; padding:10px; font-size:13px; }
.switch-field{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.switch-field label{ font-size:13.5px; font-weight:600; margin:0; }
.freq-row{ display:flex; gap:8px; }
.freq-row .field{ flex:1; margin-bottom:0; }
.freq-row select{
  width:100%; border:1px solid var(--border); background: var(--page);
  border-radius:12px; padding:12px 13px; font-size:14px; color: var(--ink);
}

.detail-amount{ font-family: var(--font-mono); font-size:30px; font-weight:600; text-align:center; margin: 4px 0 4px; }
.detail-amount.income{ color: var(--good); }
.detail-cat{ text-align:center; font-size:13px; color: var(--ink-secondary); font-weight:600; margin-bottom:18px; }
.detail-row{ display:flex; justify-content:space-between; padding:10px 0; font-size:13.5px; }
.detail-row + .detail-row{ border-top:1px solid var(--border); }
.detail-row span:first-child{ color: var(--ink-muted); }
.detail-row span:last-child{ font-weight:600; text-align:right; max-width: 60%; }

.toast{
  position: fixed; left:50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink); color: var(--page); font-size:13px; font-weight:600;
  padding:10px 18px; border-radius: var(--radius-pill); z-index: 30;
  box-shadow: var(--shadow-raised);
}
.toast[hidden]{ display:none; }
