/* padelbot web app. Mobile-first; light + dark via prefers-color-scheme. No external assets. */

:root {
  color-scheme: light dark;
  --brand: #0f3d2e;
  --brand-2: #16543e;
  --ball: #cee83e;
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --text: #15211b;
  --muted: #5b6b63;
  --border: #dfe6e2;
  --border-strong: #c9d3ce;
  --accent: #1d7a53;
  --accent-text: #ffffff;
  --accent-soft: #e3f2ea;
  --accent-ink: #145c3e;
  --warn: #9a5b00;
  --warn-soft: #fff3dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --ok: #1d7a53;
  --chip: #eef2f0;
  --tab-active: #ffffff;
  --cell: #f1f4f2;
  --cell-on: #2e9a69;
  --grid-line: #e2e8e5;
  --grid-hour: #cbd5d0;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 2px 10px rgba(16, 40, 30, .05);
  --radius: 14px;
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1311;
    --surface: #151e1a;
    --surface-2: #1a2520;
    --text: #e4ebe7;
    --muted: #94a59c;
    --border: #25322c;
    --border-strong: #33433b;
    --accent: #3fbf83;
    --accent-text: #06140d;
    --accent-soft: #173326;
    --accent-ink: #7ddcaa;
    --warn: #f0b440;
    --warn-soft: #33270f;
    --bad: #ff7b6e;
    --bad-soft: #3a1714;
    --ok: #3fbf83;
    --chip: #1f2a25;
    --tab-active: #2a3832;
    --cell: #1b2521;
    --cell-on: #3aae78;
    --grid-line: #24302b;
    --grid-hour: #34443c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
code, pre { font-family: var(--mono); font-size: .88em; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.warn-text { color: var(--warn); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ----------------------------------------------------------------- layout */
.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
}
.no-nav .main { padding-bottom: 32px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  min-height: 52px;
  padding: 0 8px 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--brand);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 650; font-size: 1.05rem; letter-spacing: .01em; margin-right: auto; }
.brand img { border-radius: 6px; }
.logout { margin: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; color: rgba(255,255,255,.85);
  font: inherit; font-size: .9rem; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.logout-label { display: none; }

/* bottom tab bar on mobile */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 44px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 550;
}
.nav-item.active { color: var(--accent-ink); }
.nav-item.active svg { stroke-width: 2.2; }
.nav-icon { position: relative; display: inline-flex; }
.badge {
  position: absolute; top: -5px; right: -10px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--bad); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}

@media (min-width: 760px) {
  .topbar { padding: 0 16px 0 24px; gap: 16px; }
  .brand { margin-right: 12px; }
  .nav {
    position: static; display: flex; gap: 4px; height: auto; padding: 0; margin-right: auto;
    background: transparent; border: 0;
  }
  .nav-item {
    flex-direction: row; gap: 8px; padding: 0 12px; min-height: 40px; border-radius: 10px;
    color: rgba(255,255,255,.78); font-size: .92rem;
  }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
  .nav-item.active { color: #fff; background: rgba(255,255,255,.14); }
  .badge { top: -7px; right: -9px; }
  .logout-label { display: inline; }
  .main { padding: 24px 24px 48px; }
}

.page-title { font-size: 1.45rem; font-weight: 700; margin: 4px 0 14px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hint { color: var(--muted); font-size: .9rem; margin: -6px 0 12px; }
.back { margin: 0 0 10px; }
.back a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 550; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); padding: 0 10px; }
.btn-quiet:hover { color: var(--text); border-color: transparent; background: var(--chip); }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.link-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--accent-ink); font: inherit; font-weight: 600; font-size: .9rem;
  cursor: pointer; text-decoration: none;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ----------------------------------------------------------------- tabs */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin: 0 0 16px;
  background: var(--chip); border-radius: 12px;
}
.tab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border-radius: 9px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.tab.active { background: var(--tab-active); color: var(--text); box-shadow: var(--shadow); }
.count {
  min-width: 22px; padding: 1px 7px; border-radius: 10px;
  background: var(--border); color: var(--muted); font-size: .78rem; font-weight: 700; text-align: center;
}
.tab.active .count { background: var(--accent-soft); color: var(--accent-ink); }

