:root {
  --brand: #0f3d3e;
  --brand-2: #155e5f;
  --accent: #e8b04a;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --text: #1b2321;
  --muted: #5f6b68;
  --line: #e2dfd7;
  --good: #1d7a4c;
  --bad: #b3261e;
  --warn: #9a6400;
  --radius: 16px;
  --tap: 52px;
  --shadow: 0 1px 2px rgba(15, 61, 62, .06), 0 4px 16px rgba(15, 61, 62, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1514; --surface: #162120; --surface-2: #1b2826; --text: #e7ecea; --muted: #9aa8a4;
    --line: #2a3a37; --brand-2: #2f8a8b; --good: #4cc38a; --bad: #f2867c; --warn: #f0b85a;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

.splash { height: 100vh; display: grid; place-items: center; }
.spinner { width: 56px; height: 56px; background: url(/logo-tight.png) center / contain no-repeat; animation: logo-breathe 1.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons & inputs ---------- */
.btn {
  min-height: var(--tap); padding: 0 22px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 10px; text-decoration: none; color: var(--text); touch-action: manipulation;
  transition: transform .06s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.accent { background: var(--accent); color: #23180a; border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: 60px; font-size: 1.1rem; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 160px; }

.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 1.05rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 18%, transparent); }
.input.money { font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 600; text-align: right; }
.money-wrap { position: relative; }
.money-wrap span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap);
  padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 54px; height: 32px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked { background: var(--brand-2); }
.switch input:checked::after { transform: translateX(22px); }

/* ---------- auth screens ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(1200px 600px at 10% -10%, #1d6667 0%, transparent 60%), var(--brand);
}
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 28px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card.wide { max-width: 560px; }
.brandmark { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brandmark img { width: 44px; height: 44px; }
.brandmark b { display: block; font-size: 1.15rem; letter-spacing: .01em; }
.brandmark small { color: var(--muted); }
.auth h1 { font-size: 1.4rem; margin: 0 0 4px; }
.user-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 16px 0; }
.user-tile { min-height: 96px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer;
  display: grid; place-items: center; gap: 6px; padding: 12px 6px; font-weight: 600; text-align: center; }
.user-tile:active { transform: scale(.97); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-2); color: #fff; display: grid; place-items: center; font-weight: 700; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 22px 0 8px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand-2); transition: background .1s, transform .1s; }
.pin-dots i.on { background: var(--brand-2); transform: scale(1.1); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.pin-msg { min-height: 1.4em; text-align: center; font-size: .9rem; color: var(--bad); margin-bottom: 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.key { height: 68px; border-radius: 50%/42%; border: 1.5px solid var(--line); background: var(--surface-2); font-size: 1.6rem; font-weight: 600;
  cursor: pointer; touch-action: manipulation; user-select: none; display: grid; place-items: center; }
.key:active { background: var(--line); transform: scale(.95); }
.key.fn { font-size: .95rem; font-weight: 600; color: var(--muted); background: transparent; border-color: transparent; }
.key svg { width: 26px; height: 26px; }
.bio-btn { margin-top: 18px; }
.link-btn { background: none; border: 0; color: var(--brand-2); font-weight: 600; cursor: pointer; padding: 12px; min-height: 44px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand); color: #dfeceb; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brandmark b { color: #fff; }
.sidebar .brandmark small { color: #9cc3c2; }
.nav-item { display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 14px; border-radius: 12px; color: inherit; text-decoration: none; font-weight: 600; }
.nav-item svg { width: 22px; height: 22px; opacity: .9; }
.nav-item:hover { background: rgba(255,255,255,.07); }
.nav-item.active { background: rgba(255,255,255,.14); color: #fff; }
.nav-sep { margin: 14px 14px 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #8fb5b4; }
.sidebar .spacer { flex: 1; }
.sidebar .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar .me .avatar { background: var(--accent); color: #23180a; }
.main { min-width: 0; }
.topbar { display: none; }
.page { padding: 28px 32px 48px; max-width: 1100px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.tabbar { display: none; }

@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 10;
    background: var(--brand); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .topbar b { font-size: 1.05rem; }
  .topbar .btn { min-height: 44px; padding: 0 12px; background: rgba(255,255,255,.12); color: #fff; border: 0; }
  .page { padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 1.35rem; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px; font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none; min-height: 60px; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--brand-2); }
  .tabbar a.fab svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--accent); color: #23180a; box-sizing: content-box; margin-top: -14px; box-shadow: var(--shadow); }
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 16px; }
.card h2 { margin: 0 0 14px; font-size: 1.1rem; }
.hero { background: linear-gradient(135deg, var(--brand) 0%, #1a5c5d 100%); color: #fff; border: 0; padding: 26px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(232,176,74,.13); }
.hero .label { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #a8cfcd; }
.hero .big { font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 10px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: #cfe3e2; font-size: .92rem; }
.hero .meta b { color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat span { display: block; font-size: .8rem; color: var(--muted); }
.stat b { font-size: 1.2rem; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } .stats .stat:last-child { grid-column: span 2; } }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.alert { padding: 14px 16px; border-radius: 12px; font-weight: 500; margin-bottom: 16px; border: 1px solid; }
.alert.warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.alert.bad { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.alert.info { background: var(--surface-2); border-color: var(--line); color: var(--text); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 64px; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .amt { font-weight: 700; text-align: right; white-space: nowrap; }
.list-item .amt small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.icon-dot { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.icon-dot svg { width: 20px; height: 20px; }
.icon-dot.out { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.icon-dot.in { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.neg { color: var(--bad); }
.pos { color: var(--good); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); border: 1px solid var(--line); }
.badge.open { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); border-color: transparent; }
.badge.void { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-color: transparent; }
.badge.admin { background: color-mix(in srgb, var(--accent) 25%, transparent); border-color: transparent; }
.voided .title, .voided .amt { text-decoration: line-through; opacity: .6; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- voucher form ---------- */
.voucher-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 899px) { .voucher-layout { grid-template-columns: 1fr; } }
.calc { position: sticky; top: 20px; }
.calc-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.calc-row:last-of-type { border-bottom: 0; }
.calc-row.total { font-size: 1.35rem; font-weight: 750; border-top: 2px solid var(--text); border-bottom: 0; margin-top: 4px; padding-top: 14px; }
.calc-balance { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.calc-balance .calc-row { padding: 6px 0; }
.calc-balance .after { font-size: 1.15rem; font-weight: 750; }

/* ---------- voucher document ---------- */
.voucher-doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; position: relative; max-width: 760px; }
.voucher-doc header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px double var(--text); padding-bottom: 14px; margin-bottom: 18px; }
.voucher-doc header h2 { margin: 0; font-size: 1.25rem; letter-spacing: .06em; }
.voucher-doc .vno { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: var(--bad); text-align: right; }
.vd-grid { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin-bottom: 18px; }
.vd-grid dt { color: var(--muted); font-weight: 600; }
.vd-grid dd { margin: 0; font-weight: 600; }
.vd-amounts { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.vd-amounts td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.vd-amounts td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.vd-amounts tr.total td { font-size: 1.2rem; font-weight: 800; border-bottom: 3px double var(--text); }
.words { font-style: italic; color: var(--muted); margin-bottom: 18px; }
.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.signs div { border-top: 1px solid var(--text); padding-top: 6px; font-size: .85rem; color: var(--muted); }
.stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); font-size: 4rem; font-weight: 900; color: var(--bad);
  border: 6px solid var(--bad); padding: 0 24px; border-radius: 12px; opacity: .25; pointer-events: none; letter-spacing: .1em; }

