:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --border: #e3e6ea;
  --text: #15191e;
  --muted: #5f6b78;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #e6f6f4;
  --income: #15803d;
  --income-soft: #e8f6ec;
  --expense: #c2410c;
  --expense-soft: #fdf0e8;
  --danger: #b91c1c;
  --gold: #a16207;
  --gold-soft: #fdf6e3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1215;
    --surface: #161b20;
    --surface-2: #1d242a;
    --border: #2a333b;
    --text: #e8edf1;
    --muted: #93a1ae;
    --brand: #2dd4bf;
    --brand-2: #14b8a6;
    --brand-soft: #12302d;
    --income: #4ade80;
    --income-soft: #143022;
    --expense: #fb923c;
    --expense-soft: #3a2214;
    --danger: #f87171;
    --gold: #facc15;
    --gold-soft: #33290d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.income { color: var(--income); }
.expense { color: var(--expense); }
.hidden { display: none !important; }

/* ---------- buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; font-weight: 550; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #04201d; } }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 550; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 10px;
  padding: 10px 12px; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px 24px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 20px; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; }
.auth-card h1 { font-size: 22px; margin: 18px 0 4px; letter-spacing: -.01em; }
.auth-card p.lead { margin: 0 0 18px; color: var(--muted); }
.auth-switch { text-align: center; margin-top: 14px; font-size: 14px; color: var(--muted); }
.linkish { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 600; }
.code-input { letter-spacing: .5em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.dev-note { background: var(--gold-soft); color: var(--gold); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

/* ---------- shell */
.topbar {
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.topbar .brand { font-size: 17px; }
.topbar .brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 2px; margin-left: 14px; }
.nav button { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.nav button.active { background: var(--brand-soft); color: var(--brand); }
.spacer { flex: 1; }
.plan-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 0; cursor: pointer; }
.plan-badge.pro { background: var(--gold-soft); color: var(--gold); }

main { max-width: 1080px; margin: 0 auto; padding: 18px 16px 110px; }
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav button { flex: 1; min-width: 0; border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 4px 0; cursor: pointer; }
  .bottom-nav button span.ic { font-size: 19px; line-height: 1.1; }
  .bottom-nav button.active { color: var(--brand); }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .grid.two { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; flex-wrap: wrap; }
.section-title h3 { margin: 0; font-size: 16px; white-space: nowrap; }

