/* BBSCU — Bob's Balls Credit Union */
:root {
  --bg: #f8f9fb;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --line: #eaecf0;
  --line-2: #f2f4f7;
  --card-line: transparent;
  --ink: #101828;
  --mut: #667085;
  --mut-2: #98a2b3;
  --green: #16a34a;
  --green-ink: #15803d;
  --green-tint: rgba(22, 163, 74, 0.09);
  --amber: #b54708;
  --amber-tint: rgba(247, 144, 9, 0.13);
  --red: #d92d20;
  --red-tint: rgba(240, 68, 56, 0.1);
  --violet: #6941c6;
  --violet-tint: rgba(127, 86, 217, 0.11);
  --blue: #175cd3;
  --blue-tint: rgba(46, 144, 250, 0.12);
  --gray-tint: #f2f4f7;
  --rail: #14181b;
  --rail-ink: #e6e9ec;
  --rail-mut: #96a0aa;
  --rail-line: rgba(255, 255, 255, 0.07);
  --sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 10px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 8px 32px rgba(16, 24, 40, 0.12);
}
[data-theme="dark"] {
  --bg: #101413;
  --panel: #181d1b;
  --panel-2: #1e2421;
  --line: #272e2a;
  --line-2: #232a26;
  --card-line: #242b27;
  --ink: #e8edea;
  --mut: #9caba3;
  --mut-2: #6f7d76;
  --green: #34d399;
  --green-ink: #3fd9a0;
  --green-tint: rgba(52, 211, 153, 0.13);
  --amber: #dcae62;
  --amber-tint: rgba(220, 174, 98, 0.15);
  --red: #f08a8a;
  --red-tint: rgba(240, 138, 138, 0.13);
  --violet: #c3aaf0;
  --violet-tint: rgba(195, 170, 240, 0.14);
  --blue: #93bce0;
  --blue-tint: rgba(147, 188, 224, 0.14);
  --gray-tint: rgba(255, 255, 255, 0.07);
  --rail: #0d1110;
  --shadow-card: none;
  --shadow-pop: 0 8px 32px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); }
