/* The Stockvel App — the installable app (matches the phone screens in the UI drafts).
   Sizes are in rem so the Large Text switch scales everything: body 18px → 22px. */

html { font-size: 16px; }
html.lt { font-size: 19.5px; }
body.app { font-size: 1.125rem; background: #fff; min-height: 100vh; min-height: 100dvh; }

.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; background: #fff; }
.screen { padding: 1rem 1.25rem calc(11rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 1.125rem; }
.screen.no-tabs { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
.screen.tight { gap: .875rem; }
.screen.full { min-height: 100vh; min-height: 100dvh; }

/* Header that never scrolls away */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  padding: calc(.75rem + env(safe-area-inset-top)) 1.25rem .75rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.topbar .brand { display: flex; align-items: center; gap: .625rem; color: var(--deep); font-size: 1.125rem; font-weight: 800; letter-spacing: -.2px; }
.topbar .actions { display: flex; gap: .5rem; align-items: center; }
.topbar.sub { justify-content: flex-start; }
.topbar .title { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.topbar .title strong { font-size: 1.25rem; font-weight: 800; color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title span { font-size: .875rem; color: var(--slate); }
.topbar .page-title { font-size: 1.375rem; font-weight: 800; color: var(--deep); flex-grow: 1; }

.iconbtn {
  width: 2.75rem; height: 2.75rem; min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--deep); padding: 0; position: relative;
}
.iconbtn:hover { color: var(--deep); background: var(--mint); }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 999px; background: var(--red); border: 2px solid #fff; }
.avatar-btn {
  width: 2.75rem; height: 2.75rem; min-width: 44px; min-height: 44px; border-radius: 999px; background: var(--mint); color: var(--deep);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9375rem;
}
.avatar-btn:hover { color: var(--deep); }
body:not(.read-aloud) .speak-btn { display: none; }

/* Greeting */
.greet { display: flex; flex-direction: column; gap: 2px; }
.greet h1 { font-size: 1.75rem; font-weight: 800; color: var(--deep); letter-spacing: -.5px; line-height: 1.15; }
.greet span { font-size: 1rem; color: var(--slate); }
.h1 { font-size: 1.625rem; font-weight: 800; color: var(--deep); letter-spacing: -.4px; line-height: 1.15; }
.h2 { font-size: 1.3125rem; font-weight: 800; color: var(--deep); }
.h3 { font-size: 1.1875rem; font-weight: 800; color: var(--deep); }
.muted { color: var(--slate); }
.small { font-size: .875rem; }
.xs { font-size: .8125rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: .75rem; }
.between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.col { display: flex; flex-direction: column; gap: .75rem; }
.gap-s { gap: .5rem; }
.grow { flex-grow: 1; min-width: 0; }

/* Total saved card */
.total-card {
  background: var(--deep); border-radius: var(--radius-xl); padding: 1.375rem; color: #fff;
  display: flex; flex-direction: column; gap: .625rem; position: relative; overflow: hidden;
}
.total-card .bg-jar { position: absolute; right: -24px; bottom: -30px; opacity: .16; width: 150px; height: 150px; color: #fff; }
.total-card .lbl { font-size: 1rem; font-weight: 600; color: var(--pale-text); }
.total-card .amt { font-size: 3rem; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.pills { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .14); border-radius: 999px; padding: 7px 12px; font-size: .875rem; font-weight: 700; color: #fff; }
.pill:hover { color: #fff; background: rgba(255,255,255,.22); }
.pill .leaf { color: var(--pale); }
.pill .flame { color: var(--gold); }

/* Reminder card */
.due-card { background: var(--mint); border-radius: var(--radius-lg); padding: 1.125rem; display: flex; flex-direction: column; gap: .75rem; border: 1px solid var(--mint-line); }
.due-card .when { font-size: .875rem; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .6px; }
.due-card .what { font-size: 1.1875rem; font-weight: 700; color: var(--ink); }
.due-card .btn { align-self: flex-start; min-height: 52px; font-size: 1.0625rem; padding: 0 1.375rem; }
.due-card.behind { background: var(--gold-bg); border-color: #F5E3A6; }
.due-card.behind .when { color: var(--gold-ink); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h2 { font-size: 1.3125rem; font-weight: 800; color: var(--deep); }
.section-head a { font-size: 1rem; font-weight: 700; }

/* Stockvel cards */
.sv-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem; display: flex; flex-direction: column; gap: .75rem; color: var(--ink); background: #fff; }
.sv-card:hover { color: var(--ink); border-color: var(--mint-line); background: #FBFDFB; }
.sv-icon { width: 3rem; height: 3rem; border-radius: 14px; background: var(--mint); display: flex; align-items: center; justify-content: center; color: var(--green); flex-shrink: 0; }
.sv-icon.sm { width: 2.625rem; height: 2.625rem; border-radius: 12px; }
.sv-name { font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.sv-sub { font-size: .875rem; color: var(--slate); }
.rank { display: inline-flex; align-items: center; gap: 4px; background: var(--gold-bg); color: var(--gold-ink); font-size: .8125rem; font-weight: 800; border-radius: 999px; padding: 6px 10px; white-space: nowrap; }
.rank svg { color: var(--gold-deep); }
.track { height: 12px; background: var(--mint); border-radius: 999px; overflow: hidden; }
.track > div { height: 100%; background: var(--green); border-radius: 999px; transition: width .6s ease; }
.track.thin { height: 7px; }
.track.on-mint { background: #fff; }
.sv-foot { display: flex; justify-content: space-between; font-size: .875rem; color: var(--slate); gap: .5rem; }
.sv-foot strong { color: var(--ink); }
.unread-dot { display: inline-flex; align-items: center; gap: 6px; }
.unread-dot::before { content: ''; width: 8px; height: 8px; border-radius: 999px; background: var(--green); }
.status-tag { font-size: .75rem; font-weight: 800; border-radius: 999px; padding: 4px 10px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.status-tag.waiting { background: var(--gold-bg); color: var(--gold-ink); }
.status-tag.active { background: var(--mint); color: var(--deep); }
.status-tag.matured { background: var(--gold-bg); color: var(--gold-ink); }

/* Floating Add money button */
.fab {
  position: fixed; left: 50%; transform: translateX(-50%); width: calc(min(560px, 100%) - 2.5rem);
  bottom: calc(92px + env(safe-area-inset-bottom)); height: 3.75rem; min-height: 56px; background: var(--green); color: #fff; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: .625rem; font-size: 1.1875rem; font-weight: 800;
  box-shadow: 0 8px 20px rgba(6, 78, 42, .25); z-index: 25;
}
.fab:hover { color: #fff; background: var(--deep); }

/* Bottom tab bar */
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); width: min(560px, 100%); bottom: 0; z-index: 30;
  height: calc(76px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .75rem; font-weight: 600; color: var(--slate); position: relative; }
.tab:hover { color: var(--deep); }
.tab.on { color: var(--green); }
.tab .count { position: absolute; top: 10px; left: calc(50% + 6px); background: var(--green); color: #fff; font-size: .6875rem; font-weight: 800; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center; }
.side-brand { display: none; }

/* Jar header on a Stockvel */
.jar-card { background: var(--mint); border-radius: var(--radius-xl); padding: 1.125rem; display: flex; gap: 1rem; align-items: center; }
.jar-card .amt { font-size: 2.125rem; font-weight: 800; color: var(--deep); letter-spacing: -1px; line-height: 1.05; }
.jar-card .of { font-size: .9375rem; color: var(--ink-2); }
.jar-card .when { font-size: .9375rem; font-weight: 700; color: var(--green); }
.chip-gold { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 5px 10px; font-size: .8125rem; font-weight: 700; color: var(--gold-ink); margin-top: 4px; }
.chip-gold svg { color: var(--gold); }
.jar .jar-fill { transition: y .8s ease; }

.segs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 8px; scrollbar-width: none; margin: 0 -1.25rem; padding-left: 1.25rem; padding-right: 1.25rem; }
.segs::-webkit-scrollbar { display: none; }
.seg { font-size: .9375rem; font-weight: 700; padding: 10px 14px; border-radius: 999px; color: var(--slate); white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.seg.on { background: var(--green); color: #fff; }
.seg.on:hover { color: #fff; }
.seg .count { background: var(--red); color: #fff; border-radius: 999px; font-size: .6875rem; padding: 1px 6px; margin-left: 6px; }

.toggle2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--soft); border-radius: 999px; padding: 4px; }
.toggle2 a, .toggle2 button { border: 0; border-radius: 999px; padding: 10px; font-size: .9375rem; font-weight: 700; background: transparent; color: var(--slate); text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.toggle2 .on { background: #fff; color: var(--deep); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* Leaderboard */
.lb { display: flex; flex-direction: column; gap: 4px; }
.lb-row { display: grid; grid-template-columns: 1.75rem 2.5rem minmax(0, 1fr) auto; gap: .625rem; align-items: center; padding: .625rem .75rem; border-radius: var(--radius); }
.lb-row.mine { background: var(--mint); border: 2px solid var(--green); position: sticky; bottom: calc(160px + env(safe-area-inset-bottom)); top: 80px; z-index: 2; }
.lb-pos { font-size: 1rem; font-weight: 800; color: var(--slate); text-align: center; }
.lb-pos.first { color: var(--gold-deep); }
.lb-row.mine .lb-pos { color: var(--deep); }
.av { width: 2.5rem; height: 2.5rem; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .875rem; position: relative; flex-shrink: 0; }
.av .crown { position: absolute; top: -10px; left: 11px; color: var(--gold); }
.av.lg { width: 3.5rem; height: 3.5rem; font-size: 1.125rem; }
.lb-name { font-size: 1rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row.mine .lb-name { font-weight: 800; }
.lb-mid { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lb-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lb-amt { font-size: 1rem; font-weight: 800; }
.lb-chip { font-size: .75rem; font-weight: 700; color: var(--green); white-space: nowrap; }
.lb-chip.lead { color: var(--gold-ink); }
.lb-chip.behind { color: var(--slate); }
.lb-sub { font-size: .75rem; font-weight: 600; color: var(--slate); }
.nudge-btn { border: 1.5px solid var(--green); background: #fff; color: var(--green); border-radius: 999px; padding: 8px 12px; font-size: .8125rem; font-weight: 800; min-height: 44px; }
.nudge-btn:disabled { opacity: .5; }

/* Add money */
.picker { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: .75rem .875rem; text-align: left; min-height: 4rem; width: 100%; }
.picker .lbl { font-size: .8125rem; color: var(--slate); font-weight: 600; }
.picker .val { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.picker .chg { font-size: .9375rem; font-weight: 700; color: var(--green); }
.amount-display { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: .625rem 0; }
.amount-display .big { font-size: 4rem; font-weight: 800; color: var(--deep); letter-spacing: -2px; line-height: 1; }
.amount-display .hint { font-size: .9375rem; color: var(--slate); text-align: center; }
.amount-display input { border: 0; text-align: center; font-size: 4rem; font-weight: 800; color: var(--deep); letter-spacing: -2px; width: 100%; background: transparent; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.chip { border: 1.5px solid var(--mint-line); background: #fff; color: var(--deep); border-radius: 999px; padding: 10px 16px; font-size: 1rem; font-weight: 700; min-height: 46px; }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: 4px; }
.key { border: 0; background: var(--soft); border-radius: var(--radius); height: 3.625rem; min-height: 56px; font-size: 1.625rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.key:active { background: var(--mint-line); }
.lock-note { display: flex; align-items: center; gap: .5rem; justify-content: center; color: var(--slate); font-size: .8125rem; font-weight: 600; text-align: center; }
.cta-bottom { position: sticky; bottom: calc(1rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .625rem; margin-top: auto; padding-top: .5rem; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 30%); }
.btn-big { height: 3.875rem; min-height: 58px; font-size: 1.1875rem; width: 100%; }

/* Confirm */
.confirm-box { background: var(--mint); border-radius: var(--radius-xl); padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; text-align: center; }
.confirm-box .sentence { font-size: 1.625rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.confirm-box .sentence strong { color: var(--deep); font-weight: 800; }
.method { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .875rem; min-height: 56px; }
.method input { width: 22px; height: 22px; accent-color: var(--green); }
.pin-input { display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.pin-input label { font-weight: 700; }
.pin-field {
  width: 100%; max-width: 280px; height: 4rem; border: 2px solid var(--line); border-radius: var(--radius); text-align: center;
  font-size: 2rem; font-weight: 800; letter-spacing: .75em; padding-left: .75em; background: #fff; -webkit-text-security: disc;
}
.pin-field:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--mint); }

/* Success */
.success { background: var(--deep); color: #fff; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: calc(3.5rem + env(safe-area-inset-top)) 1.5rem calc(1.75rem + env(safe-area-inset-bottom)); gap: 1.125rem; position: relative; overflow: hidden; text-align: center; }
.success .big { font-size: 2.75rem; font-weight: 800; letter-spacing: -1px; line-height: 1.05; }
.success .sub { font-size: 1.0625rem; color: var(--pale-text); }
.success .total { font-size: 1.0625rem; color: var(--mint); }
.success .total strong { color: #fff; }
.success .actions { width: 100%; display: flex; flex-direction: column; gap: .625rem; margin-top: auto; }
.success .pill { padding: 9px 14px; font-size: .9375rem; font-weight: 800; }
.badge-card { width: 100%; background: #fff; color: var(--ink); border-radius: 22px; padding: 1rem; display: flex; gap: .875rem; align-items: center; text-align: left; }
.badge-ico { width: 3.5rem; height: 3.5rem; border-radius: 999px; background: var(--gold-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--gold-deep); }
.badge-card .k { font-size: .8125rem; font-weight: 800; color: var(--gold-ink); text-transform: uppercase; letter-spacing: .6px; }
.badge-card .n { font-size: 1.125rem; font-weight: 800; }
.badge-card .d { font-size: .875rem; color: var(--slate); }
.c { position: absolute; width: 10px; height: 16px; border-radius: 3px; animation: drop 1.6s ease-in both; }
@keyframes drop { from { transform: translateY(-120px) rotate(0); opacity: 0; } 15% { opacity: 1; } to { opacity: 1; } }
.coin-drop { animation: coin .7s cubic-bezier(.5, 0, .75, 0) both .2s; }
@keyframes coin { from { transform: translateY(-40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* My Savings */
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; }
.tile { border-radius: var(--radius-lg); padding: 1rem; display: flex; flex-direction: column; gap: 4px; }
.tile.deep { background: var(--deep); color: #fff; }
.tile.mint { background: var(--mint); }
.tile .lbl { font-size: .875rem; font-weight: 600; }
.tile.deep .lbl, .tile.deep .sub { color: var(--pale-text); }
.tile.mint .lbl, .tile.mint .sub { color: var(--ink-2); }
.tile .v { font-size: 1.875rem; font-weight: 800; letter-spacing: -.8px; }
.tile.mint .v { color: var(--deep); }
.tile .sub { font-size: .8125rem; }
.box { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem; display: flex; flex-direction: column; gap: .75rem; background: #fff; color: var(--ink); }
a.box:hover { color: var(--ink); border-color: var(--mint-line); }
.bars { display: grid; gap: .375rem; height: 10rem; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; font-size: .6875rem; font-weight: 600; color: var(--slate); height: 100%; min-width: 0; }
.bar .v { color: var(--ink); font-weight: 700; white-space: nowrap; font-size: .625rem; }
.bar .b { width: 100%; background: var(--leaf); border-radius: 8px; min-height: 3px; }
.bar.now .b { background: var(--green); }
.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.stat3 > div { display: flex; flex-direction: column; gap: 2px; }
.stat3 .k { font-size: .75rem; color: var(--slate); font-weight: 600; }
.stat3 .v { font-size: 1.0625rem; font-weight: 800; }
.stat3 .v.green { color: var(--green); }
.promise { display: flex; gap: .625rem; align-items: flex-start; background: var(--soft); border-radius: var(--radius); padding: .75rem .875rem; font-size: .875rem; color: var(--ink-2); line-height: 1.45; }
.promise svg { color: var(--green); margin-top: 1px; }

/* Discover */
.search { display: flex; align-items: center; gap: .625rem; background: var(--soft); border-radius: 999px; padding: 0 1rem; height: 3.25rem; color: var(--slate); }
.search input { border: 0; background: transparent; font-size: 1rem; flex-grow: 1; outline: none; color: var(--ink); height: 100%; min-width: 0; }
.fchips { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; margin: 0 -1.25rem; padding: 0 1.25rem 2px; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 8px 14px; font-size: .875rem; font-weight: 700; white-space: nowrap; min-height: 2.5rem; display: inline-flex; align-items: center; gap: 6px; }
.fchip.on { background: var(--green); border-color: var(--green); color: #fff; }
.fchip:hover { color: var(--ink-2); border-color: var(--mint-line); }
.fchip.on:hover { color: #fff; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem; display: flex; flex-direction: column; gap: .75rem; background: #fff; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; font-size: .8125rem; color: var(--slate); }
.meta strong { display: block; font-size: 1rem; color: var(--ink); }
.tag { font-size: .75rem; font-weight: 800; border-radius: 999px; padding: 5px 10px; background: var(--mint); color: var(--deep); white-space: nowrap; }
.tag.gold { background: var(--gold-bg); color: var(--gold-ink); }
.tag.grey { background: var(--soft); color: var(--ink-2); }
.btn-requested { background: var(--mint); color: var(--ink-2); border: 1.5px solid var(--mint-line); }

/* Bottom sheets (instead of modals) */
dialog.sheet {
  margin: auto auto 0; width: min(560px, 100%); max-width: 100%; max-height: 88vh; border: 0; padding: 0;
  border-radius: 24px 24px 0 0; background: #fff; color: var(--ink); box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
}
dialog.sheet::backdrop { background: rgba(15, 26, 20, .45); }
dialog.sheet[open] { animation: sheet-up .22s ease-out both; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-body { padding: .75rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; max-height: 88vh; }
.sheet-grip { width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto .25rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sheet-head h2 { font-size: 1.3125rem; font-weight: 800; color: var(--deep); }
.option-list { display: flex; flex-direction: column; gap: .5rem; }
.option { display: flex; align-items: center; gap: .75rem; border: 1.5px solid var(--line); border-radius: var(--radius); padding: .75rem .875rem; min-height: 3.75rem; background: #fff; text-align: left; width: 100%; color: var(--ink); }
.option.on, .option:has(input:checked) { border-color: var(--green); background: var(--mint); }
.option input[type=radio], .option input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); flex-shrink: 0; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .5rem; }
.field > label, .field .label { font-size: 1rem; font-weight: 700; color: var(--ink); }
.field .help { font-size: .875rem; color: var(--slate); }
.field input[type=text], .field input[type=tel], .field input[type=number], .field input[type=date], .field input[type=password], .field select, .field textarea {
  min-height: 3.5rem; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 0 1rem; font-size: 1.125rem; background: #fff; width: 100%; color: var(--ink);
}
.field textarea { padding: .875rem 1rem; min-height: 6rem; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--mint); }
.field .err, .err-text { color: var(--red); font-weight: 700; font-size: .9375rem; }
.phone-input { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius); min-height: 3.75rem; overflow: hidden; }
.phone-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--mint); }
.phone-input .prefix { padding: 0 .875rem; font-size: 1.25rem; font-weight: 800; color: var(--deep); background: var(--soft); align-self: stretch; display: flex; align-items: center; }
.phone-input input { border: 0; outline: none; font-size: 1.375rem; font-weight: 700; padding: 0 .875rem; flex: 1; min-width: 0; height: 3.75rem; letter-spacing: 1px; }
.code-input { text-align: center; font-size: 2rem !important; font-weight: 800; letter-spacing: .5em; padding-left: .5em !important; }
.check { display: flex; gap: .75rem; align-items: flex-start; font-size: 1rem; line-height: 1.45; }
.check input { width: 26px; height: 26px; accent-color: var(--green); flex-shrink: 0; margin-top: 1px; }

.alert { border-radius: var(--radius); padding: .875rem 1rem; font-size: 1rem; font-weight: 600; display: flex; gap: .625rem; align-items: flex-start; line-height: 1.45; }
.alert svg { margin-top: 2px; }
.alert.err { background: var(--red-bg); color: var(--red); }
.alert.ok { background: var(--mint); color: var(--deep); }
.alert.info { background: var(--soft); color: var(--ink-2); }
.alert.demo { background: var(--gold-bg); color: var(--gold-ink); }

/* Onboarding */
.onboard { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); gap: 1.25rem; max-width: 560px; margin: 0 auto; }
.onboard .step { font-size: .875rem; font-weight: 700; color: var(--slate); }
.onboard h1 { font-size: 1.875rem; font-weight: 800; color: var(--deep); letter-spacing: -.5px; line-height: 1.15; }
.onboard .lead { font-size: 1.125rem; color: var(--ink-2); }
.onboard form { display: flex; flex-direction: column; gap: 1.25rem; flex-grow: 1; }
.onboard .spacer { flex-grow: 1; }
.lang-btn { display: flex; align-items: center; justify-content: space-between; border: 2px solid var(--line); border-radius: var(--radius-lg); background: #fff; padding: 0 1.25rem; min-height: 4.5rem; font-size: 1.5rem; font-weight: 800; color: var(--deep); width: 100%; }
.lang-btn:hover, .lang-btn.on { border-color: var(--green); background: var(--mint); }
.welcome-cards { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -1.25rem; padding: 0 1.25rem .5rem; scrollbar-width: none; }
.welcome-cards::-webkit-scrollbar { display: none; }
.wcard { flex: 0 0 86%; scroll-snap-align: center; border-radius: var(--radius-xl); padding: 1.75rem 1.5rem; display: flex; flex-direction: column; gap: .875rem; min-height: 21rem; }
.wcard:nth-child(1) { background: var(--deep); color: #fff; }
.wcard:nth-child(2) { background: var(--mint); color: var(--deep); }
.wcard:nth-child(3) { background: var(--ink); color: #fff; }
.wcard .t { font-size: 1.75rem; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; }
.wcard .d { font-size: 1.0625rem; line-height: 1.5; opacity: .9; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--line); }
.dots span.on { background: var(--green); width: 22px; }
.big-choice { display: flex; align-items: center; gap: 1rem; border: 2px solid var(--line); border-radius: var(--radius-xl); padding: 1.375rem 1.25rem; color: var(--ink); background: #fff; min-height: 7rem; }
.big-choice:hover { border-color: var(--green); background: var(--mint); color: var(--ink); }
.big-choice .ico { width: 3.75rem; height: 3.75rem; border-radius: 18px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.big-choice .t { font-size: 1.375rem; font-weight: 800; color: var(--deep); }
.big-choice .d { font-size: .9375rem; color: var(--slate); }

/* Wizard */
.wizard-step[hidden] { display: none !important; }
.progress-steps { display: flex; gap: 6px; }
.progress-steps span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.progress-steps span.on { background: var(--green); }
.icon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.icon-pick { position: relative; }
.icon-pick input { position: absolute; opacity: 0; inset: 0; }
.icon-pick span { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 2px solid var(--line); border-radius: var(--radius); color: var(--green); background: #fff; min-height: 56px; }
.icon-pick input:checked + span { border-color: var(--green); background: var(--mint); }
.icon-pick input:focus-visible + span { outline: 3px solid var(--gold); }
.type-option { align-items: flex-start; }
.type-option .t { font-size: 1.125rem; font-weight: 800; color: var(--deep); }
.type-option .d { font-size: .9375rem; color: var(--slate); }
.type-option.disabled { opacity: .55; }
.rules-list { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .625rem; font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; }
.share-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .375rem; border: 1.5px solid var(--line); border-radius: var(--radius); padding: .875rem; min-height: 5.5rem; background: #fff; color: var(--deep); font-weight: 700; font-size: .9375rem; }
.share-btn:hover { border-color: var(--green); background: var(--mint); color: var(--deep); }
.qr { width: 220px; height: 220px; margin: 0 auto; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.qr svg, .qr img { width: 100%; height: 100%; }
.link-box { display: flex; align-items: center; gap: .5rem; background: var(--soft); border-radius: var(--radius); padding: .75rem .875rem; font-size: .9375rem; font-weight: 600; word-break: break-all; }

/* Lists (settings, members, activity) */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: .875rem; padding: .875rem 1rem; min-height: 3.75rem; color: var(--ink); background: #fff; width: 100%; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; font-size: 1rem; }
.li:first-child { border-top: 0; }
a.li:hover, button.li:hover { background: #FBFDFB; color: var(--ink); }
.li .ico { width: 2.5rem; height: 2.5rem; border-radius: 12px; background: var(--mint); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.li .main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li .main strong { font-weight: 700; }
.li .main span { font-size: .875rem; color: var(--slate); }
.li .end { color: var(--slate); font-size: .875rem; font-weight: 700; text-align: right; }
.switch { position: relative; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background var(--fast); }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--fast); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.act { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: 0; }
.act .ico { width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--mint); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act .txt { font-size: .9375rem; line-height: 1.4; }
.act .when { font-size: .8125rem; color: var(--slate); }
.flag-unusual { color: var(--gold-ink); font-weight: 700; font-size: .75rem; }

.group-progress { display: flex; align-items: center; gap: .625rem; }
.avatars { display: flex; }
.avatars .av { width: 2rem; height: 2rem; font-size: .6875rem; border: 2px solid #fff; margin-left: -8px; }
.avatars .av:first-child { margin-left: 0; }
.avatars .av.unpaid { background: var(--soft) !important; color: var(--slate) !important; border: 2px dashed #9AA8A0; }

/* Votes */
.vote-card { border: 1.5px solid var(--mint-line); border-radius: var(--radius-lg); padding: .875rem; display: flex; flex-direction: column; gap: .625rem; background: #fff; }
.vote-card .q { font-size: 1.0625rem; font-weight: 800; }
.vote-card .by { font-size: .875rem; color: var(--slate); }
.vote-bar { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; display: flex; }
.vote-bar .y { background: var(--green); }
.vote-bar .n { background: #E2A3A3; }
.vote-count { font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.vote-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.vote-btns .btn { min-height: 48px; font-size: 1rem; padding: 0 1rem; }
.vote-btns .btn.chosen { outline: 3px solid var(--gold); }

/* Chat */
.chat-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto; }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: calc(.875rem + env(safe-area-inset-top)) 1rem .875rem; border-bottom: 1px solid var(--line); background: #fff; }
.chat-head .t { font-size: 1.125rem; font-weight: 800; color: var(--deep); }
.chat-head .s { display: flex; align-items: center; gap: 5px; font-size: .8125rem; color: var(--slate); font-weight: 600; }
.chat-scroll { flex-grow: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .625rem; background: #fff; overscroll-behavior: contain; }
.day { align-self: center; font-size: .75rem; font-weight: 700; color: var(--slate); }
.sys { align-self: center; display: flex; align-items: center; gap: .5rem; background: var(--mint); color: var(--deep); border-radius: 999px; padding: 8px 14px; font-size: .8125rem; font-weight: 700; text-align: center; max-width: 92%; }
.msg { max-width: 78%; padding: 10px 14px; font-size: 1rem; line-height: 1.4; position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.them { align-self: flex-start; background: var(--soft); border-radius: 6px 20px 20px 20px; }
.me { align-self: flex-end; background: var(--green); color: #fff; border-radius: 20px 6px 20px 20px; }
.who { display: block; font-size: .75rem; font-weight: 800; color: var(--green); margin-bottom: 2px; }
.time { display: block; font-size: .6875rem; opacity: .7; margin-top: 4px; text-align: right; }
.msg .reply-to { display: block; border-left: 3px solid var(--leaf); padding-left: 8px; margin-bottom: 6px; font-size: .8125rem; opacity: .8; }
.me .reply-to { border-color: var(--pale); }
.msg .reacts { display: flex; gap: 4px; margin-top: 4px; }
.msg .reacts span { background: #fff; border-radius: 999px; padding: 0 6px; font-size: .8125rem; border: 1px solid var(--line); color: var(--ink); }
.msg.deleted { font-style: italic; opacity: .6; }
.scam-banner { display: flex; gap: 6px; align-items: flex-start; background: var(--gold-bg); color: var(--gold-ink); border-radius: 10px; padding: 6px 8px; font-size: .75rem; font-weight: 700; margin-top: 6px; }
.voice { display: flex; align-items: center; gap: .625rem; min-width: 200px; }
.voice .play { width: 38px; height: 38px; border-radius: 999px; border: 0; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.me .voice .play { background: #fff; color: var(--green); }
.voice .wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 3px; }
.voice .wave i { display: block; width: 4px; border-radius: 2px; background: #B8CFC0; }
.voice .wave i.p { background: var(--leaf); }
.voice .dur { font-size: .8125rem; font-weight: 700; color: var(--slate); }
.me .voice .dur { color: var(--mint); }
.composer { display: flex; align-items: center; gap: .5rem; padding: .75rem .875rem calc(.875rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.composer label { flex-grow: 1; background: var(--soft); border-radius: 999px; min-height: 3.25rem; display: flex; align-items: center; padding: 0 1rem; }
.composer input { border: 0; background: transparent; font-size: 1rem; outline: none; width: 100%; min-height: 3.25rem; }
.round-btn { width: 3.25rem; height: 3.25rem; min-width: 52px; min-height: 52px; border-radius: 999px; border: 0; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.round-btn.rec { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(198, 40, 40, .15); } }
.reply-bar { display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; background: var(--soft); font-size: .875rem; }
.reply-bar[hidden] { display: none; }
.chat-row { display: flex; align-items: center; gap: .875rem; padding: .875rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.chat-row:hover { color: var(--ink); }
.chat-row .last { font-size: .875rem; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .count { background: var(--green); color: #fff; font-size: .75rem; font-weight: 800; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }

/* Badges grid */
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; }
.badge-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: .875rem; display: flex; flex-direction: column; gap: .375rem; align-items: flex-start; }
.badge-tile .badge-ico { width: 2.75rem; height: 2.75rem; }
.badge-tile.locked { opacity: .45; }
.badge-tile .badge-ico.locked { background: var(--soft); color: var(--slate); }
.badge-tile strong { font-size: .9375rem; }
.badge-tile span { font-size: .8125rem; color: var(--slate); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .75rem; padding: 1.5rem .5rem; }
.empty .art { width: 7rem; height: 7rem; border-radius: 999px; background: var(--mint); display: flex; align-items: center; justify-content: center; color: var(--green); }

.install-card { background: var(--mint); border: 1px solid var(--mint-line); border-radius: var(--radius-lg); padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.install-card[hidden] { display: none; }
.install-card .phone-pic { display: flex; gap: .75rem; align-items: center; }
.install-card ol { margin: 0; padding-left: 1.25rem; font-size: .9375rem; display: flex; flex-direction: column; gap: 4px; }

.season { background: linear-gradient(120deg, var(--deep), var(--green)); color: #fff; border-radius: var(--radius-lg); padding: .875rem 1rem; display: flex; align-items: center; gap: .75rem; font-weight: 700; }
.season .n { font-size: 1.75rem; font-weight: 800; line-height: 1; }

.levelup { position: fixed; inset: 0; background: var(--deep); color: #fff; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; padding: 2rem; }
.levelup[hidden] { display: none; }

.footer-mini { font-size: .8125rem; color: var(--slate); text-align: center; line-height: 1.6; padding-top: .5rem; }
.footer-mini a { font-weight: 800; }

.statement { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem; }
.statement table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.statement th, .statement td { text-align: left; padding: .5rem .25rem; border-bottom: 1px solid var(--line); }
.statement td.r, .statement th.r { text-align: right; }

.ptr { position: fixed; top: 0; left: 50%; transform: translate(-50%, -60px); z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 999px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--green); transition: transform .15s; box-shadow: 0 4px 12px rgba(0,0,0,.08); }

/* Desktop: from 1024 px the tabs become a left sidebar */
@media (min-width: 1024px) {
  .shell { max-width: none; padding-left: 260px; }
  .shell > .topbar, .shell > .screen, .shell > .page-inner { max-width: 760px; margin: 0 auto; }
  .tabs {
    left: 0; transform: none; top: 0; width: 260px; height: 100vh; grid-template-columns: 1fr; grid-auto-rows: min-content;
    border-top: 0; border-right: 1px solid var(--line); padding: 1.5rem 1rem; gap: .25rem; align-content: start;
  }
  .topbar .brand { visibility: hidden; }
  .side-brand { display: flex; align-items: center; gap: .625rem; color: var(--deep); font-weight: 800; font-size: 1.125rem; padding: 0 .75rem 1.25rem; }
  .tab { flex-direction: row; justify-content: flex-start; gap: .875rem; font-size: 1rem; padding: .875rem .875rem; border-radius: var(--radius); }
  .tab.on { background: var(--mint); }
  .tab .count { position: static; margin-left: auto; }
  .fab { left: calc(260px + (100% - 260px) / 2); width: min(720px, calc(100% - 260px - 2.5rem)); bottom: 24px; }
  .screen { padding-bottom: 7rem; }
  .lb-row.mine { bottom: 100px; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .chat-page { max-width: 760px; }
  .chat-shell { padding-left: 260px; }
}
