@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #080c12;
  --bg-elev: #0f151f;
  --bg-elev-2: #141c29;
  --bg-soft: #1a2433;
  --border: #223044;
  --border-soft: #1a2534;
  --text: #e9eef7;
  --muted: #8b9ab0;
  --muted-strong: #b3c1d4;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.13);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --bad: #fb7185;
  --bad-soft: rgba(251, 113, 133, 0.13);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(14, 165, 233, 0.16), transparent 60%),
    radial-gradient(700px 380px at 5% 0%, rgba(52, 211, 153, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.muted { color: var(--muted); }
h1, h2, h3, p { margin: 0; }

/* Boot */
.boot-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
}
.boot-screen h1 { font-size: 24px; letter-spacing: 0.4px; }
.boot-screen p { color: var(--muted); }
.boot-spinner, .spinner {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(56, 189, 248, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(52, 211, 153, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.brand-mark svg { width: 28px; height: 28px; }
.brand-mark.large { width: 78px; height: 78px; border-radius: 24px; box-shadow: var(--shadow); }
.brand-mark.large svg { width: 48px; height: 48px; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 11px; }
.brand-mark.small svg { width: 22px; height: 22px; }

/* Auth */
.auth-screen {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(26px + env(safe-area-inset-top)) 18px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.auth-brand h1 { font-size: 22px; line-height: 1.3; }
.auth-brand h1 span { color: var(--accent); font-size: 13px; display: inline-block; margin-inline-start: 6px; }
.auth-brand p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13px;
  transition: 0.18s;
}
.segmented button .icon { width: 17px; height: 17px; }
.segmented button.active { background: var(--bg-soft); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }

.auth-card {
  background: linear-gradient(180deg, rgba(20, 28, 41, 0.96), rgba(13, 19, 28, 0.98));
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}
.auth-note {
  display: flex; align-items: flex-start; gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 0 6px;
}
.auth-note .icon { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted-strong); font-weight: 700; }
.field > small, .field-hint { color: var(--muted); font-size: 11.5px; line-height: 1.7; }
input[type='text'], input[type='password'], input[type='url'], input[type='number'], input[type='date'], select, textarea {
  width: 100%;
  background: #0b111a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--text);
  outline: none;
  min-height: 43px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}
input[dir='ltr'], select[dir='ltr'], .ltr { text-align: left; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(14px) calc(50% - 2px), calc(19px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-left: 32px;
}
input[type='date'] { direction: ltr; text-align: right; }
input[type='range'] { width: 100%; accent-color: var(--accent); }

.btn {
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  min-height: 42px;
  transition: 0.15s;
}
.btn .icon { width: 17px; height: 17px; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border-color: rgba(56, 189, 248, 0.65);
  color: #f0faff;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.22);
}
.btn-ghost { background: transparent; }
.btn-danger { background: var(--bad-soft); border-color: rgba(251, 113, 133, 0.4); color: #fecdd3; }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; min-height: 47px; font-size: 14px; }
.btn-row { display: flex; gap: 7px; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
}
.icon-btn:active { background: var(--bg-soft); }
.icon-btn.bordered { border: 1px solid var(--border); background: var(--bg-elev); }
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn.danger { color: #fda4af; }

.form-error {
  background: var(--bad-soft);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: #fecdd3;
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 12px;
}

/* App shell */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(8, 12, 18, 0.82);
  border-bottom: 1px solid rgba(34, 48, 68, 0.7);
  backdrop-filter: blur(16px);
}
.appbar-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.appbar-brand div:last-child { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.appbar-brand strong { font-size: 14px; }
.appbar-brand span { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.appbar-actions { display: flex; align-items: center; gap: 5px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  color: var(--muted-strong);
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}
.status-pill b { font-weight: 700; }
.status-pill .dot, .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
  flex: none;
}
.status-pill.warn .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12); }
.status-pill.bad .dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.12); }
.status-pill .dot.offline { background: var(--muted); box-shadow: none; }

.views { flex: 1; padding: 14px 13px calc(86px + env(safe-area-inset-bottom)); max-width: 820px; width: 100%; margin: 0 auto; }
.view { animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.view-head h2 { font-size: 18px; }
.view-head p { color: var(--muted); font-size: 11.5px; }
.view-head-actions { display: flex; gap: 6px; }

.tabbar {
  position: fixed; z-index: 30; bottom: 0; left: 0; right: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 10px calc(7px + env(safe-area-inset-bottom));
  background: rgba(10, 15, 23, 0.92);
  border-top: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
}
.tabbar .tab {
  border: 0; background: transparent;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}
.tabbar .tab .icon { width: 21px; height: 21px; }
.tabbar .tab.active { color: var(--accent); }
.tabbar .tab.active .icon { filter: drop-shadow(0 0 9px rgba(56, 189, 248, 0.35)); }
.tabbar.two-cols { grid-template-columns: repeat(2, 1fr); }

/* Live */
.live-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.live-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #05080d;
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}
.live-card video { width: 100%; height: 100%; object-fit: cover; display: block; background: #05080d; }
.live-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 32%, transparent 62%, rgba(0, 0, 0, 0.65));
  pointer-events: none;
}
.live-card-top {
  position: absolute; z-index: 2; top: 9px; right: 10px; left: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.live-name { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); min-width: 0; }
.live-name span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-live {
  font-size: 9px; letter-spacing: 0.6px; font-weight: 700;
  color: #fecdd3; background: rgba(225, 29, 72, 0.25);
  border: 1px solid rgba(251, 113, 133, 0.4);
  padding: 2px 7px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.live-card-actions {
  position: absolute; z-index: 2; bottom: 8px; left: 8px;
  display: flex; gap: 5px;
}
.live-card-actions button {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(6, 11, 18, 0.55);
  color: #eef6ff;
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
}
.live-card-actions .icon { width: 17px; height: 17px; }
.live-card-clock { position: absolute; z-index: 2; bottom: 14px; right: 12px; font-size: 9.5px; color: rgba(233, 238, 247, 0.8); direction: ltr; font-variant-numeric: tabular-nums; }
.live-state {
  position: absolute; z-index: 3; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(5, 8, 13, 0.72);
  color: var(--muted-strong);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}
.live-state .spinner { width: 22px; height: 22px; }
.live-state .icon { width: 24px; height: 24px; color: var(--warn); }
.live-state .btn { margin-top: 3px; }

/* Playback */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 13px;
}
.filter-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.filter-panel .btn { grid-column: 1 / -1; }
.player-card {
  position: relative;
  margin-top: 11px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #04070b;
  aspect-ratio: 16 / 9;
}
.player-card video { width: 100%; height: 100%; display: block; background: #000; }
.player-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: radial-gradient(400px 170px at 50% 30%, rgba(14, 165, 233, 0.12), transparent), #070b11;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}
.player-placeholder .icon { width: 28px; height: 28px; color: var(--accent); opacity: 0.8; }
.player-placeholder strong { color: var(--muted-strong); font-size: 12.5px; }
.player-placeholder span { font-size: 11px; }
.player-meta {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
  padding: 8px 11px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  pointer-events: none;
  font-size: 10.5px;
}
.player-meta strong { font-size: 11.5px; }
.player-meta span { color: var(--muted-strong); direction: ltr; }

.segments-panel { margin-top: 11px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h3 { font-size: 14px; }
.panel-head p { color: var(--muted); font-size: 10.5px; }
.segments { display: flex; flex-direction: column; gap: 6px; max-height: 48vh; overflow-y: auto; }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 22px 12px; color: var(--muted); font-size: 11.5px; }
.loading-row .spinner { width: 20px; height: 20px; }
.segment-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px;
  border-radius: 11px;
  background: var(--bg-elev-2);
  border: 1px solid transparent;
}
.segment-row.active { border-color: rgba(56, 189, 248, 0.38); background: var(--accent-soft); }
.seg-time { direction: ltr; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--accent); width: 58px; flex: none; }
.seg-meta { flex: 1; min-width: 0; font-size: 10.5px; color: var(--muted); }
.seg-meta strong { display: block; color: var(--muted-strong); font-size: 11.5px; font-weight: 700; }
.seg-btn {
  width: 34px; height: 34px; flex: none;
  border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--muted-strong);
  display: grid; place-items: center;
}
.seg-btn .icon { width: 15px; height: 15px; }
.placeholder-box {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--muted);
  text-align: center;
  padding: 26px 15px;
  font-size: 11.5px;
}
.placeholder-box .icon { width: 26px; height: 26px; color: var(--accent); opacity: 0.65; }
.placeholder-box strong { color: var(--muted-strong); font-size: 12.5px; }

