/* ════════════════════════════════════════════════════════════════════
   FlyNet support — black glass and brushed silver.
   One stylesheet for the customer app and the agents' panel.
   Behind everything: a slow aurora, a faint grid and (fx.js) a quiet
   network of silver nodes. Panels are dark glass on top of it.
   ════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #07080a;
  --text: #e8ecf1;
  --ink: #0b0d10;               /* dark text that sits on silver */
  --ink-2: #1b1e24;
  --paper: rgba(255,255,255,.055);   /* recessed fields and hovers */
  --card: rgba(20,22,27,.78);
  --line: rgba(196,204,216,.14);
  --line-2: rgba(210,217,228,.30);
  --muted: #8f98a6;
  --silver-1: #f6f8fb;
  --silver-2: #c6ccd6;
  --silver-3: #8c95a3;
  --silver: linear-gradient(135deg, #f7f9fc 0%, #c9cfd9 36%, #8f98a6 64%, #e1e5ec 100%);
  --mine: #cdd3dc;
  --mine-ink: #0b0d10;
  --theirs: rgba(31,34,41,.86);
  --signal: #d9dee6;             /* the one accent is now silver */
  --signal-ink: #0b0d10;
  --ok: #3fd08a;
  --bad: #e0553f;
  --note: rgba(120,100,40,.26);
  --note-line: rgba(231,207,127,.5);
  --focus: #dfe4ec;
  --radius: 16px;
  --glass: blur(14px) saturate(120%);
  --font: "Vazirmatn", "Vazir", "IRANSansX", "IRANSans", "Shabnam", "Noto Sans Arabic UI", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #3b414b transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3b414b; border-radius: 8px; }
::selection { background: rgba(214,221,232,.28); }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.7; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: inherit; }
.ic { width: 22px; height: 22px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── the living background ─────────────────────────────────────────── */
body::before {                                   /* aurora: three soft silver lights drifting */
  content: ''; position: fixed; inset: -25%; z-index: -3; pointer-events: none;
  background:
    radial-gradient(38% 34% at 22% 24%, rgba(196,206,222,.17), transparent 70%),
    radial-gradient(34% 30% at 80% 72%, rgba(140,156,180,.15), transparent 70%),
    radial-gradient(26% 22% at 64% 14%, rgba(255,255,255,.08), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {                                    /* a fine grid that fades out toward the edges */
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 38%, #000 0%, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 38%, #000 0%, transparent 78%);
  animation: grid 50s linear infinite;
}
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 1; }
#root { position: relative; z-index: 1; height: 100%; }
@keyframes drift { 0% { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); } 50% { transform: translate3d(3%, 2%, 0) rotate(5deg) scale(1.06); } 100% { transform: translate3d(-2%, 4%, 0) rotate(-4deg) scale(1.02); } }
@keyframes grid { to { background-position: 46px 46px, 46px 46px; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes scan { from { background-position: 140% 0; } to { background-position: -40% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes breathe { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes sheen { 0%, 62% { transform: translateX(130%); } 100% { transform: translateX(-130%); } }
@keyframes blink { to { visibility: hidden; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(63,208,138,.55); } 100% { box-shadow: 0 0 0 9px rgba(63,208,138,0); } }

/* ── the frame ─────────────────────────────────────────────────────── */
.app {
  display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto;
  background: rgba(7,8,10,.10);                  /* (no blur here: the moving network behind must stay sharp) */
  border-inline: 1px solid var(--line); box-shadow: 0 0 80px rgba(0,0,0,.45);
}
.bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 58px; position: relative; z-index: 2;
  background: linear-gradient(180deg, rgba(30,33,39,.92), rgba(14,15,19,.88)); color: var(--text);
  border-bottom: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.07);
}
.bar::after {                                    /* a thin light that travels along the bar's lower edge */
  content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(240,244,250,.95), transparent) no-repeat; background-size: 38% 100%;
  animation: scan 6s linear infinite;
}
.bar-mark { width: 36px; height: 36px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 8px rgba(190,200,215,.28)); }
.bar h1 {
  font-size: 17px; font-weight: 800; margin: 0; line-height: 1.3;
  background: linear-gradient(180deg, #ffffff, #b9c1cd); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bar .sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.bar .grow { flex: 1; min-width: 0; }
.bar .grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: inherit; transition: background .2s, border-color .2s, transform .15s;
}
.iconbtn:hover { background: rgba(255,255,255,.08); border-color: var(--line); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.dark:hover { background: rgba(255,255,255,.08); }

/* the signal strip: the line's state, and your place in the queue */
.strip {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px; font-size: 13.5px; min-height: 34px;
  background: rgba(255,255,255,.04); color: var(--silver-2); border-bottom: 1px solid var(--line);
}
.strip .dot { width: 9px; height: 9px; border-radius: 50%; background: #66707e; flex: none; }
.strip.on .dot { background: var(--ok); box-shadow: 0 0 10px rgba(63,208,138,.7); animation: ping 2.2s ease-out infinite; }
.strip.down { background: rgba(130,42,28,.38); color: #ffd9d0; }
.strip.down .dot { background: #ff8a6b; animation: blink 1.2s steps(2, start) infinite; }
.strip.queue { background: var(--silver); color: var(--signal-ink); font-weight: 700; }
.strip.queue .dot { background: var(--signal-ink); }
.strip .pos { font-size: 20px; font-weight: 800; line-height: 1; }

.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 8px; }
.pad { padding: 18px 16px; }

/* ── forms and cards ───────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, rgba(31,34,40,.80), rgba(15,17,21,.80));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 14px 34px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.08);
  -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
.card + .card { margin-top: 12px; animation-delay: .08s; }
.card + .card + .card { animation-delay: .16s; }
.card h2 { font-size: 16px; margin: 0 0 8px; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label.f { display: block; margin: 12px 0 4px; font-size: 13.5px; color: var(--muted); }
.in {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255,255,255,.05);
  font-size: 16px;                                /* (16px: iPhone does not zoom in) */
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.in::placeholder, .composer textarea::placeholder { color: #6d7581; }
.in:focus { border-color: var(--silver-2); background: rgba(255,255,255,.08); outline: none; box-shadow: 0 0 0 3px rgba(214,221,232,.16); }
.in.ltr { direction: ltr; text-align: left; }
textarea.in { resize: vertical; min-height: 80px; }
select.in, .chathead select { background-color: #14161b; color: var(--text); }
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px; border: 1px solid rgba(255,255,255,.35); min-height: 44px; font-weight: 700;
  background: var(--silver); color: var(--signal-ink); text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn::after {                                    /* a pass of light across the silver */
  content: ''; position: absolute; inset: 0; pointer-events: none; transform: translateX(130%);
  background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.75) 50%, transparent 62%);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 12px 28px rgba(0,0,0,.5), 0 0 22px rgba(200,210,225,.2), inset 0 1px 0 rgba(255,255,255,.8); }
.btn:hover::after { animation: sheen 1.1s ease-out 1; }
.btn.wide { width: 100%; }
.btn.wide:not(:disabled)::after { animation: sheen 5.5s ease-in-out infinite; }
.btn:active { transform: translateY(0) scale(.98); }
.btn.ghost { background: rgba(255,255,255,.04); color: var(--text); border-color: var(--line-2); box-shadow: none; }
.btn.ghost::after { display: none; }
.btn.ghost:hover { background: rgba(255,255,255,.09); border-color: var(--silver-3); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #e5654f, #a82f1d); color: #fff; border-color: rgba(255,255,255,.2); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 13.5px; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; transform: none; filter: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.mt { margin-top: 12px; }
.card > .row.end, form > .row.end { margin-top: 10px; }
.err { color: #ff8f7a; font-size: 13.5px; margin-top: 8px; min-height: 1em; }
.tabs { display: flex; gap: 4px; background: rgba(255,255,255,.05); border: 1px solid var(--line); padding: 4px; border-radius: 13px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 10px; color: var(--muted); transition: background .2s, color .2s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--silver); color: var(--signal-ink); font-weight: 800; box-shadow: 0 2px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.7); }
.code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; direction: ltr; letter-spacing: .12em;
  font-size: 22px; font-weight: 700; text-align: center; padding: 12px; border-radius: 11px; background: rgba(255,255,255,.05);
  border: 1px dashed var(--silver-3); color: #fff;
}

/* the welcome screen: the logo, the shop's name, and the way in */
.hello { position: relative; padding: 18px 18px 6px; text-align: center; }
.hello::before {
  content: ''; position: absolute; inset: 0 10% auto; height: 280px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(206,214,228,.2), transparent); animation: breathe 6s ease-in-out infinite;
}
.hero-logo { display: block; width: min(62vw, 250px); height: auto; margin: 0 auto -6px; animation: float 7s ease-in-out infinite; filter: drop-shadow(0 12px 30px rgba(190,200,216,.22)); }
.hello.sm { padding-top: 14px; }
.hello.sm .hero-logo { width: 104px; margin-bottom: 0; }
.hello .name {
  font-size: 26px; font-weight: 800; line-height: 1.3; margin: 0 0 6px;
  background: linear-gradient(100deg, #8d96a4 0%, #ffffff 22%, #aab2be 45%, #ffffff 68%, #8d96a4 100%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 7s linear infinite;
}
.hello p { margin: 0; white-space: pre-line; color: var(--muted); }
.cats { display: grid; gap: 8px; margin-top: 12px; }
.cat {
  text-align: start; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  font-weight: 600; display: flex; align-items: center; justify-content: space-between; color: var(--text);
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.cat:hover { border-color: var(--silver-3); background: rgba(255,255,255,.09); transform: translateX(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.cat:active { transform: scale(.985); }
.cat .ic { transform: scaleX(-1); opacity: .5; transition: opacity .2s; }
.cat:hover .ic { opacity: 1; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li + li { border-top: 1px solid var(--line); }
.hist button { width: 100%; text-align: start; background: none; border: 0; padding: 12px 2px; display: flex; justify-content: space-between; gap: 10px; color: var(--text); }
.hist button:hover { color: #fff; }

/* ── messages ──────────────────────────────────────────────────────── */
.day { text-align: center; margin: 10px 0; }
.day span { font-size: 12px; background: rgba(255,255,255,.07); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; color: var(--muted); }
.evt { text-align: center; margin: 10px 0; font-size: 12.5px; color: var(--muted); }
.evt span { background: rgba(255,255,255,.05); border: 1px solid var(--line); padding: 3px 12px; border-radius: 99px; display: inline-block; }
.evt-note span { background: var(--note); border-color: var(--note-line); }
.msg { display: flex; flex-direction: column; max-width: min(82%, 520px); margin: 4px 0; animation: pop .22s ease-out both; }
/* what I sent sits on the right (the start side in Persian), as in Telegram; the other side on the left */
.msg.mine { margin-inline-end: auto; align-items: flex-start; }
.msg.theirs { margin-inline-start: auto; align-items: flex-end; }
.msg-body {
  padding: 8px 12px; border-radius: 17px; background: var(--theirs); border: 1px solid var(--line);
  overflow-wrap: anywhere; white-space: pre-wrap; position: relative; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.msg.mine .msg-body {
  background: linear-gradient(145deg, #f1f4f8 0%, #c3cad4 55%, #aab2be 100%); color: var(--mine-ink); border-color: rgba(255,255,255,.4);
  border-end-start-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.8);
}
.msg.theirs .msg-body { border-end-end-radius: 4px; }
.msg.note .msg-body { background: var(--note); border: 1px dashed var(--note-line); color: #f3e8bf; }
.msg-by { font-size: 12px; font-weight: 700; color: var(--silver-2); margin-bottom: 2px; }
.msg.mine .msg-by { color: #3b424d; }
.msg-text a { word-break: break-all; text-decoration-color: rgba(255,255,255,.4); }
.msg-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; padding: 1px 6px 0; align-items: center; }
.tick { letter-spacing: -2px; }
.tick.seen { color: #6cb8ff; }
.tick.failed { color: #ff8f7a; font-weight: 800; letter-spacing: 0; }
.retry { border: 0; background: none; color: #ff8f7a; font-size: 12.5px; padding: 2px 6px; text-decoration: underline; }
.msg-img { border: 0; padding: 0; background: none; display: block; margin: -2px -6px 4px; border-radius: 12px; overflow: hidden; }
.msg-img img { display: block; max-width: 100%; max-height: 320px; min-width: 120px; min-height: 80px; object-fit: cover; background: rgba(255,255,255,.05); }
.msg-file { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 0; }
.msg-file .mf-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 220px; white-space: nowrap; }
.msg-file .mf-size { font-size: 12px; color: var(--muted); }
.msg.mine .mf-size, .msg.mine .vp-time { color: #3b424d; }
.vp { display: flex; align-items: center; gap: 10px; min-width: 200px; padding: 2px 0; }
.vp-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--silver); color: var(--signal-ink); display: grid; place-items: center; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.vp-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); position: relative; cursor: pointer; overflow: hidden; }
.vp-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--silver-1); border-radius: 3px; }
.vp-time { font-size: 12px; color: var(--muted); min-width: 34px; }
.msg.mine .vp-btn { background: #0d0f13; color: #fff; }
.msg.mine .vp-bar { background: rgba(0,0,0,.2); }
.msg.mine .vp-fill { background: #0d0f13; }
.typing { font-size: 12.5px; color: var(--silver-2); padding: 0 16px 4px; min-height: 20px; }
.typing:not(:empty)::after { content: '…'; }

/* ── the composer ──────────────────────────────────────────────────── */
.composer {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(20,22,27,.92), rgba(10,11,14,.95)); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.05);
}
.composer textarea {
  flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 22px; padding: 9px 15px; resize: none; max-height: 160px;
  font-size: 16px; line-height: 1.5; min-height: 42px; transition: border-color .2s, box-shadow .2s;
}
.composer textarea:focus { outline: none; border-color: var(--silver-2); box-shadow: 0 0 0 3px rgba(214,221,232,.13); }
.composer .iconbtn { color: var(--muted); }
.composer .iconbtn:hover { color: #fff; }
.composer .send { background: var(--silver); color: var(--signal-ink); width: 44px; height: 44px; border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.8); }
.composer .send:hover { box-shadow: 0 4px 18px rgba(0,0,0,.5), 0 0 18px rgba(205,214,228,.35), inset 0 1px 0 rgba(255,255,255,.8); }
.composer .send .ic { transform: scaleX(-1); }      /* (points to the start side in RTL) */
.composer.notemode { background: linear-gradient(180deg, rgba(70,58,22,.85), rgba(40,33,12,.9)); }
.recbar { display: flex; align-items: center; gap: 12px; flex: 1; padding: 0 6px; min-height: 44px; }
.recbar .rdot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: blink 1s steps(2, start) infinite; }
.recbar .rtime { font-weight: 700; min-width: 48px; }
.closed-box { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(14,15,19,.92); border-top: 1px solid var(--line); text-align: center; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 8px 0; direction: ltr; }
.stars button { border: 0; background: none; font-size: 30px; line-height: 1; color: #3d434d; padding: 2px; transition: transform .15s, color .2s; }
.stars button:hover { transform: scale(1.15); }
.stars button.on { color: #e9edf3; text-shadow: 0 0 12px rgba(220,228,240,.55); }

/* ── overlays ──────────────────────────────────────────────────────── */
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: grid; place-items: center; z-index: 50; }
.viewer img { max-width: 96vw; max-height: 92vh; }
.viewer-x { position: absolute; top: 12px; inset-inline-end: 12px; color: #fff; background: rgba(255,255,255,.14); border: 0; border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; }
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: linear-gradient(180deg, rgba(30,33,39,.98), rgba(14,15,19,.98)); border: 1px solid var(--line-2); border-bottom: 0;
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; box-shadow: 0 -20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.1);
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: rise .28s cubic-bezier(.2,.7,.2,1) both;
}
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 20px; border-bottom: 1px solid var(--line-2); } }
.sheet h2 { margin: 0 0 10px; font-size: 17px; color: #fff; }
.menu { list-style: none; margin: 0; padding: 0; }
.menu button { width: 100%; text-align: start; padding: 12px 8px; border: 0; background: none; display: flex; gap: 12px; align-items: center; border-radius: 11px; color: var(--text); }
.menu button:hover { background: rgba(255,255,255,.07); }
#toasts { position: fixed; top: 64px; inset-inline: 0; display: grid; justify-items: center; gap: 6px; z-index: 60; pointer-events: none; }
.toast {
  background: rgba(24,26,31,.96); color: #fff; padding: 9px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw;
  border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: opacity .3s; animation: rise .25s both;
}
.toast.bad { background: linear-gradient(135deg, #7d2a1c, #5a1d13); border-color: rgba(255,140,110,.4); }
.toast.out { opacity: 0; }
.mirror { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.mirror code { direction: ltr; font-size: 13.5px; flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; color: var(--silver-2); }
.mirror .row { flex-wrap: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }

/* ════ the agents' panel ═════════════════════════════════════════════ */
.admin { display: grid; grid-template-columns: 340px 1fr; height: 100dvh; max-width: none; background: transparent; border-inline: 0; }
.admin .side { display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); background: rgba(12,13,17,.82); min-height: 0; }
.admin .main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.nav button { border: 0; background: none; padding: 7px 10px; border-radius: 9px; white-space: nowrap; color: var(--muted); font-size: 14px; transition: background .2s, color .2s; }
.nav button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav button[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; font-weight: 700; box-shadow: inset 0 -2px 0 var(--silver-2); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--silver); color: var(--signal-ink); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; margin-inline-start: 4px; }
.badge.zero { background: rgba(255,255,255,.09); color: var(--muted); font-weight: 600; }
.search { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.search .tabs { padding: 3px; gap: 2px; }
.search .tabs button { font-size: 12.5px; padding: 7px 3px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.search .tabs .badge { margin-inline-start: 2px; min-width: 18px; line-height: 18px; font-size: 11px; padding: 0 4px; }
.search .in { padding: 8px 12px; font-size: 14.5px; }
.clist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.citem {
  width: 100%; text-align: start; border: 0; background: none; padding: 11px 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  border-bottom: 1px solid var(--line); border-inline-start: 3px solid transparent; color: var(--text); transition: background .2s;
}
.citem:hover { background: rgba(255,255,255,.05); }
.citem[aria-current="true"] { background: rgba(214,221,232,.10); border-inline-start-color: var(--silver-1); }
.citem .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem .when { font-size: 12px; color: var(--muted); }
.citem .prev { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem .tags { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); grid-column: 1 / -1; flex-wrap: wrap; }
.chip { font-size: 11.5px; padding: 0 8px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid var(--line); line-height: 20px; color: var(--silver-2); }
.chip.wait { background: rgba(241,162,8,.14); border-color: rgba(241,162,8,.45); color: #ffd98a; }
.chathead { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: rgba(16,17,21,.88); flex-wrap: wrap; }
.chathead .grow { flex: 1; min-width: 140px; }
.chathead .who { font-weight: 700; color: #fff; }
.chathead select { padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line-2); }
.quick { position: absolute; bottom: 64px; inset-inline: 10px; max-height: 50vh; overflow-y: auto; background: rgba(20,22,27,.98); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.6); z-index: 5; }
.quick button { display: block; width: 100%; text-align: start; border: 0; background: none; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.quick button:hover, .quick button.sel { background: rgba(255,255,255,.08); }
.quick b { display: block; font-size: 14px; }
.quick span { font-size: 13px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: start; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table tbody tr:hover { background: rgba(255,255,255,.03); }
.stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat div { background: linear-gradient(180deg, rgba(31,34,40,.8), rgba(15,17,21,.8)); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.07); animation: rise .5s both; }
.stat b { display: block; font-size: 24px; background: linear-gradient(180deg, #fff, #aeb7c4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 13px; color: var(--muted); }
.page { overflow-y: auto; padding: 16px; flex: 1; }
.page h2 { font-size: 18px; margin: 0 0 12px; color: #fff; }
.mobile-only { display: none; }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .admin .side { border: 0; }
  .admin.viewing .side { display: none; }
  .admin:not(.viewing) .main { display: none; }
  .mobile-only { display: inline-grid; }
}
.grow-col { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.col { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pos-rel { position: relative; }
.iconbtn[aria-pressed="true"] { background: rgba(231,207,127,.25); color: #ffe9a8; border-color: var(--note-line); }
.hist button span:first-child { font-weight: 600; }
.citem > .badge { justify-self: end; align-self: center; }

/* people who asked their device for less motion get a still version */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .strip.on .dot { box-shadow: 0 0 10px rgba(63,208,138,.7); }
  .btn::after, .bar::after { display: none; }
}
