/* ============================================================
   Jonson Delivery — the lit console
   Hebrew RTL SMS dispatch. Indigo light in a deep blue-black room.
   One system, two compositions:
     · ≥ 900px  desktop — glass sidebar, stepped send flow beside a cost rail
     · < 900px  phone   — bottom tab bar, one step per screen, sheets
   ============================================================ */

@font-face {
  font-family: 'Grotesk';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/space-grotesk-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Grotesk';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/space-grotesk-700.woff2') format('woff2');
}

:root {
  color-scheme: dark;

  /* The room. Blue-black, never neutral: every surface carries the indigo
     in its tint so the accent reads as the light source, not a sticker. */
  --bg: #080910;
  --bg-elevated: #0c0d17;
  --surface: #10121c;
  --surface-2: #161827;
  --surface-3: #1d2032;
  --border: #22253a;
  --border-2: #2e3352;
  --border-soft: #1b1e30;

  /* Text — every value clears 4.5:1 on --surface */
  --text: #eff0f8;
  --text-muted: #a9adc7;
  --text-dim: #8388a8;

  /* The one accent, and the glow it throws. */
  --accent: #6366f1;
  --accent-hover: #5b52ea;
  /* The top stops of the surfaces that carry white type: 5.2:1 and 4.7:1. */
  --accent-top: #5f57ee;
  --accent-top-hover: #6360f0;
  --accent-strong: #4f46e5;
  --accent-deep: #3b34c9;
  --accent-light: #a5b4fc;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-softer: rgba(99, 102, 241, 0.08);
  --accent-line: rgba(99, 102, 241, 0.42);
  --accent-glow: rgba(99, 102, 241, 0.5);

  /* Outcome only. Never decoration. */
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.13);
  --ok-text: #7ee9bb;
  --ok-line: rgba(52, 211, 153, 0.3);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --warn-text: #ffd98a;
  --warn-line: rgba(251, 191, 36, 0.3);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.13);
  --bad-text: #ffb3b3;
  --bad-line: rgba(248, 113, 113, 0.3);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --pill: 999px;

  /* Depth: an offset shadow, and — on the things that float — the indigo
     light catching their edge. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.42), 0 14px 32px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.5), 0 40px 90px -20px rgba(0, 0, 0, 0.7), 0 30px 80px -40px var(--accent-glow);

  /* The panel material: a gentle top-lit gradient inside a hairline. */
  --panel: linear-gradient(170deg, var(--surface-2), var(--surface));
  --panel-lit: linear-gradient(170deg, #1a1c2e, #10121c 70%);

  --sidebar-w: 284px;
  --tabbar-h: 64px;
  --stepbar-h: 68px;
  --rail-w: 292px;

  --font: "Rubik", "Heebo", "Assistant", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  /* Figures are the content. They get a face of their own. */
  --mono: "Grotesk", "Rubik", ui-monospace, "SF Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  --inset-shade: rgba(0, 0, 0, 0.38);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--accent-light);
}

/* The room's light: two indigo pools, a faint grid that fades out, and a
   breath of grain so the dark never reads as flat pixels. Fixed, and still. */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(99, 102, 241, 0.20), transparent 62%),
    radial-gradient(700px 480px at 6% 108%, rgba(79, 70, 229, 0.13), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
  -webkit-mask-image: radial-gradient(85% 70% at 70% 20%, #000 20%, rgba(0, 0, 0, 0.35) 100%);
  mask-image: radial-gradient(85% 70% at 70% 20%, #000 20%, rgba(0, 0, 0, 0.35) 100%);
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9990; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }
.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;
}

/* The surfaces the browser draws belong to the design too. */
::selection { background: var(--accent-strong); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--border-2); }
*::-webkit-scrollbar-track { background: transparent; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes appFade { from { opacity: 0; } to { opacity: 1; } }
.app-view--enter { animation: appFade 0.5s var(--ease) both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulseDot { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ============================================================
   The cursor ring (fine pointers, desktop only; fx.js adds the class)
   ============================================================ */
html.has-cursor body { cursor: none; }
html.has-cursor a, html.has-cursor button, html.has-cursor summary, html.has-cursor label { cursor: none; }
/* Text keeps its own cursor: the I-beam is information, not decoration. */
html.has-cursor input, html.has-cursor textarea, html.has-cursor select { cursor: auto; }
#cursor {
  position: fixed; top: 0; left: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  pointer-events: none; z-index: 10000; opacity: 0;
  transition: opacity 0.25s;
  will-change: transform;
}
/* The ring itself scales; the wrapper only travels. */
#cursor i {
  position: absolute; inset: 0; display: block;
  border: 1px solid rgba(165, 180, 252, 0.8); border-radius: 50%;
  transition: transform 0.3s var(--ease), background 0.25s, border-color 0.25s;
}
#cursor i::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px;
  border-radius: 50%; background: var(--accent-light); box-shadow: 0 0 8px var(--accent);
}
#cursor.is-on { opacity: 1; }
#cursor.is-hover i { transform: scale(1.65); background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.55); }
#cursor.is-down i { transform: scale(0.65); }
#cursor.is-text { opacity: 0; }

/* ============================================================
   Boot — the mark, a bar, a counter
   ============================================================ */
.boot {
  position: fixed; inset: 0; z-index: 95;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: var(--bg);
  transition: opacity 0.55s var(--ease), visibility 0.55s;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-mark { display: grid; place-items: center; filter: drop-shadow(0 0 26px rgba(99, 102, 241, 0.55)); }
.boot-mark svg { width: 84px; height: 84px; }
.boot-bar { width: min(240px, 60vw); height: 2px; border-radius: var(--pill); background: var(--border); overflow: hidden; }
.boot-bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: right; box-shadow: 0 0 14px var(--accent); }
.boot-num { font: 500 12px var(--mono); letter-spacing: 0.22em; color: var(--text-dim); direction: ltr; }
.boot .spinner { display: none; }

/* ============================================================
   Material — how a surface says what it is
   ============================================================ */

/* Panels: a top-lit gradient inside a hairline, and a lit edge along the top. */
.card, .balance-card, .summary-cell, .rowcard, .figure, .table-wrap, .send-rail, .quota-strip,
.user-card, .stat, .login-card, .sheet, .requests-card, .pending-card, .ccard, .mini-figure, .tl-item {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), var(--shadow-sm);
}
.sheet, .login-card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-lg); }
.table-wrap, .send-rail { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow); }

/* A spotlight that follows the pointer across the surface (fx.js sets --mx/--my). */
.spot { position: relative; isolation: isolate; }
.spot::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(99, 102, 241, 0.17), transparent 62%);
  opacity: 0; transition: opacity 0.35s;
}
.spot.is-lit::before { opacity: 1; }

/* Something that tilts towards the hand. */
[data-tilt] { transform-style: preserve-3d; transition: transform 0.5s var(--ease), box-shadow 0.5s; will-change: transform; }
[data-tilt].is-tilting { transition: transform 0.12s linear; }

/* Inputs read as cut into the surface. */
.input, .textarea, select.input, .search-box { box-shadow: inset 0 1px 3px var(--inset-shade); }

/* ============================================================
   Primitives
   ============================================================ */

.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 11px 22px;
  border: 1px solid var(--border-2); border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.035); color: var(--text);
  font-family: inherit; font-size: 0.95rem; font-weight: 700; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background 0.22s, border-color 0.22s, color 0.22s, opacity 0.2s, transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  transform: translate(var(--pull-x, 0), var(--pull-y, 0));
}
.btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; transition: transform 0.35s var(--ease); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn--primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(180deg, var(--accent-top), var(--accent-strong) 55%, var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.4), 0 12px 30px -10px var(--accent-glow);
}
/* The sweep of light across the primary action on hover. */
.btn--primary::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.26) 50%, transparent 68%);
  transform: translateX(130%); transition: transform 0.75s var(--ease);
}
.btn--secondary { background: rgba(255, 255, 255, 0.035); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--danger { color: var(--bad-text); border-color: var(--bad-line); background: transparent; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 7px 16px; font-size: 0.85rem; }
.btn--lg { min-height: 54px; padding: 14px 30px; font-size: 1.02rem; }

@media (hover: hover) {
  .btn:hover:not(:disabled) { border-color: var(--accent-line); background: var(--accent-soft); }
  .btn--primary:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--accent-top-hover), var(--accent-hover) 55%, var(--accent-strong));
    border-color: transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -1px 0 rgba(0, 0, 0, 0.25),
      0 3px 8px rgba(0, 0, 0, 0.44), 0 18px 44px -12px var(--accent-glow);
  }
  .btn--primary:hover:not(:disabled)::before { transform: translateX(-130%); }
  .btn--quiet:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); color: var(--text); border-color: transparent; }
  .btn--danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); color: var(--bad-text); }
}
.btn:active:not(:disabled) { transform: translate(var(--pull-x, 0), var(--pull-y, 0)) scale(0.97); }
.btn--primary:active:not(:disabled) { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3); }

