/* ============================================================
   Phone Sex Club — Admin
   Moody crimson-and-black, utilitarian work tool. Mobile-first.
   ============================================================ */

/* The `hidden` attribute must always win over display rules below
   (e.g. .login-wrap's display:flex), or logged-in users keep seeing
   the login form above the dashboard. */
[hidden] { display: none !important; }

:root {
  --bg: #050308;
  --bg-soft: #0c070b;
  --panel: #120a10;
  --panel-2: #180c14;
  --line: rgba(189, 0, 61, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --crimson: #bd003d;
  --crimson-hot: #ff0052;
  --magenta: #ff0079;
  --plum: #502a50;
  --rose: #ba71a2;
  --champagne: #ecd0ec;
  --ink: #f4e9f2;
  --ink-dim: #b9a6b4;
  --ink-faint: #7d6b78;
  --green: #3ddc84;
  --yellow: #f5c542;
  --red: #ff4d6d;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --radius: 10px;
  --glow: 0 0 18px rgba(255, 0, 82, 0.35);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(189, 0, 61, 0.16), transparent 70%),
    radial-gradient(700px 380px at 100% 110%, rgba(126, 42, 83, 0.10), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  color: var(--champagne);
  letter-spacing: 0.02em;
  margin: 0 0 0.6em;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

a { color: var(--rose); }

/* ============ Buttons ============ */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: box-shadow 0.18s, background 0.18s, transform 0.05s;
  min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #d8004a, var(--crimson));
  border-color: rgba(255, 0, 82, 0.6);
  color: #fff;
  box-shadow: var(--glow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 26px rgba(255, 0, 82, 0.55); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-soft);
  color: var(--ink-dim);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--line); }

.btn-danger {
  background: rgba(189, 0, 61, 0.12);
  border-color: rgba(255, 77, 109, 0.5);
  color: var(--red);
}

.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.84rem; min-height: 38px; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }

/* ============ Login ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, rgba(24, 12, 20, 0.96), rgba(12, 7, 11, 0.96));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.5rem 1.5rem;
  box-shadow: 0 0 60px rgba(189, 0, 61, 0.18), 0 24px 60px rgba(0, 0, 0, 0.6);
}
.login-brand { text-align: center; margin-bottom: 1.4rem; }
.login-logo {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.6rem;
  color: var(--champagne);
  text-shadow: 0 0 24px rgba(255, 0, 121, 0.6);
  letter-spacing: 0.06em;
}
.login-sub { color: var(--ink-dim); font-size: 0.86rem; margin: 0.2rem 0 0; }
.login-error {
  color: #ffb3c1;
  background: rgba(189, 0, 61, 0.16);
  border: 1px solid rgba(255, 77, 109, 0.45);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  margin: 0 0 0.8rem;
}
.login-hint {
  color: var(--ink-faint);
  font-size: 0.78rem;
  text-align: center;
  margin: 0.9rem 0 0;
}
.login-back {
  display: block;
  text-align: center;
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  text-decoration: none;
}
.login-back:hover { color: var(--rose); }

/* ============ App shell ============ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 3, 8, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.7rem 1rem 0.4rem;
}
.app-brand { display: flex; align-items: center; gap: 0.6rem; }
.app-logo {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--champagne);
  text-shadow: 0 0 16px rgba(255, 0, 121, 0.55);
}
.app-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.4rem 1rem 0.7rem;
}
.tab {
  flex: 1;
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.6rem 0.25rem;
  cursor: pointer;
  min-height: 44px;
}
.tab.is-active {
  color: var(--champagne);
  border-bottom-color: var(--crimson-hot);
  text-shadow: 0 0 12px rgba(255, 0, 121, 0.5);
}

.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.panel-head h2 { margin: 0; }

/* ============ Cards (lists) ============ */
.cards { display: grid; gap: 0.85rem; }
@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 0.9rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.card.is-archived { opacity: 0.62; border-style: dashed; }

.card-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #1c0f18;
  border: 1px solid var(--line-soft);
}
.card-thumb--none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 1.3rem;
}

