:root {
  --bg: #f4f6f6;
  --card: #ffffff;
  --ink: #142326;
  --ink-2: #364a4e;
  --muted: #6b7c80;
  --line: #e2e8e9;
  --line-2: #eef2f2;
  --brand: #0d5c63;
  --brand-2: #0a4a50;
  --brand-soft: #e2f1f1;
  --on-brand: #ffffff;
  --accent: #b45309;
  --accent-soft: #fdf1e2;
  --warn: #b45309;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #15803d;
  --shadow: 0 1px 2px rgba(20,35,38,.05), 0 6px 18px rgba(20,35,38,.05);
  --shadow-lg: 0 12px 40px rgba(13,92,99,.22);
  --r: 16px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1517; --card: #162124; --ink: #e8efef; --ink-2: #c3d0d2; --muted: #8fa1a4; --line: #24353a; --line-2: #1c2a2e;
    --brand: #4fb3b8; --brand-2: #6cc6cb; --brand-soft: #173338; --on-brand: #06282b; --accent: #f0a050; --accent-soft: #3a2a18; --warn: #f0a050;
    --danger: #ff8a7a; --danger-soft: #3a1e1b; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--brand); text-decoration: none; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.accent-t { color: var(--accent); } .warn-t { color: var(--warn); } .danger-t { color: var(--danger) !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

.boot { height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 64px; height: 64px; border-radius: 20px; background: var(--brand); color: #fff; display: grid; place-items: center; animation: pulse 1.2s ease-in-out infinite; }
.boot-mark svg { width: 34px; height: 34px; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- shell ---------- */
.demo-bar { background: var(--accent-soft); color: var(--accent); font-size: .85rem; text-align: center; padding: calc(var(--sat) + 6px) 12px 6px; font-weight: 600; }
.demo-bar a { color: inherit; text-decoration: underline; }
.layout { max-width: 1240px; margin: 0 auto; }
.main { padding: calc(var(--sat) + 10px) 16px calc(var(--sab) + 96px); min-width: 0; }
.demo-bar + .layout .main { padding-top: 10px; }
.side { display: none; }
.tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(var(--sab) + 6px); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .7rem; font-weight: 600; padding: 4px 0; border-radius: 12px; }
.tabs a.on { color: var(--brand); }
.tabs a .ic { width: 24px; height: 24px; }
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: 220px 1fr; gap: 8px; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 24px 12px; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--ink-2); font-weight: 600; }
  .side a:hover { background: var(--line-2); }
  .side a.on { background: var(--brand-soft); color: var(--brand); }
  .tabs { display: none; }
  .main { padding: 24px 24px 48px; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--brand); padding: 4px 14px 18px; }
.brand .ic { width: 28px; height: 28px; }
.brand.big { justify-content: center; font-size: 1.5rem; padding: 0 0 6px; }
.brand.big .ic { width: 36px; height: 36px; }

.topbar { display: flex; align-items: center; gap: 8px; min-height: 52px; margin-bottom: 8px; }
.topbar h1 { flex: 1; font-size: 1.6rem; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:active, .icon-btn:hover { background: var(--line-2); }
.icon-btn.sm { width: 36px; height: 36px; } .icon-btn.sm .ic { width: 18px; height: 18px; }
.icon-btn.solid { background: var(--brand); color: var(--on-brand); }
.icon-btn:disabled { opacity: .3; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 700; white-space: nowrap; transition: transform .08s; }
.btn:active { transform: scale(.97); }
.btn .ic { width: 19px; height: 19px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .7; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: sp .7s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(1turn); } }