/* Manage */
.manage-tabs {
  display: flex; gap: 4px; overflow-x: auto;
  padding-bottom: 3px; margin-bottom: 11px;
  scrollbar-width: none;
}
.manage-tabs::-webkit-scrollbar { display: none; }
.manage-tabs button {
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.manage-tabs button .icon { width: 14px; height: 14px; }
.manage-tabs button.active { background: var(--accent-soft); border-color: rgba(56, 189, 248, 0.35); color: var(--accent); }
.manage-panel { animation: fade 0.18s ease-out; }
.manage-panel > .panel-head { margin: 3px 2px 9px; }
.manage-list { display: flex; flex-direction: column; gap: 8px; }
.manage-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 11px 12px;
}
.manage-card-head { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.manage-card-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.manage-card-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--bg-elev-2); color: var(--muted-strong); }
.manage-card-icon .icon { width: 18px; height: 18px; }
.manage-card-title { min-width: 0; }
.manage-card-title strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manage-card-title span { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.manage-card-actions { display: flex; gap: 3px; flex: none; }
.manage-card-actions .icon-btn { width: 32px; height: 32px; }
.manage-card-actions .icon { width: 16px; height: 16px; }
.manage-card-foot { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag {
  font-size: 9.5px; color: var(--muted-strong);
  border: 1px solid var(--border-soft);
  background: var(--bg-elev-2);
  border-radius: 999px;
  padding: 2px 7px;
}
.tag.ok { color: #a7f3d0; background: var(--ok-soft); border-color: rgba(52, 211, 153, 0.25); }
.tag.warn { color: #fde68a; background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.25); }
.tag.bad { color: #fecdd3; background: var(--bad-soft); border-color: rgba(251, 113, 133, 0.25); }
.tag.info { color: #bae6fd; background: var(--accent-soft); border-color: rgba(56, 189, 248, 0.25); }
button.tag { font-family: inherit; cursor: pointer; }
button.tag:disabled { opacity: 0.55; }
.pool-bar { height: 5px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; margin-top: 9px; }
.pool-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0ea5e9, #34d399); min-width: 2px; }
.pool-facts { display: flex; gap: 12px; margin-top: 7px; font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.pool-facts b { color: var(--muted-strong); }

.settings-group {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 13px;
  margin-bottom: 9px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.settings-group h3 { font-size: 13px; }
.settings-group > p { color: var(--muted); font-size: 10.5px; margin-top: -6px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 3px 0;
}
.switch-row > span { display: flex; flex-direction: column; }
.switch-row strong { font-size: 12px; font-weight: 700; }
.switch-row small { color: var(--muted); font-size: 10px; line-height: 1.6; }
.switch {
  appearance: none; width: 43px; height: 24px; flex: none;
  border-radius: 999px; background: var(--bg-soft);
  border: 1px solid var(--border);
  position: relative; cursor: pointer;
  transition: 0.18s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--muted); transition: 0.18s;
}
.switch:checked { background: rgba(14, 165, 233, 0.35); border-color: var(--accent-strong); }
.switch:checked::after { transform: translateX(-19px); background: #e0f2fe; }
.info-line { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; padding: 4px 0; border-bottom: 1px dashed rgba(34, 48, 68, 0.55); }
.info-line:last-child { border-bottom: 0; }
.info-line span { color: var(--muted); }
.info-line b { font-weight: 700; text-align: left; direction: ltr; word-break: break-all; }
.notice {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--warn-soft);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fde68a;
  font-size: 11px;
}
.notice.info { background: var(--accent-soft); border-color: rgba(56, 189, 248, 0.25); color: #bae6fd; }
.notice .icon { width: 16px; height: 16px; margin-top: 1px; }

/* Sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(2, 5, 9, 0.68);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: backdrop 0.18s ease-out;
}
@keyframes backdrop { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 620px;
  max-height: 92dvh;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  animation: sheetUp 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -20px 55px rgba(0, 0, 0, 0.45);
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 16px 10px; }
.sheet-head h2 { font-size: 16px; }
.sheet-head p { color: var(--muted); font-size: 11px; }
.sheet-body { padding: 2px 16px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-soft);
  display: flex; gap: 8px; justify-content: flex-start;
  background: var(--bg-elev);
}
.sheet-foot .btn { flex: 1; }
.sheet-close { background: var(--bg-elev-2); border: 1px solid var(--border-soft); border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); flex: none; }
.sheet-form { display: flex; flex-direction: column; gap: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-grid .full { grid-column: 1 / -1; }
.pick-list { display: flex; flex-direction: column; gap: 7px; }
.pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
}
.pick-row input { width: 19px; height: 19px; accent-color: var(--accent); flex: none; }
.pick-row div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-row strong { font-size: 12px; }
.pick-row span { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-result {
  padding: 9px 11px; border-radius: 10px; font-size: 11px;
  background: var(--bg-elev-2); border: 1px solid var(--border-soft);
}
.test-result.ok { background: var(--ok-soft); border-color: rgba(52, 211, 153, 0.3); color: #a7f3d0; }
.test-result.bad { background: var(--bad-soft); border-color: rgba(251, 113, 133, 0.3); color: #fecdd3; }
.confirm-text { color: var(--muted-strong); font-size: 12.5px; line-height: 1.9; }

/* Toasts */
.toast-root {
  position: fixed; z-index: 100;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 12px; right: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: 520px; width: fit-content;
  display: flex; align-items: center; gap: 7px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(20, 28, 41, 0.97);
  border: 1px solid var(--border);
  color: var(--muted-strong);
  font-size: 11.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.2s ease-out;
}
.toast .icon { width: 16px; height: 16px; color: var(--ok); }
.toast.warn .icon { color: var(--warn); }
.toast.error .icon { color: var(--bad); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.install-banner {
  position: fixed; z-index: 45;
  left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom));
  max-width: 620px; margin: 0 auto;
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(15, 21, 31, 0.97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.install-banner p { flex: 1; font-size: 11px; color: var(--muted-strong); }

@media (min-width: 620px) {
  .live-grid { grid-template-columns: 1fr 1fr; }
  .filter-panel { grid-template-columns: 1fr 1fr auto; }
  .filter-panel .btn { grid-column: auto; }
  .views { padding-left: 20px; padding-right: 20px; }
}
@media (display-mode: standalone) {
  .install-banner { display: none; }
}
