/* ===========================================================
   EYAANA — Console design system (original direction)
   Ink + paper · coral=AI · teal=human · green=live · mono telemetry
   =========================================================== */
:root{
  --ink:#1C1C1E; --ink-2:#2A2A2E; --ink-3:#3A3A3F; --ink-4:#4A4A50;
  --paper:#F4F5F8; --surface:#FFFFFF; --surface-2:#FAFBFC;
  --line:#E5E8EE; --line-2:#EEF0F4;
  --text:#1C1C1E; --text-2:#3C4046; --muted:#6E7689; --muted-2:#99A1B2;

  --ai:#C8252B; --ai-bg:#FBEAEA; --ai-line:#F1CBCB;        /* AI agent / brand red */
  --human:#0DA98F; --human-bg:#E2F6F1; --human-line:#BCEBE0; /* human */
  --live:#17BB6B; --live-bg:#E4F7EC;                          /* live/online */
  --warn:#E0902F; --warn-bg:#FBF0E1;
  --info:#3A66E0; --info-bg:#E9EEFD;
  --gold:#C9A227;

  --r-xs:8px; --r-sm:10px; --r:14px; --r-lg:20px; --r-xl:26px;
  --sh-1:0 1px 2px rgba(20,26,41,.05);
  --sh-2:0 6px 22px rgba(20,26,41,.07);
  --sh-3:0 24px 60px rgba(20,26,41,.20);
  --rail:236px; --top:64px; --maxw:1280px;
  --f-display:'Bricolage Grotesque',Georgia,serif;
  --f-body:'IBM Plex Sans',system-ui,-apple-system,sans-serif;
  --f-mono:'IBM Plex Mono',ui-monospace,monospace;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%}
body{font-family:var(--f-body);color:var(--text);background:var(--paper);font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{font-family:var(--f-display);font-weight:700;letter-spacing:-.02em;margin:0;color:var(--ink)}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
.mono{font-family:var(--f-mono)}
.eyebrow{font-family:var(--f-mono);font-size:10.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);font-weight:500}
.muted{color:var(--muted)}
.small{font-size:13.5px}.tiny{font-size:12px}
.num{font-family:var(--f-mono);font-feature-settings:"tnum"}
.row{display:flex;align-items:center}.row.gap{gap:10px}
.spread{display:flex;align-items:center;justify-content:space-between;gap:12px}
.wrap{flex-wrap:wrap}.grow{flex:1}.center{text-align:center}.hide{display:none!important}

/* ---------- live pulse signature ---------- */
.pulse{position:relative;width:8px;height:8px;border-radius:50%;background:var(--live);flex:0 0 8px}
.pulse::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1.5px solid var(--live);opacity:.6;animation:ping 1.8s ease-out infinite}
.pulse.ai{background:var(--ai)}.pulse.ai::after{border-color:var(--ai)}
.pulse.human{background:var(--human)}.pulse.human::after{border-color:var(--human)}
@keyframes ping{0%{transform:scale(.6);opacity:.7}80%,100%{transform:scale(2.1);opacity:0}}
.eq{display:inline-flex;align-items:flex-end;gap:2px;height:14px}
.eq i{width:2.5px;background:var(--live);border-radius:2px;animation:eq 1s ease-in-out infinite}
.eq i:nth-child(2){animation-delay:.15s}.eq i:nth-child(3){animation-delay:.3s}.eq i:nth-child(4){animation-delay:.45s}
@keyframes eq{0%,100%{height:4px}50%{height:14px}}