/* ----------------------------------------------------------------- cards */
.cards { display: grid; gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
  box-shadow: var(--shadow);
}
.card.nofit { background: var(--surface-2); box-shadow: none; }
.card.nofit .time { color: var(--muted); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.day { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: .88rem; font-weight: 600; letter-spacing: .01em; }
.rel { padding: 1px 8px; border-radius: 10px; background: var(--chip); color: var(--muted); font-size: .76rem; font-weight: 650; }
.rel-today { background: var(--ball); color: #23310a; }
.rel-tomorrow { background: var(--accent-soft); color: var(--accent-ink); }
.time { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 2px; }
.head-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.status-badge, .fit-badge, .tag {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
  background: var(--chip); color: var(--muted);
}
.fit-badge, .s-open, .tag-ok { background: var(--accent-soft); color: var(--accent-ink); }
.s-dismissed, .s-expired, .s-invalid { background: var(--chip); color: var(--muted); }
.s-duplicate, .tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }
.q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 3px; border-radius: 50%;
  background: var(--warn-soft); color: var(--warn);
  font-size: .7rem; font-weight: 800; vertical-align: super; line-height: 1;
}
.time .q { width: 18px; height: 18px; font-size: .75rem; vertical-align: top; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 10px 0 8px; }
.chip {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px;
  background: var(--chip); font-size: .88rem; font-weight: 650; font-variant-numeric: tabular-nums;
}
.chip-unsure { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--muted); }
.chip .q { vertical-align: baseline; }
.why-not { font-size: .85rem; color: var(--muted); margin: -2px 0 6px; }
.byline { display: grid; gap: 0; margin: 0 0 8px; font-size: .86rem; min-width: 0; }
.byline .group { font-weight: 650; overflow-wrap: anywhere; }
.byline .by { color: var(--muted); }
.sep { opacity: .6; }
.msg {
  white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 8px 12px; border-left: 3px solid var(--border-strong); border-radius: 0 8px 8px 0;
  background: var(--surface-2); color: var(--text); font-size: .93rem;
}
.card.nofit .msg { background: var(--surface); }
.msg-text.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.msg-text.clamp.expanded { display: block; }
.note { font-size: .84rem; color: var(--muted); margin-top: 6px; }
.note-warn { color: var(--warn); }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.actions > .btn-primary { flex: 0 1 auto; padding: 0 14px; }
.actions-right { display: flex; gap: 2px; margin-left: auto; flex: none; }
.reply-in { font-size: .86rem; color: var(--muted); padding: 2px 0; min-width: 0; overflow-wrap: anywhere; flex: 1 1 auto; line-height: 1.3; }
.reply-in strong { color: var(--text); font-weight: 600; }
.status-dismissed, .status-expired, .status-invalid { opacity: .8; }
@media (max-width: 479px) {
  .report-label { display: none; }
  .actions .btn-quiet { min-width: 44px; padding: 0 10px; }
}