.icon-btn {
  display: grid; place-items: center; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .icon-btn:hover { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); } }

.link-btn {
  background: none; border: none; padding: 6px 2px; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--accent-light);
}
@media (hover: hover) { .link-btn:hover { text-decoration: underline; text-underline-offset: 3px; } }

.spinner {
  width: 17px; height: 17px; display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.24); border-top-color: currentColor;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.spinner--lg { width: 30px; height: 30px; border-width: 3px; color: var(--accent); }

/* --- Fields --- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field--spaced { margin-top: 18px; }
.field-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.field-hint { font-size: 0.78rem; color: var(--text-dim); line-height: 1.5; }
.field-hint--ok { color: var(--ok-text); }
.field-hint--bad { color: var(--bad-text); }
.lm-upload { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.form-error { margin: 0; font-size: 0.85rem; color: var(--bad-text); }

.input, .textarea, select.input {
  width: 100%; min-height: 48px; padding: 12px 15px;
  background: rgba(0, 0, 0, 0.26); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: inset 0 1px 3px var(--inset-shade), 0 0 0 4px var(--accent-soft), 0 0 24px -6px var(--accent-glow);
  background: rgba(0, 0, 0, 0.34);
}
.input[readonly] { color: var(--text-muted); cursor: not-allowed; }
.textarea { min-height: 116px; line-height: 1.65; resize: vertical; }
select.input {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9adc7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; background-size: 17px;
  padding-inline-start: 15px; padding-inline-end: 40px;
}
select.input option { background: var(--surface-2); color: var(--text); }

/* --- Notices --- */
.notice {
  margin-top: 14px; padding: 12px 15px; border-radius: var(--radius-sm);
  font-size: 0.85rem; line-height: 1.55; border: 1px solid transparent;
}
.notice--warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
.notice--bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-text); }
.notice--info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-light); }

/* --- Badges & pills --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--pill);
  font-size: 0.76rem; font-weight: 700; white-space: nowrap; line-height: 1.5;
  border: 1px solid transparent;
}
/* Outcome badges carry a lit dot; the neutral ones do not — the unremarkable
   case must not be the loudest thing on the screen. */
.badge--submitted::before, .badge--accepted::before, .badge--delivered::before, .badge--on::before,
.badge--partial::before, .badge--failed::before, .badge--off::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor;
}
.badge--submitted, .badge--accepted { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-light); }
.badge--delivered, .badge--on { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-text); }
.badge--partial { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
.badge--failed { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-text); }
.badge--admin { background: var(--surface-3); border-color: var(--border-2); color: var(--text); }
.badge--user { background: rgba(255, 255, 255, 0.03); border-color: var(--border); color: var(--text-muted); }
.badge--off { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
.badge--neutral { background: transparent; border-color: var(--border); color: var(--text-muted); }
.badge--owner { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-light); }

.count-pill {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 4px 12px; border-radius: var(--pill);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  font-size: 0.82rem; font-weight: 600; color: var(--accent-light); white-space: nowrap;
}
.count-pill b { font-family: var(--mono); font-size: 0.97rem; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* A dot that says "this is live". Only where the value really is polled. */
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: pulseDot 2s infinite;
}

/* --- Logo --- */
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo--stacked { flex-direction: column; gap: 16px; margin-bottom: 28px; }
.logo-mark { display: grid; place-items: center; filter: drop-shadow(0 0 14px rgba(99, 102, 241, 0.45)); transition: filter 0.4s, transform 0.4s var(--ease); }
.logo-mark--hero { width: 96px; height: 96px; position: relative; filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.6)); }
.logo-mark--hero > svg { width: 84px; height: 84px; transition: opacity 0.45s var(--ease); }
.logo-mark--hero canvas { display: block; position: absolute; top: 0; left: 0; opacity: 0; transition: opacity 0.6s var(--ease); }
.logo-mark--hero.is-live > svg { opacity: 0; }
.logo-mark--hero.is-live canvas { opacity: 1; }
@media (hover: hover) { .sidebar .logo:hover .logo-mark { filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.7)); transform: scale(1.05); } }
.logo-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.logo-name {
  direction: ltr; text-transform: uppercase;
  font-weight: 800; font-size: 1.12rem; letter-spacing: 0.04em; line-height: 1.1;
  color: var(--text); white-space: nowrap; min-width: 0;
}
.sidebar .logo-name { font-size: 1rem; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; }
.logo-text--center { align-items: center; text-align: center; }
.logo--stacked .logo-name { font-size: 1.85rem; letter-spacing: 0.045em; overflow: visible; text-overflow: clip; }
.logo-sub {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.3em;
  color: var(--accent-light); direction: ltr; text-transform: uppercase;
}
.logo-sub--hero { font-size: 0.74rem; letter-spacing: 0.38em; padding-inline-start: 6px; }

/* ============================================================
   Login — the one spectacle
   ============================================================ */
.login-view {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100dvh; display: grid; place-items: center;
  padding: 24px 20px calc(24px + var(--safe-b));
  background:
    radial-gradient(60% 55% at 50% 40%, rgba(99, 102, 241, 0.2), transparent 65%),
    radial-gradient(40% 40% at 90% 100%, rgba(79, 70, 229, 0.12), transparent 60%);
}
/* The particle sea (fx.js mounts a canvas here on a desktop). */
.login-field { position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 1.2s var(--ease); }
.login-field.is-live { opacity: 0.95; }
.login-field canvas { display: block; width: 100%; height: 100%; }
.login-view::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 200px; z-index: -1; pointer-events: none;
  background: linear-gradient(transparent, var(--bg));
}
.login-card {
  position: relative; width: 100%; max-width: 420px; padding: 40px 34px 26px;
  background: linear-gradient(165deg, rgba(26, 28, 46, 0.92), rgba(12, 13, 23, 0.95));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--border-2); border-radius: 24px;
  text-align: center;
}
/* A hairline of light along the top edge, where the room's light hits it. */
.login-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(165, 180, 252, 0.55), transparent 40%, transparent 65%, rgba(99, 102, 241, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.login-form { display: flex; flex-direction: column; gap: 15px; text-align: start; }
.login-form .btn { margin-top: 6px; }
.login-footnote {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 24px 0 0; font-size: 0.78rem; color: var(--text-dim);
}

/* ============================================================
   App shell — desktop
   ============================================================ */
.app-view { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 26px;
  padding: 26px 16px 22px;
  background: rgba(12, 13, 23, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-inline-start: 1px solid var(--border-soft);
}
.sidebar .logo { padding: 0 4px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 46px; padding: 6px 8px 6px 14px;
  background: transparent; border: 1px solid transparent; border-radius: var(--pill);
  color: var(--text-muted); font-family: inherit; font-size: 0.95rem; font-weight: 600;
  text-align: start; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
@media (hover: hover) { .nav-item:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); } }
.nav-item.is-active {
  background: linear-gradient(to left, var(--accent-soft), rgba(99, 102, 241, 0.03));
  border-color: rgba(99, 102, 241, 0.22);
  color: var(--accent-light);
}
/* The lit dot at the far end of the current item — unless a count sits there. */
.nav-item::after {
  content: ''; position: absolute; inset-inline-end: 16px; top: 50%;
  width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
  opacity: 0; transform: scale(0.4); transition: opacity 0.25s, transform 0.25s var(--ease);
}
.nav-item.is-active:not(:has(.nav-count:not(.hidden)))::after { opacity: 1; transform: none; }
.nav-ico {
  display: grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-soft);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.3s;
}
.nav-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active .nav-ico {
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-light);
  box-shadow: 0 0 18px -4px var(--accent-glow);
}
/* A count beside a navigation item, for work that is waiting. */
.nav-count {
  margin-inline-start: auto; margin-inline-end: 6px; min-width: 22px; padding: 1px 8px; border-radius: var(--pill);
  background: var(--accent-strong); color: #fff; text-align: center;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 14px -2px var(--accent-glow);
}

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 11px; padding: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.user-avatar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(160deg, var(--accent-top-hover), var(--accent-strong) 60%, var(--accent-deep));
  color: #fff; font-weight: 800; font-size: 0.97rem; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.22), 0 6px 18px -6px var(--accent-glow);
}
.user-meta { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.user-name { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 600; color: var(--text-muted); }
.role-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); box-shadow: 0 0 0 2px var(--surface-2); }
.user-role.role--admin { color: var(--accent-light); }
.user-role.role--admin .role-dot { background: var(--accent-light); box-shadow: 0 0 8px var(--accent); }

.logout-ico { width: 36px; height: 36px; }
.logout-ico svg { width: 16px; height: 16px; }
@media (hover: hover) { .logout-ico:hover { color: var(--bad-text); border-color: var(--bad-line); background: var(--bad-soft); } }

.main { padding: 28px 36px 32px; max-width: 1360px; min-width: 0; }

.appbar { display: none; }

