/* MorphCam Admin — design system (docs/ADMIN-REDESIGN-PLAN.md section 8).
   Tokens follow the website (css/styles.css) and the app (theme.ts). */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0b1118;
  --bg-2: #0f1720;
  --surface: #141f2b;
  --surface-2: #1a2735;
  --surface-3: #223244;
  --border: #213040;
  --border-2: #2d4055;
  --text: #f5f8fc;
  --text-2: #b9c6d4;
  --text-3: #8c9db1;
  --accent: #00b4d8;
  --accent-hover: #22c5e8;
  --accent-text: #2cc6e8;
  --accent-ink: #04252c;
  --accent-soft: rgba(0, 180, 216, 0.14);
  --accent-line: rgba(0, 180, 216, 0.45);
  --glow: rgba(0, 180, 216, 0.22);
  --glow-2: rgba(59, 130, 246, 0.16);
  --ok: #34d399;   --ok-soft: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, 0.14);
  --hold: #fb923c; --hold-soft: rgba(251, 146, 60, 0.15);
  --bad: #f87171;  --bad-soft: rgba(248, 113, 113, 0.14);
  --info: #60a5fa; --info-soft: rgba(96, 165, 250, 0.14);
  --violet: #a78bfa; --violet-soft: rgba(167, 139, 250, 0.15);
  --muted-soft: rgba(148, 163, 184, 0.13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, 0.75);
  --card-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --side-w: 264px;
  --top-h: 64px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root[data-theme-resolved="light"] {
  color-scheme: light;
  --bg: #f6f9fc;
  --bg-2: #eef3f8;
  --surface: #ffffff;
  --surface-2: #f3f6fa;
  --surface-3: #e7edf4;
  --border: #e2e8f0;
  --border-2: #cfd8e3;
  --text: #0b1626;
  --text-2: #3f4d61;
  --text-3: #5c6b80;
  --accent-text: #036a8c;
  --accent-soft: rgba(0, 180, 216, 0.11);
  --accent-line: rgba(3, 106, 140, 0.35);
  --glow: rgba(0, 180, 216, 0.14);
  --glow-2: rgba(99, 102, 241, 0.08);
  --ok: #047857;   --ok-soft: rgba(16, 185, 129, 0.12);
  --warn: #92400e; --warn-soft: rgba(245, 158, 11, 0.14);
  --hold: #9a3412; --hold-soft: rgba(249, 115, 22, 0.13);
  --bad: #b91c1c;  --bad-soft: rgba(239, 68, 68, 0.11);
  --info: #1d4ed8; --info-soft: rgba(59, 130, 246, 0.11);
  --violet: #6d28d9; --violet-soft: rgba(139, 92, 246, 0.12);
  --muted-soft: rgba(100, 116, 139, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px -16px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 30px 80px -28px rgba(15, 23, 42, 0.28);
  --card-grad: none;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background:
    radial-gradient(900px 480px at 85% -10%, var(--glow), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
.ic { flex-shrink: 0; display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.rise { animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- shell ---------- */
.shell {
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh;
  /* The sidebar's colour runs the full page height, however long the page is. */
  background: linear-gradient(to right, color-mix(in srgb, var(--bg-2) 82%, transparent) var(--side-w), transparent var(--side-w));
}
.side {
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 6px 18px -6px var(--glow); }
.brand b { display: block; font-size: 15px; letter-spacing: -0.01em; }
.brand small { display: block; font-size: 10.5px; letter-spacing: 0.12em; color: var(--text-3); font-weight: 600; }
.nav-group-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px;
  padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; text-align: left;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item[aria-current="page"] .ic { color: var(--accent-text); }
.nav-item .count { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.top.scrolled { border-bottom-color: var(--border); }
.search-trigger {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 520px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text-3);
  box-shadow: var(--shadow-sm); transition: border-color 0.18s, box-shadow 0.18s;
}
.search-trigger:hover { border-color: var(--border-2); }
.search-trigger > span:not(.kbd) { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-2); color: var(--text-3); background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2);
  transition: background 0.18s, color 0.18s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, var(--accent), #3b82f6); color: #fff;
}
.content { padding: 8px 28px 48px; width: 100%; max-width: 1280px; margin: 0 auto; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 640px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--accent-text); letter-spacing: 0.02em; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.purpose { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--border-2); color: var(--text-2); margin-bottom: 20px; }

/* ---------- cards ---------- */
.card {
  position: relative; background: var(--card-grad), var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-title { white-space: nowrap; }
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--text-3); }
.card-sub { font-size: 12.5px; color: var(--text-3); }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.section-gap { margin-top: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 11px; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: transform 0.12s var(--ease), background 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--glow); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--border-2); background: var(--surface-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; min-height: 46px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.link-btn { color: var(--accent-text); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--muted-soft); color: var(--text-2);
}
.badge .ic { width: 13px; height: 13px; }
.b-wait { background: var(--warn-soft); color: var(--warn); }
.b-confirm { background: var(--accent-soft); color: var(--accent-text); }
.b-hold { background: var(--hold-soft); color: var(--hold); }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-over { background: var(--violet-soft); color: var(--violet); }
.b-grey { background: var(--muted-soft); color: var(--text-3); }
.b-support { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 11.5px; font-weight: 700; background: var(--accent); color: var(--accent-ink);
}
.count.warn { background: var(--warn); color: #241a03; }
.count.bad { background: var(--bad); color: #fff; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: 260px; padding: 8px 10px; border-radius: 9px; background: var(--text); color: var(--bg);
  font-size: 12px; font-weight: 500; line-height: 1.4; white-space: normal; z-index: 50; box-shadow: var(--shadow-md);
  animation: fade 0.15s both; pointer-events: none;
}

/* ---------- skeleton / empty / error ---------- */
.skel {
  border-radius: 8px; min-height: 14px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%);
  background-size: 800px 100%; animation: shimmer 1.3s linear infinite;
}
.empty { text-align: center; padding: 34px 20px 30px; color: var(--text-2); }
.empty svg.art { width: 168px; height: auto; margin: 0 auto 14px; display: block; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; letter-spacing: -0.01em; }
.err { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: var(--text-2); }