/* ----------------------------------------------------------------- empty states / panels */
.empty { text-align: center; padding: 36px 16px; display: grid; justify-items: center; gap: 10px; }
.empty h2 { font-size: 1.2rem; }
.empty p { color: var(--muted); max-width: 34ch; }
.empty-art {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 4px;
}
.empty-art svg { width: 32px; height: 32px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 28px; }
.panel-head .panel-title { margin: 0; }
.panel-head .link-btn { min-height: 32px; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 10px; }
.panel .hint { margin: 0 0 12px; }
.sub-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 8px; }
.callout { padding: 10px 12px; border-radius: 10px; font-size: .9rem; margin: 0 0 12px; }
.callout-warn { background: var(--warn-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ----------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; margin: 0 0 12px; }
.field-label { font-size: .88rem; font-weight: 600; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 64px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-inline { grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin: 0; }
.field-inline .field-label { display: grid; gap: 2px; }
.field-inline .field-label .small { font-weight: 400; }
.input-suffix { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.input-suffix input { width: 96px !important; text-align: right; font-variant-numeric: tabular-nums; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 6px 0; border-top: 1px solid var(--border); cursor: pointer;
}
.panel-title + .switch-row, .row-2 + .switch-row { border-top: 0; }
.switch-row > span { display: grid; gap: 1px; }
.switch-title { font-weight: 550; }
input[type=checkbox][role=switch] {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 48px; height: 28px; border-radius: 14px; margin: 0;
  background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s;
}
input[type=checkbox][role=switch]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
input[type=checkbox][role=switch]:checked { background: var(--accent); }
input[type=checkbox][role=switch]:checked::after { transform: translateX(20px); }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: .92rem; }

/* ----------------------------------------------------------------- login / setup */
.login { max-width: 380px; margin: 8vh auto 0; text-align: center; display: grid; gap: 8px; }
.login h1 { font-size: 1.7rem; }
.login-logo { justify-self: center; border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 6px; }
.login-form { text-align: left; display: grid; gap: 4px; margin-top: 18px; }
.login-form .btn { margin-top: 6px; }
.setup { text-align: left; max-width: 520px; }
.setup h1, .setup .login-logo { justify-self: center; }
.setup-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.setup-list li { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.setup-list li.missing { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.setup-list li.missing .muted { color: var(--warn); }
.code { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 0; }

/* ----------------------------------------------------------------- availability grid */
.avail {
  display: grid;
  grid-template-columns: 42px repeat(7, minmax(0, 1fr));
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  margin: 0 -4px;
}
.avail .dayhead, .avail .corner {
  position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 2;
  display: grid; place-items: center; height: 32px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: .78rem; font-weight: 700; color: var(--muted);
  touch-action: pan-y;
}
.avail .corner { background: var(--surface-2); border-bottom: 1px solid var(--border); touch-action: pan-y; height: 32px; }
.avail .tlabel {
  height: 26px; padding-right: 6px;
  font-size: .7rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums;
  line-height: 1; padding-top: 2px; touch-action: pan-y;
}
.avail .cell {
  height: 26px;
  background: var(--cell);
  border-left: 1px solid var(--grid-line);
  touch-action: none; cursor: pointer;
}
.avail .cell.hour { box-shadow: inset 0 1px 0 var(--grid-hour); }
.avail .cell.half { box-shadow: inset 0 1px 0 var(--grid-line); }
.avail .cell.on { background: var(--cell-on); box-shadow: none; }
.avail .cell.on.top { box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.avail .cell.weekend { background: color-mix(in srgb, var(--cell) 80%, var(--border)); }
.avail .cell.weekend.on { background: var(--cell-on); }
@media (hover: hover) { .avail .cell:hover { outline: 2px solid var(--accent); outline-offset: -2px; } }
@media (hover: none) { .touch-only { display: inline; } }
@media (hover: hover) { .touch-only { display: none; } }
@media (min-width: 760px) { .avail .cell, .avail .tlabel { height: 22px; } }
.slot-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip { padding: 4px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-size: .86rem; font-weight: 650; font-variant-numeric: tabular-nums; }

/* save bar */
.savebar {
  position: fixed; left: 0; right: 0; z-index: 25;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  margin: 0 auto; width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.savebar-text { margin-right: auto; font-weight: 600; font-size: .92rem; }
.savebar .btn-quiet { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.savebar .btn-quiet:hover { background: transparent; color: var(--bg); }
@media (min-width: 760px) { .savebar { bottom: 16px; } }
.device-status { font-size: .95rem; }

/* ----------------------------------------------------------------- status */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 14px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: grid; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat-num { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--muted); }
.client + .client { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.client-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.client-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 0; }
.kv > div { display: grid; gap: 1px; min-width: 0; }
.kv dt { font-size: .78rem; color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.spend { margin-top: 14px; }
.spend-head { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; margin-bottom: 6px; flex-wrap: wrap; }
.meter { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.meter-fill { display: block; height: 100%; min-width: 2px; background: var(--accent); border-radius: 4px; }
.meter-warn .meter-fill { background: var(--warn); }
.notif-list { list-style: none; padding: 0; margin: 10px 0 0; }
.notif { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--border); align-items: baseline; }
.notif-kind { grid-row: span 2; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); min-width: 58px; }
.notif-title { font-weight: 550; font-size: .92rem; overflow-wrap: anywhere; }
.notif-title a { color: inherit; text-decoration: none; }
.notif-title a:hover { text-decoration: underline; }
.notif-meta { display: flex; gap: 8px; align-items: center; font-size: .8rem; }

/* ----------------------------------------------------------------- reports */
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.reason { font-weight: 700; }
.reason-not_an_opening, .reason-duplicate { color: var(--bad); }
.report-comment { margin-top: 6px; font-style: italic; overflow-wrap: anywhere; }
.card.is-reviewed { opacity: .75; }

/* ----------------------------------------------------------------- bottom sheet */
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh;
  margin: auto auto 0; padding: 0;
  border: 0; border-radius: 20px 20px 0 0;
  background: var(--surface); color: var(--text);
  box-shadow: 0 -8px 30px rgba(0,0,0,.25);
}
.sheet::backdrop { background: rgba(5, 15, 10, .45); }
.sheet[open] { animation: sheet-in .18s ease-out; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-body { padding: 8px 16px calc(16px + var(--safe-b)); display: grid; gap: 8px; }
.sheet-grip { justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 4px 0 6px; }
.sheet h2 { font-size: 1.15rem; margin-bottom: 2px; }
.reasons { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; }
.radio { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 6px; border-radius: 10px; cursor: pointer; }
.radio:hover { background: var(--surface-2); }
.radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.sheet .hint { margin: 0; font-size: .82rem; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
@media (min-width: 760px) {
  .sheet { margin: auto; border-radius: 20px; }
}

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; z-index: 50;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 24px);
  padding: 6px 6px 6px 16px; min-height: 48px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-size: .92rem; font-weight: 550;
}
.toast.error { background: var(--bad); color: #fff; }
.toast-action {
  min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ball); font: inherit; font-weight: 750; cursor: pointer;
}
.toast-text { padding: 6px 10px 6px 0; }
.no-nav .toast, .toast.raised { bottom: calc(var(--tabbar-h) + var(--safe-b) + 72px); }
.no-nav .toast { bottom: 24px; }
@media (min-width: 760px) { .toast { bottom: 24px; } .toast.raised { bottom: 84px; } }

/* ----------------------------------------------------------------- offline page */
.offline { max-width: 380px; margin: 14vh auto 0; text-align: center; display: grid; gap: 10px; justify-items: center; padding: 0 16px; }