.main-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.main-title { margin: 0 0 3px; font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.main-sub { margin: 0; font-size: 0.95rem; color: var(--text-muted); }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 14px; border-radius: var(--pill);
  background: var(--bad-soft); border: 1px solid var(--bad-line);
  font-size: 0.85rem; font-weight: 600; color: var(--bad-text);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.tabbar { display: none; }

.panel { display: none; }
.panel.is-active { display: block; }

/* --- Collapsible card: compact head, opens to full text --- */
.ccard {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; transition: border-color 0.2s;
}
.ccard + .ccard { margin-top: 9px; }
@media (hover: hover) { .ccard:hover { border-color: var(--border-2); } }
.ccard-head, .ccard-toggle {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 17px; min-height: 54px;
  background: none; border: none; cursor: pointer; text-align: start; font: inherit; color: var(--text);
}
@media (hover: hover) { .ccard-head:hover, .ccard-toggle:hover { background: rgba(255, 255, 255, 0.03); } }
.ccard-head:focus-visible, .ccard-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ccard-headactions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.ccard-iconbtn {
  display: grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; padding: 0;
  border: none; border-radius: var(--pill); background: none; color: var(--text-dim); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ccard-iconbtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .ccard-iconbtn:hover { background: var(--surface-3); color: var(--text); } }
.ccard-iconbtn--danger:hover { background: var(--bad-soft); color: var(--bad-text); }
.ccard-iconbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ccard-headmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ccard-title { font-size: 0.97rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-sub { font-size: 0.8rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-chevron {
  display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  color: var(--text-dim); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-soft);
  transition: transform 0.4s var(--ease), color 0.2s, border-color 0.2s, background 0.2s;
}
.ccard-chevron svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ccard.is-open .ccard-chevron { transform: rotate(180deg); color: var(--accent-light); border-color: var(--accent-line); background: var(--accent-soft); }
.ccard-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.42s var(--ease); }
.ccard.is-open .ccard-collapse { grid-template-rows: 1fr; }
.ccard-body { overflow: hidden; min-height: 0; padding: 0 17px; }
.ccard.is-open .ccard-body { padding-bottom: 16px; }
.ccard-text { margin: 0; font-size: 0.92rem; line-height: 1.65; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.ccard-meta { margin-top: 9px; font-size: 0.8rem; color: var(--text-dim); }
.ccard-body .rowcard-actions { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .ccard-collapse, .ccard-chevron { transition: none; } }

/* --- Cards --- */
.card {
  padding: 26px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.card-head { margin-bottom: 20px; }
.card-head--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { margin: 0; font-size: 1.12rem; font-weight: 800; letter-spacing: -0.01em; }
.card-sub { margin: 4px 0 0; font-size: 0.86rem; color: var(--text-muted); }

/* --- Section headers --- */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-head--panel { margin-bottom: 16px; }
.section-head--actions { display: flex; justify-content: flex-start; gap: 8px; }
.section-head-info { display: flex; align-items: center; gap: 10px; }
.section-title { margin: 0; font-size: 0.97rem; font-weight: 700; letter-spacing: -0.2px; }
.head-actions { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   Figures — the balance, wherever it is stated
   ============================================================ */
.balance-card {
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  padding: 28px 30px; margin-bottom: 18px;
  background: var(--panel-lit); border: 1px solid var(--border-2); border-radius: var(--radius);
}
.balance-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.balance-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.02em; }
.balance-value {
  font-family: var(--mono); font-size: 3.3rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; color: var(--text); direction: ltr; unicode-bidi: isolate;
  text-shadow: 0 0 34px rgba(99, 102, 241, 0.45);
}
.balance-value--pooled { font-family: var(--font); font-size: 0.72em; letter-spacing: 0; }
.balance-note { font-size: 0.85rem; color: var(--text-dim); margin-top: 3px; }
.home-top { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 26px; }
.home-top .balance-card { margin-bottom: 0; height: 100%; }
.summary-row { display: grid; grid-template-rows: repeat(3, 1fr); gap: 11px; }
.summary-cell {
  display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; min-height: 44px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  text-align: start;
}
.summary-val { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; line-height: 1.25; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.summary-label { font-size: 0.85rem; color: var(--text-muted); }

/* ============================================================
   Row cards
   ============================================================ */
.rowcards { display: flex; flex-direction: column; gap: 10px; }

.rowcard {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 15px 17px; text-align: start;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  font-family: inherit; color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.rowcard--action { cursor: pointer; }
@media (hover: hover) {
  .rowcard--action:hover {
    border-color: var(--border-2); transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow), 0 20px 50px -30px var(--accent-glow);
  }
}

.rowcard-ico {
  display: grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-softer); border: 1px solid rgba(99, 102, 241, 0.22); color: var(--accent-light);
}
.rowcard-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.rowcard-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rowcard-body b { font-size: 0.97rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowcard-body b.rowcard-title--wrap {
  white-space: normal; font-weight: 600; font-size: 0.97rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rowcard-body em {
  font-style: normal; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rowcard-meta { display: flex; align-items: center; gap: 3px 10px; flex-wrap: wrap; font-size: 0.77rem; color: var(--text-dim); }
.rowcard-meta .num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.rowcard-sep { opacity: 0.45; }
.rowcard-arrow { display: grid; place-items: center; flex-shrink: 0; color: var(--text-dim); }
.rowcard-arrow svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rowcard-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.rowcard-badge { align-self: flex-start; margin-top: 4px; }

/* --- The live message meter under the compose box --- */
.compose-meter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; margin-top: 10px; }
.compose-count { font-size: 0.88rem; color: var(--text-muted); }
.compose-count b { font-family: var(--mono); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.compose-rule { font-size: 0.78rem; color: var(--text-dim); }

/* --- The assigned settings (read-only) --- */
.account-facts--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 11px; margin: 0; }
.account-facts--grid .account-fact { flex-direction: column; align-items: flex-start; gap: 4px; }
.account-facts--grid .account-fact dt { font-size: 0.8rem; }
.account-facts--grid .account-fact dd { font-size: 1.02rem; font-weight: 700; overflow-wrap: anywhere; }
.account-facts { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; }
.account-fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 15px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-soft);
}
.account-fact dt { font-size: 0.85rem; color: var(--text-muted); }
.account-fact dd { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.account-fact--balance { background: var(--panel-lit); border-color: var(--accent-line); }
.account-fact--balance dt { color: var(--accent-light); font-weight: 600; }
.account-fact--balance dd { font-family: var(--mono); font-size: 1.9rem; letter-spacing: -0.02em; }

/* The account sheet: a big balance and the sender name. */
.account-hero { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 16px; }
.account-hero-balance {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px; border-radius: 18px;
  background: var(--panel-lit); border: 1px solid var(--accent-line);
}
.account-hero-balance::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 120% at 100% 0, rgba(99, 102, 241, 0.22), transparent 60%);
}
.account-hero-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.account-hero-balance .account-hero-label { color: var(--accent-light); }
.account-hero-value {
  font-family: var(--mono); font-size: 2.4rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em;
  color: var(--text); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
  text-shadow: 0 0 28px rgba(99, 102, 241, 0.45);
}
.account-hero-sender {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border-soft);
}
.account-hero-sender-val { font-size: 1.02rem; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }

/* --- Empty & loading --- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 46px 24px; text-align: center;
  background: var(--panel); border: 1px dashed var(--border-2); border-radius: var(--radius);
}
.empty-ico {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 18px;
  color: var(--accent-light); background: var(--accent-softer); border: 1px solid rgba(99, 102, 241, 0.22);
  box-shadow: 0 0 24px -6px var(--accent-glow);
}
.empty-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.empty-text { max-width: 44ch; margin: 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.6; }
.empty .btn { margin-top: 10px; }

.skeleton {
  height: 66px; border-radius: 14px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}

/* ============================================================
   The console strip — the balance, standing above the flow
   ============================================================ */
.quota-strip {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 22px; padding: 22px 26px 20px;
  background: var(--panel-lit); border: 1px solid var(--border-2); border-radius: var(--radius);
}
.quota-strip::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 130% at 100% 0, rgba(99, 102, 241, 0.22), transparent 60%);
}
.quota-strip--low { border-color: var(--warn-line); }
.quota-strip--blocked { border-color: var(--bad-line); }
.quota-strip--low::after { background: radial-gradient(70% 130% at 100% 0, rgba(251, 191, 36, 0.14), transparent 60%); }
.quota-strip--blocked::after { background: radial-gradient(70% 130% at 100% 0, rgba(248, 113, 113, 0.16), transparent 60%); }
.quota-strip-main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.quota-strip-label { display: inline-flex; align-items: center; gap: 9px; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.02em; }
.quota-strip-value {
  font-family: var(--mono); font-size: 3.3rem; font-weight: 700; font-variant-numeric: tabular-nums;
  line-height: 1; letter-spacing: -0.03em; color: var(--text); direction: ltr; unicode-bidi: isolate;
  text-shadow: 0 0 36px rgba(99, 102, 241, 0.5);
}
.quota-strip-value--pooled { font-family: var(--font); font-size: 1.5rem; letter-spacing: 0; }
.quota-strip--low .quota-strip-value { color: var(--warn-text); text-shadow: 0 0 30px rgba(251, 191, 36, 0.35); }
.quota-strip--blocked .quota-strip-value { color: var(--bad-text); text-shadow: 0 0 30px rgba(248, 113, 113, 0.35); }
.quota-meter { height: 5px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.quota-meter-fill {
  display: block; height: 100%; width: 100%; border-radius: var(--pill);
  transform: scaleX(0); transform-origin: right center;
  background: linear-gradient(to left, var(--accent-deep), var(--accent), var(--accent-light));
  box-shadow: 0 0 12px var(--accent);
  transition: transform 0.4s var(--ease), background 0.25s;
}
.quota-strip--low .quota-meter-fill { background: var(--warn); box-shadow: 0 0 12px var(--warn); }
.quota-strip--blocked .quota-meter-fill { background: var(--bad); box-shadow: 0 0 12px var(--bad); }
.quota-strip-note { margin: 0; min-height: 1.2em; font-size: 0.78rem; color: var(--text-dim); line-height: 1.5; }
.quota-strip--blocked .quota-strip-note { color: var(--bad-text); font-weight: 600; }

/* ============================================================
   Send flow — three dots on a line
   ============================================================ */
.stepper {
  position: relative; display: flex; align-items: flex-start; gap: 0;
  margin: 0 0 28px; padding: 0; list-style: none;
}
.stepper::before, .stepper::after {
  content: ''; position: absolute; top: 14px; inset-inline: 16.66%; height: 1px;
}
.stepper::before { background: var(--border-2); }
.stepper::after {
  background: linear-gradient(to left, var(--accent-deep), var(--accent));
  box-shadow: 0 0 12px var(--accent);
  transform: scaleX(0); transform-origin: right center;
  transition: transform 0.55s var(--ease);
}
.panel--send[data-step="2"] .stepper::after { transform: scaleX(0.5); }
.panel--send[data-step="3"] .stepper::after { transform: scaleX(1); }
.step-dot {
  display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; min-width: 0;
  padding: 0 6px; text-align: center; color: var(--text-dim);
  transition: color 0.2s;
}
.step-num {
  position: relative; z-index: 1;
  display: grid; place-items: center; flex-shrink: 0;
  width: 29px; height: 29px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-dim);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.4s var(--ease);
}
.step-num svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.step-text { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.step-name { font-size: 0.88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-hint { font-size: 0.76rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.step-dot.is-active { color: var(--text); }
.step-dot.is-active .step-num {
  background: var(--accent-strong); border-color: var(--accent-hover); color: #fff;
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 22px var(--accent-glow);
}
.step-dot.is-done { color: var(--text-muted); }
.step-dot.is-done .step-num { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-light); }

/* Desktop: the step column beside a rail that keeps the cost on screen. */
.send-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 0; gap: 0;
  align-items: start;
  transition: grid-template-columns 0.3s var(--ease), gap 0.3s var(--ease);
}
.panel--send[data-step="3"] .send-layout { grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 24px; }

.send-stage { min-width: 0; }
.panel--send [data-step] { display: none; }
.panel--send[data-step="1"] [data-step="1"],
.panel--send[data-step="2"] [data-step="2"],
.panel--send[data-step="3"] [data-step="3"] { display: block; }
.panel--send .stepper [data-step] { display: flex; }

.stepbar { display: none; }

.stage-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.stage-actions .btn { min-width: 140px; }
.panel--send[data-step="1"] #step-prev { visibility: hidden; }
.panel--send[data-step="3"] #step-next { display: none; }

/* The cost rail — shown at the review step. */
.send-rail {
  position: sticky; top: 24px;
  display: none; flex-direction: column;
  padding: 20px 20px 18px; gap: 2px;
  background: var(--panel-lit); border: 1px solid var(--border-2); border-radius: var(--radius);
}
.panel--send[data-step="3"] .send-rail { display: flex; }
.rail-title { margin: 0 0 12px; font-size: 0.82rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.03em; }
.rail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; }
.rail-row + .rail-row { border-top: 1px solid var(--border-soft); }
.rail-label { font-size: 0.85rem; color: var(--text-muted); }
.rail-val { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; direction: ltr; unicode-bidi: isolate; }
.rail-row--total { margin-top: 2px; border-top: 1px solid var(--border-2); padding-top: 13px; }
.rail-row--total .rail-label { color: var(--text); font-weight: 600; }
.rail-row--total .rail-val { font-size: 1.9rem; color: var(--accent-light); text-shadow: 0 0 26px var(--accent-glow); }
.rail-row--balance .rail-val { font-size: 1.15rem; }
.rail-after { margin: 12px 0 0; font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; min-height: 1.2em; }

