/* OpenMausBot UI demo — faithful port of the Grok-style dark palette */
:root {
  --app: #070707;
  --panel: #111111;
  --raised: #2f2f2f;
  --raised-hover: #3d3d3d;
  --card: #262626;
  --inset: #191919;
  --hairline: #333333;
  --ink: #fcfcfc;
  --ink2: rgba(252, 252, 252, 0.6);
  --accent: #1084fe;
  --bubble-user: #5a5a5a;
  --success: #38d591;
  --danger: #ff5667;
  --warning: #ff9800;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body {
  background: var(--app);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  font-size: 15px;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3d3d3d; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
button { font-family: inherit; background: none; border: none; color: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

.shell { display: flex; height: 100%; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: 320px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid rgba(51,51,51,.4); background: var(--panel);
}
.titlebar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; }
.traffic { display: flex; gap: 8px; }
.traffic span { width: 12px; height: 12px; border-radius: 50%; }
.traffic span:nth-child(1) { background: #ff5f57; }
.traffic span:nth-child(2) { background: #febc2e; }
.traffic span:nth-child(3) { background: #28c840; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink2); padding: 4px; }
.iconbtn:hover { background: var(--raised); color: var(--ink); }
.searchbox { padding: 8px 12px 12px; }
.searchbox .field {
  display: flex; align-items: center; gap: 8px; background: rgba(47,47,47,.7);
  border-radius: 8px; padding: 8px 12px;
}
.searchbox input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-size: 14px; }
.searchbox input::placeholder { color: var(--ink2); }
.botlist { flex: 1; overflow-y: auto; padding: 0 8px; }
.botitem {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border-radius: 12px; padding: 10px 12px; text-align: left; margin-bottom: 2px;
}
.botitem:hover { background: rgba(47,47,47,.5); }
.botitem.selected { background: var(--raised); }
.botitem .meta { flex: 1; min-width: 0; }
.botitem .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.botitem .name { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
.botitem .name .pin { color: var(--ink2); }
.botitem .name .trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.botitem .time { font-size: 12px; color: var(--ink2); flex-shrink: 0; }
.botitem .preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink2); }
.botitem .preview .trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unreaddot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.sidebar .footer { padding: 8px 12px 12px; }
/* ── live DeepSeek credit card ── */
.balcard {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(79,107,254,.08), rgba(79,107,254,.02));
  padding: 10px 12px;
  margin-bottom: 8px;
  opacity: .85;
  transition: opacity .3s, border-color .3s, box-shadow .3s;
}
.balcard.live { opacity: 1; }
.balcard.dip {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px rgba(255,86,103,.35), 0 0 14px rgba(255,86,103,.25);
}
.bal-head { display: flex; align-items: center; gap: 8px; }
.bal-ic {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 7px;
  background: rgba(79,107,254,.16); color: #7c96ff;
}
.bal-label { font-size: 12px; color: var(--ink2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bal-dot { width: 7px; height: 7px; border-radius: 50%; background: #555; flex-shrink: 0; }
.bal-dot.up { background: var(--success); box-shadow: 0 0 6px rgba(56,213,145,.7); }
.bal-dot.down { background: var(--danger); box-shadow: 0 0 6px rgba(255,86,103,.7); }
.bal-dot.off { background: var(--warning); box-shadow: 0 0 6px rgba(255,152,0,.6); }
.bal-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.bal-num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bal-delta { font-size: 11px; font-weight: 600; }
.bal-delta.down { color: var(--danger); }
.bal-delta.up { color: var(--success); }
.bal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.bal-spark { display: flex; align-items: center; opacity: .9; }
.bal-upd { font-size: 10px; color: var(--ink2); white-space: nowrap; }
.footerbtn { display: flex; align-items: center; gap: 12px; width: 100%; border-radius: 12px; padding: 8px 12px; text-align: left; font-size: 14px; color: var(--ink); }
.footerbtn:hover { background: rgba(47,47,47,.5); }
.footerbtn .lbl { flex: 1; min-width: 0; }
.footer .userrow { display: flex; align-items: center; }
.avatar-mini { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #3a3a3a; font-size: 11px; font-weight: 600; flex-shrink: 0; }

/* ── Context menu ────────────────────────── */
.ctxmenu {
  position: fixed; z-index: 40; width: 228px; overflow: hidden;
  border-radius: 12px; border: 1px solid rgba(51,51,51,.5);
  background: var(--card); padding: 6px 0; box-shadow: 0 25px 50px rgba(0,0,0,.6);
  animation: pop-in .16s cubic-bezier(.22,1,.36,1);
}
.ctxmenu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px;
  font-size: 14px; text-align: left; color: var(--ink);
}
.ctxmenu button:hover { background: rgba(47,47,47,.7); }
.ctxmenu button.danger { color: var(--danger); }
.ctxmenu button:disabled { opacity: .4; cursor: default; }
.ctxmenu button:disabled:hover { background: none; }
.ctxmenu .divider { height: 1px; margin: 4px 8px; background: rgba(51,51,51,.4); }

/* ── Main chat ───────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--app); position: relative; }
.chathead { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; }
.chathead .who { display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 4px 6px; }
.chathead .who:hover { background: rgba(47,47,47,.5); }
.chathead .who .nm { font-size: 15px; font-weight: 600; }
.headbtns { display: flex; align-items: center; gap: 8px; }
.stopbtn {
  display: flex; align-items: center; gap: 6px; border-radius: 999px;
  border: 1px solid rgba(51,51,51,.4); background: rgba(47,47,47,.6);
  padding: 4px 10px; font-size: 13px; color: var(--ink2);
}
.stopbtn:hover { background: var(--raised); color: var(--ink); }
.modelpill {
  display: flex; align-items: center; gap: 6px; border-radius: 999px;
  border: 1px solid rgba(51,51,51,.4); background: rgba(47,47,47,.6);
  padding: 4px 10px 4px 8px; font-size: 13px; color: var(--ink); max-width: 220px;
}
.modelpill:hover { background: var(--raised); }
.modelpill .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitorbtn { border-radius: 6px; padding: 6px; color: var(--ink2); }
.monitorbtn:hover { background: var(--raised); color: var(--ink); }
.monitorbtn.active { color: var(--accent); }

.msgs { flex: 1; overflow-y: auto; padding: 0 20px; }
.msgs .inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; }
.datechip { padding: 12px 0 4px; text-align: center; font-size: 13px; color: var(--ink2); }
.bubble { max-width: 78%; padding: 9px 14px; font-size: 15px; line-height: 1.5; word-wrap: break-word; }
.bubble.user { align-self: flex-end; background: var(--bubble-user); color: var(--ink); white-space: pre-wrap; border-radius: 18px 18px 4px 18px; }
.bubble.bot { align-self: flex-start; background: var(--card); border-radius: 18px 18px 18px 4px; }
.bubble .btime { display: block; text-align: right; font-size: 10.5px; line-height: 1; color: var(--ink2); margin-top: 3px; padding-top: 2px; }
/* WhatsApp/Viber spacing: tight between same author, air between authors */
.msgs .inner { gap: 10px; }
.bubble.user + .bubble.user, .bubble.bot + .bubble.bot { margin-top: -6px; }
.bubble.bot strong { font-weight: 600; }
.bubble.bot code { background: var(--inset); border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.bubble.bot .h { font-weight: 600; margin-top: 6px; }
.bubble.bot .li { display: flex; gap: 8px; padding-left: 4px; }
.bubble.bot .li .b { color: var(--ink2); }
.bubble.bot .blank { height: 10px; }
.streaming .cursor { display: inline-block; width: 2px; height: 14px; background: var(--ink2); vertical-align: middle; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .2; } }

.activitychip { align-self: flex-start; display: flex; align-items: center; gap: 8px; border-radius: 999px; border: 1px solid rgba(51,51,51,.4); background: var(--panel); padding: 6px 12px; font-size: 13px; color: var(--ink2); }
.activitychip .tn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activitychip.ok { color: var(--ink2); }
.activitychip.fail { color: var(--danger); }

.screenframe { align-self: flex-start; max-width: 70%; border-radius: 16px; border: 1px solid rgba(51,51,51,.4); overflow: hidden; }

.typing { align-self: flex-start; display: flex; gap: 6px; background: var(--raised); border-radius: 16px; padding: 12px 16px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink2); animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 150ms; }
.typing span:nth-child(3) { animation-delay: 300ms; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

/* ── Option (approval) card ───────────────── */
.optioncard { align-self: center; width: 100%; max-width: 840px; border-radius: 16px; border: 1px solid rgba(51,51,51,.5); background: var(--card); padding: 16px; animation: pop-in .2s cubic-bezier(.22,1,.36,1); }
.optioncard .oc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.optioncard .oc-title { font-size: 16px; font-weight: 600; }
.optioncard .oc-sub { margin-top: 2px; font-size: 14px; color: var(--ink2); }
.optioncard .oc-opts { margin-top: 12px; border: 1px solid rgba(51,51,51,.4); border-radius: 8px; overflow: hidden; }
.optioncard .oc-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; font-size: 15px; text-align: left; color: var(--ink); }
.optioncard .oc-opt + .oc-opt { border-top: 1px solid rgba(51,51,51,.4); }
.optioncard .oc-opt:hover:not(:disabled) { background: rgba(47,47,47,.6); }
.optioncard .oc-opt.answered { background: var(--raised); }
.optioncard .oc-opt:disabled { cursor: default; }
.optioncard .oc-opt .letter { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: var(--raised); font-size: 12px; font-weight: 500; color: var(--ink2); flex-shrink: 0; }
.optioncard .oc-custom { margin-top: 12px; width: 100%; border-radius: 8px; border: 1px solid rgba(51,51,51,.4); background: var(--inset); padding: 10px 12px; font-size: 15px; color: var(--ink); outline: none; }
.optioncard .oc-custom:focus { border-color: var(--hairline); }
.optioncard .oc-custom::placeholder { color: var(--ink2); }

/* ── Composer ─────────────────────────────── */
.composer { padding: 8px 20px 20px; }
.composer .pill {
  max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 8px;
  border-radius: 999px; border: 1px solid rgba(51,51,51,.4); background: rgba(47,47,47,.6);
  padding: 8px 8px;
}
.composer input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-size: 16px; } /* 16px — iOS would auto-zoom on focus below this */
.composer input::placeholder { color: var(--ink2); }
.circle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: var(--ink2); flex-shrink: 0; }
.circle:hover { background: var(--raised); color: var(--ink); }
.circle.rec { background: rgba(255,86,103,.2); color: var(--danger); animation: pulse 1.2s infinite; }
.circle.send { background: var(--success); color: #04170f; }
.circle.send:hover { background: #2ec384; color: #04170f; }
.circle.send svg { animation: sendpop .18s ease-out; }
@keyframes sendpop { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Computer panel ───────────────────────── */
.comppanel { width: 400px; flex-shrink: 0; display: flex; flex-direction: column; border-left: 1px solid rgba(51,51,51,.4); background: var(--panel); animation: panel-in .24s cubic-bezier(.22,1,.36,1); }
@keyframes panel-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(.96) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.comppanel .cp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.comppanel .cp-title { font-size: 15px; font-weight: 600; }
.comppanel .cp-body { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.cp-label { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 6px; font-size: 13px; color: var(--ink2); }
.screenbox { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16/10; border-radius: 12px; background: var(--card); overflow: hidden; position: relative; }
.screenbox .empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink2); text-align: center; padding: 0 24px; }
.screenbox .empty .t { font-size: 12px; }
.cp-actions { display: flex; gap: 8px; margin-top: 12px; }
.cpbtn { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; border-radius: 8px; background: var(--raised); padding: 8px; font-size: 13px; color: var(--ink); }
.cpbtn:hover { background: var(--raised-hover); }
.cpbtn.small { flex: 0; padding: 8px 12px; }
.cpcard { margin-top: 16px; border-radius: 12px; background: var(--card); padding: 16px; }
.cpcard .tt { font-size: 15px; font-weight: 500; }
.cpcard .st { margin-top: 2px; font-size: 13px; color: var(--ink2); }
.seg { display: flex; margin-top: 12px; border: 1px solid rgba(51,51,51,.4); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; padding: 6px; font-size: 13px; color: var(--ink2); }
.seg button + button { border-left: 1px solid rgba(51,51,51,.4); }
.seg button:hover { background: rgba(47,47,47,.6); color: var(--ink); }
.seg button.on { background: var(--raised); color: var(--ink); }
.routinebtn { margin-top: 12px; width: 100%; border-radius: 8px; background: var(--raised); padding: 8px; font-size: 13px; color: var(--ink2); opacity: .6; cursor: not-allowed; }

/* Mock bot screen */
.mock-screen { width: 100%; height: 100%; background: linear-gradient(160deg, #0d1117 0%, #151b23 60%, #1a212b 100%); display: flex; align-items: center; justify-content: center; position: relative; }
.mock-win { width: 88%; height: 78%; border-radius: 8px; border: 1px solid #2a313c; background: #0b0f14; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.mock-win .mw-bar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #151b23; border-bottom: 1px solid #232a35; }
.mock-win .mw-bar i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.mock-win .mw-bar i:nth-child(1) { background: #ff5f57; } .mock-win .mw-bar i:nth-child(2) { background: #febc2e; } .mock-win .mw-bar i:nth-child(3) { background: #28c840; }
.mock-win .mw-url { flex: 1; margin-left: 6px; background: #0d1117; border-radius: 5px; padding: 3px 10px; font-size: 10px; color: #8b949e; font-family: ui-monospace, monospace; }
.mock-term { flex: 1; padding: 10px 12px; font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; line-height: 1.65; color: #c9d1d9; overflow: hidden; white-space: pre-wrap; }
.mock-term .ok { color: #38d591; }
.mock-term .dim { color: #6e7681; }
.mock-term .acc { color: #1084fe; }
.mock-term .cur { display: inline-block; width: 6px; height: 11px; background: #38d591; vertical-align: -2px; animation: pulse 1s steps(2) infinite; }

/* ── Model picker ─────────────────────────── */
.picker { position: relative; }
.picker-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 320px;
  display: flex; border-radius: 12px; border: 1px solid rgba(51,51,51,.5);
  background: var(--card); box-shadow: 0 25px 50px rgba(0,0,0,.5); overflow: hidden;
  animation: pop-in .16s cubic-bezier(.22,1,.36,1);
}
.picker-rail { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-right: 1px solid rgba(51,51,51,.4); background: var(--panel); }
.picker-rail button { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 16px; }
.picker-rail button:hover { background: rgba(47,47,47,.6); }
.picker-rail button.on { background: var(--raised); }
.picker-list { flex: 1; min-width: 0; padding: 8px; }
.picker-list .ph { padding: 4px 8px 2px; }
.picker-list .ph .nm { font-size: 13px; font-weight: 600; }
.picker-list .ph .vs { font-size: 11px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-list .mdl { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border-radius: 8px; padding: 6px 8px; font-size: 13px; text-align: left; color: var(--ink); }
.picker-list .mdl:hover { background: rgba(47,47,47,.6); }
.picker-list .mdl.on { background: var(--raised); }
.picker-list .mdl .def { border-radius: 4px; background: var(--inset); padding: 1px 6px; font-size: 10px; color: var(--ink2); }
.picker-list .mdl .chk { color: var(--accent); flex-shrink: 0; }
.picker-list .mdl.disabled { opacity: .5; cursor: not-allowed; }
.provdot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ── Settings / panels ────────────────────── */
.rightpanel { width: 400px; flex-shrink: 0; display: flex; flex-direction: column; border-left: 1px solid rgba(51,51,51,.4); background: var(--panel); animation: panel-in .24s cubic-bezier(.22,1,.36,1); }
.rp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.rp-body { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 6px; }
.field input, .field textarea { width: 100%; border-radius: 8px; border: 1px solid rgba(51,51,51,.4); background: var(--inset); padding: 9px 12px; font-size: 14px; color: var(--ink); outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--hairline); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; }
.swatch.on { border-color: var(--ink); }
.savebtn { margin-top: 18px; width: 100%; border-radius: 8px; background: var(--accent); padding: 10px; font-size: 14px; font-weight: 500; color: #fff; }
.savebtn:hover { filter: brightness(1.1); }
.dangerbtn { margin-top: 8px; width: 100%; border-radius: 8px; background: rgba(255,86,103,.12); border: 1px solid rgba(255,86,103,.3); padding: 10px; font-size: 14px; color: var(--danger); }
.dangerbtn:hover { background: rgba(255,86,103,.2); }
.plugrow { display: flex; align-items: center; gap: 12px; margin-top: 8px; border-radius: 10px; background: var(--card); padding: 10px 12px; }
.plugrow .pl { flex: 1; min-width: 0; }
.plugrow .pl .nm { font-size: 14px; font-weight: 500; }
.plugrow .pl .ds { font-size: 12px; color: var(--ink2); }
.toggle { width: 36px; height: 20px; border-radius: 999px; background: var(--inset); position: relative; flex-shrink: 0; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #8a8a8a; transition: transform .15s, background .15s; }
.toggle.on { background: rgba(16,132,254,.4); }
.toggle.on::after { transform: translateX(16px); background: var(--accent); }

/* ── Modal / onboarding ───────────────────── */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: var(--app); }
.modal .box { width: 460px; border-radius: 16px; border: 1px solid rgba(51,51,51,.4); background: var(--panel); padding: 32px; }
.modal .box.center { display: flex; flex-direction: column; align-items: center; }
.modal h1 { font-size: 20px; font-weight: 600; margin-top: 16px; }
.modal p { margin-top: 6px; font-size: 14px; line-height: 1.55; color: var(--ink2); text-align: center; }
.modal input[type="email"] { margin-top: 20px; width: 100%; border-radius: 8px; border: 1px solid rgba(51,51,51,.4); background: var(--inset); padding: 10px 12px; font-size: 15px; color: var(--ink); outline: none; }
.modal input[type="email"]:focus { border-color: var(--hairline); }
.primarybtn { margin-top: 12px; width: 100%; border-radius: 8px; background: var(--accent); padding: 10px; font-size: 15px; font-weight: 500; color: #fff; }
.primarybtn:disabled { opacity: .4; cursor: default; }
.ghostbtn { margin-top: 12px; font-size: 12px; color: var(--ink2); }
.ghostbtn:hover { color: var(--ink); }
.statusrow { display: flex; align-items: flex-start; gap: 12px; margin-top: 10px; border-radius: 12px; background: var(--card); padding: 14px; }
.statusrow .ic { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; }
.statusrow .ic.ok { background: rgba(56,213,145,.13); color: var(--success); }
.statusrow .ic.warn { background: rgba(255,152,0,.13); color: var(--warning); }
.statusrow .ic.off { background: var(--raised); color: var(--ink2); }
.statusrow .tt { font-size: 14px; font-weight: 500; }
.statusrow .ds { margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: var(--ink2); }

/* ── Toast ────────────────────────────────── */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { border-radius: 10px; border: 1px solid rgba(51,51,51,.5); background: var(--card); padding: 10px 16px; font-size: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: pop-in .18s cubic-bezier(.22,1,.36,1); }

/* ── Mascot ───────────────────────────────── */
.maus { display: block; }
.maus .maus-body { transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-origin: 100px 100px; }
.maus.busy .maus-body { animation: maus-rock 1.15s ease-in-out infinite; }
@keyframes maus-rock { 0%,100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-3px); } }
.maus .maus-eyes { transition: transform 150ms cubic-bezier(.2,.8,.2,1); }
.maus .blink { animation: maus-blink 5.2s infinite; }
@keyframes maus-blink { 0%, 94%, 100% { transform: scaleY(1); } 96%, 98% { transform: scaleY(.08); } }
.maus .orbit { opacity: 0; }
.maus.busy .orbit { opacity: 1; animation: orbit-turn 1.15s linear infinite; transform-origin: 100px 100px; }
.maus .orbit .od { animation: od-pulse 1.15s ease-in-out infinite; transform-origin: center; }
@keyframes orbit-turn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes od-pulse { 0%,100% { opacity: .35; r: 3.5; } 50% { opacity: 1; r: 5; } }
.maus.arrive .maus-body { animation: maus-arrive 700ms cubic-bezier(.2,.82,.22,1) both; }
@keyframes maus-arrive {
  0% { opacity: 0; transform: perspective(180px) translate3d(30px, 4px, 0) rotateY(70deg) rotateZ(38deg) scale(.35,.7); }
  45% { opacity: 1; transform: perspective(180px) translate3d(-3px, -2px, 10px) rotateY(-12deg) rotateZ(-7deg) scale(1.06,.94); }
  100% { opacity: 1; transform: none; }
}
.maus.celebrate .maus-body { animation: maus-bounce 700ms cubic-bezier(.18,.8,.2,1); }
@keyframes maus-bounce { 0% { transform: translateY(0); } 35% { transform: translateY(-9px) scale(.92,1.14); } 65% { transform: translateY(1px) scale(1.06,.94); } 100% { transform: none; } }

/* ── mobile (iPhone / small screens) — sidebar stays on the LEFT ── */
@media (max-width: 768px) {
  .sidebar {
    width: 84px !important; height: 100% !important;
    border-right: 1px solid rgba(51,51,51,.4); border-bottom: none; flex-shrink: 0;
  }
  .titlebar, .searchbox, .sidebar .footer { display: none; }
  .botlist { flex: 1; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 8px; }
  .botitem { min-width: 0; border-radius: 12px; padding: 8px 4px; flex-direction: column; align-items: center; }
  .botitem .meta { display: none; }
  .botitem .maus { margin: 0 auto; width: 34px !important; height: 34px !important; }
  .msgs { padding: 0 12px; }
  .composer { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
  .modal .box { width: 90%; }
}

/* ── live waveform / compact recording row (ChatGPT-style) ── */
.recmini { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.wave-mini { flex: 1; min-width: 0; height: 28px; display: block; }
.recmini .rectime {
  font-size: 13px; font-weight: 600; color: var(--ink2);
  font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; flex-shrink: 0;
}
.pill .circle.rec { flex-shrink: 0; }
.pill .circle { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ── credits pill (visible on every device, right in the chat header) ── */
.balpill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
  border-radius: 8px; background: var(--raised); color: var(--ink2);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.balpill .provdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.balpill:hover { color: var(--ink); }

/* ── Viber-style search ── */
.searchbtn.active { color: var(--accent, #38d591); }
.searchbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  border-bottom: 1px solid rgba(51,51,51,.4); background: var(--panel);
}
.searchbar input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--ink); font-size: 14px;
}
.searchbar input::placeholder { color: var(--ink2); }
.searchbar .scount { font-size: 12px; color: var(--ink2); white-space: nowrap; }
.bubble { position: relative; }
.bubble-match { outline: 1px solid rgba(56,213,145,.55); outline-offset: 2px; border-radius: 14px !important; }
.bubble-match.matchflash { animation: matchpulse 1.2s ease; }
@keyframes matchpulse { 0%,100% { background: inherit; } 30% { background: rgba(56,213,145,.25); } }
.matchchip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  color: #38d591; background: rgba(56,213,145,.12); border-radius: 8px;
  padding: 2px 8px; margin-right: 8px; vertical-align: 2px; text-transform: lowercase;
}
mark { background: rgba(56,213,145,.35); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ── live waveform ── */
.wave { width: 100%; height: 64px; display: block; margin-bottom: 6px; }

/* ── mobile (iPhone / small screens) — sidebar stays on the LEFT ── */
@media (max-width: 768px) {
  .sidebar {
    width: 84px !important; height: 100% !important;
    border-right: 1px solid rgba(51,51,51,.4); border-bottom: none; flex-shrink: 0;
  }
  .titlebar, .searchbox, .sidebar .footer { display: none; }
  .botlist { flex: 1; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 8px; }
  .botitem { min-width: 0; border-radius: 12px; padding: 8px 4px; flex-direction: column; align-items: center; }
  .botitem .meta { display: none; }
  .botitem .maus { margin: 0 auto; width: 34px !important; height: 34px !important; }
  .msgs { padding: 0 12px; }
  .composer { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
  .modal .box { width: 90%; }
  .who { min-width: 0; }
  .who .nm { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .headbtns .modelpill .lbl { display: none; }
  .headbtns { gap: 2px; }
  .searchbar { padding: 6px 10px; }
}

@media (max-width: 768px) {
  .balpill { padding: 4px 6px; font-size: 11px; }
  .balpill .provdot { display: none; }
}
.typing .worktime {
  font-size: 12px; font-weight: 600; color: var(--ink2);
  font-variant-numeric: tabular-nums; margin-left: 8px; vertical-align: 2px;
}

/* ── file attachments ── */
.attrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 6px; }
.atchip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--ink); background: var(--raised); border: 1px solid rgba(51,51,51,.4);
  border-radius: 8px; padding: 3px 8px; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.atchip .ax {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; color: var(--ink2); flex-shrink: 0;
}
.atchip .ax:hover { color: var(--danger); background: rgba(255,86,103,.15); }
.atchip svg { flex-shrink: 0; }

@media (max-width: 768px) {
  .msgs { padding: 0 10px; }
  .bubble { max-width: 88%; }
}

/* ── Viber-style agent list (phones) ── */
.mlist { height: 100%; display: flex; flex-direction: column; background: var(--app); }
.mlist-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.mlist-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.mlist .searchbox { padding: 8px 14px 10px; }
.mlist-items { flex: 1; overflow-y: auto; padding: 0 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.mitem {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 14px; border-radius: 16px; background: var(--panel);
  border: 1px solid rgba(51,51,51,.35); text-align: left;
}
.mitem.sel { border-color: rgba(56,213,145,.5); background: var(--raised); }
.mitem .maus { flex-shrink: 0; }
.mitem-meta { flex: 1; min-width: 0; }
.mitem-name { font-size: 16px; font-weight: 600; color: var(--ink); }
.mitem-prev {
  font-size: 13px; color: var(--ink2); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.backbtn { margin-right: 2px; }