a { color: var(--green-ink); }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.login-card {
  width: 380px; max-width: 100%; text-align: center;
  background: var(--panel); border: 1px solid var(--card-line); border-radius: 16px;
  box-shadow: var(--shadow-pop); padding: 44px 36px 36px;
}
.login-mark { width: 48px; height: 48px; margin-bottom: 20px; }
.login-card h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.login-tag { color: var(--mut); font-size: 13.5px; margin: 5px 0 28px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-pass {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
#login-pass:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; }
.login-or { color: var(--mut-2); font-size: 12px; margin: 14px 0 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap; transition: background 0.1s;
}
.btn:hover { background: var(--panel-2); }
.btn svg { width: 15px; height: 15px; }
.btn-primary, .btn-gold { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover, .btn-gold:hover { background: #138a41; border-color: #138a41; }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-gold { background: #1fa25c; border-color: #1fa25c; }
[data-theme="dark"] .btn-primary:hover, [data-theme="dark"] .btn-gold:hover { background: #25b268; }
.btn-green { background: var(--green-tint); border-color: transparent; color: var(--green-ink); }
.btn-red { background: var(--red-tint); border-color: transparent; color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--mut); }
.btn-ghost:hover { color: var(--ink); background: var(--gray-tint); }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.linkish { color: var(--rail-mut); font-size: 13px; text-align: left; padding: 5px 0; }
.linkish:hover { color: var(--rail-ink); }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 236px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--rail);
  padding: 22px 14px 18px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 0 10px 24px; }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { color: var(--rail-ink); font-size: 14.5px; font-weight: 700; }
.brand-sub { color: var(--rail-mut); font-size: 11.5px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 13px; border-radius: 999px;
  color: var(--rail-mut); text-decoration: none; font-weight: 600; font-size: 13.5px;
  transition: background 0.1s, color 0.1s;
}
.nav a svg { width: 17px; height: 17px; stroke-width: 1.6; }
.nav a:hover { color: var(--rail-ink); background: rgba(255, 255, 255, 0.05); }
.nav a.on { color: #4ade80; background: rgba(52, 211, 153, 0.12); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding: 14px 10px 0; border-top: 1px solid var(--rail-line); }
.dbl-pill { font-size: 12px; color: var(--rail-mut); padding-bottom: 8px; }
.dbl-pill b { color: #dcae62; font-weight: 600; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { padding: 30px 40px 64px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- shared ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.page-head .sub { color: var(--mut); font-size: 13.5px; margin-top: 3px; }
.kicker { display: none; }
.card {
  background: var(--panel); border: 1px solid var(--card-line); border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 20px 22px; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.money { font-variant-numeric: tabular-nums; }
.pos { color: var(--green-ink); }
.neg { color: var(--red); }
.gold-txt { color: var(--amber); }
.muted { color: var(--mut); }
.tiny { font-size: 12px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2.5px 9px; white-space: nowrap; }
.pill-tier-hobbyist { color: var(--blue); background: var(--blue-tint); }
.pill-tier-breeder { color: var(--green-ink); background: var(--green-tint); }
.pill-tier-investor { color: var(--violet); background: var(--violet-tint); }
.pill-2x { color: var(--amber); background: var(--amber-tint); }
.pill-legacy { color: var(--mut); background: var(--gray-tint); }
.pill-carryover { color: var(--mut); background: var(--gray-tint); }
.pill-status-declined { color: var(--red); background: var(--red-tint); }
.pill-status-former, .pill-status-left, .pill-status-unknown { color: var(--mut); background: var(--gray-tint); }
.pill-paused { color: var(--amber); background: var(--amber-tint); }
.pill-type-accrual { color: var(--green-ink); background: var(--green-tint); }
.pill-type-bonus { color: var(--amber); background: var(--amber-tint); }
.pill-type-opening { color: var(--blue); background: var(--blue-tint); }
.pill-type-adjustment { color: var(--violet); background: var(--violet-tint); }
.pill-type-redemption { color: var(--red); background: var(--red-tint); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
}
.avatar-lg { width: 46px; height: 46px; font-size: 15px; }

/* ---------- dashboard ---------- */
.dbl-banner {
  background: var(--panel); border: 1px solid var(--card-line); border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 18px 22px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.dbl-ic {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
  background: var(--amber-tint); color: var(--amber);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.dbl-body { flex: 1; min-width: 260px; }
.dbl-body b { font-size: 14.5px; }
.dbl-body p { color: var(--mut); font-size: 13.5px; margin-top: 1px; }
.dbl-stats { display: flex; gap: 26px; align-items: center; }
.dbl-stat .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dbl-stat .l { color: var(--mut-2); font-size: 12.5px; }
.dbl-track { width: 100%; height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 12px; }
.dbl-fill { height: 100%; border-radius: 99px; background: var(--green); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { padding: 18px 20px; }
.stat .l { color: var(--mut); font-size: 13px; font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat .s { color: var(--mut-2); font-size: 12.5px; margin-top: 3px; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rowline { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.rowline:first-of-type { border-top: 0; padding-top: 2px; }
.datechip {
  flex-shrink: 0; width: 46px; text-align: center; background: var(--gray-tint);
  border-radius: 10px; padding: 4px 0 6px; line-height: 1.15;
}
.datechip .m { display: block; font-size: 9.5px; font-weight: 600; text-transform: uppercase; color: var(--mut-2); letter-spacing: 0.4px; }
.datechip .d { font-size: 15px; font-weight: 700; }
.rowline .who { flex: 1; min-width: 0; }
.rowline .who .n { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowline .who .s { display: block; color: var(--mut); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowline .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13.5px; }
.alert-card { }
.alert-line { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.alert-line:first-of-type { border-top: 0; }
.alert-line svg { width: 15px; height: 15px; color: var(--amber); flex-shrink: 0; margin-top: 3px; }

/* ---------- members ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 210px; max-width: 320px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--mut-2); }
.search input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px 8px 34px; outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.search input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12.5px; font-weight: 600; color: var(--mut); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  transition: background 0.1s, color 0.1s;
}
.chip:hover { color: var(--ink); }
.chip.on { color: var(--green-ink); background: var(--green-tint); border-color: transparent; }
.chip.on.chip-gold { color: var(--amber); background: var(--amber-tint); }
select.sel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 11px; font-size: 12.5px; font-weight: 600; color: var(--mut); outline: none; cursor: pointer;
}

.tablecard { overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12.5px; color: var(--mut-2); font-weight: 500;
  padding: 12px 20px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.tbl td { padding: 12px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background 0.08s; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .r { text-align: right; }
.mcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mcell .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.mcell .ds { color: var(--mut); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.bal { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.badges { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.count-note { color: var(--mut-2); font-size: 12.5px; padding: 12px 20px; border-top: 1px solid var(--line-2); }

/* ---------- drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.35); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 96vw; z-index: 61;
  background: var(--panel); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; animation: slide 0.16s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 13px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line-2); }
.drawer-head .info { flex: 1; min-width: 0; }
.drawer-head .nm { font-size: 16.5px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.drawer-head .em { color: var(--mut); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-x { color: var(--mut-2); padding: 6px; border-radius: 8px; }
.drawer-x:hover { color: var(--ink); background: var(--gray-tint); }
.drawer-x svg { width: 17px; height: 17px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 44px; display: flex; flex-direction: column; gap: 14px; }

.bal-hero { text-align: center; padding: 20px 18px 18px; background: var(--panel-2); border-radius: 14px; }
.bal-hero .l { color: var(--mut); font-size: 13px; font-weight: 500; }
.bal-hero .v-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 2px; }
.bal-hero .v { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.bal-edit-btn { color: var(--mut-2); padding: 6px; border-radius: 8px; }
.bal-edit-btn:hover { color: var(--ink); background: var(--gray-tint); }
.bal-edit-btn svg { width: 15px; height: 15px; }
.bal-hero .s { color: var(--mut); font-size: 12.5px; margin-top: 5px; }
.bal-edit-row { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.bal-edit-row input {
  width: 140px; text-align: center; font-size: 18px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; outline: none; font-variant-numeric: tabular-nums;
}
.bal-edit-row input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }

.legacy-card { border-radius: 14px; background: var(--amber-tint); padding: 14px 18px; }
.legacy-card .t { color: var(--amber); font-weight: 600; font-size: 13px; }
.legacy-card .d { color: var(--ink); font-size: 13px; margin-top: 4px; line-height: 1.55; opacity: 0.85; }
.legacy-card .m { color: var(--mut); font-size: 12px; margin-top: 5px; }
.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; padding-top: 11px; border-top: 1px solid rgba(0, 0, 0, 0.06); font-size: 13px; font-weight: 600; }
[data-theme="dark"] .switchrow { border-top-color: rgba(255, 255, 255, 0.08); }
.switch { position: relative; width: 38px; height: 21px; border-radius: 99px; background: var(--line); flex-shrink: 0; transition: background 0.13s; }
.switch::after { content: ''; position: absolute; top: 2.5px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: left 0.13s; }
.switch.on { background: var(--green); }
.switch.on::after { left: 19px; }
.act-row { display: flex; gap: 8px; }
.act-row .btn { flex: 1; }
.inline-form { background: var(--panel-2); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.inline-form .fr { display: flex; gap: 8px; }
.inline-form input { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; outline: none; width: 100%; }
.inline-form input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }
.inline-form .amt-in { max-width: 120px; }
.mini-note { color: var(--mut-2); font-size: 12px; }
.drawer .entry { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.drawer .entry:first-of-type { border-top: 0; }
.drawer .entry .dt { color: var(--mut-2); font-size: 11.5px; width: 50px; flex-shrink: 0; }
.drawer .entry .nt { flex: 1; min-width: 0; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .entry .am { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
textarea.notes {
  width: 100%; min-height: 60px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; outline: none; resize: vertical; font-size: 13px;
}
textarea.notes:focus { border-color: var(--green); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 13px; }
.kv .k { color: var(--mut-2); }
.sec-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }

/* ---------- prize wheel ---------- */
.wheel-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.wheel-stage { padding: 26px 24px 24px; display: flex; flex-direction: column; align-items: center; }
.wheel-wrap { position: relative; width: 100%; max-width: 540px; }
#wheel-canvas { display: block; width: 100%; height: auto; }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent;
  border-top: 26px solid var(--ink);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  z-index: 2;
}
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%; background: var(--panel);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.wheel-hub svg { width: 38px; height: 38px; }
.wheel-live { margin-top: 18px; font-size: 16px; font-weight: 700; min-height: 24px; text-align: center; }
.wheel-spin-btn { margin-top: 14px; padding: 12px 34px; font-size: 15px; border-radius: 12px; }
.wheel-side { display: flex; flex-direction: column; gap: 16px; }
.wheel-modal-scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45); z-index: 62; }
.wheel-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 63;
  width: 350px; max-width: 92vw; padding: 30px 28px 24px; text-align: center;
  box-shadow: var(--shadow-pop); animation: rise 0.2s ease-out;
  display: flex; flex-direction: column; align-items: center;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, -46%); } }
.wm-kicker { color: var(--green-ink); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 14px; }
.wm-name { font-size: 21px; font-weight: 700; margin-top: 10px; letter-spacing: -0.01em; }
.wm-bal { font-size: 13px; margin-top: 7px; }
.wm-award { display: flex; gap: 8px; margin-top: 16px; width: 100%; }
.wm-award input {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; outline: none; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums;
}
.wm-award input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }
.wm-actions { display: flex; gap: 8px; margin-top: 12px; width: 100%; flex-wrap: wrap; }
.wm-actions .btn { flex: 1 1 30%; padding: 7px 6px; font-size: 12.5px; }
.confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* ---------- import ---------- */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: 14px;
  padding: 44px 24px; text-align: center; cursor: pointer;
  background: var(--panel); transition: border-color 0.12s, background 0.12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--green); background: var(--green-tint); }
.dropzone svg { width: 30px; height: 30px; color: var(--mut-2); margin-bottom: 10px; }
.dropzone .t { font-weight: 600; font-size: 14.5px; }
.dropzone .s { color: var(--mut); font-size: 13px; margin-top: 3px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.plan-card .num { font-size: 24px; font-weight: 700; }
.plan-list { margin-top: 8px; display: flex; flex-direction: column; }
.plan-list .pl { display: flex; justify-content: space-between; gap: 10px; padding: 6.5px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.plan-list .pl:first-child { border-top: 0; }
.import-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.pat-row { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.sync-ind { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--mut); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.dot.idle { background: var(--mut-2); }
.dot.busy { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-tint); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.form-col { display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.form-col input { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none; }
.form-col input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #101828; color: #f2f4f7; border-radius: 10px; padding: 10px 16px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-pop);
  display: flex; gap: 8px; align-items: center;
  max-width: 92vw;
}
.toast svg { width: 14px; height: 14px; color: #4ade80; }
.toast.err svg { color: #fca5a5; }

.empty { text-align: center; color: var(--mut-2); padding: 38px 20px; font-size: 13.5px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .dash-grid, .plan-grid, .settings-grid, .wheel-grid { grid-template-columns: 1fr; }
  .view { padding: 20px 18px 64px; }
}
@media (max-width: 860px) {
  .side {
    position: fixed; left: 0; z-index: 70; transform: translateX(-100%);
    transition: transform 0.2s ease-out; width: 252px;
    box-shadow: var(--shadow-pop);
  }
  .side.open { transform: none; }
  .side-scrim { display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, 0.35); z-index: 69; }
  .side-scrim.show { display: block; }
  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 40;
    background: var(--panel);
  }
  .burger { color: var(--mut); }
  .burger svg { width: 20px; height: 20px; }
  .topbar-mark { width: 26px; height: 26px; }
  .topbar-name { font-weight: 700; font-size: 14.5px; }
  .tbl .hide-sm { display: none; }
  .drawer { width: 100vw; max-width: 100vw; }
  .dbl-stats { width: 100%; justify-content: space-between; }
  /* 16px inputs stop iOS from zooming the page on focus */
  input, select, textarea { font-size: 16px; }
  .view { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .drawer-body { padding-bottom: calc(44px + env(safe-area-inset-bottom)); }
  .side { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .page-head h2 { font-size: 19px; }
  .stat .v { font-size: 23px; }
  .bal-hero .v { font-size: 28px; }
  .mcell .nm, .mcell .ds { max-width: 46vw; }
  .tbl th, .tbl td { padding: 11px 12px; }
  .wheel-stage { padding: 18px 12px 18px; }
  .wheel-hub { width: 54px; height: 54px; }
  .wheel-hub svg { width: 30px; height: 30px; }
  #toast-root { bottom: calc(18px + env(safe-area-inset-bottom)); width: 100%; padding: 0 12px; }
}