/* --- Step 1: recipients --- */
.sources { display: flex; flex-direction: column; gap: 10px; }
.manual-add { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; border-radius: var(--radius-sm); }
.manual-add.dragover { outline: 2px dashed var(--accent); outline-offset: 4px; }
#manual-number { direction: rtl; text-align: right; min-width: 0; font-family: var(--font); }
.manual-add .btn { flex-shrink: 0; white-space: nowrap; }
.manual-upload { padding-inline: 14px; }

.sources-hint { margin: 0; font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; }
.file-name {
  margin: 2px 0 0; padding: 4px 12px; border-radius: var(--pill); max-width: 100%; align-self: start;
  background: var(--surface-3); border: 1px solid var(--border); font-size: 0.78rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.recip-view { margin-top: 16px; }
.recip-view .ccard-toggle { padding: 12px 15px; }
.recip-view .ccard-title { font-size: 0.9rem; }
.count-pill { margin-inline-start: auto; }
.recip-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 2px 2px; }
.recip-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 6px 4px 11px; border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--text-muted);
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
}
.recip-chip--more { padding: 4px 11px; color: var(--text-dim); background: none; border-style: dashed; font-family: var(--font); }
.recip-chip--static { padding: 4px 11px; }
.ccard-nums { padding: 2px 0; }
.ccard-loading { margin: 0; font-size: 0.85rem; color: var(--text-dim); }
.recip-chip-x {
  display: grid; place-items: center; width: 18px; height: 18px; padding: 0;
  border: none; border-radius: 999px; background: none; cursor: pointer; color: var(--text-dim);
}
.recip-chip-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .recip-chip-x:hover { background: var(--bad-soft); color: var(--bad-text); } }
.recip-chip-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-top: 14px; }
.stat {
  padding: 13px 12px; text-align: center; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.2);
}
.stat-value { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.77rem; color: var(--text-muted); }
.stat--ok .stat-value { color: var(--ok-text); text-shadow: 0 0 18px rgba(52, 211, 153, 0.35); }
.stat--dup .stat-value { color: var(--warn-text); }
.stat--bad .stat-value { color: var(--bad-text); }
.stat--blocked .stat-value { color: var(--warn-text); }
.stat--blocked { border-color: var(--warn-line); background: var(--warn-soft); }

.preview-note { margin: 12px 0 0; font-size: 0.85rem; color: var(--text-muted); min-height: 1.2em; }
.preview-note--ok { color: var(--ok-text); }
.preview-note--bad { color: var(--bad-text); }

.recip-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

/* --- Step 2: compose --- */
#msg-cap { margin-top: 10px; font-size: 0.85rem; }
.textarea--capped { border-color: var(--warn-line); }
.tpl-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 18px; }
/* The sender box beside the one-tap virtual-number choice. */
.sender-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.sender-row .btn { white-space: nowrap; font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; }

