/* ════════════════════════════════════════════════════════════════════
   FlyNet support — graphite glass, brushed silver, a soft aurora.
   One stylesheet for the customer app and the agents' panel.
   Behind everything: two slow coloured lights and a quiet dot constellation (bg.js).
   Panels are frosted glass on top of it.
   ════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #141823;
  --bg-top: #1d2231;
  --text: #eceff5;
  --ink: #0e1117;               /* dark text that sits on silver */
  --ink-2: #1d212b;
  --paper: rgba(255,255,255,.05);    /* hovers */
  --field: rgba(8,10,15,.55);        /* recessed inputs */
  --card: rgba(33,38,51,.72);
  --card-2: rgba(22,26,36,.80);
  --line: rgba(188,198,228,.12);
  --line-2: rgba(198,208,236,.22);
  --muted: #8f98ac;
  --silver-1: #f7f9fd;
  --silver-2: #c9d0de;
  --silver-3: #8e98ad;
  --silver: linear-gradient(135deg, #fbfcfe 0%, #d7dce8 34%, #a9b2c6 64%, #e9ecf4 100%);
  --mine-ink: #10131a;
  --theirs: rgba(40,46,61,.92);
  --accent: #9aa6ff;              /* soft periwinkle: focus rings, links, the aurora */
  --accent-2: #b89cff;
  --signal-ink: #10131a;
  --ok: #3ed598;
  --bad: #ef6a55;
  --note: rgba(120,100,40,.26);
  --note-line: rgba(231,207,127,.5);
  --focus: #b6beff;
  --radius: 18px;
  --glass: blur(16px) saturate(130%);
  --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: #3a4152 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3a4152; border-radius: 8px; }
::selection { background: rgba(154,166,255,.32); }
html, body { margin: 0; height: 100%; }
body {                                           /* (this background is the page's canvas: the lights below sit on top of it) */
  font-family: var(--font); font-size: 15px; line-height: 1.7; color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 55%, #10131b 100%) fixed;
  -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 background ────────────────────────────────────────────────── */
body::before {                                   /* aurora: an indigo and a violet light, drifting slowly */
  content: ''; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(42% 34% at 78% 12%, rgba(122,134,255,.26), transparent 70%),
    radial-gradient(38% 32% at 14% 86%, rgba(176,120,255,.18), transparent 70%),
    radial-gradient(30% 24% at 40% 40%, rgba(220,226,255,.05), transparent 70%);
  animation: drift 30s ease-in-out infinite alternate;
}
canvas.bgnet { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
#root { position: relative; z-index: 1; height: 100%; }
@keyframes drift { 0% { transform: translate3d(-3%, -2%, 0) scale(1); } 50% { transform: translate3d(3%, 2%, 0) scale(1.06); } 100% { transform: translate3d(-2%, 3%, 0) scale(1.02); } }
@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 drop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@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(62,213,152,.55); } 100% { box-shadow: 0 0 0 8px rgba(62,213,152,0); } }

/* ── the frame ─────────────────────────────────────────────────────── */
.app {
  display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto;
  border-inline: 1px solid var(--line); box-shadow: 0 0 90px rgba(0,0,0,.35);
}
.bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 64px; position: relative; z-index: 3;
  background: linear-gradient(180deg, rgba(32,37,49,.90), rgba(20,23,31,.86)); color: var(--text);
  -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
}
.bar-mark { width: 38px; height: 38px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 8px rgba(160,170,255,.25)); }
/* the round badge at the start of the bar (like a chat's photo) */
.avatar {
  position: relative; width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #343b52, #151922 72%);
  box-shadow: 0 0 0 1.5px rgba(214,222,245,.45), 0 4px 16px rgba(0,0,0,.45), 0 0 22px rgba(122,134,255,.18);
}
.avatar img { width: 36px; height: 36px; object-fit: contain; }
.avatar .on-dot { position: absolute; bottom: 1px; inset-inline-start: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid #1b1f2a; }
.bar h1 {
  font-size: 17px; font-weight: 800; margin: 0; line-height: 1.35;
  background: linear-gradient(180deg, #ffffff, #c3cad9); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bar .sub { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.bar .sub.live { color: #8fe3bd; }
.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: 42px; height: 42px; 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.round { background: rgba(255,255,255,.06); border-color: var(--line); }
.iconbtn.dark:hover { background: rgba(255,255,255,.08); }

/* the signal strip: a dropped line, your place in the queue, or «nobody is online» */
.strip {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px; font-size: 13.5px; min-height: 34px; line-height: 1.6;
  background: rgba(255,255,255,.035); color: var(--silver-2); border-bottom: 1px solid var(--line);
}
.strip.quiet { display: none; }
.strip .dot { width: 9px; height: 9px; border-radius: 50%; background: #6a7385; flex: none; }
.strip.on .dot { background: var(--ok); box-shadow: 0 0 10px rgba(62,213,152,.7); animation: ping 2.2s ease-out infinite; }
.strip.down { background: rgba(140,46,32,.40); color: #ffdcd3; }
.strip.down .dot { background: #ff8a6b; animation: blink 1.2s steps(2, start) infinite; }
.strip.queue { background: linear-gradient(90deg, rgba(122,134,255,.20), rgba(176,120,255,.14)); color: #e6e9ff; font-weight: 700; }
.strip.queue .dot { background: var(--accent); box-shadow: 0 0 10px rgba(154,166,255,.8); }
.strip .pos {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 99px;
  background: var(--silver); color: var(--signal-ink); font-size: 16px; 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, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.07);
  -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: 14px 0 6px; font-size: 14px; color: var(--silver-2); font-weight: 600; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.in {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--field);
  font-size: 16px; min-height: 50px;              /* (16px: iPhone does not zoom in) */
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.in::placeholder, .composer textarea::placeholder { color: #697286; }
.in:focus { border-color: rgba(182,190,255,.65); background: rgba(10,12,19,.7); outline: none; box-shadow: 0 0 0 3px rgba(154,166,255,.18); }
.in.ltr { direction: ltr; text-align: left; }
.in.ltr:placeholder-shown { direction: rtl; text-align: right; }   /* (a Persian hint reads right to left; what is typed, left to right) */
textarea.in { resize: vertical; min-height: 84px; }
.in[readonly] { opacity: .65; cursor: default; }
select.in, .chathead select { background-color: #161a23; color: var(--text); }
/* a password with an eye to show it */
.pw { position: relative; }
.pw .in { padding-inline-end: 52px; }
.pw .eye {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: none; color: var(--muted); display: grid; place-items: center;
}
.pw .eye:hover { color: #fff; background: rgba(255,255,255,.06); }
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 14px; border: 1px solid rgba(255,255,255,.4); min-height: 46px; font-weight: 800;
  background: var(--silver); color: var(--signal-ink); text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.75);
  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.05); box-shadow: 0 12px 30px rgba(0,0,0,.42), 0 0 24px rgba(154,166,255,.22), inset 0 1px 0 rgba(255,255,255,.8); }
.btn:hover::after { animation: sheen 1.1s ease-out 1; }
.btn.wide { width: 100%; min-height: 52px; font-size: 16px; }
.btn.wide:not(:disabled)::after { animation: sheen 6s ease-in-out infinite; }
.btn:active { transform: translateY(0) scale(.98); }
.btn.ghost { background: rgba(255,255,255,.045); color: var(--text); border-color: var(--line-2); box-shadow: none; font-weight: 700; }
.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, #f0705a, #b2341f); color: #fff; border-color: rgba(255,255,255,.2); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 13.5px; font-weight: 700; border-radius: 11px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(16,19,26,.25); border-top-color: var(--signal-ink); animation: turn .8s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.linkbtn { border: 0; background: none; padding: 4px 2px; color: #aeb8ff; font-weight: 700; text-decoration: none; }
.linkbtn:hover { color: #d0d6ff; text-decoration: underline; text-underline-offset: 4px; }
.linkbtn.muted { color: var(--muted); font-weight: 600; }
.linkbtn.muted:hover { color: var(--text); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }
.card > .row.end, form > .row.end { margin-top: 12px; }
.err { color: #ff9a86; font-size: 13.5px; margin-top: 8px; min-height: 1em; }
.err:empty { margin-top: 0; min-height: 0; }
.tabs { display: flex; gap: 4px; background: rgba(6,8,12,.5); border: 1px solid var(--line); padding: 5px; border-radius: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 12px; color: var(--muted); font-weight: 700; 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 3px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.75); }
.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: 12px; background: var(--field);
  border: 1px dashed var(--silver-3); color: #fff;
}

/* ── the way in: logo, name, and one card ─────────────────────────── */
.auth { display: flex; flex-direction: column; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); }
.auth > :first-child { margin-top: auto; }          /* (centred, yet scrolls from the top when taller than the screen) */
.auth > :last-child { margin-bottom: auto; }
.auth-card { max-width: 440px; width: 100%; margin: 0 auto; padding: 22px 20px 20px; }
.auth-head { position: relative; text-align: center; margin-bottom: 18px; }
.auth-head::before {
  content: ''; position: absolute; inset: -10px 18% auto; height: 190px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(154,166,255,.20), transparent); animation: breathe 6s ease-in-out infinite;
}
.hero-logo { display: block; width: min(44vw, 168px); height: auto; margin: 0 auto 4px; animation: float 7s ease-in-out infinite; filter: drop-shadow(0 10px 26px rgba(140,150,255,.22)); }
.auth-head .name {
  font-size: 15px; font-weight: 700; margin: 2px 0 0; color: var(--silver-2); letter-spacing: .01em;
}
.auth-head .welcome { margin: 6px auto 0; max-width: 34ch; white-space: pre-line; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.auth .tabs { margin-bottom: 4px; }
.steps { display: flex; align-items: center; gap: 12px; margin: 16px 0 2px; font-size: 13px; color: var(--muted); }
.steps .track { flex: 1; height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); position: relative; overflow: hidden; }
.steps .track i.s1 { width: 50%; }
.steps .track i.s2 { width: 100%; }
.steps .track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: var(--silver); box-shadow: 0 0 12px rgba(214,222,245,.4); transition: width .35s cubic-bezier(.2,.7,.2,1); }
.auth-foot { text-align: center; margin-top: 16px; color: var(--muted); font-size: 14px; }
.auth-extra { max-width: 440px; width: 100%; margin: 12px auto 0; }
.auth .back { margin-bottom: 4px; }

/* the welcome block (offline page, agents' sign-in) */
.hello { position: relative; padding: 18px 18px 6px; text-align: center; }
.hello::before {
  content: ''; position: absolute; inset: 0 12% auto; height: 240px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(154,166,255,.18), transparent); animation: breathe 6s ease-in-out infinite;
}
.hello .name {
  font-size: 24px; font-weight: 800; line-height: 1.3; margin: 0 0 6px;
  background: linear-gradient(100deg, #9aa3b8 0%, #ffffff 22%, #b2bacb 45%, #ffffff 68%, #9aa3b8 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); }
.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 4px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--text); border-radius: 10px; }
.hist button:hover { color: #fff; background: rgba(255,255,255,.04); }

/* ── messages ──────────────────────────────────────────────────────── */
.day { text-align: center; margin: 12px 0; }
.day span { font-size: 12.5px; background: rgba(22,26,35,.75); border: 1px solid var(--line); padding: 3px 14px; border-radius: 99px; color: var(--silver-2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.evt { text-align: center; margin: 10px 0; font-size: 12.5px; color: var(--muted); }
.evt span { background: rgba(22,26,35,.75); 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(84%, 540px); margin: 5px 0; animation: pop .22s ease-out both; }
/* what I sent sits on the right (the start side in Persian); 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: 9px 14px; border-radius: 20px; background: var(--theirs); border: 1px solid var(--line);
  overflow-wrap: anywhere; white-space: pre-wrap; position: relative; box-shadow: 0 6px 18px rgba(0,0,0,.26);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.msg.mine .msg-body {
  background: linear-gradient(145deg, #f6f8fc 0%, #d3d9e5 55%, #b8c0d0 100%); color: var(--mine-ink); border-color: rgba(255,255,255,.45);
  border-end-start-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.85);
}
.msg.theirs .msg-body { border-end-end-radius: 6px; }
.msg.greet .msg-body { background: linear-gradient(160deg, rgba(46,52,70,.94), rgba(31,35,47,.94)); border-color: rgba(198,208,236,.18); }
.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: #3b4250; }
.msg-text a { word-break: break-all; text-decoration-color: rgba(255,255,255,.4); }
.msg.mine .msg-text a { text-decoration-color: rgba(0,0,0,.35); }
.msg-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; padding: 2px 8px 0; align-items: center; }
.tick { letter-spacing: -2px; }
.tick.seen { color: #8ab4ff; }
.tick.failed { color: #ff9a86; font-weight: 800; letter-spacing: 0; }
.retry { border: 0; background: none; color: #ff9a86; font-size: 12.5px; padding: 2px 6px; text-decoration: underline; }
.msg-img { border: 0; padding: 0; background: none; display: block; margin: -3px -8px 4px; border-radius: 14px; 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: #3b4250; }
.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: #12151c; color: #fff; }
.msg.mine .vp-bar { background: rgba(0,0,0,.2); }
.msg.mine .vp-fill { background: #12151c; }
.typing { font-size: 12.5px; color: var(--silver-2); padding: 0 18px 4px; min-height: 20px; }
.typing:not(:empty)::after { content: '…'; }

/* ── the composer: one rounded pill, like Telegram ─────────────────── */
.composer-wrap { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
.composer {
  display: flex; align-items: flex-end; gap: 4px; padding: 6px;
  background: linear-gradient(180deg, rgba(34,39,51,.92), rgba(22,25,34,.94)); border: 1px solid var(--line-2); border-radius: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
}
.composer textarea {
  flex: 1; border: 0; background: transparent; border-radius: 18px; padding: 9px 8px; resize: none; max-height: 160px;
  font-size: 16px; line-height: 1.5; min-height: 44px;
}
.composer textarea:focus { outline: none; }
.composer .iconbtn { color: var(--muted); width: 44px; height: 44px; }
.composer .iconbtn:hover { color: #fff; }
.composer .send { background: var(--silver); color: var(--signal-ink); border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.8); }
.composer .send:hover { color: var(--signal-ink); box-shadow: 0 4px 18px rgba(0,0,0,.5), 0 0 18px rgba(154,166,255,.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,.88), rgba(40,33,12,.92)); }
/* the agents' panel keeps its composer flat across the bottom */
.admin .composer { border-radius: 0; border-inline: 0; border-bottom: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
.recbar { display: flex; align-items: center; gap: 12px; flex: 1; padding: 0 8px; 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(18,21,29,.92); border-top: 1px solid var(--line); text-align: center; }
.closed-box .row.end { justify-content: center; margin-top: 8px; }
.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: #3f4555; padding: 2px; transition: transform .15s, color .2s; }
.stars button:hover { transform: scale(1.15); }
.stars button.on { color: #f1d78a; text-shadow: 0 0 12px rgba(241,215,138,.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(5,6,10,.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(34,39,51,.98), rgba(19,22,30,.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,.08);
  border-radius: 24px 24px 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: 24px; border-bottom: 1px solid var(--line-2); } }
.sheet h2 { margin: 0 0 10px; font-size: 17px; color: #fff; }
.sheet h3 { margin: 18px 0 6px; font-size: 15px; color: #fff; }
/* the ⋮ menu, dropping down from the bar */
.pop-back { position: fixed; inset: 0; z-index: 30; }
.pop {
  position: fixed; z-index: 31; min-width: 250px; max-width: calc(100vw - 24px); padding: 8px;
  background: linear-gradient(180deg, rgba(36,41,54,.97), rgba(22,25,34,.97)); border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.07); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
  animation: drop .18s ease-out both; transform-origin: top left;
}
.pop button {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 0; background: none; border-radius: 14px;
  color: var(--text); text-align: start; font-size: 15px; font-weight: 600;
}
.pop button:hover, .pop button:focus-visible { background: rgba(255,255,255,.07); }
.pop button .ic { color: var(--silver-2); width: 22px; height: 22px; }
.pop button.danger { color: #ff8f7a; }
.pop button.danger .ic { color: #ff8f7a; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 8px; }
.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: 72px; inset-inline: 0; display: grid; justify-items: center; gap: 6px; z-index: 60; pointer-events: none; }
.toast {
  background: rgba(30,34,45,.97); color: #fff; padding: 10px 16px; border-radius: 14px; 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, #82301f, #5c1f14); 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 details of one customer, row by row (agents' panel) */
.info { border: 1px solid var(--line); border-radius: 18px; background: rgba(8,10,15,.35); overflow: hidden; }
.info .it { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.info .it + .it { border-top: 1px solid var(--line); }
.info .it > .ic { color: var(--silver-3); }
.info .it .v { flex: 1; min-width: 0; }
.info .it .v b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.info .it .v span { display: block; font-size: 12.5px; color: var(--muted); }
.info .it .v b.ltr { direction: ltr; text-align: right; }
.info .it .iconbtn { width: 38px; height: 38px; color: var(--silver-2); }
.info .it a.iconbtn { text-decoration: none; }

/* ════ 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(16,19,26,.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: 10px; 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(154,166,255,.12); color: #fff; font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.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; border-radius: 13px; }
.search .tabs button { font-size: 12.5px; padding: 7px 3px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 2px; border-radius: 10px; }
.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; min-height: 40px; border-radius: 12px; }
.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,.04); }
.citem[aria-current="true"] { background: rgba(154,166,255,.10); border-inline-start-color: var(--accent); }
.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(20,23,31,.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: 10px; border: 1px solid var(--line-2); }
.quick { position: absolute; bottom: 64px; inset-inline: 10px; max-height: 50vh; overflow-y: auto; background: rgba(26,30,40,.98); border: 1px solid var(--line-2); border-radius: 16px; 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); }
.table td.ltr { direction: ltr; text-align: right; }
.stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat div { background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); animation: rise .5s both; }
.stat b { display: block; font-size: 24px; background: linear-gradient(180deg, #fff, #b3bccd); -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(62,213,152,.7); }
  .btn::after { display: none; }
}