/* ---------- shell ---------- */
body.app{overflow:hidden}
.app-shell{display:flex;height:100vh;height:100dvh;overflow:hidden}
.rail{width:var(--rail);flex:0 0 var(--rail);background:var(--ink);color:#fff;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;height:100dvh}
.rail-brand{display:flex;align-items:center;gap:10px;padding:18px 18px 14px}
.rail-brand img{height:46px;width:auto;display:block}
.rail-brand .logo-light{display:none}                                   /* dark rail (admin/dealer) → white logo */
body.t-company .rail-brand .logo-light{display:block}                    /* company light theme → black logo */
body.t-company .rail-brand .logo-dark{display:none}
html[data-theme="dark"] body.t-company .rail-brand .logo-light{display:none}   /* company dark mode → white logo */
html[data-theme="dark"] body.t-company .rail-brand .logo-dark{display:block}
.rail-brand .chip{background:#fff;border-radius:9px;padding:5px 8px;display:flex}
.rail-brand .chip img{height:24px}
.rail-brand .wm{font-family:var(--f-display);font-weight:800;letter-spacing:.02em;font-size:16px}
.wm .e{color:var(--ai)}
.rail-nav{flex:1;overflow-y:auto;padding:6px 12px}
.rail-group{font-family:var(--f-mono);font-size:9.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted-2);opacity:.7;margin:16px 10px 7px}
.rail-link{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:9px;color:#AeB4C2;color:rgba(255,255,255,.62);font-weight:500;font-size:13px;cursor:pointer;margin-bottom:1px;position:relative;transition:.14s}
.rail-link svg{width:17px;height:17px;flex:0 0 17px;stroke:currentColor;stroke-width:1.9;fill:none}
.rail-link:hover{color:#fff;background:rgba(255,255,255,.06)}
.rail-link.active{color:#fff;background:rgba(255,255,255,.08)}
.rail-link.active::before{content:"";position:absolute;left:-12px;top:50%;transform:translateY(-50%);width:3px;height:20px;border-radius:0 3px 3px 0;background:var(--ai)}
.rail-foot{margin:8px 12px 14px;padding:12px;border-radius:12px;background:rgba(255,255,255,.05);font-size:11.5px}
.rail-foot .lbl{font-family:var(--f-mono);font-size:9.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted-2);margin-bottom:6px}
.rail-foot a{color:rgba(255,255,255,.55);font-size:11px}
.rail-foot a:hover{color:#fff}

.main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}
.topbar{height:var(--top);background:rgba(255,255,255,.82);backdrop-filter:blur(8px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px;position:sticky;top:0;z-index:30}
.topbar .tb-title{font-family:var(--f-display);font-weight:700;font-size:18px;line-height:1.1}
.topbar .tb-crumb{font-family:var(--f-mono);font-size:10.5px;letter-spacing:.04em;color:var(--muted);margin-top:2px}
.tb-actions{display:flex;align-items:center;gap:10px}
.tb-live{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:var(--text-2);background:var(--surface);border:1px solid var(--line);padding:6px 12px;border-radius:30px}
.tb-live .num{color:var(--ink)}
.ibtn{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;color:var(--muted);cursor:pointer;position:relative;border:1px solid transparent}
.ibtn:hover{background:var(--surface);border-color:var(--line);color:var(--text)}
.ibtn svg{width:17px;height:17px;stroke:currentColor;stroke-width:1.9;fill:none}
.ibtn .dot{position:absolute;top:7px;right:8px;width:6px;height:6px;border-radius:50%;background:var(--ai);border:1.5px solid #fff}
.user{display:flex;align-items:center;gap:9px;padding:5px 12px 5px 5px;border-radius:30px;border:1px solid var(--line);background:var(--surface);cursor:pointer}
.user:hover{border-color:var(--ink-3)}
.user .av{width:28px;height:28px;border-radius:50%;background:var(--ink);color:#fff;display:flex;align-items:center;justify-content:center;font-family:var(--f-mono);font-weight:600;font-size:11px}
.presence{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:var(--text-2)}
.toggle{width:40px;height:23px;border-radius:30px;background:#CBD2DE;position:relative;cursor:pointer;transition:.2s;flex:0 0 40px}
.toggle::after{content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:#fff;transition:.2s;box-shadow:var(--sh-1)}
.toggle.on{background:var(--live)}.toggle.on::after{left:20px}

.content{padding:24px;flex:1;min-height:0;overflow:auto;max-width:none}
.page-intro{margin-bottom:20px;max-width:720px}
.page-intro .eyebrow{margin-bottom:8px}
.page-intro h1{font-size:24px}
.page-intro p{color:var(--muted);margin:6px 0 0}

/* ---------- panels / grid ---------- */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--sh-1)}
.panel.pad{padding:20px}
.panel-h{padding:16px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}
.panel-h .eyebrow{margin-bottom:3px}
.panel-h h3{font-size:15.5px}
.panel-b{padding:20px}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,1fr)}.g3{grid-template-columns:repeat(3,1fr)}.g4{grid-template-columns:repeat(4,1fr)}
@media(max-width:1100px){.g4{grid-template-columns:repeat(2,1fr)}.g3{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.g2,.g3,.g4{grid-template-columns:1fr}}

/* ---------- metric (telemetry) ---------- */
.metric{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px 18px;position:relative;overflow:hidden}
.metric .k{font-family:var(--f-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.metric .v{font-family:var(--f-mono);font-weight:600;font-size:30px;letter-spacing:-.02em;color:var(--ink);line-height:1.1;margin-top:6px}
.metric .v small{font-size:15px;color:var(--muted)}
.metric .d{font-size:11.5px;font-weight:600;margin-top:6px;display:inline-flex;gap:5px;align-items:center}
.metric .d.up{color:var(--live)}.metric .d.down{color:var(--ai)}
.metric .spark{position:absolute;right:14px;bottom:12px;opacity:.85}
.metric.lead-ai::before,.metric.lead-human::before,.metric.lead-live::before,.metric.lead-info::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px}
.metric.lead-ai::before{background:var(--ai)}.metric.lead-human::before{background:var(--human)}
.metric.lead-live::before{background:var(--live)}.metric.lead-info::before{background:var(--info)}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;gap:8px;font-family:var(--f-body);font-weight:600;font-size:14px;padding:9px 15px;border-radius:10px;border:1px solid transparent;cursor:pointer;transition:.14s;white-space:nowrap}
.btn svg{width:16px;height:16px;stroke:currentColor;stroke-width:2;fill:none}
.btn.primary{background:var(--ai);color:#fff}
.btn.primary:hover{filter:brightness(.93)}
.btn.accent{background:var(--ai);color:#fff}
.btn.accent:hover{filter:brightness(.95)}
.btn.ghost{background:var(--surface);border-color:var(--line);color:var(--text)}
.btn.ghost:hover{border-color:var(--ink-3)}
.btn.quiet{background:transparent;color:var(--muted)}
.btn.quiet:hover{background:var(--surface);color:var(--text)}
.btn.sm{padding:7px 12px;font-size:12px}
.btn.lg{padding:12px 20px;font-size:14.5px}
.btn.block{width:100%;justify-content:center}

/* ---------- chips ---------- */
.chip{display:inline-flex;align-items:center;gap:6px;font-family:var(--f-mono);font-size:10.5px;font-weight:500;letter-spacing:.03em;padding:4px 9px;border-radius:7px;background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)}
.chip.ai{background:var(--ai-bg);color:#C23A1B;border-color:var(--ai-line)}
.chip.human{background:var(--human-bg);color:#0A7A68;border-color:var(--human-line)}
.chip.live{background:var(--live-bg);color:#0E8A4F;border:1px solid #BCE9CE}
.chip.warn{background:var(--warn-bg);color:#A66A1A;border-color:#F1DBB8}
.chip.info{background:var(--info-bg);color:#2B4FB0;border-color:#CDD9FA}
.chip.solid{background:var(--ink);color:#fff;border-color:var(--ink)}
.sdot{width:7px;height:7px;border-radius:50%;display:inline-block}
.sdot.on{background:var(--live)}.sdot.off{background:var(--muted-2)}

/* ---------- tables ---------- */
.table{width:100%;border-collapse:collapse}
.table th{text-align:left;font-family:var(--f-mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:500;padding:12px 16px;border-bottom:1px solid var(--line)}
.table td{padding:13px 16px;border-bottom:1px solid var(--line-2);font-size:14px}
.table tr:last-child td{border-bottom:none}
.table tbody tr:hover td{background:var(--surface-2)}
.table .rowlink{cursor:pointer}
.av{width:30px;height:30px;border-radius:8px;background:var(--ink);color:#fff;display:flex;align-items:center;justify-content:center;font-family:var(--f-mono);font-weight:600;font-size:11px;flex:0 0 30px}
.av.ai{background:var(--ai)}.av.human{background:var(--human)}.av.soft{background:var(--surface-2);color:var(--ink);border:1px solid var(--line)}

/* ---------- forms ---------- */
.field{margin-bottom:15px}
.field label{display:block;font-family:var(--f-mono);font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
.input,select.input,textarea.input{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;font-family:var(--f-body);font-size:14px;background:var(--surface);color:var(--text);transition:.14s}
.input:focus{outline:none;border-color:var(--ai);box-shadow:0 0 0 3px var(--ai-bg)}
textarea.input{resize:vertical;min-height:84px}
.hint{font-size:11.5px;color:var(--muted);margin-top:5px}
.codebox{font-family:var(--f-mono);font-size:12px;background:var(--ink);color:#D6DBE6;border-radius:10px;padding:12px 14px;white-space:pre-wrap;word-break:break-all}

/* ---------- tabs ---------- */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin-bottom:18px}
.tab{padding:10px 14px;font-weight:600;font-size:13px;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;display:flex;align-items:center;gap:7px}
.tab svg{width:15px;height:15px;stroke:currentColor;stroke-width:2;fill:none}
.tab:hover{color:var(--text)}
.tab.active{color:var(--ink);border-bottom-color:var(--ai)}

/* ---------- accordion ---------- */
.acc{border:1px solid var(--line);border-radius:var(--r);margin-bottom:10px;background:var(--surface);overflow:hidden}
.acc-h{display:flex;align-items:center;gap:12px;padding:14px 16px;cursor:pointer}
.acc-h .ch{margin-left:auto;transition:transform .2s;color:var(--muted)}
.acc-h .ch svg{width:18px;height:18px;stroke:currentColor;stroke-width:2;fill:none}
.acc.open .ch{transform:rotate(180deg)}
.acc-b{padding:0 16px;max-height:0;overflow:hidden;transition:max-height .25s ease,padding .25s}
.acc.open .acc-b{padding:4px 16px 18px;max-height:640px}
.chan{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;flex:0 0 36px}
.chan svg{width:19px;height:19px;stroke:#fff;stroke-width:2;fill:none}

/* ---------- progress / bars ---------- */
.bar{height:6px;border-radius:30px;background:var(--line);overflow:hidden}
.bar>i{display:block;height:100%;border-radius:30px;background:var(--ink)}
.bar.ai>i{background:var(--ai)}.bar.human>i{background:var(--human)}.bar.live>i{background:var(--live)}

/* ---------- note ---------- */
.note{background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--info);border-radius:12px;padding:13px 16px;font-size:13px;color:var(--text-2);display:flex;gap:11px;align-items:flex-start}
.note svg{width:17px;height:17px;flex:0 0 17px;stroke:var(--info);stroke-width:2;fill:none;margin-top:1px}
.note.ai{border-left-color:var(--ai)}.note.ai svg{stroke:var(--ai)}

/* ---------- knowledge flow ---------- */
.flow{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;align-items:center;gap:0}
.flow .node{border:1px solid var(--line);border-radius:14px;padding:16px;background:var(--surface)}
.flow .node .eyebrow{margin-bottom:8px}
.flow .node b{font-size:14px}
.flow .arr{color:var(--muted-2);padding:0 10px}
.flow .arr svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.6;fill:none}
@media(max-width:900px){.flow{grid-template-columns:1fr}.flow .arr{transform:rotate(90deg);justify-self:center;padding:8px 0}}

/* ---------- console (chat) ---------- */
.console{display:grid;grid-template-columns:300px 1fr 330px;grid-template-rows:minmax(0,1fr);border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden;height:100%;min-height:520px;background:var(--surface)}
.c-list{border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0;min-height:0}
.c-list .seg{display:flex;gap:2px;padding:12px;border-bottom:1px solid var(--line)}
.c-list .seg .s{flex:1;text-align:center;font-size:12px;font-weight:600;color:var(--muted);padding:7px;border-radius:8px;cursor:pointer}
.c-list .seg .s.active{background:var(--ink);color:#fff}
.c-scroll{overflow-y:auto;flex:1}
.c-group{font-family:var(--f-mono);font-size:9.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);padding:14px 16px 6px;display:flex;align-items:center;gap:8px}
.conv{display:flex;gap:11px;padding:11px 16px;cursor:pointer;border-left:2px solid transparent}
.conv:hover{background:var(--surface-2)}
.conv.active{background:var(--ai-bg);border-left-color:var(--ai)}
.conv .nm{font-weight:600;font-size:13px;display:flex;justify-content:space-between;gap:6px}
.conv .nm .t{font-family:var(--f-mono);font-size:10px;color:var(--muted);font-weight:400}
.conv .pv{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:195px}
.c-main{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--surface-2)}
.c-top{padding:12px 18px;border-bottom:1px solid var(--line);background:var(--surface);display:flex;align-items:center;justify-content:space-between}
.c-body{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:12px}
.msg{display:flex;gap:8px;align-items:flex-end;max-width:82%;padding:0}
.msg.ai,.msg.human{align-self:flex-end;flex-direction:row-reverse}
.msg.cust,.msg.customer{align-self:flex-start}
.msg .bubble{padding:9px 12px;border-radius:14px;font-size:13px;line-height:1.45;min-width:0;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.msg .bubble .t{font-family:var(--f-mono);font-size:9.5px;color:var(--muted);margin-top:5px}
.msg-av{width:24px;height:24px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:600;font-family:var(--f-display);letter-spacing:.02em}
.msg-av.customer,.msg-av.cust{background:var(--surface-2);color:var(--muted)}
.msg-av.ai{background:var(--ai-bg);color:#C23A1B}
.msg-av.human{background:var(--human);color:#fff}
.msg.cust .bubble,.msg.customer .bubble{background:var(--surface);border:1px solid var(--line);border-bottom-left-radius:4px}
.msg.ai .bubble{background:var(--ai-bg);border:1px solid var(--ai-line);border-bottom-right-radius:4px}
.msg.ai .bubble .t{color:#C9745F}
.msg.human .bubble{background:var(--human-bg);border:1px solid var(--human-line);border-bottom-right-radius:4px}
.msg.sys{align-self:center;max-width:none;justify-content:center}
.msg.sys .bubble.sysb{background:var(--warn-bg);color:#A66A1A;border-radius:30px;padding:6px 14px;font-size:11.5px;font-weight:600;font-family:var(--f-mono)}
.composer{position:relative;flex:0 0 auto;margin:8px 14px 14px;padding:11px 13px 8px;border:1px solid var(--line);border-radius:18px;background:var(--surface);display:flex;flex-direction:column;gap:8px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.composer:focus-within{border-color:var(--human-line,#bfe5dc);box-shadow:0 1px 6px rgba(0,0,0,.06)}
.composer-input{border:none;background:transparent;resize:none;outline:none;font:inherit;font-size:14px;line-height:1.5;color:inherit;min-height:24px;max-height:140px;padding:2px 4px 0;width:100%}
.composer-input::placeholder{color:var(--muted)}
.composer-bar{display:flex;align-items:center;justify-content:space-between}
.composer-left,.composer-right{display:flex;align-items:center;gap:4px}
.cbtn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9px;border:none;background:transparent;color:var(--muted);cursor:pointer;padding:0}
.cbtn svg{width:17px;height:17px}
.cbtn:hover{background:var(--surface-2);color:var(--ink)}
.cbtn.mic.rec{color:#e5484d;animation:micpulse 1s infinite}
.cbtn.send{background:var(--human);color:#fff;border-radius:50%}
.cbtn.send:hover{filter:brightness(.95);background:var(--human)}
.cbtn.send:disabled{opacity:.4;cursor:default}
.composer-dot{position:absolute;top:13px;right:15px;width:8px;height:8px;border-radius:50%;background:#1d9e75}
.advisor{border-left:1px solid var(--line);display:flex;flex-direction:column;min-height:0;background:var(--surface)}
.advisor .ah{padding:13px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:9px;font-weight:700;font-family:var(--f-display)}
.advisor .ah .pulse{margin-left:auto}
.advisor-b{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:11px}
.card-sm{border:1px solid var(--line);border-radius:12px;padding:12px;font-size:12.5px}
.card-sm .lbl{font-family:var(--f-mono);font-size:9.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
@media(max-width:1180px){.console{grid-template-columns:260px 1fr}.advisor{display:none}}

/* ---------- timeline ---------- */
.tl{position:relative;padding-left:22px}
.tl::before{content:"";position:absolute;left:6px;top:4px;bottom:4px;width:2px;background:var(--line)}
.tl .ev{position:relative;padding:0 0 16px}
.tl .ev::before{content:"";position:absolute;left:-19px;top:3px;width:9px;height:9px;border-radius:50%;background:var(--ink);border:2px solid var(--surface)}
.tl .ev.ai::before{background:var(--ai)}.tl .ev.human::before{background:var(--human)}

/* ---------- auth ---------- */
.auth{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr}
.auth .stage{background:var(--ink);color:#fff;padding:48px;display:flex;flex-direction:column;position:relative;overflow:hidden}
.auth .stage .grid-bg{position:absolute;inset:0;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:34px 34px;mask-image:radial-gradient(circle at 70% 30%,#000,transparent 75%)}
.auth .stage .chip{background:#fff;border-radius:10px;padding:6px 10px;display:inline-flex;align-self:flex-start;position:relative}
.auth .stage .chip img{height:26px}
.auth .stage svg{height:40px;width:auto}
.brand-lockup{display:flex;align-items:center;gap:13px;position:relative}
.brand-wm{font-family:var(--f-display);font-weight:800;letter-spacing:.06em;font-size:24px;color:#fff}
.brand-wm .e{color:var(--ai)}
.auth .stage .stage-foot{margin-top:auto;position:relative}
.auth .stage .stage-foot h1{margin:0 0 12px;font-size:30px;line-height:1.18;color:#fff}
.auth .stage .stage-foot p{opacity:.7;max-width:420px;margin:0 0 24px;font-size:14.5px}
.stage-stats{display:flex;gap:26px}
.stage-stats b{display:block;color:#fff;font-size:18px;font-family:var(--f-mono)}
.stage-stats span{color:rgba(255,255,255,.5);font-size:12px}
.auth .stage::after{content:"";position:absolute;width:360px;height:360px;border-radius:50%;background:radial-gradient(circle,rgba(200,37,43,.34),transparent 70%);top:-110px;right:-110px;pointer-events:none}
.auth .stage h1{font-size:33px;margin-top:auto;line-height:1.12;position:relative}
.auth .stage p{opacity:.72;max-width:400px;margin-top:14px;font-size:14.5px;position:relative}
.auth .stage .sig{position:relative;margin-top:26px;display:flex;flex-direction:column;gap:12px}
.auth .stage .sline{display:flex;gap:11px;align-items:center;font-size:13px;opacity:.92}
.auth .stage .sline .d{width:30px;height:30px;border-radius:8px;background:rgba(255,255,255,.08);display:flex;align-items:center;justify-content:center;flex:0 0 30px}
.auth .stage .sline .d svg{width:15px;height:15px;stroke:#fff;stroke-width:2;fill:none}
.auth .formside{display:flex;align-items:center;justify-content:center;padding:40px;background:var(--surface)}
.auth .fcard{width:100%;max-width:372px}
.auth .fcard .eyebrow{color:var(--ai)}
.auth .fcard h2{font-size:25px;margin:8px 0 4px}
.auth .fcard .sub{color:var(--muted);margin-bottom:22px;font-size:14px}
.portal-switch{margin-top:20px;font-size:12px;color:var(--muted);text-align:center}
.portal-switch a{color:var(--ai);font-weight:600}
@media(max-width:860px){.auth{grid-template-columns:1fr}.auth .stage{display:none}}

/* ---------- widget demo ---------- */
.stage-dark{min-height:100vh;background:#0E1320;background-image:radial-gradient(circle at 78% 18%,#1B2336,#0E1320 60%);display:flex;align-items:flex-end;justify-content:flex-end;padding:28px;position:relative}
.stage-grid{position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.03) 1px,transparent 1px);background-size:38px 38px}
.fakesite{position:absolute;top:26px;left:50%;transform:translateX(-50%);width:min(720px,78%);background:var(--surface);border-radius:14px;box-shadow:var(--sh-3);overflow:hidden}
.fakesite .bar{background:#EDEFF3;padding:9px 14px;display:flex;align-items:center;gap:7px}
.fakesite .bar i{width:10px;height:10px;border-radius:50%}
.fakesite .body{padding:32px 26px;min-height:210px}
.fakesite h2{font-size:23px}
.widget{width:374px;height:588px;background:var(--surface);border-radius:20px;box-shadow:var(--sh-3);display:flex;flex-direction:column;overflow:hidden;position:relative;z-index:2}
.widget-top{background:var(--ink);color:#fff;padding:16px 18px;display:flex;align-items:center;gap:12px}
.widget-top .wav{width:40px;height:40px;border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:center}
.widget-top .wav img{height:22px}
.widget-body{flex:1;overflow-y:auto;padding:16px;background:var(--surface-2);display:flex;flex-direction:column;gap:11px}
.widget-input{padding:12px;border-top:1px solid var(--line);display:flex;gap:8px}
.widget-input .input{flex:1;border-radius:30px}
.typing{display:flex;gap:4px;padding:4px 0}
.typing span{width:6px;height:6px;border-radius:50%;background:var(--muted-2);animation:bo 1s infinite}
.typing span:nth-child(2){animation-delay:.2s}.typing span:nth-child(3){animation-delay:.4s}
@keyframes bo{0%,60%,100%{opacity:.3}30%{opacity:1}}

/* ---------- steps / hub / landing ---------- */
.steps{display:grid;gap:6px}
.step{display:flex;gap:16px;align-items:flex-start;padding:16px;border-radius:14px;transition:.15s}
.step:hover{background:var(--surface-2)}
.step .n{font-family:var(--f-mono);font-weight:600;font-size:13px;color:var(--ai);border:1.5px solid var(--ai-line);background:var(--ai-bg);width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;flex:0 0 34px}
.step h4{font-size:14.5px;margin-bottom:3px}
.step p{margin:0;color:var(--muted);font-size:13px}
.hubcard{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:20px;cursor:pointer;transition:.16s;box-shadow:var(--sh-1)}
.hubcard:hover{transform:translateY(-3px);box-shadow:var(--sh-2);border-color:var(--ink-3)}
.hubcard .hi{width:42px;height:42px;border-radius:11px;background:var(--ink);display:flex;align-items:center;justify-content:center;margin-bottom:13px}
.hubcard .hi svg{width:21px;height:21px;stroke:#fff;stroke-width:1.9;fill:none}
.hubcard h3{font-size:16px;margin-bottom:5px}
.hubcard p{color:var(--muted);font-size:13px;margin:0}
.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin-top:10px}
.legend span{display:flex;align-items:center;gap:6px}
.legend i{width:10px;height:10px;border-radius:3px;display:inline-block}

/* modal */
.modal-bg{position:fixed;inset:0;background:rgba(14,19,32,.5);display:flex;align-items:center;justify-content:center;z-index:60}

/* ---------- Phase 8: layout + component gap-fills ---------- */
.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media(max-width:980px){.grid-2,.grid-3{grid-template-columns:1fr}}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px 18px}
.kpi-l{font-family:var(--f-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.kpi-n{font-family:var(--f-mono);font-weight:600;font-size:26px;color:var(--ink);line-height:1.1;margin-top:6px}
.pane{display:block}
.check-list{display:flex;flex-direction:column}
.check-row{display:flex;gap:10px;align-items:center;padding:9px 0;font-size:13.5px;border-bottom:1px solid var(--line-2)}
.check-row:last-child{border-bottom:none}
.check-row .ico{width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:0 0 22px}
.check-row .ico.done{background:var(--live-bg);color:#0E8A4F}
.check-row .ico.todo{background:var(--surface-2);color:var(--muted-2);border:1px solid var(--line)}
.check-row .ico svg{width:13px;height:13px}
.check-row.done .lab{color:var(--text)}
.check-row .lab{color:var(--muted)}

/* agent avatars */
.avatar{width:30px;height:30px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--surface-2);border:1px solid var(--line);font-size:12px;font-weight:600;color:var(--muted);flex:none}
.avatar.ai{background:rgba(120,90,255,.12);color:var(--ai);border-color:transparent}
.avatar svg{width:16px;height:16px}

/* checkbox row */
.check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text);cursor:pointer}
.check input{width:auto;margin:0}

/* ===== top-bar UI controls: font size + theme ===== */
.ui-ctl{display:flex;align-items:center;gap:4px;margin-right:6px}
.ui-ctl .ibtn{min-width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:13px;border-radius:8px;border:1px solid var(--line);background:var(--surface);color:var(--text-2);cursor:pointer}
.ui-ctl .ibtn:hover{background:var(--surface-2)}
.ui-ctl .ibtn svg{width:16px;height:16px}
.ic-dark{display:none}

/* ===== dark mode ===== */
html[data-theme="dark"]{
  --paper:#0E1320; --surface:#151B27; --surface-2:#1B2230;
  --line:#28303F; --line-2:#222A38;
  --text:#E8EBF1; --text-2:#BCC3D0; --muted:#8B93A4; --muted-2:#69727F;
  --ai-bg:rgba(245,81,46,.16); --ai-line:rgba(245,81,46,.38);
  --human-bg:rgba(13,169,143,.16); --human-line:rgba(13,169,143,.38);
  --live-bg:rgba(23,187,107,.16);
  --warn-bg:rgba(224,144,47,.16);
  --info-bg:rgba(58,102,224,.16);
  --sh-1:0 1px 2px rgba(0,0,0,.4); --sh-2:0 6px 22px rgba(0,0,0,.5); --sh-3:0 24px 60px rgba(0,0,0,.6);
}
html[data-theme="dark"] .ic-light{display:none}
html[data-theme="dark"] .ic-dark{display:inline-flex}
html[data-theme="dark"] .topbar{background:rgba(21,27,39,.85);border-bottom-color:var(--line)}
html[data-theme="dark"] .input,
html[data-theme="dark"] select.input,
html[data-theme="dark"] textarea.input{background:var(--surface-2);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] .btn.quiet{color:var(--text-2)}
html[data-theme="dark"] .chip{background:var(--surface-2)}

/* console inbox status chips + unread */
.conv.unread{position:relative}
.conv.unread::after{content:"";position:absolute;top:14px;right:12px;width:8px;height:8px;border-radius:50%;background:var(--ai)}

/* conversation detail: transcript + analysis */
.convgrid{display:grid;grid-template-columns:1fr 360px;gap:24px;align-items:start}
.convgrid #thread{display:flex;flex-direction:column;gap:10px;max-height:none}
.anrows{display:flex;flex-direction:column;gap:10px}
.anrow{display:flex;flex-direction:column;gap:2px}
.anrow .ank{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:600}
.anrow .anv{font-size:13px;line-height:1.5}
@media(max-width:980px){.convgrid{grid-template-columns:1fr}}

/* live inbox counts */
.conv{position:relative}
.ubadge{position:absolute;right:12px;bottom:11px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--ai);color:#fff;font-size:11px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.seg-count{font-size:12px;font-weight:400;color:var(--muted);margin-left:2px}
.wait-pill{display:inline-flex;align-items:center;background:var(--warn-bg,#fff4e5);color:var(--warn,#b26a00);font-size:11px;font-weight:600;padding:2px 8px;border-radius:10px;margin-left:8px;vertical-align:middle}

/* chat media (voice / image / file) */
.media-img{max-width:240px;max-height:240px;border-radius:10px;display:block;margin-top:6px}
.media-audio{margin-top:6px;max-width:240px;height:38px;display:block}
.media-file{display:inline-flex;align-items:center;gap:6px;margin-top:6px;padding:7px 11px;border:1px solid var(--line,#e5e7eb);border-radius:10px;font-size:13px;text-decoration:none;color:inherit;background:rgba(0,0,0,.02)}
.media-file:hover{background:rgba(0,0,0,.05)}
.btn.mic{background:transparent;border:none;font-size:17px;cursor:pointer;padding:0 6px;line-height:1}
.btn.mic.rec{color:#e5484d;animation:micpulse 1s infinite}
@keyframes micpulse{0%,100%{opacity:1}50%{opacity:.45}}

/* AI Advisor chat */
.advisor-input{flex:0 0 auto;display:flex;gap:8px;align-items:flex-end;padding:10px 12px;border-top:1px solid var(--line);background:var(--surface)}
.advisor-input textarea{flex:1;resize:none;max-height:90px;border:1px solid var(--line);border-radius:10px;padding:8px 10px;font:inherit;font-size:13px;background:var(--surface-2);color:inherit}
.adv-msg{max-width:92%;font-size:12.5px;line-height:1.5}
.adv-msg.me{align-self:flex-end;background:var(--info-bg,#eef2ff);color:inherit;border-radius:12px 12px 3px 12px;padding:8px 11px}
.adv-msg.ai{align-self:flex-start;background:var(--surface-2);border:1px solid var(--line);border-radius:12px 12px 12px 3px;padding:8px 11px}
.adv-msg .adv-bd{white-space:pre-wrap}
.adv-acts{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.adv-refs{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}
.adv-ref{font-size:10px;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:1px 7px}
/* voice preview */
.voice-preview{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:9px 14px;border-top:1px solid var(--line);background:var(--surface-2)}
.voice-preview audio{flex:1;height:34px;max-width:none}
/* media lightbox */
.lightbox{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.72);display:flex;align-items:center;justify-content:center;padding:24px}
.lightbox-inner{position:relative;display:flex;flex-direction:column;align-items:center}
.lightbox-x{position:absolute;top:-14px;right:-14px;width:34px;height:34px;border-radius:50%;border:none;background:#fff;color:#111;font-size:16px;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.3)}

/* console redesign: identity, channels, markdown bubbles */
.av.wa{background:#1d9e75;color:#fff}
.av.web{background:var(--surface-2);color:var(--muted)}
.chn-badge{font-size:10px;font-weight:600;padding:1px 9px;border-radius:999px;letter-spacing:.02em}
.chn-badge.wa{background:#e1f5ee;color:#0f6e56}
.chn-badge.web{background:var(--surface-2);color:var(--muted)}
.conv .cname{font-weight:600}
.msg .bd strong{font-weight:600}
.msg .bd em{font-style:italic}
.msg .bd ul,.msg .bd ol{margin:6px 0 2px;padding-left:18px}
.msg .bd li{margin:3px 0;line-height:1.45}
.msg .bd code{font-family:var(--f-mono);font-size:12px;background:rgba(0,0,0,.06);padding:1px 5px;border-radius:5px}
.msg .bd a{color:inherit;text-decoration:underline}
.msg .bd p{margin:0 0 6px}
.msg{box-shadow:0 1px 2px rgba(0,0,0,.03)}

/* Option 3: status-edge inbox + macros */
.conv{border-left:3px solid transparent}
.conv[data-status="IncomingQueue"]{border-left-color:#ba7517}
.conv[data-status="HumanHandling"]{border-left-color:#1d9e75}
.conv[data-status="AiHandling"]{border-left-color:var(--line)}
.macros{flex:0 0 auto;display:flex;gap:6px;flex-wrap:wrap;padding:9px 14px 0}
.macro{font-size:11px;border:1px solid var(--line);border-radius:999px;padding:3px 11px;cursor:pointer;color:var(--muted);background:var(--surface);user-select:none}
.macro:hover{background:var(--surface-2);color:var(--ink)}

.chn-ic{display:inline-flex;align-items:center;vertical-align:-2px;margin:0 5px;color:var(--muted);flex:none}
.chn-ic svg{display:block}

/* WiseMind slide-over */
.wm-panel{position:fixed;top:0;right:0;height:100vh;width:390px;max-width:94vw;background:var(--surface);border-left:1px solid var(--line);box-shadow:-10px 0 36px rgba(0,0,0,.14);display:flex;flex-direction:column;overflow:hidden;transform:translateX(102%);transition:transform .26s ease, width .2s ease;z-index:1000}
.wm-panel.open{transform:translateX(0)}
.wm-panel.wide{width:720px}
.wm-scrim{position:fixed;inset:0;background:rgba(0,0,0,.22);opacity:0;visibility:hidden;transition:.26s;z-index:999}
.wm-scrim.show{opacity:1;visibility:visible}
.wm-head{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;border-bottom:1px solid var(--line)}
.wm-title{display:flex;align-items:center;gap:8px;font-size:15px}
.wm-title svg{width:20px;height:20px;color:var(--ai)}
.wm-sub{font-size:11px;color:var(--muted);margin-left:2px;font-weight:400}
.wm-body{flex:1;min-height:0;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}
.wm-empty{margin:auto;text-align:center;max-width:300px;color:var(--muted);font-size:13px;line-height:1.55}
.wm-orb{width:54px;height:54px;border-radius:50%;background:var(--ai-bg);color:var(--ai);display:flex;align-items:center;justify-content:center;margin:0 auto 14px}
.wm-orb svg{width:26px;height:26px}
.wm-suggest{display:flex;flex-direction:column;gap:8px;margin-top:18px}
.wm-suggest button{font-size:12.5px;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:8px 12px;cursor:pointer;text-align:left;color:var(--ink)}
.wm-suggest button:hover{background:var(--surface-2)}
.wm-msg{max-width:90%;font-size:13px;line-height:1.5;padding:9px 12px;border-radius:13px}
.wm-msg.me{align-self:flex-end;background:var(--info-bg,#eef2ff);border-bottom-right-radius:4px}
.wm-msg.ai{align-self:flex-start;background:var(--surface-2);border:1px solid var(--line);border-bottom-left-radius:4px}
.wm-msg.ai strong{font-weight:600}
.wm-msg.ai ul{margin:6px 0 2px;padding-left:18px}.wm-msg.ai li{margin:3px 0}
.wm-msg.ai code{font-family:var(--f-mono);font-size:12px;background:rgba(0,0,0,.06);padding:1px 5px;border-radius:4px}
.wm-msg.ai a{color:inherit;text-decoration:underline}
.wm-input{flex:0 0 auto;display:flex;gap:8px;align-items:flex-end;padding:12px 14px;border-top:1px solid var(--line)}
.wm-input textarea{flex:1;resize:none;max-height:120px;border:1px solid var(--line);border-radius:12px;padding:9px 12px;font:inherit;font-size:13px;background:var(--surface-2);color:inherit;outline:none}
.wm-typing{color:var(--muted)}
