/* Leo's Finances — warm, refined, quiet. Paper-and-ink, single green accent. */

@font-face { font-family:'Fraunces'; src:url('../vendor/fonts/fraunces-latin-400-normal.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Fraunces'; src:url('../vendor/fonts/fraunces-latin-600-normal.woff2') format('woff2'); font-weight:600; font-display:swap; }
@font-face { font-family:'Fraunces'; src:url('../vendor/fonts/fraunces-latin-700-normal.woff2') format('woff2'); font-weight:700; font-display:swap; }
@font-face { font-family:'Hanken Grotesk'; src:url('../vendor/fonts/hanken-grotesk-latin-400-normal.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Hanken Grotesk'; src:url('../vendor/fonts/hanken-grotesk-latin-500-normal.woff2') format('woff2'); font-weight:500; font-display:swap; }
@font-face { font-family:'Hanken Grotesk'; src:url('../vendor/fonts/hanken-grotesk-latin-600-normal.woff2') format('woff2'); font-weight:600; font-display:swap; }

:root {
  --paper:#F4F0E7;
  --card:#FFFFFF;
  --ink:#29251F;
  --muted:#8C857A;
  --green:#2E6B4F;
  --green-dark:#234f3b;
  --teal:#3E8E7E;
  --save-tint:#E7F0EA;
  --teal-tint:#E5F0EC;
  --track:#EAE4D7;
  --line:rgba(41,37,31,0.09);
  --line-strong:rgba(41,37,31,0.16);
  --amber:#B8791F;
  --amber-tint:#F6ECD8;
  --down:#B23B2C;
  --down-tint:#F6E4E1;

  /* legacy aliases so older inline references keep working */
  --paper-2:var(--track);
  --ink-soft:var(--muted);
  --ink-faint:var(--muted);
  --green-soft:var(--save-tint);
  --clay:var(--teal);
  --gold:var(--amber);
  --danger:var(--down);

  --radius:14px;
  --radius-sm:10px;
  --display:'Fraunces',Georgia,serif;
  --sans:'Hanken Grotesk',-apple-system,system-ui,sans-serif;
  --maxw:980px;
}

* { box-sizing:border-box; margin:0; padding:0; }
html,body { height:100%; }
body {
  font-family:var(--sans);
  color:var(--ink);
  background:var(--paper);
  -webkit-font-smoothing:antialiased;
  line-height:1.55;
  font-size:16px;
}
a { color:var(--green); text-decoration:none; }
a:hover { text-decoration:underline; }
button { font-family:inherit; cursor:pointer; }
h1,h2,h3 { font-family:var(--display); font-weight:600; line-height:1.12; letter-spacing:-.01em; color:var(--ink); }
.num { font-family:var(--display); font-variant-numeric:tabular-nums; letter-spacing:-.01em; }
.ic { display:inline-block; vertical-align:-.18em; flex:none; }

/* ---- App layout: sidebar + content ---- */
.layout { display:flex; min-height:100vh; align-items:stretch; }
.sidebar {
  width:236px; flex:none; background:var(--card); border-right:1px solid var(--line);
  padding:1.4rem 1rem; position:sticky; top:0; height:100vh;
  display:flex; flex-direction:column; gap:.25rem;
}
.sidebar .brand {
  display:flex; align-items:center; gap:.55rem; font-family:var(--display); font-weight:700;
  font-size:1.18rem; color:var(--ink); padding:.2rem .5rem 1.1rem;
}
.sidebar .brand .ic { color:var(--green); }
.navlink {
  display:flex; align-items:center; gap:.7rem; width:100%; text-align:left;
  padding:.62rem .75rem; border:0; background:transparent; border-radius:11px;
  color:var(--muted); font-weight:500; font-size:.95rem;
  transition:background .15s, color .15s;
}
.navlink:hover { background:var(--paper); color:var(--ink); }
.navlink.active { background:var(--green); color:#fff; }
.sidebar .spacer { flex:1; }
.sidebar .foot { color:var(--muted); font-size:.78rem; padding:.4rem .6rem; }

.content { flex:1; min-width:0; }
main { max-width:var(--maxw); margin:0 auto; padding:2.1rem 2.1rem 4.5rem; }
.screen { animation:screenIn .34s cubic-bezier(.22,.68,0,1) both; }
@keyframes screenIn { from { opacity:0; transform:translateY(10px) scale(.994); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce){ .screen { animation:none; } }
@keyframes rise { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.page-title { font-size:1.5rem; margin-bottom:.15rem; }
.page-sub { color:var(--muted); margin-bottom:1.1rem; font-size:.95rem; }
.eyebrow { color:var(--green); font-weight:600; font-size:.82rem; letter-spacing:.01em; }

/* ---- Greeting banner ---- */
.greet { position:relative; overflow:hidden; background:var(--green); color:#fff; border-radius:18px; padding:1.7rem 1.9rem; margin-bottom:1.5rem; }
.greet .flow { position:absolute; inset:0; width:100%; height:100%; opacity:.5; }
.greet-inner { position:relative; z-index:1; }
.greet h1 { color:#fff; font-size:1.7rem; margin-bottom:.12rem; }
.greet p { color:rgba(255,255,255,.82); font-size:.95rem; }

/* ---- Cards & grid ---- */
.grid { display:grid; gap:1rem; }
.grid.cols-2 { grid-template-columns:repeat(2,1fr); }
.grid.cols-3 { grid-template-columns:repeat(3,1fr); }
.grid.cols-4 { grid-template-columns:repeat(4,1fr); }
@media (max-width:760px){ .grid.cols-2,.grid.cols-3,.grid.cols-4 { grid-template-columns:1fr; } .grid.cols-4.keep-2,.grid.cols-3.keep-2 { grid-template-columns:1fr 1fr; } }

.card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:1.15rem 1.2rem; }
.card.tap { transition:transform .15s, border-color .15s; cursor:pointer; }
.card.tap:hover { transform:translateY(-2px); border-color:var(--line-strong); }
.card h3 { font-size:1.05rem; }
.card-head { display:flex; align-items:center; justify-content:space-between; gap:.6rem; margin-bottom:.9rem; }

.stat-label { color:var(--muted); font-size:.82rem; letter-spacing:.01em; font-weight:600; display:flex; align-items:center; gap:.4rem; }
.stat-label .ic { color:var(--muted); }
.stat-value { font-family:var(--display); font-size:2rem; font-variant-numeric:tabular-nums; letter-spacing:-.01em; margin-top:.25rem; }
.stat-value.lg { font-size:2.5rem; }
.stat-foot { color:var(--muted); font-size:.85rem; margin-top:.35rem; }
.pos { color:var(--green); } .neg { color:var(--down); } .warn { color:var(--amber); }

/* ---- Lists / rows ---- */
.row { display:flex; align-items:center; gap:.8rem; padding:.7rem 0; border-top:1px solid var(--line); }
.row:first-of-type { border-top:0; }
.row .grow { flex:1; min-width:0; }
.row .title { font-weight:500; }
.row .meta { color:var(--muted); font-size:.83rem; }
.row .amount { font-family:var(--display); font-variant-numeric:tabular-nums; font-weight:600; }
.muted { color:var(--muted); }
.strike .title, .strike .amount { text-decoration:line-through; color:var(--muted); }

/* ---- Check toggle ---- */
.check { width:24px; height:24px; border-radius:7px; border:2px solid var(--line-strong); display:grid; place-items:center; background:var(--card); flex:none; transition:all .15s; color:#fff; }
.check[aria-pressed="true"] { background:var(--green); border-color:var(--green); }
.check svg { width:14px; height:14px; opacity:0; transition:opacity .15s; }
.check[aria-pressed="true"] svg { opacity:1; }

/* ---- Buttons ---- */
.btn { border:1px solid var(--line-strong); background:var(--card); color:var(--ink); padding:.6rem 1rem; border-radius:11px; font-weight:600; font-size:.92rem; transition:all .15s; display:inline-flex; align-items:center; gap:.45rem; }
.btn:hover { border-color:var(--muted); }
.btn.primary { background:var(--green); color:#fff; border-color:var(--green); }
.btn.primary:hover { background:var(--green-dark); border-color:var(--green-dark); }
.btn.green { background:var(--green); color:#fff; border-color:var(--green); }
.btn.green:hover { background:var(--green-dark); }
.btn.ghost { background:transparent; border-color:transparent; color:var(--green); padding:.4rem .5rem; }
.btn.danger { color:var(--down); border-color:transparent; background:transparent; padding:.4rem .5rem; }
.btn.sm { padding:.42rem .72rem; font-size:.85rem; border-radius:9px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-row { display:flex; gap:.6rem; flex-wrap:wrap; }

/* ---- Forms ---- */
label.field { display:block; margin-bottom:.85rem; }
label.field span { display:block; font-size:.85rem; color:var(--muted); margin-bottom:.3rem; font-weight:500; }
input,select,textarea { width:100%; font-family:inherit; font-size:1rem; color:var(--ink); background:var(--card); border:1px solid var(--line-strong); border-radius:10px; padding:.65rem .8rem; }
input:focus,select:focus,textarea:focus { outline:none; border-color:var(--green); box-shadow:0 0 0 3px var(--save-tint); }
.inline-form { display:flex; gap:.5rem; flex-wrap:wrap; align-items:flex-end; }
.input-prefix { position:relative; }
.input-prefix input { padding-left:1.6rem; }
.input-prefix::before { content:'£'; position:absolute; left:.7rem; top:50%; transform:translateY(-50%); color:var(--muted); }

/* ---- Progress ---- */
.progress { height:12px; border-radius:999px; background:var(--track); overflow:hidden; }
.progress > span { display:block; height:100%; background:var(--green); border-radius:999px; transition:width .6s cubic-bezier(.2,.7,.2,1); }

/* ---- Pills ---- */
.pill { display:inline-flex; align-items:center; gap:.35rem; font-size:.78rem; font-weight:600; padding:.22rem .6rem; border-radius:8px; background:var(--track); color:var(--ink); }
.pill.green { background:var(--save-tint); color:var(--green-dark); }
.pill.clay { background:var(--teal-tint); color:#2c6256; }
.pill.amber { background:var(--amber-tint); color:#7d5414; }

/* ---- Payday countdown ---- */
.countdown { text-align:center; padding:1.6rem 1rem; }
.countdown .big { font-family:var(--display); font-size:4rem; font-weight:700; line-height:1; color:var(--green); font-variant-numeric:tabular-nums; }
.countdown .unit { color:var(--muted); font-size:1rem; margin-top:.3rem; }
.countdown .when { margin-top:.5rem; color:var(--ink); font-weight:500; }

.empty { text-align:center; color:var(--muted); padding:1.4rem .5rem; font-size:.95rem; }
.spinner { width:30px; height:30px; border:3px solid var(--line); border-top-color:var(--green); border-radius:50%; animation:spin .8s linear infinite; margin:3rem auto; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ---- Auth: full-bleed split with curved green art panel ---- */
.auth-split { display:flex; min-height:100vh; }
.auth-art { flex:0 0 44%; background:var(--green); color:#fff; position:relative; overflow:hidden; border-radius:0 60px 60px 0; padding:3rem; display:flex; flex-direction:column; justify-content:center; }
.auth-art .flow { position:absolute; inset:0; width:100%; height:100%; opacity:.5; }
.auth-art .mark { position:relative; z-index:1; }
.auth-art .piggy { width:56px; height:56px; margin-bottom:1.2rem; }
.auth-art .wordmark { font-family:var(--display); font-weight:700; font-size:2rem; line-height:1.1; }
.auth-art .tagline { color:rgba(255,255,255,.82); margin-top:.6rem; font-size:1.02rem; max-width:22rem; }
.auth-form { flex:1; display:grid; place-items:center; padding:2rem 1.5rem; }
.auth-card { width:100%; max-width:400px; }
.auth-card .eyebrow { display:block; margin-bottom:.2rem; }
.auth-card h2 { font-size:1.5rem; }
.auth-tag { color:var(--muted); margin-bottom:1.4rem; }
.qr { display:block; margin:1rem auto; border-radius:12px; border:1px solid var(--line); }
.secret-code { font-family:ui-monospace,monospace; background:var(--track); padding:.5rem .7rem; border-radius:9px; word-break:break-all; font-size:.9rem; text-align:center; }
.error-msg { color:var(--down); font-size:.9rem; margin-top:.3rem; min-height:1.1rem; }
.ok-msg { color:var(--green); font-size:.9rem; margin-top:.3rem; }

.chart-box { position:relative; height:240px; }
.chart-box.sm { height:200px; }

/* ---- Modal & toast ---- */
.modal-bg { position:fixed; inset:0; background:rgba(41,37,31,.42); display:grid; place-items:center; z-index:50; padding:1rem; animation:fade .2s; }
@keyframes fade { from { opacity:0; } }
.modal { width:100%; max-width:460px; max-height:90vh; overflow:auto; }
#toast { position:fixed; bottom:1.2rem; left:50%; transform:translateX(-50%) translateY(2rem); opacity:0; background:var(--ink); color:var(--paper); padding:.7rem 1.1rem; border-radius:12px; font-size:.9rem; z-index:60; transition:all .25s; }
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ---- Responsive: sidebar collapses to a top bar ---- */
@media (max-width:860px){
  .layout { flex-direction:column; }
  .sidebar {
    width:auto; height:auto; position:sticky; top:0; z-index:30;
    flex-direction:row; align-items:center; gap:.2rem;
    border-right:0; border-bottom:1px solid var(--line);
    padding:.55rem .7rem; overflow-x:auto;
    background:color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter:blur(8px);
  }
  .sidebar .brand { padding:.2rem .5rem; margin-right:.4rem; font-size:1.05rem; white-space:nowrap; }
  .sidebar .brand .label { display:none; }
  .navlink { width:auto; padding:.5rem .7rem; white-space:nowrap; }
  .sidebar .spacer, .sidebar .foot { display:none; }
  main { padding:1.3rem 1rem 4rem; }
  .stat-value.lg { font-size:2.1rem; }
  .countdown .big { font-size:3.2rem; }
}
@media (max-width:820px){
  .auth-split { flex-direction:column; }
  .auth-art { flex:none; border-radius:0 0 36px 36px; padding:2.4rem 1.6rem; }
  .auth-art .piggy { width:44px; height:44px; margin-bottom:.8rem; }
  .auth-art .wordmark { font-size:1.6rem; }
}
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; } }

/* ===== v2 layout & components ============================================= */
.content { padding:1.5rem 2rem 3rem; max-width:1240px; }
.screen { display:flex; flex-direction:column; gap:1.15rem; }
@media (max-width:760px){ .content { padding:1rem 1rem 2.5rem; } }

/* Sidebar additions */
.sidebar { display:flex; flex-direction:column; padding:1.1rem .8rem; gap:.25rem; }
.synced { display:flex; align-items:center; gap:.45rem; color:var(--teal); font-weight:600; font-size:.82rem; padding:.2rem .6rem 1rem; }
.synced .ic { color:var(--teal); }
.navgroup { display:flex; flex-direction:column; gap:.2rem; }
.sidebar .spacer { flex:1; min-height:1.2rem; }
.navlink { width:100%; text-align:left; }
.avatar { width:26px; height:26px; border-radius:50%; background:var(--green); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:.8rem; flex:none; }
.avatar.has-img { background:none; overflow:hidden; }
.avatar.has-img img { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }
.navlink.active .avatar { background:#fff; color:var(--green); }

/* Persistent greeting banner */
.greet { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.greet-date { text-transform:uppercase; letter-spacing:.08em; font-size:.72rem; font-weight:700; color:rgba(255,255,255,.7); margin-bottom:.35rem; }
.payday-pill { position:relative; z-index:1; text-align:right; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.22); border-radius:12px; padding:.5rem .8rem; color:#fff; min-width:118px; }
.payday-pill .lbl { display:flex; align-items:center; justify-content:flex-end; gap:.15rem; text-transform:uppercase; letter-spacing:.06em; font-size:.62rem; color:rgba(255,255,255,.72); }
.payday-pill .days { display:block; font-family:var(--display); font-size:1.18rem; font-weight:600; margin:.05rem 0; }
.payday-pill .when { font-size:.74rem; color:rgba(255,255,255,.8); }

/* Head row (total + month nav) */
.head-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.monthnav { display:flex; align-items:center; gap:.5rem; }
.navbtn { width:32px; height:32px; border-radius:9px; border:1px solid var(--line-strong); background:var(--card); color:var(--ink); display:inline-flex; align-items:center; justify-content:center; }
.navbtn:hover { border-color:var(--muted); }
.monthlabel { font-weight:600; min-width:108px; text-align:center; }

/* Stat blocks */
.stat-label { display:flex; align-items:center; gap:.4rem; color:var(--muted); font-size:.82rem; font-weight:500; }
.stat-label .ic { color:var(--muted); }
.stat-value { font-family:var(--display); font-size:1.7rem; font-weight:600; margin-top:.2rem; display:flex; align-items:center; gap:.4rem; }
.stat-value.lg { font-size:2.2rem; }
.stat-value.sm { font-size:1.5rem; }
.stat-value.pos { color:var(--green); }
.stat-value.neg { color:var(--down); }
.stat-foot { color:var(--muted); font-size:.8rem; margin-top:.4rem; }
.num.pos { color:var(--green); } .num.neg { color:var(--down); }
.pos { color:var(--green); } .neg { color:var(--down); }
.small { font-size:.8rem; }

/* Charts */
.chart-box { position:relative; height:240px; }
.chart-box.sm { height:210px; }
.spark { position:relative; height:48px; margin-top:.5rem; }

/* Grid 5-up for budget stats */
.grid.cols-5 { grid-template-columns:repeat(5,1fr); }
@media (max-width:1100px){ .grid.cols-5 { grid-template-columns:repeat(3,1fr); } }
@media (max-width:680px){ .grid.cols-5 { grid-template-columns:repeat(2,1fr); } }

/* Pot cards */
.pot-head { display:flex; align-items:center; justify-content:space-between; min-height:30px; margin-bottom:.1rem; }
.pot-name { font-family:var(--display); font-size:1.15rem; font-weight:600; }
.logo { height:22px; width:auto; max-width:150px; object-fit:contain; object-position:left; }
.logo-sm { height:18px; width:auto; max-width:90px; object-fit:contain; }
.badge { display:inline-flex; align-items:center; gap:.15rem; font-size:.78rem; font-weight:600; padding:.16rem .5rem; border-radius:999px; }
.badge.up { color:var(--green); background:var(--save-tint); }
.badge.down { color:var(--down); background:var(--down-tint); }
.badge .ic { width:13px; height:13px; }
.pot-actions { display:flex; gap:.5rem; align-items:center; margin-top:.7rem; }
.pot-actions .btn { flex:1; justify-content:center; }

/* Icon + link buttons */
.iconbtn { width:30px; height:30px; border-radius:8px; border:1px solid var(--line); background:var(--card); color:var(--muted); display:inline-flex; align-items:center; justify-content:center; flex:none; }
.iconbtn:hover { color:var(--ink); border-color:var(--line-strong); }
.iconbtn.danger:hover { color:var(--down); border-color:var(--down); }
.btn.sm { padding:.42rem .7rem; font-size:.85rem; border-radius:9px; }
.btn.ghost { background:transparent; border-color:transparent; color:var(--muted); }
.btn.ghost:hover { color:var(--ink); background:var(--paper); border-color:var(--line); }
.linklike { background:none; border:none; color:var(--green); font-weight:600; font-size:.82rem; display:inline-flex; align-items:center; gap:.25rem; padding:.3rem 0 0; cursor:pointer; }
.linklike:hover { color:var(--green-dark); }
.addrow { width:100%; border:1px dashed var(--line-strong); background:transparent; color:var(--muted); border-radius:var(--radius); padding:.8rem; display:flex; align-items:center; justify-content:center; gap:.4rem; font-weight:600; cursor:pointer; }
.addrow:hover { color:var(--green); border-color:var(--green); background:var(--save-tint); }

/* Budget two-column */
.budget-cols { display:grid; grid-template-columns:1fr 330px; gap:1.15rem; align-items:start; }
@media (max-width:980px){ .budget-cols { grid-template-columns:1fr; } }
.budget-side { display:flex; flex-direction:column; gap:1.15rem; }
.card-head { display:flex; align-items:center; justify-content:space-between; gap:.6rem; margin-bottom:.5rem; }

/* Expense table */
.exp-head, .exp-row { display:grid; grid-template-columns:1fr 132px 92px 168px; align-items:center; gap:.5rem; }
.exp-head { color:var(--muted); font-size:.7rem; text-transform:uppercase; letter-spacing:.05em; padding:.3rem 0 .5rem; border-bottom:1px solid var(--line); }
.exp-head span:last-child, .exp-amt { text-align:right; justify-content:flex-end; }
.exp-row { padding:.6rem 0; border-bottom:1px solid var(--line); }
.exp-c1 { display:flex; align-items:center; gap:.6rem; min-width:0; }
.exp-c1 .title { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.exp-amt { display:flex; align-items:center; justify-content:flex-end; gap:.3rem; }
.exp-row.strike .title { text-decoration:line-through; color:var(--muted); }
.exp-row .due-soon { color:var(--amber); font-weight:600; display:inline-flex; align-items:center; gap:.2rem; }
.exp-row .muted .ic, .due-soon .ic { width:13px; height:13px; }
.exp-divider { text-align:center; color:var(--muted); font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; padding:.9rem 0 .5rem; display:flex; align-items:center; justify-content:center; gap:.4rem; }
.exp-add { display:flex; align-items:center; gap:.5rem; padding-top:.8rem; }
.exp-add input { flex:1; }
.exp-add .input-prefix { flex:none; }
@media (max-width:560px){ .exp-head { display:none; } .exp-row { grid-template-columns:1fr auto; grid-auto-flow:row; } }

/* Template editor list: narrower grid that fits inside the modal so the name column keeps its width */
.tmpl.exp-head, .tmpl.exp-row { grid-template-columns:minmax(0,1fr) 112px 56px auto; gap:.4rem; }
@media (max-width:560px){ .tmpl.exp-head { display:none; } .tmpl.exp-row { grid-template-columns:1fr auto; } }

/* Sections / requests */
.section-label { color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.07em; font-weight:700; margin:.4rem 0 -.2rem; }
.head-card { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.req-row { display:flex; align-items:center; gap:.8rem; }
.req-row.tap { cursor:pointer; transition:transform .15s, border-color .15s; }
.req-row.tap:hover { transform:translateY(-2px); border-color:var(--line-strong); }
.req-row.strike .title { text-decoration:line-through; color:var(--muted); }

.inline-form { display:flex; gap:.7rem; }

/* ===== v2 layout corrections (match mockups) ============================== */
/* Sidebar blends with the cream page; active item is a white card, not green fill */
.sidebar { background:var(--paper); border-right:none; width:218px; padding-top:1.3rem; }
.navlink { color:var(--ink); border-radius:12px; padding:.6rem .7rem; font-weight:500; }
.navlink .ic { color:var(--muted); }
.navlink:hover { background:rgba(41,37,31,.045); color:var(--ink); }
.navlink:hover .ic { color:var(--ink); }
.navlink.active { background:var(--card); color:var(--ink); border:1px solid var(--line); box-shadow:0 1px 4px rgba(41,37,31,.07); }
.navlink.active .ic { color:var(--green); }
.navlink.active .avatar { background:var(--green); color:#fff; }

/* "New savings pot" is a quiet text link, not a dashed box */
.addrow { border:none; background:transparent; color:var(--ink); justify-content:flex-start; padding:.45rem .15rem; font-weight:600; }
.addrow:hover { color:var(--green); background:transparent; border:none; }
.addrow .ic { color:var(--green); }

/* Use more of the width, like the mockups */
.content { max-width:1340px; }

/* ===== v2 fixes: full-width, clickable payday, monzo wordmark ============= */
/* Fill the page — no capped content width / right-hand whitespace */
.content { max-width:none; }
/* The screen content must align with the banner (was centered in a narrow column) */
main { max-width:none; margin:0; padding:0; }

/* Payday pill is now a button -> opens a popup */
button.payday-pill { cursor:pointer; font:inherit; text-align:right; transition:background .15s, border-color .15s; }
button.payday-pill:hover { background:rgba(255,255,255,.2); border-color:rgba(255,255,255,.4); }
button.payday-pill:active { transform:translateY(1px); }

/* Monzo rendered as a crisp wordmark (an <img> SVG can't use page fonts) */
.monzo-word { font-family:'Hanken Grotesk',sans-serif; font-weight:800; color:#FF4B36; letter-spacing:-.03em; line-height:1; display:inline-block; }
.monzo-word.logo { font-size:1.35rem; }
.monzo-word.logo-sm { font-size:1.15rem; }

/* Transparent balance graph (sits on the page, not in a card) */
.chart-box.wide { height:250px; background:transparent; }

/* ============================================================================
   EXACT SPEC ALIGNMENT — values verbatim from src/App.jsx spec
   (final block: authoritative over everything above)
   ========================================================================== */
/* 5. App shell & layout */
.layout { max-width:1860px; margin:0 auto; gap:24px; align-items:flex-start; padding:22px 30px 40px; }
.sidebar { width:198px; flex-shrink:0; position:sticky; top:22px; background:transparent; border:none; box-shadow:none; padding:0; }
.content { flex:1; min-width:0; padding:0; }
main { max-width:none; margin:0; padding:0; }

/* 6. Navigation */
.synced { gap:5px; font-size:12.5px; font-weight:600; color:var(--green); padding:2px 12px; margin-bottom:18px; }
.synced .ic { color:var(--green); }
.navgroup { gap:5px; }
.navlink { gap:11px; padding:10px 12px; border-radius:11px; font-size:14.5px; font-weight:500; color:var(--muted); }
.navlink .ic { color:var(--muted); width:18px; height:18px; }
.navlink:hover { background:rgba(41,37,31,.04); color:var(--ink); }
.navlink:hover .ic { color:var(--ink); }
.navlink.active { background:#fff; color:var(--green); border:none; box-shadow:0 1px 3px rgba(41,37,31,.08); }
.navlink.active .ic { color:var(--green); }
.sidebar .spacer { display:none; }
#nav-bottom { margin-top:16px; padding-top:14px; border-top:1px solid var(--line); gap:5px; }
.navlink .avatar { width:30px; height:30px; font-size:13px; }

/* 7. Greeting banner */
.greet { border-radius:18px; padding:22px 24px; margin-bottom:18px;
  background:var(--green); background:linear-gradient(125deg, var(--green), #244F3B 55%, var(--teal)); color:#F4F0E7; }
.greet .flow { left:auto; right:0; top:0; width:360px; height:auto; opacity:.14; }
.greet-date { font-size:12px; font-weight:600; letter-spacing:.5px; text-transform:uppercase; opacity:.72; margin-bottom:0; color:#F4F0E7; }
.greet h1 { font-family:var(--display); font-size:28px; font-weight:500; margin-top:4px; letter-spacing:-.01em; color:#F4F0E7; }
button.payday-pill, .payday-pill { background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.22); border-radius:14px; padding:9px 16px; min-width:0; }
.payday-pill .lbl { font-size:10.5px; letter-spacing:.6px; opacity:.8; }
.payday-pill .days { font-family:var(--display); font-size:18px; font-weight:500; margin:.05rem 0; }
.payday-pill .when { font-size:12px; opacity:.85; }

/* 3. Cards & named text styles */
.card { border-radius:16px; padding:16px; }
.section-label { font-size:13px; font-weight:600; color:var(--muted); margin:0 0 10px; letter-spacing:.02em; text-transform:uppercase; }
.stat-label { gap:6px; font-size:12.5px; font-weight:600; color:var(--muted); }
.stat-value { font-family:var(--display); font-size:24px; font-weight:500; margin-top:5px; gap:.4rem; }
.stat-value.lg { font-size:34px; letter-spacing:-.01em; }
.stat-value.sm { font-size:24px; }

/* 9.3 dashboard grids */
.head-row { align-items:flex-start; margin-bottom:4px; }
.metric-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin:14px 0; }
.pot-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; margin-bottom:12px; }
.summary-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; margin-bottom:14px; }

/* logos / trend chip / charts */
.logo { height:16px; max-width:130px; }
.logo-sm { height:14px; }
.monzo-word.logo { font-size:1.05rem; } .monzo-word.logo-sm { font-size:.95rem; }
.badge { font-size:12px; padding:.14rem .45rem; }
.chart-box.wide { height:230px; }
.spark { height:58px; margin-top:6px; }

/* 9.6 "Where your money sits" donut + proportion bars */
.sits { display:flex; gap:30px; flex-wrap:wrap; align-items:center; }
.donut-wrap { position:relative; width:168px; height:168px; flex:none; }
.donut-center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; pointer-events:none; }
.donut-center .t { font-size:11px; color:var(--muted); }
.donut-center .v { font-family:var(--display); font-size:19px; font-weight:500; }
.bars { flex:1; min-width:240px; display:flex; flex-direction:column; gap:16px; }
.bar-row { display:flex; align-items:center; gap:10px; }
.bar-dot { width:10px; height:10px; border-radius:3px; flex:none; }
.bar-name { flex:1; font-size:14px; font-weight:500; }
.bar-val { font-family:var(--display); font-size:16px; font-weight:500; }
.bar-pct { color:var(--muted); font-size:12.5px; width:42px; text-align:right; }
.bar-track { height:8px; background:var(--track); border-radius:99px; overflow:hidden; margin-top:6px; }
.bar-fill { height:100%; border-radius:99px; transition:width .5s; }

@media (max-width:860px){ .sidebar { display:none; } .layout { padding:16px; } }

/* Tighten vertical rhythm — spec uses ~12px section spacing, not an 18px
   flex-gap stacked on top of each section's own margins */
.screen { gap:12px; }
.metric-grid { margin:0; }
.pot-grid { margin:0; }
.summary-grid { margin:0; }
.head-row { margin-bottom:0; }
.metric-grid .spark { height:34px; margin-top:8px; }

/* Segmented toggle (Contribution / Withdrawal) */
.seg { display:flex; gap:6px; background:var(--track); padding:4px; border-radius:11px; }
.seg-btn { flex:1; border:none; background:transparent; color:var(--muted); border-radius:8px; padding:8px 0; font-weight:600; font-size:.9rem; cursor:pointer; }
.seg-btn.active { background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(41,37,31,.08); }

/* Budget sheet switcher (Leo / Mark / Maureen) */
.sheet-tabs { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:4px; }
.sheet-tab {
  appearance:none; border:1px solid var(--line); background:var(--card); color:var(--muted);
  font:inherit; font-weight:600; font-size:13.5px; padding:7px 16px; border-radius:999px;
  cursor:pointer; display:inline-flex; align-items:center; gap:6px; transition:all .12s ease;
}
.sheet-tab:hover { color:var(--ink); border-color:rgba(41,37,31,.2); }
.sheet-tab.active { background:var(--green); border-color:var(--green); color:#fff; box-shadow:0 1px 3px rgba(41,37,31,.12); }
.sheet-tab.cog, .sheet-tab.add { padding:7px 9px; color:var(--muted); }
.sheet-tab.add { border-style:dashed; }

/* Fund-from-pot toggle + marker */
.check-line { display:flex; align-items:center; gap:9px; margin:2px 0 14px; font-size:14px; cursor:pointer; }
.check-line input { width:17px; height:17px; accent-color:var(--green); flex:none; }
.tag-direct { margin-left:6px; font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.04em;
  color:var(--muted); border:1px solid var(--line); border-radius:5px; padding:1px 5px; vertical-align:middle; }

/* Print button row */
.head-left { display:flex; gap:8px; align-items:center; }

/* Printable sheet (hidden on screen, shown only when printing) */
.print-root { display:none; }
@media print {
  #app, #toast, #lf-assistant { display:none !important; }
  body { background:#fff !important; }
  .print-root {
    display:block; color:#1b1b1a;
    font-family:'Hanken Grotesk', system-ui, sans-serif;
    -webkit-print-color-adjust:exact; print-color-adjust:exact;
  }
  .print-root h1 { font-family:'Fraunces', serif; font-weight:600; font-size:21pt; margin:0; color:#1b1b1a; }
  .print-root h2 { font-family:'Fraunces', serif; font-weight:600; font-size:13pt; margin:4pt 0; }
  .p-head { border-bottom:2px solid #244F3B; padding-bottom:7pt; margin-bottom:12pt; }
  .p-sub { color:#555; font-size:11pt; margin-top:2pt; }
  .p-summary { display:flex; gap:26pt; margin-bottom:14pt; }
  .p-summary span { display:block; font-size:8pt; text-transform:uppercase; letter-spacing:.06em; color:#666; margin-bottom:2pt; }
  .p-summary b { font-family:'Fraunces', serif; font-weight:600; font-size:15pt; }
  .p-table { width:100%; border-collapse:collapse; font-size:10pt; margin-bottom:8pt; }
  .p-table th { text-align:left; border-bottom:1px solid #888; padding:4pt 6pt; font-size:8pt; text-transform:uppercase; letter-spacing:.05em; color:#444; }
  .p-table td { padding:3.5pt 6pt; border-bottom:.5px solid #ddd; }
  .p-table .r { text-align:right; font-variant-numeric:tabular-nums; }
  .p-table .c { text-align:center; }
  .p-table tfoot td { border-top:1.5px solid #244F3B; border-bottom:none; font-weight:600; padding-top:5pt; }
  .p-divider td { background:#efece4; font-size:8pt; text-transform:uppercase; letter-spacing:.05em; color:#555; font-weight:600; }
  .p-tag { font-size:7.5pt; text-transform:uppercase; letter-spacing:.04em; color:#777; border:.5px solid #bbb; border-radius:3px; padding:0 3pt; }
  .p-pots { margin-top:6pt; break-inside:avoid; }
  .p-mtl-block { margin-top:10pt; break-inside:avoid; }
  .p-mtl { display:flex; flex-wrap:wrap; gap:7pt; }
  .p-mtl-step { border:1px solid #d6d2c9; border-radius:6pt; padding:6pt 8pt; min-width:58pt; text-align:center; break-inside:avoid; }
  .p-mtl-step.done { background:#eef4ef; border-color:#2E6B4F; }
  .p-mtl-dot { width:13pt; height:13pt; line-height:11pt; border-radius:50%; border:1.2pt solid #2E6B4F; margin:0 auto 3pt; font-size:9pt; color:#2E6B4F; }
  .p-mtl-step.done .p-mtl-dot { background:#2E6B4F; color:#fff; }
  .p-mtl-wd { font-size:7.5pt; color:#777; text-transform:uppercase; letter-spacing:.04em; }
  .p-mtl-date { font-size:11pt; font-weight:600; color:#1b1b1a; }
  .p-mtl-label { font-size:8.5pt; margin-top:1.5pt; color:#333; }
  .p-foot { margin-top:16pt; font-size:8pt; color:#999; }
  tr { break-inside:avoid; }
  @page { margin:14mm; }
}

/* Manage-pots rows */
.pot-row { display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid var(--line); }
.pot-row .pot-name { flex:1; padding:7px 10px; border:1px solid var(--line); border-radius:9px; font:inherit; background:var(--card); color:var(--ink); }
.pot-row .pot-name:focus { outline:none; border-color:var(--green); }

/* Floating "Can I afford…?" assistant */
.lf-assistant { position:fixed; right:20px; bottom:20px; z-index:120; }
.lf-assistant.lf-scoped:not(.lf-show) { display:none; } /* penny-scope-leo-20260626 — only inside an account */
.lf-fab { width:56px; height:56px; border-radius:50%; border:none; cursor:pointer;
  background:var(--green); color:#fff; display:grid; place-items:center;
  box-shadow:0 6px 20px rgba(36,79,59,.35); transition:transform .2s ease, box-shadow .2s ease, opacity .18s ease; }
.lf-fab:hover { transform:translateY(-2px) scale(1.04); box-shadow:0 10px 26px rgba(36,79,59,.42); }
.lf-fab:active { transform:translateY(0) scale(.96); }
.lf-assistant.open .lf-fab { opacity:0; transform:scale(.55); pointer-events:none; }
.lf-chat { position:absolute; right:0; bottom:0; width:374px; max-width:calc(100vw - 32px);
  height:min(580px, calc(100vh - 120px)); background:var(--card); border:1px solid var(--line);
  border-radius:18px; box-shadow:0 18px 50px rgba(41,37,31,.22); display:flex; flex-direction:column; overflow:hidden;
  transform-origin:bottom right; opacity:0; transform:translateY(12px) scale(.96); visibility:hidden; pointer-events:none;
  transition:opacity .2s ease, transform .28s cubic-bezier(.2,.9,.25,1), visibility 0s linear .28s; }
.lf-assistant.open .lf-chat { opacity:1; transform:none; visibility:visible; pointer-events:auto;
  transition:opacity .2s ease, transform .3s cubic-bezier(.2,.9,.25,1), visibility 0s; }
.lf-chat-head { display:flex; align-items:center; justify-content:space-between; padding:.7rem .85rem;
  border-bottom:1px solid var(--line); background:linear-gradient(180deg, var(--save-tint), rgba(231,240,234,.35)); }
.lf-title { display:flex; align-items:center; gap:.55rem; }
.lf-ava { width:30px; height:30px; border-radius:50%; background:linear-gradient(145deg,#3f9069,#234f3b); color:#fff; display:grid; place-items:center; box-shadow:0 4px 10px -4px rgba(35,79,59,.6); flex:none; }
.lf-name { display:flex; flex-direction:column; line-height:1.12; font-weight:600; color:var(--green-dark); }
.lf-sub { font-weight:400; font-size:.72rem; color:var(--muted); }
.lf-close { background:none; border:none; color:var(--muted); cursor:pointer; padding:5px; border-radius:9px; display:grid; place-items:center; transition:background .15s, color .15s; }
.lf-close:hover { background:rgba(41,37,31,.07); color:var(--ink); }
.lf-body { flex:1; overflow-y:auto; padding:.9rem; display:flex; flex-direction:column; gap:.55rem; }
.lf-msg { max-width:86%; padding:.58rem .78rem; border-radius:15px; line-height:1.5; font-size:.92rem; box-shadow:0 1px 2px rgba(41,37,31,.05); animation:lf-in .22s ease both; }
@keyframes lf-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.lf-msg p { margin:0 0 .5rem; } .lf-msg p:last-child { margin-bottom:0; }
.lf-msg .h { font-weight:600; }
.lf-msg ul { margin:.3rem 0; padding-left:1.1rem; } .lf-msg li { margin:.15rem 0; }
.lf-msg.me { align-self:flex-end; background:linear-gradient(145deg,#3f9069,#2E6B4F); color:#fff; border-bottom-right-radius:5px; }
.lf-msg.bot { align-self:flex-start; background:#fff; color:var(--ink); border:1px solid var(--line); border-bottom-left-radius:5px; }
.lf-msg.err { background:#fbeae7; color:var(--down); border:none; }
.lf-msg strong { font-weight:600; }
.lf-chips { display:flex; flex-direction:column; gap:.4rem; align-self:stretch; margin-top:.35rem; }
.lf-chip { text-align:left; background:rgba(255,255,255,.7); border:1px solid var(--line); border-radius:12px; padding:.55rem .75rem; cursor:pointer; color:var(--ink); font-size:.88rem; transition:border-color .15s, color .15s, transform .12s, background .15s; }
.lf-chip:hover { border-color:var(--green); color:var(--green-dark); background:#fff; transform:translateY(-1px); }
.lf-pot { display:inline-flex; align-items:center; gap:.35rem; margin-top:.55rem; background:#fff; border:1px solid var(--green); color:var(--green-dark); border-radius:10px; padding:.4rem .65rem; cursor:pointer; font-size:.86rem; }
.lf-pot:hover { background:var(--save-tint); }
.lf-pot.done { border-color:var(--line); color:var(--muted); cursor:default; }
.lf-input { display:flex; gap:.5rem; padding:.7rem; border-top:1px solid var(--line); background:rgba(255,255,255,.5); }
.lf-input input { flex:1; border:1px solid var(--line); border-radius:12px; padding:.6rem .75rem; font:inherit; color:var(--ink); background:var(--paper); transition:border-color .15s, box-shadow .15s; }
.lf-input input:focus { outline:none; border-color:var(--green); box-shadow:0 0 0 3px rgba(46,107,79,.14); }
.lf-send { flex:none; width:42px; border:none; border-radius:12px; background:var(--green); color:#fff; cursor:pointer; display:grid; place-items:center; transition:background .15s, transform .12s; }
.lf-send:hover { background:var(--green-dark); }
.lf-send:active { transform:scale(.94); }
.lf-send:disabled { opacity:.5; cursor:default; }
@media (prefers-reduced-motion: reduce) {
  .lf-chat, .lf-fab, .lf-msg, .lf-chip, .lf-send { transition:none !important; animation:none !important; }
}
.lf-dots { display:inline-flex; gap:4px; align-items:center; padding:2px 0; }
.lf-dots i { width:6px; height:6px; border-radius:50%; background:var(--muted); display:inline-block; animation:lfb 1s infinite ease-in-out; }
.lf-dots i:nth-child(2) { animation-delay:.15s; } .lf-dots i:nth-child(3) { animation-delay:.3s; }
@keyframes lfb { 0%,80%,100% { transform:translateY(0); opacity:.4; } 40% { transform:translateY(-3px); opacity:1; } }
@media (max-width:560px) {
  .lf-assistant { right:14px; bottom:14px; }
  .lf-chat { width:calc(100vw - 28px); height:min(72vh, calc(100vh - 90px)); }
}

/* ---- App switcher (shared by Finances + Events) ------------------------- */
.appswitch { display:inline-flex; align-items:center; gap:10px; }
.as-segs { display:inline-flex; background:var(--paper); border:1px solid var(--line); border-radius:11px; padding:3px; gap:2px; }
.as-seg { padding:6px 13px; border-radius:8px; font-size:.86rem; font-weight:600; color:var(--muted); text-decoration:none; cursor:pointer; border:none; background:none; font-family:inherit; line-height:1.1; }
.as-seg.active { background:var(--green); color:#fff; }
.as-seg:not(.active):hover { color:var(--ink); }
.as-hub, .as-hub-ic { display:inline-flex; align-items:center; gap:5px; color:var(--muted); text-decoration:none; font-size:.82rem; font-weight:600; }
.as-hub:hover, .as-hub-ic:hover { color:var(--green); }
.as-hub-ic { width:36px; height:36px; justify-content:center; border:1px solid var(--line); border-radius:10px; background:var(--card); }
/* Sidebar variant: stack the toggle full-width above a small Hub link */
.appswitch.side { display:flex; flex-direction:row; align-items:center; gap:8px; padding:0 0 1rem; }
.appswitch.side .as-hub-ic { width:34px; height:34px; flex:none; }
.appswitch.side .as-segs { flex:1; }
.appswitch.side .as-seg { flex:1; text-align:center; padding:6px 6px; }
@media (max-width:860px){ .appswitch.side { padding:.2rem .4rem; } }

/* ===== Modern glassy auth (light & warm) ================================== */
.auth-split {
  background:
    radial-gradient(1100px 580px at 88% -12%, rgba(62,142,126,.12), transparent 60%),
    radial-gradient(820px 520px at 108% 88%, rgba(46,107,79,.10), transparent 58%),
    linear-gradient(158deg, #FBF8F1, #F1ECE1);
}
.auth-art {
  flex:0 0 46%;
  background:
    radial-gradient(680px 360px at 16% 10%, rgba(140,214,182,.34), transparent 60%),
    radial-gradient(620px 520px at 92% 104%, rgba(18,52,38,.55), transparent 62%),
    linear-gradient(155deg, #2f6f52 0%, #234f3b 58%, #1b3d2f 100%);
  border-radius:0 56px 56px 0;
  box-shadow:0 30px 80px -30px rgba(27,61,47,.55);
}
.auth-art::after {
  content:""; position:absolute; width:440px; height:440px; border-radius:50%;
  background:radial-gradient(circle, rgba(160,226,196,.32), transparent 70%);
  top:-140px; left:-90px; z-index:0; pointer-events:none;
}
.auth-art .flow { opacity:.32; z-index:0; }
.auth-art .piggy {
  width:62px; height:62px; display:grid; place-items:center; margin-bottom:1.3rem;
  background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.24);
  border-radius:18px; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); color:#eafff4;
}
.auth-art .piggy svg { width:30px; height:30px; }
.auth-art .wordmark { font-size:2.2rem; letter-spacing:-.01em; }
.auth-art .tagline { color:rgba(255,255,255,.86); font-size:1.05rem; max-width:23rem; }

.auth-card {
  max-width:420px; padding:2.2rem 2rem; border-radius:24px;
  background:rgba(255,255,255,.62);
  -webkit-backdrop-filter:blur(18px) saturate(1.1); backdrop-filter:blur(18px) saturate(1.1);
  border:1px solid rgba(255,255,255,.72);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6), 0 30px 60px -24px rgba(41,37,31,.28);
}
.auth-card h2 { font-size:1.72rem; letter-spacing:-.01em; }
.auth-card .auth-tag { margin-bottom:1.6rem; }
.auth-card .field span { font-weight:600; }
.auth-card .field input {
  width:100%; border:1px solid var(--line); background:rgba(255,255,255,.78);
  border-radius:13px; padding:.82rem .9rem; font-size:1rem; transition:border-color .16s, box-shadow .16s, background .16s;
}
.auth-card .field input:focus {
  outline:none; border-color:var(--green); background:#fff; box-shadow:0 0 0 4px var(--save-tint);
}
.auth-card .btn.primary {
  background:linear-gradient(135deg, #3a8662, #234f3b); border:none;
  padding:.85rem 1rem; border-radius:13px; font-size:1rem; box-shadow:0 12px 26px -10px rgba(35,79,59,.6);
}
.auth-card .btn.primary:hover { filter:brightness(1.06); transform:translateY(-1px); }
.auth-card .btn:not(.primary) {
  background:rgba(255,255,255,.72); border:1px solid var(--line); border-radius:13px; padding:.8rem 1rem;
}
@media (max-width:820px){
  .auth-art { border-radius:0 0 40px 40px; }
  .auth-card { background:rgba(255,255,255,.8); }
}

/* ===== Site-wide modern glass theme (light & warm) ======================= */
body {
  background:
    radial-gradient(1000px 620px at 8% 4%, rgba(46,107,79,.09), transparent 55%),
    radial-gradient(900px 720px at 98% 100%, rgba(62,142,126,.11), transparent 55%),
    linear-gradient(160deg, #FBF8F1, #F0EBE0) !important;
  background-attachment:fixed;
}
.card {
  background:rgba(255,255,255,.6);
  -webkit-backdrop-filter:blur(16px) saturate(1.08); backdrop-filter:blur(16px) saturate(1.08);
  border:1px solid rgba(255,255,255,.7); border-radius:20px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55), 0 18px 40px -24px rgba(41,37,31,.22);
}
.greet {
  background:
    radial-gradient(560px 320px at 12% 6%, rgba(140,214,182,.30), transparent 60%),
    radial-gradient(520px 420px at 94% 110%, rgba(18,52,38,.5), transparent 62%),
    linear-gradient(150deg, #2f6f52, #234f3b 60%, #1d402f) !important;
  border-radius:24px; box-shadow:0 24px 50px -26px rgba(27,61,47,.5);
}
.field input, .field textarea, .field select, .input-prefix input, .exp-add input, input.pot-name {
  border:1px solid var(--line); background:rgba(255,255,255,.82); border-radius:12px;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field textarea:focus, .field select:focus,
.input-prefix input:focus, .exp-add input:focus, input.pot-name:focus {
  outline:none; border-color:var(--green); background:#fff; box-shadow:0 0 0 4px var(--save-tint);
}
.btn { border-radius:12px; }
.btn.primary, .btn.green {
  background:linear-gradient(135deg, #3a8662, #234f3b); border:none;
  box-shadow:0 10px 22px -10px rgba(35,79,59,.55);
}
.btn.primary:hover, .btn.green:hover { filter:brightness(1.05); background:linear-gradient(135deg, #3a8662, #234f3b); }
.modal {
  background:rgba(255,255,255,.74) !important;
  -webkit-backdrop-filter:blur(22px) saturate(1.1); backdrop-filter:blur(22px) saturate(1.1);
  border:1px solid rgba(255,255,255,.75); border-radius:22px;
  box-shadow:0 40px 80px -30px rgba(41,37,31,.4);
}
.navlink.active {
  background:rgba(255,255,255,.78) !important;
  box-shadow:0 4px 14px -6px rgba(41,37,31,.18), inset 0 1px 0 rgba(255,255,255,.6);
}
.lf-fab { background:linear-gradient(145deg, #3f9069, #234f3b) !important;
  box-shadow:0 14px 30px -10px rgba(35,79,59,.6) !important; }
.lf-chat {
  background:rgba(255,255,255,.82) !important;
  -webkit-backdrop-filter:blur(24px) saturate(1.1); backdrop-filter:blur(24px) saturate(1.1);
  border:1px solid rgba(255,255,255,.7) !important; border-radius:22px !important;
  box-shadow:0 40px 80px -30px rgba(41,37,31,.42) !important;
}

/* ---- Budget cycle-milestone timeline (landscape stepper) --------------- */
.mtl-card { margin: 4px 0 2px; }
.mtl-scroll { overflow-x: auto; padding-bottom: 4px; }
.mtl { display: flex; align-items: flex-start; min-width: min-content; padding-top: 6px; }
.mtl-step { position: relative; flex: 1 0 112px; min-width: 112px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 4px; }
.mtl-step::after { content: ""; position: absolute; top: 13px; left: 50%; width: 100%; height: 2px; background: var(--track, #EAE4D7); z-index: 0; }
.mtl-step:last-child::after { display: none; }
.mtl-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--track, #d9d2c2); background: var(--card, #fff); color: var(--green, #2E6B4F); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.mtl-dot svg { width: 15px; height: 15px; }
.mtl-dot:hover { border-color: var(--green, #2E6B4F); }
.mtl-step.done .mtl-dot { background: var(--green, #2E6B4F); border-color: var(--green, #2E6B4F); color: #fff; }
.mtl-step.done::after { background: var(--green, #2E6B4F); }
.mtl-step.overdue .mtl-dot { border-color: var(--down, #B23B2C); color: var(--down, #B23B2C); }
.mtl-cap { margin-top: 8px; max-width: 132px; }
.mtl-wd { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #9a948a); }
.mtl-date { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--green, #2E6B4F); font-size: .9rem; }
.mtl-step.overdue .mtl-date { color: var(--down, #B23B2C); }
.mtl-step.done .mtl-date { color: var(--muted, #8a847a); }
.mtl-label { font-size: .82rem; color: var(--ink, #29251F); margin-top: 2px; line-height: 1.2; }
.mtl-step.done .mtl-label { color: var(--muted, #8a847a); text-decoration: line-through; }
.mtl-empty { background: none; border: 1px dashed var(--line, #e6dfd0); border-radius: 10px; padding: 14px; width: 100%; cursor: pointer; color: var(--green, #2E6B4F); font: inherit; }
.mtl-empty:hover { border-color: var(--green, #2E6B4F); }
.tmpl-list .row-actions { display: inline-flex; gap: 4px; margin-left: auto; }

/* range-views-v1-leo-20260624 — savings chart range picker */
.chart-tools { display:flex; justify-content:flex-end; margin:-2px 0 8px; }
.rangepick { display:inline-flex; gap:4px; background:var(--track); padding:4px; border-radius:10px; }
.rangepick button { border:none; background:transparent; color:var(--muted); border-radius:7px; padding:5px 11px; font-weight:600; font-size:.8rem; line-height:1; cursor:pointer; transition:color .12s, background .12s; }
.rangepick button:hover { color:var(--ink); }
.rangepick button.active { background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(41,37,31,.08); }

/* templates-tab-v1-leo-20260625 — app switcher menu + Templates tab */
.as-apps-wrap { position:relative; display:inline-block; }
.as-apps { width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--muted); cursor:pointer; padding:0; }
.as-apps:hover { color:var(--green); border-color:var(--green); }
.app-menu { position:absolute; top:calc(100% + 6px); left:0; z-index:60; min-width:180px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:6px; box-shadow:0 10px 28px rgba(41,37,31,.14); }
.app-menu[hidden] { display:none; }
.app-menu-item { display:flex; align-items:center; gap:10px; padding:9px 11px; border-radius:9px; color:var(--ink); text-decoration:none; font-size:.92rem; font-weight:600; }
.app-menu-item:hover { background:var(--paper); }
.app-menu-item.active { color:var(--green); }
.app-menu-item.active::after { content:'\2713'; margin-left:auto; color:var(--green); }

.tpl-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(238px,1fr)); gap:1rem; }
.tpl-card { display:flex; flex-direction:column; }
.tpl-card .btn { align-self:flex-start; margin-top:.7rem; }
.tpl-lines { display:flex; flex-direction:column; gap:.3rem; margin:.5rem 0 0; }
.tpl-line { display:flex; align-items:center; gap:8px; font-size:.92rem; }
.tpl-line .grow { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tpl-sheets { margin-bottom:1rem; }
.tpl-global { margin-top:1rem; }

/* sandbox-v1-leo-20260626 — budget sandbox mode */
.sbx-banner { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; background:linear-gradient(135deg, var(--save-tint), #F4EFE2); border:1px dashed var(--green); border-radius:14px; padding:.7rem 1rem; margin-bottom:1rem; }
.sbx-info { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; min-width:0; }
.sbx-badge { display:inline-flex; align-items:center; gap:6px; background:var(--green); color:#fff; font-weight:700; font-size:.8rem; padding:4px 10px; border-radius:999px; }
.sbx-sub { color:var(--green-dark); font-size:.88rem; }
.sbx-actions { display:flex; align-items:center; gap:8px; }

/* sandbox-savings-v1-leo-20260626 — savings sandbox projection */
.sbx-proj-controls { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:.8rem; align-items:end; }
.sbx-proj-controls .field { margin:0; }
.sbx-horizon .seg-btn { padding:6px 8px; }
.sbx-proj-out { margin-top:.7rem; display:flex; flex-direction:column; gap:.45rem; }
.sbx-out-row { display:flex; align-items:center; gap:8px; justify-content:space-between; }
.sbx-out-row.good { color:var(--green-dark); justify-content:flex-start; font-weight:600; }
.sbx-out-row.muted { color:var(--muted); justify-content:flex-start; }

/* sandbox stacks: match the .screen gap so cards don't butt together */
.sbx-stack { display:flex; flex-direction:column; gap:12px; }

/* account-manager-stage2-leo-20260626 — Account Manager (table redesign) */
.am-av { flex:none; display:inline-flex; align-items:center; justify-content:center; }
.am-avimg { border-radius:50%; object-fit:cover; }
.am-avinit { border-radius:50%; background:var(--green); color:#fff; font-family:var(--font-display, Georgia, serif); font-weight:600; display:inline-flex; align-items:center; justify-content:center; }
.am-you { font-size:.62rem; text-transform:uppercase; letter-spacing:.05em; background:var(--save-tint); color:var(--green-dark); border-radius:999px; padding:1px 7px; font-weight:700; vertical-align:middle; }

/* People table */
.am-tablewrap { padding:4px 4px; overflow:hidden; }
.am-table { width:100%; border-collapse:collapse; }
.am-table thead th { text-align:left; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:700; padding:10px 14px; border-bottom:1px solid var(--line); }
.am-row { cursor:pointer; transition:background .12s; }
.am-row:hover { background:var(--save-tint); }
.am-row + .am-row td { border-top:1px solid var(--line); }
.am-table td { padding:12px 14px; vertical-align:middle; }
.am-person { display:flex; align-items:center; gap:11px; }
.am-person .am-name { font-weight:600; color:var(--ink); }
.am-emailcell { color:var(--muted); font-size:.9rem; }
.am-featcell { color:var(--ink); font-size:.85rem; }
.am-open { width:1%; color:var(--muted); text-align:right; }

/* Person view */
.am-back { margin-bottom:.5rem; }
.am-pbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:.5rem; }
.am-ptitle { display:flex; align-items:center; gap:12px; }
.am-gear { color:var(--muted); }
.am-av.lg { position:relative; border:none; background:none; cursor:pointer; padding:0; }
.am-av-edit { position:absolute; right:-2px; bottom:-2px; width:24px; height:24px; border-radius:50%; background:var(--green); color:#fff; display:inline-flex; align-items:center; justify-content:center; border:2px solid var(--card); }

/* Feature switches */
.am-switches { display:flex; gap:10px; flex-wrap:wrap; }
.am-switch { display:inline-flex; align-items:center; gap:8px; cursor:pointer; user-select:none; background:var(--card); border:1px solid var(--line); border-radius:999px; padding:6px 12px 6px 10px; }
.am-switch input { position:absolute; opacity:0; width:0; height:0; }
.am-track { position:relative; width:34px; height:20px; border-radius:999px; background:var(--line); transition:background .15s; flex:none; }
.am-track::after { content:''; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:#fff; transition:transform .15s; box-shadow:0 1px 2px rgba(0,0,0,.2); }
.am-switch input:checked + .am-track { background:var(--green); }
.am-switch input:checked + .am-track::after { transform:translateX(14px); }
.am-switch input:focus-visible + .am-track { outline:2px solid var(--green); outline-offset:2px; }
.am-swlabel { font-weight:600; font-size:.88rem; color:var(--ink); }
.am-feats { margin:0 0 .25rem; width:auto; display:inline-flex; }
.am-content { margin-top:.25rem; }

/* Account-tab profile with avatar */
.acct-profile { display:flex; align-items:center; gap:16px; }

/* Admin per-row manage + temporary password — admin-mgmt-leo-20260626 */
.warn-tri { display:inline-flex; align-items:center; justify-content:center; width:64px; height:64px; border-radius:50%; background:#FBF3D7; color:#C9A227; margin:0 auto; }
.am-rowactions { display:flex; align-items:center; gap:10px; justify-content:flex-end; white-space:nowrap; }
.am-table td.am-rowactions { width:1%; }
.temp-pass { background:var(--save-tint); border-radius:12px; padding:12px 14px; }
.temp-pass-row { display:flex; align-items:center; gap:10px; margin-top:4px; }
.temp-pass-row code { font-family:ui-monospace,'Hanken Grotesk',monospace; font-size:1.25rem; font-weight:700; letter-spacing:.08em; color:var(--green-dark); background:#fff; border:1px solid var(--line); border-radius:8px; padding:6px 12px; }

.hist-bal { color:var(--ink); font-weight:600; } /* balance at time of entry — savings-history-leo-20260704 */

/* Admin app — admin-app-leo-20260626 */
.admin-wrap { max-width:880px; margin:0 auto; padding:0 1.2rem; }
.admin-wrap.is-wide { max-width:1240px; } /* remote-in finances needs the room — admin-app-leo-20260626 */
.admin-top { display:flex; align-items:center; justify-content:space-between; padding:1.1rem 0; border-bottom:1px solid var(--line); margin-bottom:1.6rem; }
.admin-back { display:inline-flex; align-items:center; gap:4px; color:var(--muted); text-decoration:none; font-weight:600; }
.admin-back:hover { color:var(--ink); }
.admin-title { display:inline-flex; align-items:center; gap:7px; font-weight:700; }
.admin-main { padding-bottom:4rem; }
.adm-sec { border-top:1px solid var(--line); padding-top:1rem; margin-top:1rem; }
.adm-sec .title { margin-bottom:.5rem; }
.adm-toggle { display:flex; align-items:center; justify-content:space-between; padding:.45rem 0; cursor:pointer; }
.adm-toggle.is-disabled { opacity:.5; }

/* On/off toggle switch — admin-app-leo-20260626 */
.switch { position:relative; display:inline-block; width:46px; height:27px; flex:none; }
.switch input { position:absolute; opacity:0; width:0; height:0; }
.switch .slider { position:absolute; inset:0; background:var(--line); border-radius:999px; transition:background .18s ease; cursor:pointer; }
.switch .slider::before { content:''; position:absolute; height:21px; width:21px; left:3px; top:3px; background:#fff; border-radius:50%; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:transform .18s ease; }
.switch input:checked + .slider { background:var(--green); }
.switch input:checked + .slider::before { transform:translateX(19px); }
.switch input:disabled + .slider { opacity:.5; cursor:not-allowed; }

/* reminders: read-only recipient line — reminders-account-email-leo-20260626 */
.rm-sendto { display:flex; align-items:center; gap:6px; font-size:.9rem; margin:.5rem 0 .2rem; color:var(--ink); }
.rm-sendto svg { color:var(--muted); flex:none; }

/* Planned purchases — planned-purchases-leo-20260705 */
.pp-top { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1.2rem; flex-wrap:wrap; }
.pp-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(320px, 1fr)); gap:1rem; }
.pp-card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:1rem 1.1rem; display:flex; flex-direction:column; gap:.75rem; }
.pp-card.covered { border-color:#bcd9c6; }
.pp-card.short { border-color:#e7c3bf; }
.pp-head { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.pp-name { font-family:'Fraunces',serif; font-size:1.15rem; font-weight:600; color:var(--ink); background:none; border:none; cursor:pointer; padding:0; text-align:left; }
.pp-name:hover { text-decoration:underline; }
.pp-pot { display:inline-flex; align-items:center; gap:5px; font-size:.78rem; font-weight:600; padding:4px 10px; border-radius:999px; border:1px solid var(--line); background:var(--paper); cursor:pointer; white-space:nowrap; }
.pp-pot.ok { color:var(--green-dark); background:var(--save-tint); border-color:#bcd9c6; }
.pp-pot.no { color:#9c2f26; background:#FBEBEA; border-color:#e7c3bf; }
.pp-pot.none { color:var(--muted); }
.pp-afford { border-radius:12px; padding:.6rem .75rem; }
.pp-afford.is-ok { background:var(--save-tint); }
.pp-afford.is-short { background:#FBEBEA; }
.pp-afford.is-none { background:var(--paper); border:1px dashed var(--line); }
.pp-bar { height:8px; border-radius:999px; background:#ffffff88; overflow:hidden; margin-bottom:.4rem; }
.pp-afford.is-ok .pp-bar span { background:var(--green); }
.pp-afford.is-short .pp-bar span { background:#C0573B; }
.pp-bar span { display:block; height:100%; border-radius:999px; transition:width .3s ease; }
.pp-afford-txt { font-size:.82rem; font-weight:600; color:var(--ink); }
.pp-afford.is-short .pp-afford-txt { color:#9c2f26; }
.pp-afford.is-ok .pp-afford-txt { color:var(--green-dark); }
.pp-items { display:flex; flex-direction:column; gap:2px; }
.pp-item { display:flex; align-items:center; gap:8px; padding:.4rem .1rem; border-bottom:1px solid var(--line); }
.pp-item:last-child { border-bottom:none; }
.pp-item-label { flex:1; font-size:.9rem; }
.pp-item-amt { font-variant-numeric:tabular-nums; font-weight:600; font-size:.9rem; }
.pp-empty { color:var(--muted); font-size:.85rem; font-style:italic; border-bottom:none; }
.pp-x { background:none; border:none; color:var(--muted); cursor:pointer; padding:2px; border-radius:6px; display:inline-flex; }
.pp-x:hover { color:var(--ink); background:var(--paper); }
.pp-foot { display:flex; align-items:center; justify-content:space-between; margin-top:.2rem; padding-top:.4rem; border-top:1px solid var(--line); }
.pp-total { font-family:'Fraunces',serif; font-size:1.05rem; font-weight:600; }
.pp-potlist { display:flex; flex-direction:column; gap:2px; }
.pp-potpick { display:flex; align-items:center; gap:10px; padding:.6rem .5rem; border-radius:10px; cursor:pointer; }
.pp-potpick:hover { background:var(--paper); }

/* Planned purchases — detail view + clickable cards */
.pp-card.pp-click { cursor:pointer; text-align:left; width:100%; font:inherit; color:inherit; }
.pp-card.pp-click:hover { border-color:var(--green); box-shadow:0 2px 10px rgba(0,0,0,.05); }
.pp-card.pp-click .pp-total { display:inline-flex; align-items:center; gap:2px; }
.pp-dhead { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:.4rem 0 1rem; flex-wrap:wrap; }
.pp-dhead-actions { display:flex; align-items:center; gap:.5rem; }
.pp-items-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:.6rem; }
.am-back { margin-bottom:.6rem; }