/* --- Step 3: confirm --- */
.review-preview { margin-top: 4px; }
.review-preview-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
/* The message as a bubble on the customer's phone. */
.sms-preview {
  position: relative; max-width: 440px;
  padding: 15px 18px; border-radius: 18px 18px 18px 6px;
  background: linear-gradient(180deg, #252841, #1a1c30);
  border: 1px solid var(--border-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
}
.sms-from { display: block; font-size: 0.76rem; font-weight: 700; color: var(--accent-light); margin-bottom: 6px; letter-spacing: 0.04em; }
.sms-body { margin: 0; font-size: 0.97rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.sms-body:empty::before { content: 'ההודעה עדיין ריקה'; color: var(--text-dim); }
.review-to { margin: 18px 0 0; font-size: 0.85rem; color: var(--text-muted); }
.review-to b { font-family: var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.review-legal { margin: 9px 0 0; max-width: 440px; font-size: 0.78rem; line-height: 1.55; color: var(--text-dim); }
.review-legal b { color: var(--text-muted); font-weight: 600; }

.consent {
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: 20px; padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer; user-select: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.3s ease;
}
@media (hover: hover) { .consent:hover { border-color: var(--accent-line); } }
.consent-box { position: absolute; opacity: 0; width: 0; height: 0; }
.consent-mark {
  flex-shrink: 0; width: 21px; height: 21px; margin-top: 1px;
  display: grid; place-items: center;
  border: 1.5px solid var(--border-2); border-radius: 8px;
  background: var(--surface-3);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.3s ease;
}
.consent-mark svg {
  width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(0.7);
  transition: opacity 0.14s ease, transform 0.18s var(--ease);
}
.consent-text { font-size: 0.86rem; line-height: 1.55; color: var(--text-muted); }
.consent-box:checked ~ .consent-mark { background: var(--accent-strong); border-color: var(--accent-hover); box-shadow: 0 0 14px -2px var(--accent-glow); }
.consent-box:checked ~ .consent-mark svg { opacity: 1; transform: scale(1); }
.consent-box:checked ~ .consent-text { color: var(--text); }
.consent:has(.consent-box:checked) { border-color: var(--accent-line); background: var(--accent-softer); }
.consent-box:focus-visible ~ .consent-mark { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .consent, .consent-mark, .consent-mark svg { transition: none; } }

/* ============================================================
   Admin — built to scan hundreds of rows
   ============================================================ */
.admin-figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.figure {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  padding: 18px 20px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
@media (hover: hover) { .figure:hover { border-color: var(--border-2); transform: translateY(-3px); } }
.figure-val {
  font-family: var(--mono); font-size: 1.9rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.figure-label { font-size: 0.82rem; color: var(--text-muted); }
/* The real capacity: the one figure that carries the light. */
.figure--accent { background: var(--panel-lit); border-color: rgba(99, 102, 241, 0.32); }
.figure--accent::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 130% at 100% 0, rgba(99, 102, 241, 0.24), transparent 60%);
}
.figure--accent .figure-val { color: var(--accent-light); text-shadow: 0 0 26px var(--accent-glow); }

.admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 260px; min-width: 200px;
  padding: 0 16px; min-height: 46px;
  background: rgba(0, 0, 0, 0.26); border: 1px solid var(--border); border-radius: var(--pill);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: inset 0 1px 3px var(--inset-shade), 0 0 0 4px var(--accent-soft); }
.search-box svg { fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search-input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-family: inherit; font-size: 0.95rem; }
.search-input::placeholder { color: var(--text-dim); }
.search-input::-webkit-search-cancel-button { filter: invert(0.6); }

.segmented {
  display: inline-flex; padding: 4px; gap: 3px;
  background: rgba(0, 0, 0, 0.26); border: 1px solid var(--border); border-radius: var(--pill);
}
.segmented button {
  min-height: 36px; padding: 6px 15px;
  background: transparent; border: none; border-radius: var(--pill);
  color: var(--text-muted); font-family: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.3s;
}
@media (hover: hover) { .segmented button:hover { color: var(--text); } }
.segmented button.is-on { background: var(--accent-soft); color: var(--accent-light); box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35); }

.admin-count { font-size: 0.85rem; color: var(--text-dim); margin-inline-start: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

.filter-group { display: contents; }
.filter-toggle { display: none; }

.table-wrap {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  max-height: calc(100dvh - 430px);
  min-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
}
.dtable thead th:first-child { border-start-start-radius: var(--radius); }
.dtable thead th:last-child { border-start-end-radius: var(--radius); }
.dtable tbody tr:last-child td:first-child { border-end-start-radius: var(--radius); }
.dtable tbody tr:last-child td:last-child { border-end-end-radius: var(--radius); }
.dtable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.dtable thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 12px 15px; text-align: start; white-space: nowrap;
  background: rgba(22, 24, 39, 0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--text-muted);
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}
.dtable th.is-sortable { cursor: pointer; user-select: none; }
@media (hover: hover) { .dtable th.is-sortable:hover { color: var(--text); } }
.dtable th .sort-arrow { display: inline-block; margin-inline-start: 5px; opacity: 0.45; font-size: 0.72rem; }
.dtable th.is-sorted { color: var(--accent-light); }
.dtable th.is-sorted .sort-arrow { opacity: 1; }
.dtable tbody td { padding: 12px 15px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; transition: background 0.15s; }
.dtable tbody tr:last-child td { border-bottom: none; }
@media (hover: hover) { .dtable tbody tr:hover td { background: rgba(255, 255, 255, 0.03); } }
.dtable tbody tr.is-off td { color: var(--text-dim); }
.dtable tbody tr.is-selected td { background: var(--accent-soft); }
.dtable tbody tr:focus { outline: none; }
.dtable tbody tr:focus-visible td { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--accent-light); }
.dtable tbody tr:focus-visible td:first-child { box-shadow: inset 0 0 0 1px var(--accent-light), inset 2px 0 0 var(--accent); }
.dtable th.is-sortable:focus-visible { outline: 2px solid var(--accent-light); outline-offset: -2px; }
.dtable tbody tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.dtable td.pick, .dtable th.pick { width: 1%; padding: 0; }
.pick-label { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; margin-inline-start: 8px; }
.row-check { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

.bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 16px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--pill);
  box-shadow: 0 0 30px -12px var(--accent-glow);
}
.bulkbar-count { font-size: 0.9rem; font-weight: 700; color: var(--accent-light); font-variant-numeric: tabular-nums; }
.bulkbar-spacer { flex: 1; }
.dtable td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dtable td.mono { font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.02em; }
.dtable td.actions { width: 1%; white-space: nowrap; text-align: end; }

@media (max-width: 1160px) { .dtable .col-created { display: none; } }