/* ---------- Today ---------- */
.hello { padding: 22px 0 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hello h1 { font-size: 30px; letter-spacing: -0.025em; line-height: 1.15; font-weight: 700; }
.hello h1 .wave { display: inline-block; }
.hello .date { color: var(--text-3); font-weight: 500; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.hello .summary { color: var(--text-2); margin-top: 8px; font-size: 15px; }
.hello .summary b { color: var(--text); }
.queue-list { display: flex; flex-direction: column; }
.q-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--border); transition: background 0.18s;
}
.q-item:first-child { border-top: 0; }
.q-item:hover { background: var(--surface-2); }
.q-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.q-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-sub { color: var(--text-3); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-people { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); max-width: 100%; }
.chip b { color: var(--text); font-weight: 600; }
.kpi { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 4px; min-height: 148px; overflow: hidden; }
.kpi-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin-top: 4px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin-top: auto; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 2px 7px; border-radius: 999px; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--text-3); background: var(--muted-soft); }
.spark { width: 100%; height: 44px; margin-top: 6px; display: block; overflow: visible; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; display: inline-block; }
.gauge-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: center; padding: 6px 20px 20px; }
.gauge-num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.gauge-legend { display: grid; gap: 8px; max-width: 440px; }
#kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.gauge-legend div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); }
.gauge-legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.state-line { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.chart-box { padding: 8px 20px 18px; }
.chart-top { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.chart-top::after { content: "highest day"; opacity: .75; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.chart-tip { position: absolute; pointer-events: none; padding: 6px 9px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; transform: translate(-50%, -120%); white-space: nowrap; box-shadow: var(--shadow-md); opacity: 0; transition: opacity 0.12s; }
.streamers { display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 18px; }
.streamer { display: flex; align-items: center; gap: 10px; }
.streamer .mini-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.streamer .who { flex: 1; min-width: 0; }
.streamer .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(600px 400px at 20% 10%, rgba(0, 180, 216, 0.35), transparent 60%),
    radial-gradient(520px 420px at 90% 90%, rgba(59, 130, 246, 0.28), transparent 60%),
    linear-gradient(160deg, #0c1a26, #081018);
  color: #f5f8fc;
}
.auth-art h2 { font-size: 34px; line-height: 1.15; letter-spacing: -0.03em; max-width: 440px; }
.auth-art p { color: #b9c6d4; max-width: 420px; margin-top: 12px; font-size: 15px; }
.auth-art .orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: 0.55; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; animation: rise 0.5s var(--ease) both; }
.auth-card h1 { font-size: 24px; letter-spacing: -0.02em; margin: 18px 0 6px; }
.auth-card .lead { color: var(--text-2); margin-bottom: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); font-size: 16px; transition: border-color 0.18s, box-shadow 0.18s;
}
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.code { letter-spacing: 0.35em; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.form-error { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.codes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; margin-bottom: 14px; }
.steps { display: flex; gap: 6px; margin-bottom: 4px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--surface-3); }
.steps i.on { background: var(--accent); }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(4, 8, 12, 0.55); backdrop-filter: blur(4px); animation: fade 0.18s both; }
.sheet {
  position: fixed; z-index: 81; top: 0; right: 0; bottom: 0; width: min(520px, 100%);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide-in 0.25s var(--ease) both;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { font-size: 17px; letter-spacing: -0.01em; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px; }
.sheet-actions { display: flex; gap: 10px; padding: 14px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); }
.sheet-actions .btn { flex: 1; }
.palette {
  position: fixed; z-index: 90; top: 12vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100% - 24px));
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: rise 0.2s var(--ease) both;
}
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette-input input { flex: 1; height: 56px; border: 0; background: transparent; font-size: 16px; outline: 0; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.pal-group { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 10px; text-align: left; color: var(--text-2); }
.pal-item b { color: var(--text); font-weight: 600; }
.pal-item[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.pal-item .hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.pal-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100% - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; background: var(--surface);
  border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); animation: rise 0.25s var(--ease) both; font-weight: 500;
}
.toast.ok .ic { color: var(--ok); } .toast.bad .ic { color: var(--bad); } .toast.info .ic { color: var(--accent-text); }
.toast .t-body { flex: 1; }
.toast .t-act { font-weight: 700; color: var(--accent-text); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 230px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow-lg); animation: rise 0.16s var(--ease) both;
}
.menu-pop .who { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-pop .who b { display: block; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; color: var(--text-2); text-align: left; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-2); color: var(--text); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 4px 0; border-radius: 10px; background: var(--surface-2); }
.seg button { justify-content: center; padding: 7px 0; font-size: 12px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gauge-wrap { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 0 14px; height: 58px; }
  .top .search-trigger { display: none; }
  .top .brand-mini { display: flex; }
  .content { padding: 0 16px calc(var(--tab-h) + var(--safe-b) + 40px); }
  html { scroll-padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .hello h1 { font-size: 25px; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px) saturate(1.3);
    border-top: 1px solid var(--border);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); position: relative; }
  .tab[aria-current="page"] { color: var(--accent-text); }
  .tab .count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; }
  .q-item { grid-template-columns: 36px minmax(0, 1fr); padding: 14px 16px; }
  .q-item .q-act { grid-column: 1 / -1; }
  .q-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .q-item .q-act .btn { width: 100%; min-height: 44px; }
  .q-icon { width: 36px; height: 36px; border-radius: 10px; }
  .gauge-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .gauge-legend { width: 100%; }
  .sheet { top: auto; left: 0; width: 100%; max-height: 92vh; border-left: 0; border-top: 1px solid var(--border); border-radius: 22px 22px 0 0; animation: sheet-up 0.28s var(--ease) both; }
  .sheet::before { content: ""; width: 40px; height: 5px; border-radius: 5px; background: var(--border-2); margin: 8px auto 0; }
  .palette { top: 8px; border-radius: 18px; }
  .toasts { left: 16px; right: 16px; width: auto; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-panel { align-items: start; padding-top: 48px; }
  .kpi-value { font-size: 24px; }
}
@media (min-width: 901px) { .brand-mini { display: none !important; } }
@media (max-width: 420px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .kpi { padding: 14px 14px 12px; min-height: 132px; } .kpi-value { font-size: 21px; } }
.spin { animation: spin 0.9s linear infinite; }
.nav-item > span:first-of-type { flex: 1; }
@media (max-width: 900px) { #kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* ---------- phase 2: lists (rows on desktop, cards on phones) ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 38px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--text-2); white-space: nowrap; flex: 1 0 auto; justify-content: center; }
.tab-btn:hover { color: var(--text); }
.tab-btn[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-btn .count { height: 20px; min-width: 20px; font-size: 11px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .input { height: 40px; font-size: 14px; width: auto; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box .input { padding-left: 38px; width: 100%; }
select.input { padding-right: 34px; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.chip-btn b { color: var(--text); font-variant-numeric: tabular-nums; }
.chip-btn:hover { border-color: var(--border-2); }
.chip-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.chip-btn[aria-pressed="true"] b { color: var(--accent-text); }
.chip-btn.zero { opacity: .55; }
.list { display: flex; flex-direction: column; }
.row { display: grid; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); cursor: pointer; transition: background .15s; text-align: left; width: 100%; color: inherit; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row .who { min-width: 0; }
.row .who > b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .who > span:not(.tags) { display: block; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .money { font-weight: 700; font-variant-numeric: tabular-nums; }
.row .money small { display: block; font-weight: 500; font-size: 12px; color: var(--text-3); }
.row .sub { font-size: 12.5px; color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.row .chev { color: var(--text-3); justify-self: end; }
.cols-manual { grid-template-columns: minmax(170px, 1.5fr) 120px minmax(110px, 1fr) minmax(130px, 1.1fr) 100px 20px; }
.cols-done { grid-template-columns: 22px minmax(170px, 1.4fr) 110px minmax(100px, .8fr) minmax(170px, 1.2fr) 20px; }
.cols-auto { grid-template-columns: minmax(170px, 1.5fr) 110px minmax(150px, 1.1fr) minmax(130px, 1fr) 20px; }
.cols-unmatched { grid-template-columns: 110px minmax(120px, 1fr) minmax(160px, 1.3fr) minmax(130px, 1fr) 20px; }
.cb { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.list-head { display: grid; gap: 14px; padding: 12px 18px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); align-items: center; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; align-items: center; }
.bulkbar { position: sticky; bottom: 16px; z-index: 15; display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); animation: rise .2s var(--ease) both; flex-wrap: wrap; }
.bulkbar .grow { flex: 1; font-weight: 600; }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); margin-bottom: 14px; border: 1px solid; flex-wrap: wrap; }
.banner.hold { background: var(--hold-soft); border-color: color-mix(in srgb, var(--hold) 35%, transparent); }
.banner.hold > .ic { color: var(--hold); }
.banner .grow { flex: 1; min-width: 200px; font-size: 13.5px; color: var(--text-2); }
.banner .grow b { color: var(--text); display: block; font-size: 14px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 18px; font-size: 13.5px; }
.facts dt { color: var(--text-3); }
.facts dd { color: var(--text); min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.copy-btn { width: 28px; height: 28px; flex: none; }
.sheet-section { margin-top: 24px; }
.sheet-section h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 10px; font-weight: 600; }
.sheet-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px; border-radius: var(--r-md); background: var(--card-grad), var(--surface-2); border: 1px solid var(--border); }
.hero-amount { font-size: 32px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.proof { margin-top: 4px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; background: var(--surface-2); min-height: 120px; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }
.proof img { width: 100%; display: block; max-height: 460px; object-fit: contain; background: #000; cursor: zoom-in; }
.tl { display: grid; }
.tl-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); margin-top: 3px; }
.tl-item b { font-size: 13.5px; }
.tl-item .when { font-size: 12px; color: var(--text-3); }
.tl-item .kv { display: inline-block; margin: 4px 10px 0 0; font-size: 12px; color: var(--text-2); }
.textarea { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; resize: vertical; }
.textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.notice > .ic { color: var(--accent-text); margin-top: 2px; flex: none; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.warn > .ic { color: var(--warn); }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 6px 0 10px; cursor: pointer; }
.stack { display: grid; gap: 14px; }
.sheet-actions.wrap { flex-wrap: wrap; }
.sheet-actions .btn { flex: 1 1 auto; }
.btn-ghost-bad { color: var(--bad); }

@media (max-width: 900px) {
  .list-head { display: none; }
  .row, .cols-manual, .cols-done, .cols-auto, .cols-unmatched { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; }
  .row.has-cb { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .row.has-cb > .c-full { grid-column: 2 / -1; }
  .row > .c-hide { display: none; }
  .row > .c-full { grid-column: 1 / -1; }
  .row .chev { display: none; }
  .bulkbar { bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }
  .toolbar .search-box { flex: 1 1 180px; min-width: 0; }
  .tab-btn > .ic { display: none; }
  .tabs .tab-btn { padding: 0 10px; flex: 1 0 auto; }
  .toolbar select.input { flex: 1; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .tab-btn { padding: 0 12px; }
}

.confirm-line { line-height: 1.55; }
:root[data-theme-resolved="light"] .count.warn { color: #fff; }
@media (min-width: 901px) { .toolbar select.input { max-width: 280px; } }
.health { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; font-size: 12.5px; color: var(--text-2); }
.health:empty { display: none; }
.h-item { display: inline-flex; align-items: center; gap: 7px; }
.h-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.h-ok i { background: var(--ok); }
.h-bad { color: var(--bad); font-weight: 600; }
.h-bad i { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

/* ---------- phase 2 polish ---------- */
.t-short, .ph-only { display: none; }
.date-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.row-cta { display: none; align-items: center; justify-content: space-between; margin-top: 6px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 13px; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; animation: rise .18s var(--ease) both; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(10px) 16px; padding-top: max(10px, env(safe-area-inset-top)); color: #cbd5e1; font-size: 13px; }
.lb-bar span { flex: 1; }
.lb-bar .icon-btn { color: #fff; }
.lb-stage { flex: 1; overflow: auto; display: grid; place-items: center; touch-action: pan-x pan-y pinch-zoom; padding-bottom: env(safe-area-inset-bottom); }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.lb-stage img.zoomed { max-width: none; max-height: none; width: 250%; cursor: zoom-out; place-self: start; }

@media (max-width: 900px) {
  .ph-only { display: inline; }
  .row-cta { display: flex; }
  #aCounts { display: none; }
  .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .tabs .tab-btn { padding: 0 4px; gap: 5px; font-size: 13px; min-width: 0; }
  .tabs .t-long { display: none; }
  .tabs .t-short { display: inline; }
  .tabs .tab-btn .count { height: 18px; min-width: 18px; font-size: 10.5px; padding: 0 5px; }
  .sheet { max-height: 92dvh; }
  .sheet-body { padding-bottom: 48px; }
  .sheet-actions.wrap .btn-primary { flex-basis: 100%; }
  .sheet-actions.wrap .btn-danger { flex: 0 1 auto; margin-left: auto; }
  .date-field { flex: 1; }
  .date-field .input { flex: 1; min-width: 0; }
}
@media (max-width: 360px) {
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs .tab-btn { min-height: 36px; }
}
@media (max-width: 900px) {
  .sheet-actions.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sheet-actions.wrap .btn { min-height: 44px; padding: 6px 10px; font-size: 14px; white-space: normal; line-height: 1.2; margin: 0; }
  .sheet-actions.wrap .btn-primary { grid-column: 1 / -1; }
  .sheet-actions.wrap .btn-danger { grid-column: auto; }
}
.tl-item .kv { color: var(--text-3); } .tl-item .kv b { font-weight: 500; }

/* ---------- phase 3: customers ---------- */
.ic.flip { transform: rotate(180deg); }
.who-av { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cols-users { grid-template-columns: minmax(220px, 1.6fr) 100px minmax(150px, 1.1fr) 110px 130px 20px; }
.cols-live { grid-template-columns: minmax(220px, 1.6fr) 110px 120px 110px 20px; }
.cols-tx { grid-template-columns: minmax(200px, 1.6fr) 110px 120px 170px; }
.row.static { cursor: default; }
.row.static:hover { background: transparent; }
.row .money.neg { color: var(--text-2); }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cu-head { display: flex; gap: 18px; align-items: center; padding: 18px 0 16px; }
.cu-head h1 { font-size: 26px; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.cu-av { width: 64px; height: 64px; font-size: 24px; flex: none; }
.cu-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-2); font-size: 14px; margin-top: 4px; }
.cu-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
@media (max-width: 900px) {
  .cols-users, .cols-live, .cols-tx { grid-template-columns: minmax(0, 1fr) auto; }
  .row-acts { justify-content: flex-start; }
  .cu-head { gap: 14px; }
  .cu-av { width: 52px; height: 52px; font-size: 20px; }
  .cu-head h1 { font-size: 22px; }
  .cu-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cu-actions .btn-primary { grid-column: 1 / -1; }
  .cols-tx .sub:last-child { grid-column: 1 / -1; }
}
.cu-meta { color: var(--text-3); font-size: 13px; margin-top: 2px; }
@media (max-width: 900px) { .cu-head { align-items: flex-start; } }

/* ---------- phase 3 polish ---------- */
.appr { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em; background: var(--hold-soft); color: var(--hold); white-space: nowrap; }
.upd-pill { display: inline-flex; align-items: center; gap: 8px; }
.upd-pill .live-dot { flex: none; }
.kpi-wait { color: var(--warn); font-weight: 600; }
.live-line { font-size: 12.5px; }
@media (max-width: 900px) {
  .ph-only.c-full { display: block; }
  .row-acts { gap: 12px; }
  .row-acts .row-acts-far { margin-left: auto; }
}
@media (max-width: 520px) {
  .toolbar .search-box { flex-basis: 100%; }
}

/* ---------- phase 4: growth ---------- */
.cols-g { grid-template-columns: minmax(200px, 1.6fr) repeat(var(--n, 3), minmax(90px, 1fr)) 20px; }
.cols-g.has-acts { grid-template-columns: minmax(200px, 1.6fr) repeat(var(--n, 2), minmax(90px, 1fr)) 250px; }
.flag-detail { grid-column: 1 / -1; white-space: normal !important; overflow-wrap: anywhere; }
.neg-money { color: var(--bad); font-weight: 700; }
.tabs-wrap { flex-wrap: wrap; }
.tabs-wrap .tab-btn { flex: 1 0 auto; }
.section-pick { display: none; }
.mini-list { display: grid; }
.mini-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.mini-row:first-child { border-top: 0; }
.app-card { padding: 18px; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.app-card:first-child { border-top: 0; }
.app-note { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.app-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-btns { display: flex; gap: 10px; }
.set-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 22px 0 10px; font-weight: 600; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.export-btn { justify-content: flex-start; min-height: 52px; }
.export-btn span { flex: 1; text-align: left; }
@media (max-width: 900px) {
  .cols-g, .cols-g.has-acts { grid-template-columns: minmax(0, 1fr) auto; }
  .tabs-wrap { display: none; }
  .section-pick { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-weight: 600; color: var(--text-2); font-size: 13px; }
  .section-pick select { flex: 1; }
  .app-btns { width: 100%; }
  .app-btns .btn { flex: 1; }
  .app-btns .btn-primary { order: -1; }
}
.app-card .who b { display: block; font-weight: 600; }
.app-card .who span { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
@media (max-width: 900px) {
  #gKpis { gap: 10px; }
  #gKpis .kpi { min-height: 0; padding: 12px 14px; }
  #gKpis .kpi-value { font-size: 20px; }
  #gKpis .kpi-foot { display: none; }
  .section-pick { margin: 0 0 14px; }
}
@media (max-width: 900px) { #gBody { margin-top: 16px; } }

/* ---------- phase 4 polish ---------- */
.row .who.wrap > span:not(.tags) { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.set-wide { grid-column: 1 / -1; }
.set-wide select { max-width: 560px; }
.change-list { display: grid; gap: 8px; }
.change-list > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.change-list span { color: var(--text-2); overflow-wrap: anywhere; }
.flag-row { grid-template-columns: minmax(200px, 1.6fr) minmax(160px, 1.4fr) 140px; }
.flag-row .flag-acts { grid-column: 1 / -1; justify-content: flex-start; }
@media (max-width: 900px) {
  .flag-row { grid-template-columns: minmax(0, 1fr) auto; }
  .app-btns .btn-primary { order: 0; }
}
.row .sub.wrapline { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

/* ---------- phase 5: messages ---------- */
.mail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .9fr); gap: 18px; align-items: start; }
.mail-preview-wrap { position: sticky; top: calc(var(--top-h) + 16px); }
.mailer-line { font-size: 13px; }
.step-h { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--accent-soft); color: var(--accent-text); }
.aud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.aud { display: grid; gap: 3px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.aud b { font-size: 14px; }
.aud span { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.aud em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-top: 4px; }
.aud[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.aud[aria-checked="true"] em { color: var(--accent-text); }
.pick-list { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.pick:first-child { border-top: 0; }
.pick:hover { background: var(--surface-2); }
.pick-who { flex: 1; min-width: 0; }
.pick-who b, .pick-who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-who span { font-size: 12.5px; color: var(--text-3); }
.send-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.preview-toggle > summary { list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--text-2); margin-bottom: 10px; cursor: pointer; }
.preview-toggle > summary::-webkit-details-marker { display: none; }
.mail-preview { border-radius: var(--r-lg); background: #eef2f6; padding: 16px; border: 1px solid var(--border); color: #111827; }
.mp-subject { display: grid; gap: 2px; padding: 0 4px 12px; font-size: 13.5px; }
.mp-subject .hint { color: #6b7280; }
.mp-card { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-size: 14px; line-height: 1.6; }
.mp-logo { font-weight: 800; color: #0891b2; margin-bottom: 14px; letter-spacing: -.01em; }
.mp-card h3 { font-size: 19px; margin-bottom: 10px; line-height: 1.3; }
.mp-hi { margin-bottom: 10px; color: #374151; }
.mp-card #pvBody p { margin: 0 0 12px; color: #374151; overflow-wrap: anywhere; }
.mp-btn { display: inline-block; margin-top: 6px; padding: 10px 18px; border-radius: 10px; background: #06b6d4; color: #fff; font-weight: 700; }
.seg-wide { display: grid; grid-template-columns: 1fr 1fr; }
.notif-preview { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.notif-preview b { display: block; }
.notif-preview p { margin: 4px 0; color: var(--text-2); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.np-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.np-link { display: block; color: var(--accent-text); font-weight: 600; font-size: 13px; margin: 4px 0; }
@media (max-width: 1100px) {
  .mail-grid { grid-template-columns: minmax(0, 1fr); }
  .mail-preview-wrap { position: static; order: -1; }
  .preview-toggle:not([open]) { margin-bottom: 0; }
}
@media (max-width: 520px) {
  .aud-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .send-row .btn { width: 100%; }
}

.row .who.wrap > b { white-space: normal; overflow-wrap: anywhere; }
.pv-chev { margin-left: auto; transition: transform .2s; }
.preview-toggle[open] .pv-chev { transform: rotate(180deg); }
@media (max-width: 1100px) {
  .preview-toggle > summary { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 0; }
  .preview-toggle[open] > summary { margin-bottom: 10px; }
}
@media (max-width: 900px) {
  .tabs:has(> .tab-btn:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- phase 5 polish ---------- */
.budget { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.budget-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.budget-top span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.budget-bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: flex; }
.budget-bar i { display: block; height: 100%; background: var(--text-3); }
.budget-bar i.add { background: var(--accent); }
.budget.near .budget-bar i.add { background: var(--warn); }
.budget.over { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.budget.over .budget-bar i.add { background: var(--bad); }
.bad-notice { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--text); }
.bad-notice > .ic { color: var(--bad); }
.plan-ctl { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fail-reason { grid-column: 1 / -1; color: var(--bad) !important; white-space: normal !important; overflow-wrap: anywhere; display: flex; gap: 6px; align-items: flex-start; }
.notif-preview { border-left: 3px solid var(--accent); }
.np-main { flex: 1; min-width: 0; }
.np-top { display: flex; align-items: center; gap: 8px; }
.np-top b { flex: 1; }
.np-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.np-link { display: inline-flex !important; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--border-2); color: var(--text) !important; font-size: 13px; }
.np-link.np-update { background: var(--accent); color: var(--accent-ink) !important; border-color: transparent; }
.np-link[hidden] { display: none !important; }

/* ---------- phase 6: insights ---------- */
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.head-acts { display: flex; gap: 8px; align-items: center; }
.period { display: inline-flex; align-items: center; gap: 8px; }
.period .input { height: 38px; width: auto; }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }
.dt-wrap { overflow-x: auto; }
.dt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dt th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 10px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dt td { padding: 12px 18px; border-top: 1px solid var(--border); vertical-align: top; }
.dt tr:first-child td { border-top: 0; }
.dt .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt tbody tr:hover td { background: var(--surface-2); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .head-acts { width: 100%; }
  .period { width: 100%; }
  .period .input { flex: 1; }
  .dt thead { display: none; }
  .dt, .dt tbody, .dt tr, .dt td { display: block; width: 100%; }
  .dt tr { padding: 12px 16px; border-top: 1px solid var(--border); }
  .dt tr:first-child { border-top: 0; }
  .dt td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .dt td::before { content: attr(data-label); color: var(--text-3); font-size: 12.5px; text-align: left; flex: none; }
  .dt td.main { display: block; text-align: left; font-weight: 600; padding-bottom: 6px; }
  .dt td.main::before { display: none; }
  .dt td[data-label=""]::before { display: none; }
  .dt tbody tr:hover td { background: transparent; }
}
.period-row { display: flex; justify-content: flex-end; margin: 0 0 14px; }
.period-row:empty { display: none; }
@media (max-width: 900px) { .period-row { margin-top: -2px; } }

/* ---------- phase 6: settings ---------- */
.toggles { display: grid; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); cursor: pointer; }
.toggle-row:first-child { border-top: 0; padding-top: 0; }
.toggle-row > span { display: grid; gap: 3px; }
.switch { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cols-pm { grid-template-columns: minmax(170px, 1fr) minmax(240px, 1.7fr) 170px 240px; }
.pm-addr { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; }
.pm-addr .mono { color: var(--text-2); }
.pm-name { flex-basis: 100%; color: var(--text-2); }
@media (max-width: 900px) { .cols-pm { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---------- phase 6 polish ---------- */
.period-none { font-size: 12.5px; }
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.tabs.vtabs { flex-direction: column; align-items: stretch; position: sticky; top: calc(var(--top-h) + 16px); margin-bottom: 0; overflow: visible; }
.tabs.vtabs .tab-btn { justify-content: flex-start; flex: none; text-align: left; white-space: normal; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .stack-btns > span { display: none; }
  .stack-btns .btn { width: 100%; justify-content: center; }
}

/* ---------- phase 7: team & security ---------- */
.ap-card { padding: 16px 18px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.ap-card:first-child { border-top: 0; }
.ap-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ap-top .who b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.ap-top .who span { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 3px; overflow-wrap: anywhere; }
.audit-detail { grid-column: 1 / -1; font-size: 12.5px; }
.area-list { display: grid; gap: 2px; max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px; }
.area-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; }
.area-row:first-child { border-top: 0; }
.area-row .cb { margin-top: 2px; }
.area-row > span { display: grid; gap: 2px; }
@media (min-width: 901px) { .cols-g.has-acts.team-row { grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 1fr) minmax(150px, 1fr) 360px; } }

/* ---------- phase 7 polish ---------- */
.tech { font-size: 12px; color: var(--text-3); }
.tech summary { cursor: pointer; width: fit-content; }
.tech .mono { font-size: 11.5px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; text-align: left; }
.admin-fail-card { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }

/* ---------- payments follow-up ---------- */
.chip-btn.chip-alert { border-color: var(--warn); color: var(--text); }
.cols-exp { grid-template-columns: 22px minmax(190px, 1.5fr) 110px minmax(150px, 1.1fr) 150px 20px; }
.exp-bar { align-items: center; }
.ph-only-flex { display: none !important; }
.report-box { padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.report-box h3 { display: flex; align-items: center; gap: 6px; color: var(--text) !important; }
.cp-note { color: #374151; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .cols-exp { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .cols-exp.has-cb > .c-full { grid-column: 2 / -1; }
  .ph-only-flex { display: flex !important; }
}
.exp-bar .seg { display: inline-flex; flex-wrap: wrap; width: auto; } .exp-bar .seg button { padding: 0 14px; white-space: nowrap; }

/* ---------- archive / old waiting ---------- */
.cols-manual-cb { grid-template-columns: 22px minmax(170px, 1.5fr) 120px minmax(110px, 1fr) minmax(130px, 1.1fr) 150px 20px; }
@media (max-width: 900px) {
  .cols-manual-cb { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .cols-manual-cb.has-cb > .c-full { grid-column: 2 / -1; }
}

/* ---------- installed app: safe areas (status bar, notch, home bar) ---------- */
:root { --safe-t: env(safe-area-inset-top, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); }
.top { padding-top: var(--safe-t); height: calc(var(--top-h) + var(--safe-t)); }
.side { padding-top: calc(18px + var(--safe-t)); }

/* ---------- search panel: centred without transform (the opening animation
   used to replace translateX(-50%) and push it to the right) ---------- */
.palette { left: 0; right: 0; margin: 0 auto; transform: none; }
.pal-close { display: none; font-weight: 600; color: var(--accent-text); padding: 8px 4px 8px 8px; white-space: nowrap; }
@keyframes pal-down { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .top { height: calc(58px + var(--safe-t)); padding: var(--safe-t) max(14px, var(--safe-r)) 0 max(14px, var(--safe-l)); }
  .content { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
  .sheet { max-height: calc(100dvh - var(--safe-t) - 12px); }
  .auth-panel { padding-top: calc(48px + var(--safe-t)); }
  .palette {
    top: 0; width: 100%; max-width: none; border-radius: 0 0 20px 20px; border-top: 0; border-left: 0; border-right: 0;
    padding-top: var(--safe-t); animation: pal-down 0.2s var(--ease) both;
  }
  .palette-input { padding: 0 max(12px, var(--safe-r)) 0 max(16px, var(--safe-l)); }
  .palette-input input { min-width: 0; }
  .palette-list { max-height: calc(100dvh - var(--safe-t) - 120px); }
  .pal-esc, .pal-foot { display: none !important; }
  .pal-close { display: inline-flex; }
}
/* the browser's own "x" in the search box would sit next to Cancel/Esc */
#palQ::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* ---------- Today: hide until something new (pages/today.js) ---------- */
.q-act { display: flex; align-items: center; gap: 6px; }
.q-hide { width: 34px; height: 34px; color: var(--text-3); }
.q-hide:hover { color: var(--text); }
.q-hidden { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px 14px; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--border); }
.q-hidden span { flex: 1; min-width: 180px; }
@media (max-width: 900px) {
  .q-item .q-act .btn { flex: 1; width: auto; }
  .q-item .q-act .q-hide { width: 44px; height: 44px; flex: none; }
}

/* ---------- privacy mode (app/privacy.js) ---------- */
.icon-btn.on { background: var(--accent-soft); color: var(--accent-text); }
.priv-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.priv-menu { width: min(360px, calc(100vw - 24px)); right: 0; padding: 6px; }
.priv-menu .toggle-row { padding: 10px; gap: 14px; }
@media (max-width: 900px) { .priv-pill { display: none !important; } }
/* Customers' payment screenshots are pictures (amounts, names): blurred too. */
html[data-privacy] .proof img, html[data-privacy] .lightbox img { filter: blur(16px); }

/* ---------- phones: hover labels, top-bar menus, card text ---------- */
/* No hover labels on touch screens: a tap left them stuck on screen (one sat on the status bar). */
@media (hover: none) {
  [data-tip]:hover::after, [data-tip]:focus-visible::after { content: none !important; display: none !important; }
}
/* Top-bar labels open below the button (above it is off the screen), right-aligned near the edge. */
.top [data-tip]:hover::after, .top [data-tip]:focus-visible::after { bottom: auto; top: calc(100% + 8px); }
.top-actions [data-tip]:hover::after, .top-actions [data-tip]:focus-visible::after { left: auto; right: 0; transform: none; }
/* Any popover that still opens on a narrow screen stays inside it. */
.menu-pop { max-width: calc(100vw - 24px); }
.priv-foot { padding: 4px 10px 8px; }
.priv-sheet .toggle-row:first-child { border-top: 0; padding-top: 4px; }
.priv-sheet .priv-foot { padding: 10px 0 0; }
.q-note { color: var(--text-3); font-size: 13px; margin-top: 4px; }
@media (max-width: 900px) {
  .sheet-body { padding-bottom: calc(48px + var(--safe-b)); }
}
.q-note { display: flex; align-items: flex-start; gap: 6px; }
.q-note .ic { flex: none; margin-top: 2px; }
/* Tags under a customer's name wrap inside their column (on phones they ran into the amount). */
.row .who { min-width: 0; }
.row .who .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.row .who .tags .badge { white-space: normal; max-width: 100%; text-align: left; height: auto; min-height: 24px; padding: 3px 9px; line-height: 1.35; border-radius: 12px; }

/* Team & Security → Sign-in activity: earlier blocked addresses (folded). */
.past-blocks { padding: 4px 20px 12px; }
.past-blocks summary { cursor: pointer; color: var(--text-3); font-size: 13px; padding: 8px 0; }

/* ---------- Support inbox (pages/support.js) ---------- */
.sp-row { grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1.6fr) 170px 90px 20px; }
.sp-subj { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-subj b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-subj span { color: var(--text-3); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 4px; vertical-align: middle; }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sp-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.sp-assign { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); }
.sp-assign .input { min-width: 200px; width: auto; }
.sp-msgs { display: grid; gap: 12px; }
.sp-msg { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; max-width: 92%; }
.sp-msg.out { justify-self: end; background: var(--accent-soft); border-color: transparent; }
.sp-msg header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 8px; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 14px; }
.mail-quote { margin-top: 10px; color: var(--text-3); }
.mail-quote summary { cursor: pointer; font-size: 12.5px; }
.sp-att { margin-top: 10px; font-size: 13px; color: var(--text-2); display: flex; gap: 6px; align-items: flex-start; }
.sp-h { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.sp-send { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.sp-buys { margin: 4px 0 12px; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.mailer-line .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.mailer-line .dot.ok { background: var(--ok); } .mailer-line .dot.bad { background: var(--bad); }
@media (max-width: 900px) {
  .sp-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sp-row .sp-subj { grid-column: 1 / -1; }
  .sp-grid { grid-template-columns: 1fr; }
  .sp-msg { max-width: 100%; }
  .sp-send { justify-content: stretch; } .sp-send .btn { flex: 1; }
}