/* ---------- quick entry */
.quick { padding: 14px; border: 2px solid var(--brand); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.quick-row { display: flex; gap: 8px; align-items: center; }
.quick-input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 18px; padding: 8px 4px;
}
.quick-input::placeholder { color: var(--muted); opacity: .8; }
.mic { font-size: 18px; }
.mic.listening { background: var(--expense-soft); color: var(--expense); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.preview { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.preview.empty { display: none; }
.chip-select, .chip-input {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 600; max-width: 100%;
}
.chip-input { width: 120px; }
.chip-input.amount { width: 105px; }
.type-toggle { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.type-toggle button { border: 0; padding: 5px 12px; font-size: 13px; font-weight: 700; background: var(--surface-2); cursor: pointer; color: var(--muted); }
.type-toggle button.on.expense { background: var(--expense-soft); color: var(--expense); }
.type-toggle button.on.income { background: var(--income-soft); color: var(--income); }
.confidence { font-size: 12px; color: var(--muted); }
.examples { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.examples button { border: 1px dashed var(--border); background: transparent; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); cursor: pointer; }
.examples button:hover { color: var(--text); border-color: var(--muted); }

/* ---------- stats */
.period { display: flex; gap: 6px; flex-wrap: wrap; }
.period button { border: 1px solid var(--border); background: var(--surface); padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.period button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.stat .label { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 22px; font-weight: 750; margin-top: 4px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.hero { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0; color: #fff; }
.stat.hero .label, .stat.hero .sub { color: rgba(255, 255, 255, .85); }
@media (prefers-color-scheme: dark) { .stat.hero { color: #04201d; } .stat.hero .label, .stat.hero .sub { color: rgba(4, 32, 29, .75); } }

.bars { display: grid; gap: 10px; }
.bar-row { cursor: pointer; }
.bar-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bar-head .name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 99px; margin-top: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--expense); }
.bar-fill.income { background: var(--income); }
.bar-subs { margin: 8px 0 2px 30px; display: grid; gap: 4px; font-size: 13px; }
.bar-subs div { display: flex; justify-content: space-between; color: var(--muted); }
.empty-state { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 14px; }

.trend svg { width: 100%; height: 190px; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- transaction list */
.tx-list { display: grid; }
.tx-day { font-size: 12px; font-weight: 700; color: var(--muted); padding: 12px 4px 6px; text-transform: uppercase; letter-spacing: .04em; display: flex; }
.tx-day span:first-child { flex: 1; }
.tx { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 10px; cursor: pointer; }
.tx:hover { background: var(--surface-2); }
.tx .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: var(--expense-soft); flex: none; }
.tx.income .ic { background: var(--income-soft); }
.tx .body { flex: 1; min-width: 0; }
.tx .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filters .input { width: auto; flex: 1 1 140px; padding: 8px 10px; }

/* ---------- categories */
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 650; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
@media (max-width: 420px) { .cat-grid { grid-template-columns: 1fr; } }
.cat-card h4 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.cat-card h4 .emoji { font-size: 20px; }
.cat-card h4 .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.chip.custom { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.chip.add { border-style: dashed; color: var(--muted); background: transparent; }
.kw { font-size: 12px; color: var(--muted); margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- plans */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .plans { grid-template-columns: 1fr; } }
.plan { position: relative; }
.plan.current { border: 2px solid var(--brand); }
.plan .price { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.plan ul { padding-left: 0; list-style: none; margin: 12px 0 16px; display: grid; gap: 7px; font-size: 14px; }
.plan li::before { content: "✓"; color: var(--brand); font-weight: 800; margin-right: 8px; }
.plan li.no::before { content: "–"; color: var(--muted); }
.plan li.no { color: var(--muted); }
.ribbon { position: absolute; top: 14px; right: 14px; }
.usage-bar { height: 6px; background: var(--surface-2); border-radius: 9px; overflow: hidden; margin-top: 6px; }
.usage-bar div { height: 100%; background: var(--brand); }
.upsell { display: flex; align-items: center; gap: 12px; background: var(--gold-soft); color: var(--gold); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-top: 12px; }
.upsell span { flex: 1; }

/* ---------- modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 18, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.modal .actions .left { margin-right: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; font-size: 14px; animation: fade .2s; }
.toast span { flex: 1; }
.toast button { background: transparent; border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); color: var(--bg); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-weight: 650; font-size: 13px; }
.toast.err { background: var(--danger); color: #fff; }
/* ---------- v2: signup, analytics, account, admin */
.auth-card.wide { max-width: 480px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 10px; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.legal-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 16px; font-size: 13px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }
.legal-links.left { justify-content: flex-start; margin-top: 14px; }
.lock { font-size: 11px; }
.bottom-nav .lock { display: none; }
a.btn { text-decoration: none; color: inherit; }
.tag.soft { background: var(--surface-2); color: var(--muted); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid.three { grid-template-columns: 1fr; } }

.locked { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: center; }
@media (max-width: 700px) { .locked { grid-template-columns: 1fr; } }
.locked-preview { display: grid; gap: 12px; filter: blur(2px); opacity: .7; padding: 8px; }
.locked-preview .bar-track { height: 14px; }
.locked-body h2 { font-size: 17px; line-height: 1.3; }
.ticks { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 14px; }
.ticks li::before { content: "✓"; color: var(--brand); font-weight: 800; margin-right: 8px; }

.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.insight { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--brand); font-size: 14px; }
.insight .ii { font-size: 20px; line-height: 1.2; }
.insight.good { border-color: var(--income); }
.insight.warn { border-color: var(--gold); }
.insight.bad { border-color: var(--danger); }

.bar-fill.ok { background: var(--income); }
.bar-fill.warn { background: var(--gold); }
.bar-fill.over { background: var(--danger); }

.split { display: flex; height: 18px; border-radius: 9px; overflow: hidden; gap: 2px; }
.s-need { background: #6366f1; }
.s-want { background: var(--expense); }
.s-save { background: var(--income); }
.split-legend { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; }
.split-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
.tbl .r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }

.dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.dow > div { display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--muted); }
.dow-bar { height: 130px; width: 100%; max-width: 34px; background: var(--surface-2); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.dow-bar div { width: 100%; background: var(--expense); border-radius: 8px 8px 0 0; }

.toggle-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--border); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.email-frame { width: 100%; height: 60vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.modal:has(.email-frame) { max-width: 640px; }

/* ---------- Shifts & Pay */
.onboard { margin-top: 12px; border: 2px dashed var(--brand); }
.payday-banner { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--job, var(--brand)); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.payday-banner .pb-ic { font-size: 22px; }
.payday-banner .pb-body { flex: 1; min-width: 0; }
.cal-card { padding: 12px; }
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-head .icon-btn { font-size: 20px; padding: 2px 10px; }
.cal-title { font-size: 16px; min-width: 140px; text-align: center; }
.job-filter { display: flex; gap: 4px; flex-wrap: wrap; }
.job-filter button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.job-filter button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.job-filter i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 2px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.cal-day { min-height: 92px; border-radius: 8px; padding: 4px; background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; min-width: 0; }
.cal-day:hover { border-color: var(--muted); }
.cal-day.pa { background: color-mix(in srgb, var(--brand) 7%, var(--surface-2)); }
.cal-day.pb { background: color-mix(in srgb, var(--brand) 14%, var(--surface-2)); }
.cal-day.pstart { box-shadow: inset 3px 0 0 var(--brand); }
.cal-day.other { opacity: .5; }
.cal-day.today .cd-num { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 6px; }
@media (prefers-color-scheme: dark) { .cal-day.today .cd-num { color: #04201d; } }
.cal-day.hol { outline: 2px dashed color-mix(in srgb, var(--gold) 60%, transparent); outline-offset: -2px; }
.cd-top { display: flex; align-items: center; gap: 3px; }
.cd-num { font-size: 12px; font-weight: 700; }
.cd-pay { font-size: 12px; margin-left: auto; }
.cd-hol { font-size: 10px; color: var(--gold); font-weight: 600; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-shift { border: 0; text-align: left; background: var(--surface); border-left: 3px solid var(--job); border-radius: 5px; padding: 2px 4px; font-size: 11px; line-height: 1.25; cursor: pointer; display: grid; min-width: 0; }
.cd-shift .cs-time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.cd-shift .cs-h { font-weight: 700; }
.cd-shift .cs-hc { display: none; font-weight: 700; }
.cd-total { font-size: 10px; font-weight: 700; color: var(--muted); margin-top: auto; text-align: right; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.lg-period { background: color-mix(in srgb, var(--brand) 20%, var(--surface-2)); box-shadow: inset 3px 0 0 var(--brand); }
.lg-hol { outline: 2px dashed var(--gold); outline-offset: -2px; }
@media (max-width: 600px) {
  .cal-day { min-height: 64px; padding: 3px 2px; }
  .cd-shift .cs-time, .cd-hol, .cd-shift .cs-h { display: none; }
  .cd-shift .cs-hc { display: block; }
  .cd-shift { font-size: 10px; padding: 1px 3px; }
}
.pay-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 420px) { .pay-cards { grid-template-columns: 1fr; } }
.pay-card { border-top: 4px solid var(--job); }
.pay-card h2 { margin-bottom: 2px; }
.job-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--job); display: inline-block; }
.pay-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.pay-big .label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pay-big .v { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.pay-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.day-list { display: grid; gap: 6px; margin-bottom: 8px; }
.day-shift { display: grid; gap: 2px; text-align: left; border: 1px solid var(--border); border-left: 4px solid var(--job); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: 14px; }
.day-shift:hover { border-color: var(--muted); border-left-color: var(--job); }
.shift-preview { background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 2px; min-height: 44px; }
.shift-preview .pv-pay { font-size: 22px; font-weight: 800; color: var(--brand); }
.job-form h4 { margin: 18px 0 8px; font-size: 14px; }
.swatches { display: flex; gap: 6px; margin: -4px 0 8px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatches button.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.rule { border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px; margin-bottom: 8px; }
.rule .rule-body { display: none; padding-bottom: 6px; }
.rule.on .rule-body { display: block; }
.wd-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wd-pick label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.period-preview { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.period-preview ul { margin: 4px 0 0; padding-left: 18px; }
.modal:has(.job-form) { max-width: 520px; }

.emoji-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.emoji-pick button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 17px; }

/* ---------- coupons */
.coupon { margin-top: 12px; }
.coupon summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--brand); list-style: none; }
.coupon summary::-webkit-details-marker { display: none; }
.coupon-row { display: flex; gap: 8px; margin: 10px 0 6px; }
.coupon-row .input { text-transform: uppercase; letter-spacing: .04em; }
.coupon-row .input::placeholder { text-transform: none; letter-spacing: 0; }
s.was { opacity: .65; font-weight: 500; margin-left: 4px; }

/* ---------- motion */
:root { --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-spring: cubic-bezier(.34, 1.4, .64, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes grow-w { from { width: 0; } }
@keyframes grow-h { from { height: 0; } }
@keyframes flash { 0% { background: var(--brand-soft); transform: scale(.98); } 30% { transform: scale(1); } 100% { background: transparent; } }
@keyframes nav-pop { 40% { transform: scale(1.18); } }

/* Everything below applies under html.motion, which the app sets once you're signed in. */
/* screens fade up when you switch tabs */
.motion #view { animation: rise .32s var(--ease-out) both; }
/* home: cards arrive one after another on first load */
.motion #dash.enter .stat, .motion #dash.enter > .card { animation: rise .45s var(--ease-out) both; }
.motion #dash.enter .stat:nth-child(2) { animation-delay: .05s; }
.motion #dash.enter .stat:nth-child(3) { animation-delay: .1s; }
.motion #dash.enter .stat:nth-child(4) { animation-delay: .15s; }
.motion #dash.enter > .card:nth-of-type(1) { animation-delay: .2s; }
.motion #dash.enter > .card:nth-of-type(2) { animation-delay: .27s; }
/* the entry you just added flashes in the recent list */
.motion .tx.new { animation: flash 1.4s var(--ease-out); }
/* the quick-entry preview slides open */
.motion .preview:not(.empty) { animation: rise .22s var(--ease-out); }
.motion .quick { transition: box-shadow .2s, transform .2s var(--ease-out); }
.motion .quick:focus-within { box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow); }

/* bars and charts grow into place */
.motion .bar-fill, .motion .usage-bar div { animation: grow-w .8s var(--ease-out) both; }
.motion .split > div { animation: grow-w .8s var(--ease-out) both; }
.motion .dow-bar div { animation: grow-h .7s var(--ease-out) both; }
.motion .trend svg { animation: rise .5s var(--ease-out) both; }
.motion .insight { animation: rise .4s var(--ease-out) both; }
.motion .insight:nth-child(2) { animation-delay: .06s; }
.motion .insight:nth-child(3) { animation-delay: .12s; }

/* modals: pop in, ease out */
.motion .modal-backdrop { animation: fade .2s ease-out; }
.motion .modal { animation: pop .32s var(--ease-spring); }
.motion .modal-backdrop.out { animation: fade-out .16s ease-in forwards; pointer-events: none; }
.motion .modal-backdrop.out .modal { animation: sheet-out .16s ease-in forwards; }
@media (max-width: 600px) {
  .motion .modal-backdrop { place-items: end center; padding: 0; }
  .motion .modal { border-radius: 20px 20px 0 0; max-height: 88vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  @keyframes pop { from { transform: translateY(100%); } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
}

/* toasts */
.motion .toast { animation: toast-in .3s var(--ease-spring); }
.motion .toast.out { animation: toast-out .18s ease-in forwards; }

/* buttons and taps */
.motion :is(.btn, .chip, .icon-btn, .period button, .tabs button, .job-filter button, .examples button, .cd-shift, .day-shift, .tx, .cal-day) {
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s var(--ease-out);
}
.motion :is(.btn, .chip, .icon-btn, .examples button, .period button, .tabs button):active { transform: scale(.96); }
.motion :is(.tx, .day-shift, .cal-day):active { transform: scale(.985); }
.motion :is(.nav button, .bottom-nav button) { transition: color .2s, background-color .2s; }
.motion .bottom-nav button.active span.ic { animation: nav-pop .35s var(--ease-spring); }
.motion :is(.card, .stat) { transition: transform .2s var(--ease-out), box-shadow .2s; }
@media (hover: hover) { .motion :is(.card.cat-card, .stat):hover { transform: translateY(-2px); } }

/* shifts calendar */
.motion .cal-grid { animation: fade .25s ease-out; }
.motion .payday-banner { animation: rise .4s var(--ease-out) both; }

/* respect the phone's "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