.cell-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-avatar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-muted);
  font-weight: 800; font-size: 0.85rem; text-transform: uppercase;
}
.cell-avatar--admin { background: linear-gradient(160deg, var(--accent-top-hover), var(--accent-strong)); border-color: transparent; color: #fff; box-shadow: 0 0 14px -4px var(--accent-glow); }
.cell-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-muted { color: var(--text-dim); }

.quota-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.quota-val--low { color: var(--warn-text); }
.quota-val--empty { color: var(--bad-text); }

.table-empty { padding: 46px 24px; text-align: center; color: var(--text-muted); }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.pager-info { font-family: var(--mono); font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.pager .btn { min-width: 100px; }

/* Kebab row menu (portalled to body so it is never clipped) */
.kebab-btn {
  display: grid; place-items: center; flex-shrink: 0;
  width: 38px; height: 38px; border-radius: var(--pill);
  background: transparent; border: 1px solid transparent; color: var(--text-muted); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.kebab-btn svg { fill: currentColor; stroke: none; }
@media (hover: hover) { .kebab-btn:hover { background: var(--surface-3); color: var(--text); } }
.kebab-btn.is-open { background: var(--surface-3); color: var(--text); border-color: var(--border); }

.row-menu {
  position: absolute; z-index: 80; min-width: 214px; padding: 6px;
  background: rgba(29, 32, 50, 0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-4px) scale(0.98); transition: opacity 0.16s, transform 0.2s var(--ease);
}
.row-menu.is-in { opacity: 1; transform: none; }
.row-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 11px;
  background: none; border: none; border-radius: 8px;
  color: var(--text); font-family: inherit; font-size: 0.85rem; font-weight: 600;
  text-align: start; cursor: pointer; transition: background 0.13s;
}
.row-menu-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; color: var(--text-dim); }
@media (hover: hover) { .row-menu-item:hover { background: rgba(255, 255, 255, 0.06); } }
.row-menu-item--danger { color: var(--bad-text); }
.row-menu-item--danger svg { color: var(--bad-text); }

.users-cards { display: none; }

/* ============================================================
   Sheets / dialogs
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: 24px;
  background: rgba(5, 6, 12, 0.66);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fadeIn 0.18s ease both;
}
.sheet {
  position: relative;
  width: 100%; max-width: 480px; max-height: calc(100dvh - 48px); overflow-y: auto;
  padding: 26px 24px 22px;
  background: linear-gradient(170deg, #191b2d, #10121c 70%);
  border: 1px solid var(--border-2); border-radius: 22px;
  animation: rise 0.24s var(--ease) both;
}
.sheet--sm { max-width: 400px; }
.sheet--wide { max-width: 580px; }
.sheet-grab { display: none; }
.sheet-title { margin: 0 0 14px; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.sheet-text { margin: 0 0 18px; color: var(--text-muted); line-height: 1.6; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.sheet-actions .btn { min-width: 108px; }
.sheet-actions--stack { flex-direction: column; }
.sheet-actions--stack .btn { width: 100%; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

.locked-note {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border);
  border-radius: 14px;
}
.locked-note svg {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  fill: none; stroke: var(--text-muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.locked-note div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.locked-note b { font-size: 0.97rem; font-weight: 700; }
.locked-note span { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }

/* --- A switch --- */
.switch-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 14px; cursor: pointer;
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border); border-radius: 14px;
  transition: border-color 0.2s, background 0.2s;
}
@media (hover: hover) { .switch-row:hover { border-color: var(--accent-line); } }
.switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; flex-shrink: 0; margin-top: 1px;
  width: 44px; height: 25px; border-radius: var(--pill);
  background: var(--surface-3); border: 1px solid var(--border-2);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.3s;
}
.switch-thumb {
  position: absolute; top: 2px; inset-inline-start: 2px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.switch-input:checked + .switch-track { background: var(--accent-strong); border-color: var(--accent-hover); box-shadow: 0 0 16px -4px var(--accent-glow); }
.switch-input:checked + .switch-track .switch-thumb { background: #fff; transform: translateX(calc(19px * var(--switch-dir, -1))); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-label { font-size: 0.97rem; font-weight: 700; }
.switch-hint { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

#msg-blocked { margin: 2px 0 9px; font-size: 0.85rem; }
.textarea--blocked { border-color: var(--bad-line); }

/* --- The account window --- */
.user-sheet { max-width: 580px; }
.user-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.user-sheet-head .sheet-title { margin: 0 0 5px; }
.user-sheet-id { flex: 1; min-width: 0; }
.user-sheet-section { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--border-soft); }
.user-sheet-legend { margin: 0 0 12px; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; }

.mini-figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.mini-figure {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 13px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
}
.mini-figure-val { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.mini-figure-label { font-size: 0.72rem; color: var(--text-muted); }

.meta-rows { margin: 12px 0 0; display: flex; flex-direction: column; }
.meta-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; }
.meta-row + .meta-row { border-top: 1px solid var(--border-soft); }
.meta-row dt { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.meta-row dd { margin: 0; font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; }

.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  background: rgba(0, 0, 0, 0.18); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.2s;
}
@media (hover: hover) { .mini-item:hover { border-color: var(--border-2); } }
.mini-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-item-text { font-size: 0.85rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-item-meta { font-size: 0.72rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.mini-empty { padding: 20px; text-align: center; font-size: 0.85rem; color: var(--text-dim); }

.user-sheet .sheet-actions {
  position: sticky; bottom: 0;
  margin: 20px -24px -22px; padding: 16px 24px;
  background: rgba(16, 18, 28, 0.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.account-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }

/* ============================================================
   Toasts
   ============================================================ */
.toasts {
  position: fixed; z-index: 85; inset-inline-end: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 9px; max-width: 360px;
  pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.toast {
  position: relative;
  padding: 12px 15px; padding-inline-start: 32px;
  border-radius: 14px;
  background: rgba(29, 32, 50, 0.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow); animation: toastIn 0.28s var(--ease) both;
}
.toast::before {
  content: ''; position: absolute; inset-inline-start: 14px; top: 18px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); box-shadow: 0 0 8px currentColor;
}
.toast--ok::before { background: var(--ok); color: var(--ok); }
.toast--err::before { background: var(--bad); color: var(--bad); }
.toast--warn::before { background: var(--warn); color: var(--warn); }
.toast-title { font-size: 0.86rem; font-weight: 700; margin-bottom: 1px; }
.toast-msg { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* ============================================================
   Text approval
   ============================================================ */
.approval-banner {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 16px; padding: 15px 16px;
  background: linear-gradient(to left, var(--accent-soft), rgba(99, 102, 241, 0.06));
  border: 1px solid var(--accent-line); border-radius: 14px;
}
.approval-banner svg {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  fill: none; stroke: var(--accent-light); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.approval-banner div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.approval-banner b { font-size: 0.97rem; font-weight: 700; color: var(--accent-light); }
.approval-banner span { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }
.approval-banner .btn { align-self: flex-start; margin-top: 9px; }

.pending-card {
  margin-bottom: 16px; padding: 16px;
  background: var(--panel); border: 1px solid var(--warn-line); border-radius: 14px;
}
.pending-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.pending-when { font-size: 0.77rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.pending-name { display: block; font-size: 0.97rem; font-weight: 700; margin-bottom: 5px; }
.pending-body {
  margin: 0 0 13px; padding: 12px 14px;
  background: rgba(0, 0, 0, 0.22); border-radius: 12px;
  font-size: 0.9rem; line-height: 1.6; color: var(--text-muted);
  white-space: pre-wrap; word-break: break-word;
}
.pending-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pending-hint { font-size: 0.85rem; color: var(--text-dim); }
.request-history { margin-top: 26px; }

.pending-inline {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--warn-line); border-radius: 12px;
  font-size: 0.85rem; color: var(--text-muted);
}
.textarea--locked { background: rgba(0, 0, 0, 0.18); color: var(--text-muted); cursor: not-allowed; resize: none; }

.request-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.req-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--pill); border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.req-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.req-btn:active { transform: scale(0.94); }
.req-btn--approve { color: var(--ok-text); border-color: var(--ok-line); background: var(--ok-soft); }
@media (hover: hover) { .req-btn--approve:hover { background: var(--ok); color: #06281c; border-color: var(--ok); box-shadow: 0 0 16px -4px rgba(52, 211, 153, 0.6); } }
.req-btn--configure { color: var(--text-muted); }
@media (hover: hover) { .req-btn--configure:hover { color: var(--accent-light); border-color: var(--accent-line); background: var(--accent-soft); } }
.req-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mini-dismiss { width: 32px; height: 32px; flex-shrink: 0; color: var(--text-dim); opacity: 0; transition: opacity 0.14s, color 0.14s, background 0.14s; }
.mini-dismiss svg { width: 15px; height: 15px; }
@media (hover: hover) {
  .mini-item:hover .mini-dismiss { opacity: 1; }
  .mini-dismiss:hover { color: var(--bad-text); background: var(--bad-soft); }
}
@media (hover: none), (max-width: 899px) { .mini-dismiss { opacity: 1; } }
.mini-dismiss:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.mini-expand {
  width: 100%; margin-top: 4px; padding: 9px; min-height: 40px;
  background: none; border: 1px dashed var(--border-2); border-radius: 12px;
  color: var(--text-muted); font: inherit; font-size: 0.82rem; cursor: pointer;
}
@media (hover: hover) { .mini-expand:hover { border-color: var(--accent-line); color: var(--text); } }

.request-groups { display: flex; flex-direction: column; gap: 22px; }
.request-group { min-width: 0; }
.request-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.request-group-avatar { width: 30px; height: 30px; font-size: 0.85rem; border-radius: 8px; }
.request-group-head b { font-size: 0.97rem; font-weight: 700; }
.request-body-line { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.requests-card {
  margin-bottom: 16px; padding: 16px;
  background: var(--panel-lit); border: 1px solid var(--accent-line); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 50px -30px var(--accent-glow);
}
.requests-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.requests-title { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 0.97rem; font-weight: 700; }
.request-row { cursor: pointer; }
@media (hover: hover) { .request-row:hover { border-color: var(--accent-line); background: var(--accent-softer); } }

.decide-preview { margin: 14px 0 4px; }
.sheet-actions--three { display: grid; grid-template-columns: auto 1fr 1fr; gap: 10px; }

.us-templates-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.us-templates-head .user-sheet-legend { margin: 0; }
.mini-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* --- Links to the legal documents --- */
.login-legal, .sidebar-legal {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 4px 10px; margin: 10px 0 0;
  font-size: 0.78rem; color: var(--text-dim);
}
.login-legal a, .sidebar-legal a {
  color: var(--text-dim); text-decoration: none;
  min-height: 30px; display: inline-flex; align-items: center; padding: 0 2px;
  transition: color 0.2s;
}
@media (hover: hover) { .login-legal a:hover, .sidebar-legal a:hover { color: var(--accent-light); } }
.sidebar-legal { justify-content: flex-start; margin-top: 12px; gap: 4px 12px; padding-inline: 8px; }
.sidebar-legal--sheet { justify-content: center; margin: 4px 0 14px; padding: 0; }
@media (max-width: 899px) { .sidebar-legal a, .login-legal a { min-height: 44px; } }

@media (max-width: 899px) {
  .manual-upload span { display: none; }
  .manual-upload { padding-inline: 12px; }
}

/* ============================================================
   One account, as a page
   ============================================================ */
.userpage-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding-bottom: 18px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border-soft);
}
.up-back {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px 0 10px;
  background: none; border: 1px solid transparent; cursor: pointer;
  color: var(--text-muted); font: inherit; font-size: 0.85rem; font-weight: 600;
  border-radius: var(--pill); transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.up-back svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .up-back:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); border-color: var(--border); } }
.up-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.userpage-id { display: flex; align-items: center; gap: 13px; min-width: 0; }
.user-avatar--lg { width: 50px; height: 50px; font-size: 1.2rem; border-radius: 14px; flex-shrink: 0; }
.userpage-name-wrap { min-width: 0; }
.userpage-name { margin: 0 0 5px; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userpage-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }

.segmented--page {
  margin: 16px 0 20px;
  display: flex; flex-wrap: nowrap; gap: 3px;
  overflow-x: auto; scrollbar-width: none;
  width: fit-content; max-width: 100%;
}
.segmented--page::-webkit-scrollbar { display: none; }
.segmented--page button { white-space: nowrap; flex: 0 0 auto; min-height: 40px; padding: 0 16px; }

.upsec { display: block; }
.upsec-block { margin-bottom: 26px; }
.upsec-block:last-child { margin-bottom: 0; }
.upsec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.upsec-head .user-sheet-legend { margin: 0; }
.upsec-actions { margin-top: 20px; display: flex; justify-content: flex-start; }
.upsec-unavailable { opacity: 0.5; pointer-events: none; }

/* --- A date window --- */
.activity-range { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 16px; }
.segmented--range { display: flex; flex-wrap: nowrap; gap: 3px; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; width: fit-content; max-width: 100%; }
.segmented--range::-webkit-scrollbar { display: none; }
.segmented--range button { min-height: 36px; padding: 0 14px; font-size: 0.82rem; white-space: nowrap; flex: 0 0 auto; }
.range-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  border-radius: var(--pill);
  color: var(--text-muted); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.range-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .range-toggle:hover { color: var(--text); border-color: var(--accent-line); } }
.range-toggle.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-light); }
.range-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.range-dates { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.icon-btn--danger { color: var(--bad-text); }
@media (hover: hover) { .icon-btn--danger:hover { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-text); } }
.range-date { display: flex; flex-direction: column; gap: 3px; }
.range-date span { font-size: 0.74rem; color: var(--text-dim); padding-inline-start: 2px; }
.input--date { min-height: 40px; padding: 0 12px; width: auto; font-size: 0.85rem; font-variant-numeric: tabular-nums; color-scheme: dark; }
#up-activity-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; }

.admin-toolbar .segmented { display: flex; flex-wrap: nowrap; gap: 3px; overflow-x: auto; scrollbar-width: none; width: fit-content; max-width: 100%; }
.admin-toolbar .segmented::-webkit-scrollbar { display: none; }
.admin-toolbar .segmented button { white-space: nowrap; flex: 0 0 auto; }

.timeline-more { margin-top: 14px; }
.timeline-done { margin: 12px 0 0; text-align: center; font-size: 0.8rem; color: var(--text-dim); }

/* --- A history row that opens --- */
.rowcard--open { cursor: pointer; }
@media (hover: hover) {
  .rowcard--open:hover {
    border-color: var(--border-2); transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow), 0 20px 50px -30px var(--accent-glow);
  }
  .rowcard--open:hover .rowcard-open-ico { color: var(--accent-light); transform: translateX(-3px); }
}
.rowcard--open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rowcard-open-ico { display: inline-flex; color: var(--text-dim); transition: transform 0.25s var(--ease), color 0.2s ease; }
.rowcard-open-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .rowcard-open-ico { transition: none; } }

