/* =====================================================================
   Family Expense Tracker — MOBILE-FIRST. Base styles are for phones;
   min-width queries only add enhancements for larger screens.
   ===================================================================== */
:root {
  --bg: #080811; --bg2: #11111f; --sheet: #14142a; --surface: rgba(255,255,255,.05); --surface-2: rgba(255,255,255,.09);
  --border: rgba(255,255,255,.09); --text: #f3f3fb; --muted: #a0a0bd; --faint: #6e6e8c;
  --accent: #8b5cf6; --accent-2: #22d3ee; --good: #34d399; --bad: #fb7185; --warn: #fbbf24;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
  --shadow: 0 8px 30px rgba(0,0,0,.4); --radius: 24px; --radius-sm: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --tab-h: 68px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f2fa; --bg2: #ffffff; --sheet: #ffffff; --surface: rgba(255,255,255,.82); --surface-2: rgba(120,120,180,.12);
  --border: rgba(30,30,70,.10); --text: #15152b; --muted: #5a5a78; --faint: #8a8aa6;
  --shadow: 0 8px 24px rgba(60,60,120,.12); color-scheme: light;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; min-height: 100dvh; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; overscroll-behavior-y: none;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 28px);
}
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; animation: float 22s ease-in-out infinite; }
.aurora i:nth-child(1) { width: 320px; height: 320px; background: #6d3df0; top: -110px; left: -90px; }
.aurora i:nth-child(2) { width: 300px; height: 300px; background: #0891b2; bottom: -120px; right: -80px; animation-delay: -7s; opacity: .34; }
.aurora i:nth-child(3) { width: 220px; height: 220px; background: #db2777; top: 42%; left: 55%; animation-delay: -13s; opacity: .2; }
:root[data-theme="light"] .aurora i { opacity: .2; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-24px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 10px; }
h1 { font-size: 1.55rem; letter-spacing: -.025em; line-height: 1.15; }
h2 { font-size: 1.02rem; letter-spacing: -.01em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .82rem; }
.num { font-variant-numeric: tabular-nums; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

/* ---------- app shell (phone) ---------- */
.side { display: none; }
main { padding: calc(var(--safe-t) + 14px) 16px 0; max-width: 760px; margin: 0 auto; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.topbar .hello { min-width: 0; }
.topbar .hello .sub { color: var(--muted); font-size: .84rem; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head { margin-bottom: 14px; display: grid; gap: 10px; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); padding: 6px 8px var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(14,14,28,.96); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-top: 1px solid var(--border);
}
:root[data-theme="light"] .tabbar { background: rgba(255,255,255,.97); }
.tabbar a, .tabbar button {
  display: grid; justify-items: center; gap: 1px; font-size: .68rem; font-weight: 600; color: var(--faint);
  min-height: 54px; align-content: center; border-radius: 16px; transition: color .15s, transform .15s;
}
.tabbar .ic { font-size: 1.4rem; line-height: 1.1; transition: transform .2s; }
.tabbar a.on { color: var(--text); } .tabbar a.on .ic { transform: translateY(-2px) scale(1.12); }
.tabbar a:active, .tabbar button:active { transform: scale(.94); }
.tabbar .add { position: relative; }
.tabbar .add span {
  width: 58px; height: 58px; border-radius: 20px; background: var(--grad); color: #fff; font-size: 2rem; font-weight: 300;
  display: grid; place-items: center; margin-top: -26px; box-shadow: 0 10px 26px rgba(99,102,241,.55); border: 4px solid var(--bg);
}
.fab { display: none; }

/* ---------- primitives ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.card h2 { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stack { display: grid; gap: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center; padding: 0 18px; min-height: 48px; border-radius: 16px; font-weight: 650;
  background: var(--surface-2); border: 1px solid var(--border); transition: transform .12s, border-color .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px rgba(99,102,241,.4); }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .88rem; border-radius: 13px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); font-size: 1.1rem; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 650; background: var(--surface-2); }
.chip.good { color: var(--good); background: rgba(52,211,153,.13); } .chip.bad { color: var(--bad); background: rgba(251,113,133,.13); } .chip.warn { color: var(--warn); background: rgba(251,191,36,.13); }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .lbl { font-size: .8rem; color: var(--muted); font-weight: 650; }
input, select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 15px; background: var(--surface); border: 1px solid var(--border);
  outline: none; transition: border-color .15s, box-shadow .15s; font-size: 16px; /* 16px stops iOS auto-zoom */
}
select option { background: var(--bg2); color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,92,246,.22); }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--accent); padding: 0; }
input[type=color] { padding: 4px; height: 50px; }
input[type=file] { display: none; }
input[type=date] { min-width: 0; display: block; text-align: left; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 17px; background: var(--surface); border: 1px solid var(--border); gap: 4px; }
.seg button { min-height: 44px; border-radius: 13px; font-weight: 650; color: var(--muted); transition: .18s; }
.seg button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.seg button.on.exp { background: linear-gradient(135deg,#f43f5e,#f97316); } .seg button.on.inc { background: linear-gradient(135deg,#10b981,#22d3ee); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; min-height: 52px; }
.switch + .switch { border-top: 1px solid var(--border); }
.empty { text-align: center; padding: 34px 14px; color: var(--muted); } .empty .big { font-size: 2.6rem; margin-bottom: 8px; }
.err { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin: 2px 0 8px; }
.hint { background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.25); border-radius: 16px; padding: 12px 14px; font-size: .86rem; color: var(--muted); margin-bottom: 14px; }
.hint b { color: var(--text); } .hint ol { padding-left: 18px; margin-top: 6px; display: grid; gap: 3px; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.hscroll::-webkit-scrollbar { display: none; } .hscroll > * { flex: none; scroll-snap-align: start; }

/* ---------- month switcher ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; padding: 4px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 16px; }
.month-nav b { flex: 1; text-align: center; font-size: 1rem; }
.month-nav .icon-btn { border: 0; background: transparent; }

/* ---------- dashboard ---------- */
.stat .label { color: var(--muted); font-weight: 650; font-size: .82rem; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 1.65rem; font-weight: 780; letter-spacing: -.03em; margin: 6px 0 8px; }
.stat.hero { padding: 22px; background: linear-gradient(135deg, rgba(139,92,246,.38), rgba(34,211,238,.14)), var(--surface); }
.stat.hero .value { font-size: 2.5rem; margin: 6px 0 10px; }
.hero-flex { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ring { --p: 0; width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--surface-2) 0); transition: .8s; }
.ring span { width: 68px; height: 68px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; font-weight: 750; font-size: .95rem; text-align: center; line-height: 1.05; }
.ring small { display: block; color: var(--muted); font-weight: 500; font-size: .6rem; }
.insight { padding: 11px 15px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); font-size: .86rem; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.legend { display: grid; gap: 4px; margin-top: 10px; }
.legend .li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; font-size: .9rem; min-height: 38px; }
.dot { width: 12px; height: 12px; border-radius: 4px; }
.bar { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.budget-row { margin-bottom: 14px; } .budget-row:last-child { margin-bottom: 0; }
.budget-row .top { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: .9rem; gap: 10px; }
.chart-box { position: relative; height: 220px; } .chart-box.sm { height: 190px; }

/* ---------- transaction rows (whole row is the tap target) ---------- */
.txlist { display: grid; }
.tx {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 6px; min-height: 66px; width: 100%;
  text-align: left; border-radius: 18px; transition: background .12s;
}
.tx:active { background: var(--surface-2); }
.tx .ico { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 1.35rem; }
.tx .t1 { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .t2 { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .amt { text-align: right; font-weight: 750; font-size: 1.02rem; }
.day-head { margin: 14px 6px 2px; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 750; display: flex; justify-content: space-between; }
.sticky-filters { margin: 0 0 10px; }
.pillrow { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.pillrow::-webkit-scrollbar { display: none; }
.pill { flex: none; min-height: 40px; padding: 0 15px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: .88rem; color: var(--muted); }
.pill.on { background: var(--surface-2); color: var(--text); border-color: var(--accent); }
.summary-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.summary-strip > div { padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.summary-strip small { display: block; color: var(--muted); font-size: .7rem; font-weight: 650; } .summary-strip b { font-size: .95rem; }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat-card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; text-align: left; padding: 16px; transition: transform .15s; min-height: 126px; }
.cat-card:active { transform: scale(.97); }
.cat-card .ico { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 10px; }
.cat-pick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 -2px; }
.cat-pick::-webkit-scrollbar { display: none; }
.cat-pick button { flex: none; width: 78px; padding: 10px 4px; border-radius: 17px; border: 1px solid var(--border); background: var(--surface); font-size: .72rem; font-weight: 600; display: grid; gap: 3px; justify-items: center; transition: .15s; color: var(--muted); }
.cat-pick button .e { font-size: 1.45rem; } .cat-pick button.on { border-color: var(--accent); background: rgba(139,92,246,.2); color: var(--text); box-shadow: 0 0 0 2px rgba(139,92,246,.35); }
.cat-pick button span:last-child { max-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emoji-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; } .emoji-row button { flex: none; width: 44px; height: 44px; border-radius: 13px; background: var(--surface); font-size: 1.3rem; }

/* ---------- quick add sheet ---------- */
.amount-wrap { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0 16px; }
.amount-wrap .rs { font-size: 2.2rem; font-weight: 700; color: var(--muted); }
.amount-input { font-size: 2.8rem; font-weight: 800; text-align: center; letter-spacing: -.03em; background: transparent; border: 0; box-shadow: none !important; outline: none !important; min-height: 64px; width: calc(1ch + 6px); max-width: 70vw; padding: 0; font-variant-numeric: tabular-nums; caret-color: var(--accent-2); }
.quick-dates { display: flex; gap: 8px; }
.quick-dates button { flex: 1; min-height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: .88rem; color: var(--muted); }
.quick-dates button.on { border-color: var(--accent); color: var(--text); background: rgba(139,92,246,.2); }

/* ---------- plans ---------- */
.seg a { min-height: 44px; border-radius: 13px; font-weight: 650; color: var(--muted); display: grid; place-items: center; transition: .18s; }
.seg a.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.balance-card { padding: 22px; background: linear-gradient(135deg, rgba(34,211,238,.26), rgba(139,92,246,.30)), var(--surface); }
.balance-card .value { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 6px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.kpis > div { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; }
.kpis small { display: block; color: var(--muted); font-size: .72rem; font-weight: 650; } .kpis b { font-size: 1.02rem; }
.plan { padding: 14px; }
.plan-main { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; min-height: 56px; }
.plan-main .ico { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 1.35rem; }
.plan .t1 { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan .t2 { font-size: .8rem; color: var(--muted); display: block; }
.plan .bar { margin: 12px 0 10px; }
.plan-status { font-size: .9rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-note { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.verdict { border-radius: 18px; padding: 14px 16px; font-size: .92rem; margin: 6px 0 12px; border: 1px solid var(--border); background: var(--surface); }
.verdict.ok { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35); } .verdict.no { background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.4); }
.verdict.maybe { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.4); }
.verdict b { font-size: 1.05rem; }
.funds-card { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; }
.funds-card .big { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; }

/* ---------- visibility, sharing and views ---------- */
.scope-chips, .person-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.scope-chips button, .person-chips button { min-height: 44px; padding: 0 15px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-weight: 650; font-size: .88rem; color: var(--muted); transition: .15s; }
.scope-chips button.on { border-color: var(--accent); color: var(--text); background: rgba(139,92,246,.24); box-shadow: 0 0 0 2px rgba(139,92,246,.3); }
.person-chips button.on { border-color: var(--accent-2); color: var(--text); background: rgba(34,211,238,.17); box-shadow: 0 0 0 2px rgba(34,211,238,.25); }
.person-chips button[disabled] { opacity: .5; }
.viewpills { margin-bottom: 12px; }
.seg a { text-align: center; }

/* ---------- import table ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: .82rem; } .tbl th { text-align: left; color: var(--muted); font-weight: 650; padding: 8px; position: sticky; top: 0; background: var(--bg2); }
.tbl td { padding: 8px; border-top: 1px solid var(--border); white-space: nowrap; } .tbl-wrap { overflow: auto; max-height: 300px; border-radius: 16px; border: 1px solid var(--border); }
.drop { border: 2px dashed var(--border); border-radius: 22px; padding: 30px 16px; text-align: center; display: block; cursor: pointer; transition: .2s; }
.drop:active, .drop.over { border-color: var(--accent); background: rgba(139,92,246,.1); }

/* ---------- bottom sheet / toast / auth ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(4,4,10,.62); backdrop-filter: blur(5px); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.modal {
  width: 100%; max-width: 640px; max-height: 94vh; max-height: 94dvh; overflow: auto; overscroll-behavior: contain; background: var(--sheet);
  border: 1px solid var(--border); border-bottom: 0; border-radius: 28px 28px 0 0; padding: 10px 20px calc(20px + var(--safe-b));
  box-shadow: var(--shadow); animation: sheet .28s cubic-bezier(.2,.9,.3,1);
}
.modal::before { content: ""; display: block; width: 42px; height: 5px; border-radius: 9px; background: var(--surface-2); margin: 0 auto 14px; }
.modal h2 { font-size: 1.3rem; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.modal .foot { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 10px; }
.modal .foot.one { grid-auto-flow: row; }
@keyframes fade { from { opacity: 0; } } @keyframes sheet { from { transform: translateY(60px); opacity: 0; } }
.toasts { position: fixed; z-index: 90; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--sheet); border: 1px solid var(--border); padding: 13px 18px; border-radius: 18px; box-shadow: var(--shadow); animation: drop .3s cubic-bezier(.2,.9,.3,1.2); font-weight: 600; max-width: 460px; pointer-events: auto; }
.toast.ok { border-left: 4px solid var(--good); } .toast.fail { border-left: 4px solid var(--bad); }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; align-items: center; padding: calc(var(--safe-t) + 20px) 18px calc(var(--safe-b) + 20px); }
.auth .card { max-width: 440px; width: 100%; margin: 0 auto; padding: 28px 22px; }
.logo { width: 40px; height: 40px; border-radius: 13px; background: var(--grad); display: grid; place-items: center; font-size: 20px; box-shadow: 0 6px 22px rgba(139,92,246,.45); }
.auth .logo { width: 60px; height: 60px; font-size: 30px; border-radius: 20px; margin-bottom: 18px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 22px; height: 110px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in > * { animation: rise .5s both; } .fade-in > *:nth-child(2) { animation-delay: .05s; } .fade-in > *:nth-child(3) { animation-delay: .1s; } .fade-in > *:nth-child(4) { animation-delay: .15s; } .fade-in > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.menu-list { display: grid; gap: 10px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 64px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); font-weight: 650; }
.menu-item .ic { font-size: 1.5rem; width: 34px; text-align: center; } .menu-item small { display: block; color: var(--muted); font-weight: 500; }
.menu-item:active { transform: scale(.98); }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 4px; min-height: 66px; width: 100%; text-align: left; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 750; flex: none; color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* =====================================================================
   Larger screens: optional enhancements only
   ===================================================================== */
@media (min-width: 600px) {
  .overlay { align-items: center; padding: 16px; }
  .modal { border-radius: 28px; border-bottom: 1px solid var(--border); padding-bottom: 22px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  body { padding-bottom: 40px; }
  .tabbar { display: none; }
  .shell { display: grid; grid-template-columns: 250px 1fr; }
  .side { display: flex; position: sticky; top: 0; height: 100vh; padding: 22px 16px; flex-direction: column; gap: 6px; border-right: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), transparent); backdrop-filter: blur(18px); }
  .brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 22px; font-weight: 700; font-size: 1.05rem; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: var(--muted); font-weight: 600; }
  .side nav a:hover { background: var(--surface); color: var(--text); } .side nav a.on { background: var(--surface-2); color: var(--text); }
  .side .spacer { flex: 1; }
  main { max-width: 1100px; padding: 28px 36px 0; }
  .fab { display: grid; position: fixed; z-index: 40; right: 26px; bottom: 28px; width: 62px; height: 62px; border-radius: 22px; background: var(--grad); color: #fff; font-size: 1.9rem; place-items: center; box-shadow: 0 12px 34px rgba(99,102,241,.55); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid .full { grid-column: 1 / -1; }
  .hscroll { margin: 0; padding: 2px 0 4px; }
}