/* ---------- cards & layout ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; border: 1px solid var(--line-2); }
.card.flat { padding: 4px 0; }
.card.calm p { margin: 0; display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 600; }
.card h2, .h2 { font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.h2 { margin: 18px 2px 10px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head .muted { font-size: .85rem; }
.cols { display: grid; gap: 0 14px; }
.stack { min-width: 0; }
@media (min-width: 960px) { .cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; margin: 0; }
.sec { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; font-weight: 700; }

/* ---------- today ---------- */
.hero { padding: 6px 2px 14px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero h1 { font-size: 1.75rem; font-weight: 800; }
.hero-top .muted { margin: 0; font-size: .9rem; font-weight: 600; }
.hero-line { margin-top: 10px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; flex: none; vertical-align: middle; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span { font-size: .75rem; color: var(--muted); font-weight: 600; line-height: 1.2; }
.stat b { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.stat small { font-size: .75rem; color: var(--muted); }
@media (max-width: 380px) { .stat b { font-size: 1.1rem; } }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.card .chips.scroll { margin: 0 0 8px; padding: 0 0 2px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; font-size: .88rem; white-space: nowrap; color: var(--ink-2); }
.chip.sm { min-height: 30px; padding: 0 10px; font-size: .8rem; }
.chip.on { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.chip.on .dot { box-shadow: 0 0 0 2px #fff; }

.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); }
.plist li:last-child { border-bottom: 0; }
.card.flat .plist li, .plist.card li { padding: 0 12px; }
.prow-main { display: flex; align-items: center; gap: 12px; padding: 11px 0; flex: 1; min-width: 0; color: var(--ink); }
.grow { flex: 1; min-width: 0; }
.name { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: .85rem; margin-top: 1px; }
.sub .dot { margin-right: 4px; }
.plan { font-size: .85rem; color: var(--ink-2); background: var(--line-2); border-radius: 8px; padding: 4px 8px; margin-top: 4px; }
.prow.done .prow-main { opacity: .65; }
.seen { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 700; font-size: .85rem; }
.seen .ic { width: 18px; height: 18px; }
.chev { color: var(--muted); width: 18px; height: 18px; }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: .85rem; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.av.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.pill { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.pill.teal { background: var(--brand-soft); color: var(--brand); }
.pill.sky { background: color-mix(in srgb, #2563eb 12%, var(--card)); color: #2563eb; }
.pill.violet { background: color-mix(in srgb, #7c3aed 12%, var(--card)); color: #7c3aed; }
.pill.amber { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) { .pill.sky { color: #8ab4ff; } .pill.violet { color: #c4a4ff; } }
.later summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: .85rem; padding: 10px 0 4px; }
.rem { border-radius: 12px; background: var(--line-2); padding: 10px 12px; margin-bottom: 8px; }
.rem.warn { background: var(--accent-soft); }
.rem h3 { font-size: .9rem; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.rem h3 .ic { width: 18px; height: 18px; }
.mini { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.mini li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.mini li span { color: var(--muted); display: flex; align-items: center; white-space: nowrap; }

/* ---------- patients ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 0 12px; margin-bottom: 10px; box-shadow: inset 0 0 0 1.5px var(--line); }
.search input { flex: 1; border: 0; outline: 0; background: none; min-height: 46px; font-size: 16px; }
.search .ic { color: var(--muted); }
.count { margin: 2px 4px 8px; font-size: .85rem; }
.bar { height: 5px; background: var(--line-2); border-radius: 9px; overflow: hidden; margin-top: 6px; max-width: 220px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 9px; }
.bar.big { height: 8px; max-width: none; margin: 0; }
.phead { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.phead h1 { font-size: 1.5rem; font-weight: 800; }
.actions3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.actions3 .btn { padding: 0 8px; }
@media (min-width: 960px) { .actions3 { max-width: 560px; } }
.progress span { display: block; margin-top: 6px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.money { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.progress + .money { border-top: 1px solid var(--line-2); padding-top: 12px; }
.money:first-child { margin-top: 0; }
.money span { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.money b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.facts dt { font-size: .75rem; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; }
.note { font-size: .9rem; color: var(--ink-2); margin: 8px 0 0; white-space: pre-wrap; }
.seg { display: flex; background: var(--line-2); border-radius: 12px; padding: 3px; margin-bottom: 8px; }
.seg button { flex: 1; min-height: 38px; border-radius: 10px; font-weight: 700; font-size: .85rem; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.vlist { list-style: none; margin: 0; padding: 0; }
.vrow, .payrow { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.payrow { align-items: center; }
.vrow:last-child, .payrow:last-child { border-bottom: 0; }
.vdate { width: 54px; flex: none; text-align: center; background: var(--line-2); border-radius: 10px; padding: 6px 0; }
.vdate b { display: block; font-size: .85rem; } .vdate span { font-size: .7rem; color: var(--muted); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: .78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 2px 7px; }
.wires { font-size: .85rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.paid { font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; font-size: .68rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); padding: 12px 6px 4px; text-align: left; }

/* ---------- earnings ---------- */
.monthnav { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; font-size: 1.05rem; }
.monthnav b { min-width: 160px; text-align: center; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 15px; font-family: var(--font); }
.chart .b path { fill: var(--brand); }
.chart .b.fc path { fill: color-mix(in srgb, var(--brand) 32%, var(--card)); stroke: var(--brand); stroke-width: 1.2; stroke-dasharray: 3 2; }
.chart .b.cur path { fill: color-mix(in srgb, var(--brand) 70%, var(--card)); }
.chart .b { cursor: pointer; }
.chart .b:hover path { filter: brightness(1.1); }
.chart .b.sel text { fill: var(--ink); font-weight: 800; }
.tip { position: absolute; top: -6px; width: 150px; background: var(--ink); color: var(--card); font-size: .8rem; font-weight: 600; padding: 6px 8px; border-radius: 8px; text-align: center; pointer-events: none; }
.legend { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.legend .lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.lg.act { background: var(--brand); } .lg.fc { background: color-mix(in srgb, var(--brand) 32%, var(--card)); outline: 1px dashed var(--brand); }
.cgrid { display: grid; gap: 12px; margin-bottom: 14px; }
@media (min-width: 720px) { .cgrid { grid-template-columns: repeat(2, 1fr); } }
.ccard { background: var(--card); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid var(--line-2); text-align: left; width: 100%; display: block; color: var(--ink); }
.ccard.clickable:hover { border-color: var(--brand); }
.ccard-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.ccard-head b { font-size: 1.05rem; } .ccard-head .muted { margin-left: auto; font-size: .85rem; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .92rem; border-bottom: 1px dashed var(--line-2); }
.kv:last-of-type { border-bottom: 0; }
.kv span { color: var(--muted); } .kv b { text-align: right; font-variant-numeric: tabular-nums; }
.kv.owed b { font-size: 1.1rem; }
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 700; padding: 6px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl .r { text-align: right; }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* ---------- forms & sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(10,20,22,.45); opacity: 0; transition: opacity .2s; }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 6px 18px calc(var(--sab) + 18px); transform: translateY(100%); transition: transform .22s ease-out; overscroll-behavior: contain; }
.sheet-wrap.open .scrim { opacity: 1; } .sheet-wrap.open .sheet { transform: none; }
.grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 4px auto 6px; }
@media (min-width: 720px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 20px; max-height: 88dvh; padding: 6px 24px 22px; transform: translateY(20px) scale(.98); opacity: 0; transition: .18s; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet.wide { max-width: 980px; }
  .grab { visibility: hidden; }
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 4px 0 10px; position: sticky; top: -6px; background: var(--card); z-index: 2; }
.sheet-head h2 { font-size: 1.25rem; font-weight: 800; }
.sheet-head p { margin: 2px 0 0; font-size: .9rem; display: flex; align-items: center; }
.sheet-text { color: var(--ink-2); }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; position: sticky; bottom: calc(-18px - var(--sab)); background: var(--card); padding: 10px 0 4px; }
.sheet-actions .btn.primary { flex: 1; max-width: 260px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form.one { grid-template-columns: 1fr; }
.form .full { grid-column: 1 / -1; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > span { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.f input:not([type=checkbox]), .f select, .f textarea, .compare select, .rule select {
  width: 100%; min-height: 46px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--card); padding: 10px 12px; font-size: 16px; outline: 0; }
.f textarea { min-height: 0; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--brand); }
.f input:disabled { background: var(--line-2); }
.f input[type=date] { -webkit-appearance: none; appearance: none; }
.f small { font-size: .78rem; }
.f .chips.wrap { margin-bottom: 6px; }
.toggle { flex-direction: row; align-items: center; gap: 10px; min-height: 40px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--brand); }
.toggle span { font-size: .95rem !important; font-weight: 600 !important; color: var(--ink) !important; }
.duepick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.duepick input { flex: 1 1 160px; width: auto !important; }
.paybox { border: 1.5px dashed var(--line); border-radius: 14px; padding: 10px 12px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.paybox legend { font-size: .8rem; font-weight: 700; color: var(--ink-2); padding: 0 6px; }
.sharecalc { font-size: .9rem; background: var(--brand-soft); color: var(--ink); border-radius: 10px; padding: 8px 10px; }
.sharecalc:empty { display: none; }
.sharecalc b { color: var(--brand); }
.rule { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rule select { width: 140px !important; flex: none; }
.rule .chips { flex: 1; }
.swatch { width: 30px; height: 30px; border-radius: 50%; }
.swatch.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; color: var(--brand); text-align: center; }
.drop .ic { width: 32px; height: 32px; }
.menu { display: flex; flex-direction: column; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; padding: 14px 4px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line-2); text-align: left; }
.menu > :last-child { border-bottom: 0; }

/* photo viewer */
.sheet-wrap.dark .sheet { background: #0b0f10; color: #fff; }
.viewer-top { display: flex; align-items: center; gap: 4px; padding: 4px 0 8px; font-size: .85rem; }
.viewer-top span { flex: 1; }
.viewer-top .icon-btn { color: #fff; }
.viewer-img { position: relative; display: grid; place-items: center; min-height: 50dvh; }
.viewer-img img { max-width: 100%; max-height: 74dvh; border-radius: 8px; }
.viewer-img .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center; }
.viewer-img .prev { left: 4px; } .viewer-img .next { right: 4px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare img { width: 100%; border-radius: 10px; margin-top: 8px; background: var(--line-2); min-height: 120px; object-fit: contain; }

/* auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 22px; padding: 28px 22px; box-shadow: var(--shadow); text-align: center; }
.auth-card .form { text-align: left; margin: 18px 0 12px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 92px); transform: translate(-50%, 20px); background: var(--ink); color: var(--card); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); color: #fff; }
@media (min-width: 960px) { #toast { bottom: 28px; } }