.sms-preview--full { max-width: none; }
.meta-rows--spaced { margin-top: 18px; }
.mini-list--scroll { max-height: 280px; overflow-y: auto; }

/* --- The activity log --- */
.timeline { display: flex; flex-direction: column; }
.tl-day {
  position: sticky; top: 0; z-index: 2;
  margin: 18px 0 8px; padding: 6px 0;
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.03em;
  background: var(--bg);
}
.tl-day:first-child { margin-top: 0; }
.tl-item {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--border-soft); border-radius: 14px;
  background: var(--panel);
  margin-bottom: 7px;
  transition: border-color 0.2s;
}
@media (hover: hover) { .tl-item:hover { border-color: var(--border-2); } }
.tl-time { margin-top: 2px; font-family: var(--mono); font-size: 0.76rem; color: var(--text-dim); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.tl-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.tl-act {
  display: grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; padding: 0;
  border: none; border-radius: var(--pill); background: none; color: var(--text-dim); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tl-act svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .tl-act:hover { background: var(--surface-3); color: var(--text); } }
.tl-act--danger:hover { background: var(--bad-soft); color: var(--bad-text); }
.tl-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.info-rows { display: flex; flex-direction: column; margin: 4px 0 16px; }
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 2px; border-bottom: 1px solid var(--border-soft); }
.info-row:last-child { border-bottom: none; }
.info-row dt { font-size: 0.85rem; color: var(--text-muted); flex-shrink: 0; }
.info-row dd { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--text); text-align: end; overflow-wrap: anywhere; }

.tl-del { width: 32px; height: 32px; flex-shrink: 0; color: var(--text-dim); opacity: 0; transition: opacity 0.14s ease, color 0.14s ease; }
.tl-del svg { width: 15px; height: 15px; }
@media (hover: hover) {
  .tl-item:hover .tl-del { opacity: 1; }
  .tl-del:hover { color: var(--bad-text); background: var(--bad-soft); }
}
@media (hover: none) { .tl-del { opacity: 1; } }
@media (max-width: 899px) { .tl-del { opacity: 1; } }
.tl-del:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .tl-del { transition: none; } }