.card-body { flex: 1; min-width: 0; }
.card-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--champagne);
  margin: 0 0 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta {
  color: var(--ink-dim);
  font-size: 0.82rem;
  margin: 0 0 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

/* Status pills */
.pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid;
  margin-right: 0.4rem;
}
.pill--available { color: #8ff0b3; border-color: rgba(61, 220, 132, 0.55); background: rgba(61, 220, 132, 0.1); box-shadow: 0 0 12px rgba(61, 220, 132, 0.18); }
.pill--busy { color: #ffe08a; border-color: rgba(245, 197, 66, 0.55); background: rgba(245, 197, 66, 0.08); }
.pill--unavailable { color: #ff9db0; border-color: rgba(255, 77, 109, 0.55); background: rgba(255, 77, 109, 0.08); }
.pill--archived { color: var(--ink-faint); border-color: var(--line-soft); background: rgba(255,255,255,0.03); }

/* Availability quick toggle */
.avail-toggle {
  display: inline-flex;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.55rem;
}
.avail-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  min-height: 36px;
}
.avail-toggle button + button { border-left: 1px solid var(--line-soft); }
.avail-toggle button[data-status="available"].is-on { background: rgba(61, 220, 132, 0.18); color: #8ff0b3; }
.avail-toggle button[data-status="busy"].is-on { background: rgba(245, 197, 66, 0.16); color: #ffe08a; }
.avail-toggle button[data-status="unavailable"].is-on { background: rgba(255, 77, 109, 0.16); color: #ff9db0; }

.empty-note {
  color: var(--ink-faint);
  font-style: italic;
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius);
}
/* Terminal — embedded payment terminal, admin only */
.terminal-wrap {
  margin: -0.5rem -0.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: #fff;
}
#terminal-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 560px;
  border: 0;
}
@media (max-width: 640px) {
  #terminal-frame {
    height: calc(100dvh - 190px);
    min-height: 520px;
  }
}

/* Payroll */
.panel-head-actions { display: flex; gap: 0.6rem; }
.payroll-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.4rem; }
.payroll-total {
  text-align: center; padding: 1.2rem; border-radius: var(--radius);
  border: 1px solid var(--line-soft); background: var(--card-bg, #fff);
}
.payroll-total .num { display: block; font-size: 1.6rem; font-weight: 800; }
.payroll-total .lbl { font-size: 0.78rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.1em; }
.payroll-card { padding: 1.1rem 1.3rem; }
.payroll-close { margin-top: 1.8rem; text-align: center; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); }
.payroll-calls, .customer-history { margin-top: 1rem; border-top: 1px solid var(--line-soft); padding-top: 0.8rem; }
.payroll-call-row {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.5rem 0; border-bottom: 1px dashed var(--line-soft); font-size: 0.88rem;
}
.payroll-call-row:last-child { border-bottom: none; }
.customer-pick { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.pick-btn {
  text-align: left; padding: 0.6rem 0.8rem; border-radius: var(--radius);
  border: 1px solid var(--line-soft); background: var(--card-bg, #fff); cursor: pointer; font-size: 0.9rem;
}
.pick-btn:hover { border-color: var(--accent, #c9a0c9); }

/* Customers */
.customer-search-row { margin-bottom: 1.2rem; }
.customer-search-row input { width: 100%; max-width: 28rem; }
.customer-card { padding: 1.1rem 1.3rem; }
.customer-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.customer-head .card-name { margin: 0; }
.customer-credit { font-size: 0.82rem; font-weight: 700; padding: 0.3rem 0.8rem; border-radius: 999px; background: rgba(128, 128, 128, 0.12); color: var(--ink-faint); }
.customer-credit.has-credit { background: rgba(46, 204, 113, 0.14); color: #1e7e46; border: 1px solid rgba(46, 204, 113, 0.45); }
.customer-notes { font-size: 0.88rem; color: var(--ink-faint); font-style: italic; margin: 0.4rem 0 0; }
.credit-display { font-size: 1.3rem; font-weight: 700; padding: 0.5rem 0; }
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative; width: 100%; max-width: 34rem; max-height: 92vh; overflow-y: auto;
  background: var(--card-bg, #fff); border-radius: var(--radius);
  padding: 1.8rem 1.6rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.modal-card--sm { max-width: 22rem; }
.modal-card h3 { margin: 0 0 1.2rem; }
.modal-close {
  position: absolute; top: 0.8rem; right: 1rem;
  background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-faint);
}
.modal-actions { display: flex; gap: 0.7rem; margin-top: 1.2rem; flex-wrap: wrap; }
.form-grid { display: grid; gap: 0.9rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* Dispatch board — dead-simple availability switching */
.dispatch-list { display: flex; flex-direction: column; gap: 0.7rem; }
.dispatch-row {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.7rem 0.9rem; border-radius: var(--radius);
  background: var(--card-bg, #fff); border: 1px solid var(--line-soft);
}
.dispatch-thumb { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.dispatch-thumb--none {
  display: flex; align-items: center; justify-content: center;
  background: #2a1a2e; color: #c9a0c9; font-size: 0.7rem; font-weight: 700;
}
.dispatch-name { font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-btns { display: flex; gap: 0.45rem; flex-shrink: 0; }
.dispatch-btn {
  padding: 0.65rem 1rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700;
  border: 2px solid; background: transparent; cursor: pointer; opacity: 0.45;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.dispatch-btn:active { transform: scale(0.96); }
.dispatch-btn--available { color: #1e7e46; border-color: #2ecc71; }
.dispatch-btn--busy { color: #8a6d1f; border-color: #f1c40f; }
.dispatch-btn--unavailable { color: #a0233f; border-color: #ff0052; }
.dispatch-btn.is-on { opacity: 1; color: #fff; }
.dispatch-btn--available.is-on { background: #2ecc71; box-shadow: 0 0 14px rgba(46, 204, 113, 0.5); }
.dispatch-btn--busy.is-on { background: #f1c40f; box-shadow: 0 0 14px rgba(241, 196, 15, 0.5); }
.dispatch-btn--unavailable.is-on { background: #ff0052; box-shadow: 0 0 14px rgba(255, 0, 82, 0.5); }
@media (max-width: 560px) {
  .dispatch-row { flex-wrap: wrap; }
  .dispatch-btns { width: 100%; }
  .dispatch-btn { flex: 1; padding: 0.7rem 0.4rem; }
}

.panel-note { color: var(--ink-faint); font-size: 0.88rem; margin: 0 0 1.2rem; }
#reviews-operator-filter { max-width: 16rem; }
.review-admin-card { padding: 1.2rem 1.4rem; }
.review-admin-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.review-admin-stars { color: #e8a33d; letter-spacing: 0.12em; }
.badge { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.28rem 0.7rem; border-radius: 999px; }
.badge-pending { color: #8a6d1f; background: rgba(241, 196, 15, 0.16); border: 1px solid rgba(241, 196, 15, 0.5); }
.badge-live { color: #1e7e46; background: rgba(46, 204, 113, 0.14); border: 1px solid rgba(46, 204, 113, 0.5); }
.review-admin-text { font-style: italic; margin: 0 0 0.5rem; }
.review-admin-meta { color: var(--ink-faint); font-size: 0.85rem; margin: 0 0 1rem; }
.review-admin-actions { display: flex; gap: 0.6rem; }

/* ============ Forms ============ */
.form-card, .modal-form {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.field { margin-bottom: 1rem; }
.field > label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.35rem;
}
.field-note {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 0.35rem 0 0;
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  min-height: 44px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--crimson-hot);
  box-shadow: 0 0 0 2px rgba(255, 0, 82, 0.25);
}
.field textarea { min-height: 96px; resize: vertical; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--rose) 50%),
    linear-gradient(135deg, var(--rose) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field input[type="file"] {
  width: 100%;
  color: var(--ink-dim);
  font-size: 0.9rem;
}
.form-divider {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 1.5rem 0;
}
.form-subhead { margin-bottom: 0.8rem; }

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 1, 3, 0.82);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 0;
}
@media (min-width: 720px) {
  .modal-backdrop { padding: 2rem 1rem; display: flex; justify-content: center; align-items: flex-start; }
}
.modal {
  background: linear-gradient(180deg, #160b13, #0b060a);
  border: 1px solid var(--line);
  width: 100%;
  max-width: 760px;
  min-height: 100%;
  margin: 0 auto;
  padding: 1.1rem 1.1rem 2rem;
}
@media (min-width: 720px) {
  .modal { min-height: 0; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 60px rgba(189,0,61,0.15); }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #160b13 78%, transparent);
  padding: 0.4rem 0 0.8rem;
  z-index: 2;
}
.modal-head h2 { margin: 0; }
.modal-close {
  appearance: none;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink-dim);
  font-size: 1.2rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  flex: 0 0 auto;
}
.modal-close:hover { color: var(--ink); border-color: var(--line); }

/* Preview images / audio */
.preview-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  margin-top: 0.5rem;
  object-fit: contain;
  background: #0a0509;
}
.preview-audio { width: 100%; margin-top: 0.5rem; }

/* Gallery manager */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.gallery-item {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #0a0509;
}
.gallery-item img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
}
.gallery-item .g-controls {
  display: flex;
  border-top: 1px solid var(--line-soft);
}
.gallery-item .g-controls button {
  flex: 1;
  appearance: none;
  border: none;
  background: rgba(0,0,0,0.55);
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1;
  padding: 0.55rem 0;
  cursor: pointer;
  min-height: 40px;
}
.gallery-item .g-controls button:hover { color: var(--champagne); }
.gallery-item .g-controls button.g-remove { color: var(--red); }
.gallery-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0,0,0,0.65);
  color: var(--champagne);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}

/* Schedule builder */
.sched-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sched-row:last-of-type { border-bottom: none; }
.sched-day { width: 92px; flex: 0 0 92px; font-weight: 600; font-size: 0.92rem; }
.sched-row input[type="text"] {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.95rem;
  padding: 0.55rem 0.65rem;
  min-height: 42px;
  min-width: 0;
}
.sched-row input[type="text"]:disabled { opacity: 0.35; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.switch .track::before {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; top: 3px;
  background: var(--ink-dim);
  border-radius: 50%;
  transition: transform 0.18s, background 0.18s;
}
.switch input:checked + .track { background: rgba(189,0,61,0.45); border-color: var(--crimson-hot); }
.switch input:checked + .track::before { transform: translateX(22px); background: #fff; box-shadow: 0 0 10px rgba(255,0,82,0.7); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 2px rgba(255,0,82,0.4); }

/* Progress bar */
.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-top: 0.75rem;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--crimson), var(--crimson-hot), var(--magenta));
  box-shadow: 0 0 12px rgba(255,0,82,0.6);
  transition: width 0.15s;
}
.progress-label { font-size: 0.8rem; color: var(--ink-dim); margin-top: 0.35rem; }

/* ============ Toasts ============ */
.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 420px);
}
.toast {
  background: rgba(18, 10, 16, 0.97);
  border: 1px solid var(--line);
  border-left: 4px solid var(--crimson-hot);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6), var(--glow);
  animation: toast-in 0.22s ease-out;
}
.toast--success { border-left-color: var(--green); }
.toast--error { border-left-color: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Confirm dialog ============ */
.confirm-box {
  background: linear-gradient(180deg, #160b13, #0b060a);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.25rem;
  max-width: 420px;
  width: calc(100vw - 2.5rem);
  margin: 18vh auto 0;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), var(--glow);
}
.confirm-box h3 { margin-top: 0; }
.confirm-box p { color: var(--ink-dim); font-size: 0.92rem; }
.confirm-box .btn-row { justify-content: flex-end; }

/* Utility */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.loading-note { color: var(--ink-faint); font-style: italic; padding: 1rem 0; text-align: center; }