/* ---------- sheet table ---------- */
.table-wrap { overflow-x: auto; }
table.sheet { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.sheet th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.sheet td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.sheet td.r, table.sheet th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.sheet tr.bf td, table.sheet tr.tot td { font-weight: 700; background: var(--surface-2); }
table.sheet tr.clickable { cursor: pointer; }
table.sheet tr.clickable:hover td { background: var(--surface-2); }
table.sheet tr.voided td { text-decoration: line-through; opacity: .5; }
@media (max-width: 720px) {
  table.sheet thead { display: none; }
  table.sheet, table.sheet tbody, table.sheet tr, table.sheet td { display: block; width: 100%; }
  table.sheet tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 8px 12px; background: var(--surface); }
  table.sheet td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.sheet td::before { content: attr(data-l); color: var(--muted); font-weight: 600; text-align: left; flex: none; }
  table.sheet td.r { text-align: right; }
  table.sheet td:empty { display: none; }
}

/* ---------- dialog & toasts ---------- */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10, 25, 25, .55); backdrop-filter: blur(2px); }
dialog .dlg-body { padding: 24px; }
dialog h3 { margin: 0 0 8px; font-size: 1.2rem; }
dialog .dlg-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 22px; flex-wrap: wrap; }
dialog .dlg-actions .btn { flex: 1 1 140px; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 100; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
@media (min-width: 900px) { #toasts { bottom: 24px; } }
.toast { background: #1b2321; color: #fff; padding: 14px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 500; animation: toastIn .2s ease; }
.toast.bad { background: var(--bad); }
.toast.good { background: #1d7a4c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm; }
  :root { --text: #000; --muted: #444; --line: #bbb; --surface: #fff; --surface-2: #f3f3f3; }
  body { background: #fff; }
  .sidebar, .topbar, .tabbar, .no-print, #toasts { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .card, .voucher-doc { box-shadow: none; border: 0; padding: 0; }
  table.sheet { font-size: 10pt; }
  table.sheet thead { display: table-header-group !important; }
  table.sheet, table.sheet tbody { display: table !important; }
  table.sheet tbody { display: table-row-group !important; }
  table.sheet tr { display: table-row !important; border: 0 !important; padding: 0 !important; }
  table.sheet td { display: table-cell !important; padding: 5px 6px !important; border-bottom: 1px solid #ccc !important; text-align: left; }
  table.sheet td.r { text-align: right !important; }
  table.sheet td::before { content: none !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- layout refinements ---------- */
.list-item .title, .list-item .sub { display: block; }
.brandmark { text-align: left; }
.page-head .btn-row > .btn { flex: 0 0 auto; }
.btn span { white-space: nowrap; }
table.sheet td:nth-child(1), table.sheet td:nth-child(2) { white-space: nowrap; }
@media (max-width: 899px) {
  .actions { grid-template-columns: 1fr 1fr; }
  .actions .btn.accent { grid-column: 1 / -1; }
  .actions .btn.lg { font-size: 1rem; padding: 0 12px; }
  .page-head .btn-row { width: 100%; }
  .page-head .btn-row > .btn { flex: 1 1 auto; }
}
@media (max-width: 720px) {
  table.sheet tr.bf td, table.sheet tr.tot td { justify-content: space-between; }
  table.sheet tr.bf td[data-l=""]::before, table.sheet tr.tot td[data-l=""]::before { content: none; }
  table.sheet tr.bf td[data-l=""], table.sheet tr.tot td[data-l=""] { justify-content: flex-start; text-align: left; }
}

/* ---------- v0.5: version footer, pull-to-refresh, months, import ---------- */
html, body { overscroll-behavior-y: contain; }
.built { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 18px; letter-spacing: .01em; }
.built b { font-weight: 650; }
.built.side { color: #8fb5b4; text-align: left; padding: 4px 14px 10px; margin: 0; }
.built.side b { color: #cfe3e2; }
.built.page-foot { margin-top: 36px; }
@media (min-width: 900px) { .built.page-foot { display: none; } }
.nav-item.linkish { background: none; border: 0; width: 100%; cursor: pointer; font: inherit; font-weight: 600; text-align: left; color: #b9d6d5; min-height: 44px; }
#ptr { position: fixed; top: calc(-44px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, 0); z-index: 200; display: flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; font-size: .88rem; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: opacity .15s; }
#ptr.show { opacity: 1; }
#ptr svg { width: 18px; height: 18px; color: var(--brand-2); }
#ptr.ready { background: var(--brand); color: #fff; border-color: var(--brand); }
#ptr.ready svg { color: var(--accent); }
#ptr.loading svg { animation: spin .8s linear infinite; }
#updBanner { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); z-index: 150; display: flex; align-items: center; gap: 12px;
  background: var(--accent); color: #23180a; padding: 8px 8px 8px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-weight: 600; width: max-content; max-width: calc(100vw - 24px); }
#updBanner .btn { min-height: 40px; padding: 0 14px; }

.year { margin-bottom: 26px; }
.year-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.year-head h2 { margin: 0; font-size: 1.3rem; }
.month-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 1000px) { .month-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .month-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.month-tile { display: grid; gap: 2px; padding: 14px; min-height: 96px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit; box-shadow: var(--shadow); align-content: start; }
.month-tile b { font-size: 1.05rem; }
.month-tile span { font-weight: 700; font-size: .98rem; color: var(--bad); }
.month-tile small { color: var(--muted); font-size: .76rem; }
.month-tile:active { transform: scale(.97); }
.month-tile.current { border-color: var(--brand-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-2) 30%, transparent); }
.month-tile.empty { background: transparent; box-shadow: none; border-style: dashed; color: var(--muted); }
.month-tile.future { opacity: .45; }
@media (max-width: 560px) { .month-tile { padding: 10px; min-height: 84px; } .month-tile span { font-size: .85rem; } }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav .btn { min-height: 48px; padding: 0 10px; }
.filters { display: grid; grid-template-columns: 1fr 240px auto; gap: 12px; align-items: center; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr; } }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; cursor: pointer; color: var(--muted); flex: 1; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button.on.danger { background: var(--bad); color: #fff; }

.dropzone { display: grid; justify-items: center; gap: 6px; padding: 44px 20px; border: 2px dashed var(--line); border-radius: 20px; background: var(--surface);
  cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone svg { width: 40px; height: 40px; color: var(--brand-2); }
.dropzone b { font-size: 1.15rem; }
.dropzone.over, .dropzone:hover { border-color: var(--brand-2); background: var(--surface-2); }
.tips { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 8px; }
.imp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.imp-item.off { opacity: .6; }
.imp-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.imp-row .grow { flex: 1; min-width: 160px; }
.month-input { width: auto; min-height: 46px; padding: 8px 12px; font-size: .95rem; }
.switch.compact { border: 0; padding: 0; min-height: 0; background: none; }
.imp-bal { margin-top: 10px; font-size: .92rem; }
.dupe { margin-top: 12px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.dupe .seg { min-width: 220px; }
.badge.warnb { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); border-color: transparent; }
details { margin-top: 12px; }
details summary { cursor: pointer; font-weight: 600; color: var(--brand-2); min-height: 40px; display: flex; align-items: center; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; margin-top: 8px; }
.map-grid .field { margin-bottom: 10px; }
.map-grid .input { min-height: 44px; font-size: .92rem; padding: 8px 10px; }
.import-bar { position: sticky; bottom: 12px; z-index: 5; }
@media (max-width: 899px) { .import-bar { position: static; } }
.progress { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--brand-2); transition: width .2s; }

/* ---------- v0.5.1: notes + QuickBooks ---------- */
.note { display: block; font-size: .8rem; color: var(--muted); font-style: italic; margin-top: 2px; }
.badge.qb { background: color-mix(in srgb, #2ca01c 16%, transparent); color: #1f7a12; border-color: transparent; font-size: .68rem; padding: 1px 7px; }
@media (prefers-color-scheme: dark) { .badge.qb { color: #6fd35c; } }
.qb-card { max-width: 760px; margin-top: 16px; }
.qb-card .switch { border: 0; padding: 0; }
@media (max-width: 720px) { table.sheet td .note { text-align: right; } }

/* ---------- v0.5.2: categories ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: .9rem;
  cursor: pointer; color: var(--text); touch-action: manipulation; }
.chip:active { transform: scale(.97); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .02em; padding: 1px 8px; margin: 0 6px 3px 0; border-radius: 6px;
  background: color-mix(in srgb, var(--brand-2) 12%, transparent); color: var(--brand-2); vertical-align: 1px; white-space: nowrap; }
.cat-card { margin-top: 16px; }
.cat-card summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text); min-height: 32px; }
.cat-list { display: grid; gap: 4px; margin-top: 10px; }
.cat-row { display: grid; grid-template-columns: minmax(130px, 220px) 1fr auto; gap: 12px; align-items: center; padding: 6px 4px; border: 0; background: none;
  text-align: left; font: inherit; color: inherit; border-radius: 8px; width: 100%; }
button.cat-row { cursor: pointer; min-height: 44px; }
button.cat-row:hover { background: var(--surface-2); }
.cat-name { font-weight: 600; font-size: .9rem; }
.cat-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.cat-amt { font-weight: 700; text-align: right; font-size: .9rem; white-space: nowrap; }
.cat-amt small { color: var(--muted); font-weight: 500; margin-left: 6px; }
@media (max-width: 560px) { .cat-row { grid-template-columns: 1fr auto; } .cat-bar { grid-column: 1 / -1; grid-row: 2; } }
.filters { grid-template-columns: 1fr 200px 200px auto; }
@media (max-width: 1100px) { .filters { grid-template-columns: 1fr 1fr; } .filters .seg { grid-column: 1 / -1; } }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }
.filters { grid-template-columns: 220px 220px 1fr; }
.filters #q { grid-column: 1 / -1; }
@media (max-width: 1100px) { .filters { grid-template-columns: 1fr 1fr; } .filters .seg { grid-column: 1 / -1; } }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }

/* ---------- v0.6: TCBL branding + footer ---------- */
.logo-tile { width: 46px; height: 46px; border-radius: 12px; background: #fff; display: grid; place-items: center; padding: 4px; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-tile.sm { width: 36px; height: 36px; border-radius: 9px; padding: 3px; }
.brandmark { align-items: center; }
.sidebar .brandmark b { font-size: 1.15rem; letter-spacing: .02em; }
.top-brand { display: flex; align-items: center; gap: 10px; }
.top-brand b { letter-spacing: .02em; }
.auth { position: relative; }
.auth-logo { display: grid; justify-items: center; text-align: center; gap: 2px; margin: -4px 0 18px; }
.auth-logo img { width: 128px; height: 128px; object-fit: contain; }
.auth-logo b { font-size: 1.3rem; letter-spacing: .04em; color: var(--brand); }
@media (prefers-color-scheme: dark) { .auth-logo b { color: var(--text); } .auth-logo img { background: #fff; border-radius: 18px; padding: 6px; } }
.auth-logo small { color: var(--muted); font-size: .85rem; }
.auth-logo.small img { width: 84px; height: 84px; }
.auth-logo.small { margin-bottom: 10px; }
.built.auth-foot { position: absolute; right: 18px; bottom: calc(12px + env(safe-area-inset-bottom)); margin: 0; text-align: right; color: rgba(255,255,255,.72); }
.built.auth-foot b { color: #fff; }
.main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.page { flex: 1; width: 100%; }
.app-foot { padding: 0 32px 18px; }
.app-foot .built { text-align: right; margin: 0; }
@media (max-width: 899px) {
  .page { padding-bottom: 20px; }
  .app-foot { padding: 0 16px calc(84px + env(safe-area-inset-bottom)); }
}
.doc-brand { display: flex; align-items: center; gap: 14px; }
.doc-brand img { width: 58px; height: 58px; object-fit: contain; }
.print-head { align-items: center; gap: 14px; margin-bottom: 12px; }
.print-head img { width: 48px; height: 48px; object-fit: contain; }
@media print { .print-only.print-head { display: flex !important; } }
.switch.into-open { margin-top: 12px; border-color: color-mix(in srgb, var(--brand-2) 40%, var(--line)); background: color-mix(in srgb, var(--brand-2) 6%, var(--surface)); }

/* ---------- v0.7: sign-in account tiles ---------- */
.auth-card.wide { max-width: 600px; }
.user-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 16px auto 10px; }
.user-tile { width: 122px; min-height: 112px; padding: 14px 8px; }
.user-tile .avatar { width: 50px; height: 50px; font-size: 1.05rem; }
.user-tile .avatar svg { width: 24px; height: 24px; }
.user-tile .tile-name { font-size: .92rem; line-height: 1.25; word-break: break-word; }
.user-tile:hover { border-color: var(--brand-2); }
.link-btn.block-link { display: block; margin: 0 auto 6px; font-size: .9rem; }

/* ---------- v0.7.3: privacy mode (amounts blurred until switched off) ---------- */
.privacy .hero .big, .privacy .stat b, .privacy .amt, .privacy .num:not(input),
.privacy table.sheet td.r, .privacy .vd-amounts td:last-child, .privacy .words, .privacy .month-tile span,
.privacy .year-head .muted, .privacy .cat-amt, .privacy .imp-bal, .privacy .calc-row b, .privacy .calc-row .num {
  filter: blur(7px); user-select: none; transition: filter .2s;
}
.privacy .hero .big { filter: blur(12px); }
.privacy input, .privacy textarea, .privacy select { filter: none !important; }
@media print { .privacy * { filter: none !important; } }
.privacy-btn { position: absolute; top: 16px; right: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 99px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); color: #fff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.privacy-btn:hover { background: rgba(255,255,255,.2); }
.privacy-btn svg { width: 20px; height: 20px; }
.privacy-btn[aria-pressed="true"] { background: var(--accent); color: #23180a; border-color: var(--accent); }
.privacy-nav svg { width: 22px; height: 22px; }
.top-actions { display: flex; gap: 8px; }
.topbar [data-privacy][aria-pressed="true"] { background: var(--accent); color: #23180a; }
@media (max-width: 560px) { .privacy-btn span { display: none; } .privacy-btn { padding: 0 12px; } }

/* ---------- v0.7.4: desktop sign-in uses the full screen ---------- */
.auth-side { display: none; }
@media (min-width: 1024px) {
  .auth { display: grid; grid-template-columns: minmax(400px, 42%) 1fr; place-items: stretch; padding: 0; background: var(--bg); }
  .auth-side { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 56px 56px 48px; color: #e6f1f0;
    background: radial-gradient(900px 600px at 0% 0%, #1d6667 0%, transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(232,176,74,.18) 0%, transparent 60%), var(--brand);
    position: relative; overflow: hidden; }
  .auth-side > *:not(.side-blocks) { position: relative; z-index: 1; }
  .side-blocks { position: absolute; right: 28px; bottom: 34px; width: min(300px, 46%); height: auto; pointer-events: none; z-index: 0; opacity: .2; filter: grayscale(1) brightness(2.4); }
  .side-brand { display: flex; align-items: center; gap: 20px; }
  .logo-tile.xl { width: 112px; height: 112px; border-radius: 24px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
  .side-brand h2 { margin: 0; font-size: 2.1rem; letter-spacing: .04em; color: #fff; }
  .side-brand p { margin: 4px 0 0; color: #a8cfcd; font-size: 1.05rem; }
  .side-clock { display: grid; gap: 6px; }
  .side-clock b { font-size: clamp(3rem, 5.2vw, 4.6rem); font-weight: 750; letter-spacing: -.02em; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
  .side-clock span { font-size: 1.15rem; color: #cfe3e2; }
  .side-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 460px; }
  .side-points li { display: flex; gap: 14px; align-items: center; font-size: 1rem; color: #dbeceb; }
  .side-points svg { width: 22px; height: 22px; flex: none; padding: 9px; box-sizing: content-box; border-radius: 12px; background: rgba(255,255,255,.08); color: var(--accent); }
  .side-company { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: #8fb5b4; }
  .auth > .auth-card { align-self: center; justify-self: center; margin: 40px 48px 56px; width: calc(100% - 96px); box-shadow: 0 10px 40px rgba(15,61,62,.10); border: 1px solid var(--line); }
  .auth > .auth-card .auth-logo { display: none; }
  #loginCard { max-width: 720px; padding: 40px 40px 32px; }
  #loginCard h1 { font-size: 1.8rem; }
  #loginCard .user-tile { width: 132px; min-height: 124px; }
  .auth > .auth-card[style*="text-align:center"] { max-width: 460px; padding: 36px 36px 30px; }
  .auth .keypad { max-width: 340px; gap: 14px; }
  .auth .key { height: 72px; }
  .built.auth-foot { color: var(--muted); }
  .built.auth-foot b { color: var(--text); }
}
@media (min-width: 1024px) and (max-height: 760px) { .side-points { display: none; } .auth-side { padding: 40px 48px; } }
.pin-avatar svg { width: 28px; height: 28px; }
@media (min-width: 1024px) and (max-width: 1279px) {
  .auth { grid-template-columns: minmax(340px, 35%) 1fr; }
  .auth-side { padding: 40px 36px; }
  .logo-tile.xl { width: 88px; height: 88px; }
  .side-brand h2 { font-size: 1.7rem; }
  #loginCard { padding: 32px 28px 26px; }
}

/* ---------- v0.8: "TCBL" in the logo orange wherever the app name appears ---------- */
.app-name .tcbl { color: #f05a22; }
.sidebar .app-name .tcbl, .topbar .app-name .tcbl, .auth-side .app-name .tcbl { color: #ff6a2e; }

/* ---------- v0.8.1: backup & restore ---------- */
.backup-counts .list-item { min-height: 44px; padding: 8px 4px; }
.num-plain { font-variant-numeric: tabular-nums; }
.small-drop { padding: 26px 16px; margin-top: 8px; }
.restore-sum { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.restore-sum .calc-row { padding: 6px 0; gap: 16px; }
.restore-sum .calc-row b { text-align: right; }
.privacy .restore-sum .calc-row b { filter: none; user-select: auto; }
@media (min-width: 900px) { .voucher-layout > .card + .card { margin-top: 0; } }

/* ---------- v0.9 daily view */
.day-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.day-nav .input { width: auto; min-height: 44px; }
.day-nav a[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.day-block { margin-bottom: 22px; padding-bottom: 6px; }
.day-block + .day-block { border-top: 2px solid var(--line); padding-top: 18px; }
.day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.day-head h2 { margin: 0 0 2px; font-size: 1.15rem; }
.small-btn { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.day-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.day-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.day-stats span { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.day-stats b { font-size: 1.05rem; }
@media (max-width: 640px) { .day-stats { grid-template-columns: repeat(2, 1fr); } }
table.sheet.compact td.trunc { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { table.sheet.compact td.trunc { max-width: none; white-space: normal; } }
.day-counts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.count-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: .9rem; background: var(--surface-2); }
.count-chip svg { width: 18px; height: 18px; flex: none; }
.count-chip.ok { color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }
.count-chip.short { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.count-chip.over { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }

/* ---------- v0.9 cash counter */
.den-list { display: flex; flex-direction: column; gap: 10px; }
.den-row { display: grid; grid-template-columns: 76px 16px 1fr 110px; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); }
.den-row.has { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand) 5%, transparent); }
.den-note { font-weight: 800; font-size: 1.15rem; text-align: center; padding: 10px 0; border-radius: 10px; background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand); }
.den-x { color: var(--muted); text-align: center; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .step { width: 52px; height: 52px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 1.6rem; font-weight: 700; color: var(--text); cursor: pointer; touch-action: manipulation; }
.stepper .step:active { transform: scale(.95); }
.stepper .den-in { text-align: center; font-size: 1.25rem; font-weight: 700; min-width: 0; -moz-appearance: textfield; }
.stepper .den-in::-webkit-outer-spin-button, .stepper .den-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.den-line { text-align: right; font-variant-numeric: tabular-nums; }
.count-total { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.tally { font-variant-numeric: tabular-nums; }
.count-result { margin-top: 16px; padding: 14px; border-radius: 14px; border: 2px solid var(--line); }
.count-result .calc-row { padding: 6px 0; }
.count-result .verdict { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; font-weight: 800; margin: 10px 0 4px; }
.count-result .verdict svg { width: 26px; height: 26px; }
.count-result.ok { border-color: var(--good); } .count-result.ok .verdict { color: var(--good); }
.count-result.short { border-color: var(--bad); } .count-result.short .verdict { color: var(--bad); }
.count-result.over { border-color: var(--warn); } .count-result.over .verdict { color: var(--warn); }
@media (max-width: 520px) {
  .den-row { grid-template-columns: 64px 1fr; }
  .den-x { display: none; }
  .den-line { grid-column: 1 / -1; text-align: right; padding-right: 4px; }
  .stepper .step { width: 48px; height: 48px; }
}
/* The counter is the cashier's working tool: never blur it in privacy mode. */
.privacy .count-page .calc-row b, .privacy .count-page .num, .privacy .count-page .tally { filter: none; user-select: auto; }
.count-sticky { display: none; }
@media (max-width: 899px) {
  .count-sticky { display: flex; justify-content: space-between; align-items: center; position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 5;
    margin-top: 12px; padding: 12px 16px; border-radius: 14px; background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
  .count-sticky b { font-size: 1.4rem; }
}
@media (max-width: 560px) {
  .day-nav { display: grid; grid-template-columns: 48px 1fr auto 48px; width: 100%; gap: 6px; }
  .day-nav > a:first-child, .day-nav > a:last-child { padding: 0; justify-content: center; }
  .day-nav > a:first-child span, .day-nav > a:last-child span { display: none; }
  .day-nav .input { width: 100%; min-width: 0; }
  .page-head:has(.day-nav) { flex-wrap: wrap; } .page-head .day-nav { flex: 1 1 100%; box-sizing: border-box; }
}
/* v0.9.2 cash verification */
.count-result { margin-top: 8px; }
.count-result .verdict:empty { display: none; }
.count-break { margin-top: 10px; }
.count-break .calc-row { padding: 6px 0; font-size: .95rem; }
@media (max-width: 899px) {
  .count-sticky.verify.ok { background: var(--good); }
  .count-sticky.verify.short { background: var(--bad); }
  .count-sticky.verify.over { background: var(--warn); }
  .count-sticky span { font-weight: 700; }
}
/* v0.9.3 coins */
.coin-in { display: flex; align-items: center; gap: 8px; }
.coin-in .cur { font-weight: 700; color: var(--muted); font-size: 1.2rem; width: 44px; text-align: right; }
.coin-in .input { text-align: center; font-size: 1.25rem; font-weight: 700; min-width: 0; height: 52px; margin-right: 58px; }
.coin-row .den-note { font-size: 1rem; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--text); }
@media (max-width: 520px) {
  .coin-in .cur { width: 42px; }
  .coin-in .input { margin-right: 54px; height: 48px; }
  .coin-row .den-note { font-size: .9rem; }
}

/* v0.9.5 sidebar: menu scrolls, account + sign out always pinned bottom-left */
.sidebar { overflow: hidden; }
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 8px -6px 0; padding: 0 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.side-foot { flex: none; display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.side-foot .nav-item { min-height: 42px; }
.sidebar .me { border-top: 0; padding: 8px 0 0; gap: 8px; }
.me-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: inherit; text-decoration: none; }
.me-link:hover { background: rgba(255,255,255,.07); }
.me-link.active { background: rgba(255,255,255,.14); }
.me-text { min-width: 0; display: flex; flex-direction: column; }
.me-text b { color: #fff; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: #9cc3c2; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.signout { flex: none; flex-direction: column; gap: 2px; min-height: 52px; padding: 4px 10px; font-size: .72rem; font-weight: 700; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.btn.signout:hover { background: rgba(255,90,60,.28); }
.btn.signout svg { width: 18px; height: 18px; }
@media (max-height: 820px) and (min-width: 900px) {
  .side-nav .nav-item { min-height: 42px; }
  .nav-sep { margin: 10px 14px 4px; }
}
.me-link .avatar { flex: none; }
.side-nav { mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent); }
.me-link { padding: 6px; gap: 8px; }
.me-link .avatar { width: 36px; height: 36px; font-size: .85rem; }
.me-text b { font-size: .9rem; }
.btn.signout { padding: 4px 8px; min-height: 48px; }

/* v0.9.6 plain sign-out icon */
.btn.signout { flex-direction: row; min-height: 44px; width: 44px; padding: 0; justify-content: center; background: transparent; border: 0; color: #9cc3c2; border-radius: 10px; }
.btn.signout svg { width: 22px; height: 22px; }
.btn.signout:hover { background: rgba(255,255,255,.08); color: #fff; }

/* v0.9.7 breathing logo loader — used for the start-up splash, page loads and refreshes instead of a spinner */
@keyframes logo-breathe { 50% { transform: scale(.92); opacity: .8; } }
@keyframes logo-pop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { @keyframes logo-breathe { 50% { opacity: .55; } } }
#pageLoad { position: fixed; inset: 0; z-index: 150; background: color-mix(in srgb, var(--bg) 60%, transparent); display: grid; place-items: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; }
#pageLoad.show { opacity: 1; visibility: visible; }
#pageLoad img { width: 84px; height: auto; padding: 12px; border-radius: 22px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.14); animation: logo-pop .35s cubic-bezier(.34, 1.56, .64, 1) both, logo-breathe 1.4s ease-in-out .35s infinite; }
@media (min-width: 900px) { #pageLoad { left: 250px; } }
#ptr img { width: 22px; height: 22px; object-fit: contain; transition: transform .1s; }
#ptr.loading img { animation: logo-breathe 1.4s ease-in-out infinite; }

/* v0.9.8 phone "More" menu */
.tabbar button { display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px; font: inherit; font-size: .72rem; font-weight: 600; color: var(--muted); background: none; border: 0; min-height: 60px; cursor: pointer; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--brand-2); }
dialog.more-sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 85vh; border-radius: 22px 22px 0 0; padding: 0 0 env(safe-area-inset-bottom); display: none; flex-direction: column; }
dialog.more-sheet[open] { display: flex; animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
.more-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); background: var(--brand); color: #fff; border-radius: 22px 22px 0 0; }
.more-head .me-text { flex: 1; }
.more-head .me-text b { color: #fff; }
.more-close { min-height: 44px; width: 44px; padding: 0; justify-content: center; background: rgba(255,255,255,.12); color: #fff; border: 0; }
.more-close svg { width: 20px; height: 20px; }
.more-list { overflow-y: auto; padding: 8px 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.more-list .nav-item { color: var(--text); min-height: 50px; }
.more-list .nav-item svg { color: var(--brand-2); }
.more-list .nav-item.active { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
.more-list .nav-item.danger, .more-list .nav-item.danger svg { color: var(--bad); }
.more-list .nav-sep { color: var(--muted); }
.more-head .avatar { background: var(--accent); color: #23180a; flex: none; }

/* v0.9.9 sign-in heading: greeting → question → hint */
.login-head { text-align: center; margin: 4px 0 18px; }
.login-head .login-greet { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: var(--accent-2, #F05A22); letter-spacing: .01em; }
.login-head h1 { margin: 0 0 6px; }
.login-head #loginHint { margin: 0; }
/* v0.9.10: greeting is part of the heading; compact time · date in the card on phones/tablets (side panel has the big clock on desktop) */
.login-head h1 { line-height: 1.25; }
.card-clock { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: -4px 0 10px; font-variant-numeric: tabular-nums; }
.card-clock .clock-t { font-size: 1rem; font-weight: 700; color: var(--text); }
.card-clock .clock-ds { font-size: .9rem; color: var(--muted); }
.card-clock .clock-ds::before { content: "· "; }
@media (min-width: 1024px) { .card-clock { display: none; } }
/* v0.9.11: side-panel layout as TCBL-Vouchers — clock directly under the brand, points + company at the bottom */
@media (min-width: 1024px) {
  .auth-side { justify-content: flex-start; gap: 0; }
  .side-clock { margin-top: clamp(28px, 8vh, 72px); gap: 6px; }
  .side-clock b { font-size: clamp(46px, 4.2vw, 60px); }
  .side-clock span { font-size: 16px; color: rgba(255,255,255,.75); }
  .side-points { margin-top: auto; }
  .side-company { margin-top: clamp(24px, 5vh, 48px); }
}
@media (min-width: 1024px) and (max-height: 760px) {
  .side-clock { margin-top: 24px; } .side-clock b { font-size: 44px; } .side-company { margin-top: auto; }
}