.tl-ip-note { font-style: normal; font-size: 0.92em; color: var(--text-dim); padding-inline-start: 5px; opacity: 0.85; }
.tl-mark {
  width: 32px; height: 32px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
}
.tl-mark svg { width: 15px; height: 15px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tl-item--ok .tl-mark { background: var(--ok-soft); border-color: var(--ok-line); box-shadow: 0 0 14px -6px rgba(52, 211, 153, 0.6); }
.tl-item--ok .tl-mark svg { stroke: var(--ok-text); }
.tl-item--warn .tl-mark { background: var(--warn-soft); border-color: var(--warn-line); }
.tl-item--warn .tl-mark svg { stroke: var(--warn-text); }
.tl-item--bad .tl-mark { background: var(--bad-soft); border-color: var(--bad-line); box-shadow: 0 0 14px -6px rgba(248, 113, 113, 0.6); }
.tl-item--bad .tl-mark svg { stroke: var(--bad-text); }
.tl-body { min-width: 0; }
.tl-what { font-size: 0.89rem; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.tl-who { font-weight: 700; }
.tl-where { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.76rem; color: var(--text-dim); }
.tl-where span { display: inline-flex; align-items: center; gap: 4px; }
.tl-where svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tl-ip { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; direction: ltr; unicode-bidi: isolate; }
.tl-when { font-family: var(--mono); font-size: 0.76rem; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.timeline--compact .tl-item { padding: 9px 11px; margin-bottom: 6px; }
.timeline--compact .tl-day { margin: 13px 0 6px; background: var(--bg-elevated); }

.field-hint--block { display: block; margin-bottom: 11px; }

/* ============================================================
   PHONE — the same system, recomposed for one thumb
   ============================================================ */
@media (max-width: 899px) {
  .consent { padding: 14px; min-height: 44px; align-items: center; }

  .userpage-head { grid-template-columns: 1fr; gap: 12px; }
  .userpage-actions { justify-content: flex-start; }
  .userpage-actions .btn { min-height: 44px; }
  .segmented--page, .segmented--range, .admin-toolbar .segmented { width: 100%; }
  .segmented--page {
    display: grid; grid-template-columns: repeat(6, 1fr);
    width: 100%; margin-inline: 0; padding-inline: 0; overflow: visible;
  }
  .segmented--page button { min-height: 44px; padding: 0 3px; font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; }
  .segmented--range button, .range-toggle { min-height: 44px; }
  .input--date { min-height: 44px; }
  .range-dates { width: 100%; }
  .range-date { flex: 1 1 140px; }
  .range-date .input--date { width: 100%; }
  .tl-del { width: 44px; height: 44px; }
  .mini-list--scroll { max-height: 220px; }
  .tl-item, .tl-item--deletable { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 4px; }
  .tl-when { grid-column: 2; justify-self: start; align-self: end; }
  .tl-del { grid-column: 3; grid-row: 1 / -1; align-self: center; }

  .app-view { display: block; min-height: 100dvh; }
  .sidebar { display: none; }
  .main-top { display: none; }

  .appbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 10px;
    padding: calc(var(--safe-t) + 18px) 16px 14px;
    margin: 0 -16px;
    background: rgba(8, 9, 16, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--border-soft);
  }
  .appbar-id { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
  .appbar-title {
    min-width: 0; margin: 0;
    font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .appbar-brand { display: none; }
  .appbar-id--brand .appbar-brand { display: block; line-height: 1.15; }
  .appbar-id--brand .appbar-brand .logo-name { font-size: 1.15rem; }
  .appbar-id--brand .appbar-title { font-size: 0.85rem; font-weight: 600; letter-spacing: 0; color: var(--text-muted); }
  .appbar-back { width: 44px; height: 44px; border-color: transparent; background: transparent; }
  .appbar-back svg { width: 20px; height: 20px; }
  .appbar-avatar {
    display: grid; place-items: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 12px; border: none;
    background: linear-gradient(160deg, var(--accent-top-hover), var(--accent-strong));
    color: #fff; font-family: inherit; font-weight: 800; font-size: 0.97rem;
    text-transform: uppercase; cursor: pointer;
    box-shadow: 0 6px 18px -6px var(--accent-glow);
  }

  .main { padding: 0 16px calc(var(--tabbar-h) + var(--safe-b) + 26px); max-width: none; }

  .tabbar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
    display: flex; align-items: stretch;
    height: calc(var(--tabbar-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(8, 9, 16, 0.86);
    -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
    border-top: 1px solid var(--border-soft);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    flex: 1; min-width: 0; padding: 7px 2px;
    background: none; border: none; cursor: pointer;
    color: var(--text-dim); font-family: inherit;
    transition: color 0.2s;
  }
  .tab-ico {
    display: grid; place-items: center; width: 50px; height: 28px; border-radius: var(--pill);
    transition: background 0.25s, box-shadow 0.35s var(--ease), color 0.2s;
  }
  .tab-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tab-label { font-size: 0.7rem; font-weight: 600; letter-spacing: -0.1px; }
  .tab.is-active { color: var(--accent-light); }
  .tab.is-active .tab-ico { background: var(--accent-soft); box-shadow: 0 0 18px -4px var(--accent-glow); }
  .tab.is-active .tab-ico svg { stroke-width: 2.3; }
  .tab:active .tab-ico { background: rgba(255, 255, 255, 0.06); }

  .panel.is-active { padding-top: 16px; }

  /* On a phone the screen is the card. */
  .card { padding: 0; background: none; border: none; border-radius: 0; box-shadow: none; }
  .card-title { font-size: 1.12rem; }

  .send-layout { display: block; }
  .send-rail { display: none; }
  .panel--send[data-step="3"] .send-rail { display: block; position: static; margin-bottom: 16px; padding: 6px 18px; }
  .panel--send[data-step="3"] .rail-title { display: none; }
  .stage-actions { display: none; }

  .quota-strip { gap: 10px; padding: 16px 18px 15px; margin-bottom: 16px; }
  .quota-strip-value { font-size: 2.4rem; }
  .quota-strip-value--pooled { font-size: 1.25rem; }

  .stepper { margin-bottom: 20px; }
  .stepper::before, .stepper::after { top: 13px; }
  .step-num { width: 27px; height: 27px; font-size: 0.76rem; }
  .step-hint { display: none; }
  .step-name { font-size: 0.78rem; }

  .stepbar {
    position: fixed; inset-inline: 0; z-index: 45;
    bottom: calc(var(--tabbar-h) + var(--safe-b));
    display: grid; grid-template-columns: auto 1fr; gap: 10px;
    padding: 10px 16px;
    background: rgba(8, 9, 16, 0.86);
    -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
    border-top: 1px solid var(--border-soft);
  }
  .panel--send.is-active { padding-bottom: calc(var(--stepbar-h) + 12px); }
  .panel--send[data-step="1"] #step-prev-m { display: none; }
  .panel--send[data-step="1"] .stepbar { grid-template-columns: 1fr; }

  .sms-preview { max-width: none; }
  .panel--send #send-btn { display: none; }

  .summary-row { gap: 9px; }
  .summary-cell { padding: 13px 12px; }
  .summary-val { font-size: 1.2rem; }
  .summary-label { font-size: 0.77rem; }
  .home-top { grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; }
  .summary-row { grid-template-rows: none; grid-template-columns: repeat(3, 1fr); }
  .summary-cell { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; }
  .balance-card { padding: 20px; margin-bottom: 0; gap: 16px; }
  .balance-value { font-size: 2.4rem; }
  .balance-card .btn { width: 100%; }

  .rowcard { padding: 13px 14px; gap: 11px; }
  .rowcard-actions { flex-direction: column; gap: 6px; align-items: stretch; }
  .rowcard-actions .btn { min-height: 44px; padding: 10px 14px; font-size: 0.85rem; }
  .rowcard-meta .rowcard-sep { display: none; }

  .textarea { min-height: 116px; max-height: 148px; }
  .form-grid { grid-template-columns: 1fr; }

  .admin-figures { grid-template-columns: 1fr 1fr; gap: 9px; }
  .figure { padding: 12px 14px; gap: 0; }
  .figure-val { font-size: 1.2rem; }
  .figure-label { font-size: 0.76rem; }
  .btn--sm { min-height: 44px; padding: 10px 16px; }
  .segmented button { min-height: 44px; }
  .appbar-avatar { width: 44px; height: 44px; }
  .kebab-btn { width: 44px; height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .row-menu-item { min-height: 44px; }

  .admin-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
  .admin-toolbar > * { width: 100%; flex: 0 0 auto; }
  .search-box { min-width: 0; }
  .segmented:not(.segmented--page):not(.segmented--range):not(.admin-toolbar .segmented) {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%;
  }
  .segmented button { padding: 6px 4px; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; }
  .segmented--range button, .admin-toolbar .segmented button { padding: 6px 14px; overflow: visible; }
  .admin-count { margin-inline-start: 0; text-align: start; }

  .filter-toggle {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 9px;
    min-height: 46px; padding: 0 16px;
    background: rgba(0, 0, 0, 0.26); border: 1px solid var(--border);
    border-radius: var(--pill); color: var(--text-muted);
    font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  }
  .filter-toggle svg { width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .filter-toggle-label { flex-shrink: 0; }
  .filter-toggle-state { flex: 1; min-width: 0; text-align: start; color: var(--text-dim); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .filter-toggle-chevron { transition: transform 0.2s var(--ease); }
  .filter-toggle[aria-expanded="true"] { color: var(--text); border-color: var(--accent-line); }
  .filter-toggle[aria-expanded="true"] .filter-toggle-chevron { transform: rotate(180deg); }
  .filter-toggle.is-filtered .filter-toggle-state { color: var(--accent-light); }

  .filter-group { grid-column: 1 / -1; display: grid; gap: 9px; }
  .filter-group[hidden] { display: none; }
  .table-wrap { display: none; }
  .users-cards { display: flex; flex-direction: column; gap: 9px; }
  .user-card {
    display: flex; padding: 12px 14px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
    cursor: pointer; transition: background 0.15s, border-color 0.15s;
  }
  .user-card:active { background: var(--surface-2); }
  .user-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .user-card--off { opacity: 0.6; }
  .user-card-top { display: flex; align-items: center; gap: 10px; width: 100%; }
  .uc-meta { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
  .uc-name { font-size: 0.97rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .uc-badges { display: flex; gap: 6px; flex-wrap: wrap; }
  .user-card-info { display: flex; flex-direction: column; gap: 7px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
  .uc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.85rem; }
  .uc-row-label { color: var(--text-muted); }
  .uc-row-val { font-weight: 600; text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .uc-row-val.num { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
  .uc-row-val.mono { font-family: var(--mono); font-size: 0.85rem; direction: ltr; unicode-bidi: isolate; }

  /* --- Overlays become bottom sheets --- */
  .overlay { display: flex; align-items: flex-end; padding: 0; }
  .sheet, .sheet--sm, .sheet--wide {
    max-width: none; width: 100%;
    max-height: 92dvh;
    padding: 10px 18px calc(20px + var(--safe-b));
    border-radius: 22px 22px 0 0;
    border-inline: none; border-bottom: none;
    animation: sheetUp 0.28s var(--ease) both;
  }
  .sheet-grab { display: block; width: 38px; height: 4px; margin: 0 auto 14px; border-radius: 99px; background: var(--border-2); }
  .mini-figures { grid-template-columns: 1fr 1fr; }
  .user-sheet .sheet-actions { margin: 18px -18px calc(-20px - var(--safe-b)); padding: 14px 18px calc(14px + var(--safe-b)); }

  .sheet-actions { flex-direction: column-reverse; margin-top: 18px; }
  .sheet-actions .btn { width: 100%; min-height: 48px; }

  .toasts { inset-inline: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); max-width: none; }
  .section { margin-top: 22px; }
  .empty { padding: 34px 20px; }

  /* The room's light, without the grid: a phone screen is too small for it to
     read as anything but noise. */
  body::before { background-size: auto, auto, 0 0, 0 0; }
}

/* Tablet / narrow laptop: keep the desktop shell, tighten the rail. */
@media (min-width: 900px) and (max-width: 1140px) {
  :root { --rail-w: 240px; }
  .main { padding: 26px 24px 54px; }
  .admin-figures { grid-template-columns: repeat(2, 1fr); }
}

/* Small phones */
@media (max-width: 379px) {
  .logo--stacked .logo-name { font-size: 1.25rem; letter-spacing: 0.04em; }
}
@media (max-width: 359px) {
  .main { padding-inline: 13px; }
  .step-name { display: none; }
  .admin-figures { grid-template-columns: 1fr; }
}

/* Landscape phone: the tab bar would eat too much height. */
@media (max-width: 899px) and (max-height: 460px) and (orientation: landscape) {
  :root { --tabbar-h: 52px; }
  .tabbar { height: calc(52px + var(--safe-b)); }
  .tab-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .live-dot { animation: none; box-shadow: none; }
  .btn--primary::before { display: none; }
}
