@font-face { font-family: 'Schibsted'; src: url('../fonts/schibsted.woff2') format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Schibsted'; src: url('../fonts/schibsted-italic.woff2') format('woff2'); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  --mist: #E9EBF2;
  --mist-2: #E1E4EE;
  --sheet: #FFFFFF;
  --sheet-2: #F6F7FB;
  --ink: #17153A;
  --ink-2: #5D6080;
  --ink-3: #8C8FA8;
  --line: #DCDFEA;
  --line-2: #ECEEF4;
  --indigo: #3A2DE0;
  --indigo-2: #2A1FB8;
  --lilac: #EDEBFF;
  --lilac-2: #D9D5FF;
  --amber: #C97A12;
  --amber-bg: #FFF3DF;
  --mint: #127A55;
  --mint-bg: #E2F5EC;
  --rose: #C2334D;
  --rose-bg: #FDE8EC;
  --r-sheet: 22px;
  --r-card: 14px;
  --r-ctl: 10px;
  --shadow-sheet: 0 1px 0 rgba(23, 21, 58, .04), 0 12px 32px -18px rgba(23, 21, 58, .28);
  --shadow-pop: 0 2px 4px rgba(23, 21, 58, .06), 0 24px 60px -20px rgba(23, 21, 58, .38);
  --font: 'Schibsted', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Noto Sans', 'Noto Nastaliq Urdu', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
#root { height: 100%; }
.stat strong, .unread, .badge { font-variant-numeric: tabular-nums; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--indigo); }
::selection { background: var(--lilac-2); }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.t-display { font-size: 44px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; }
.t-h1 { font-size: 28px; }
.t-h2 { font-size: 20px; }
.t-h3 { font-size: 16px; letter-spacing: -0.01em; }
.t-muted { color: var(--ink-2); }
.t-faint { color: var(--ink-3); }
.t-small { font-size: 13px; }
.t-xs { font-size: 12px; }
p { margin: 0; }

/* ---------- the Adelaide orb (the one bold thing) ---------- */
.orb { --s: 28px; width: var(--s); height: var(--s); border-radius: 50%; position: relative; flex: none; isolation: isolate;
  background: radial-gradient(circle at 32% 28%, #fff 0 6%, transparent 30%), conic-gradient(from var(--a, 0deg), #3A2DE0, #8E7CFF, #45C3FF, #3A2DE0);
  box-shadow: inset 0 -4px 10px rgba(23, 21, 58, .35), 0 6px 18px -6px rgba(58, 45, 224, .7);
  animation: orb-spin 9s linear infinite, orb-breathe 3.6s var(--ease) infinite; }
.orb::after { content: ''; position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgba(58, 45, 224, .28), transparent 65%); z-index: -1; animation: orb-halo 3.6s var(--ease) infinite; }
.orb.off { background: radial-gradient(circle at 32% 28%, #fff 0 6%, transparent 30%), conic-gradient(#B9BCD0, #DADCE8, #A9ACC2, #B9BCD0); box-shadow: inset 0 -4px 10px rgba(23, 21, 58, .18); animation: none; }
.orb.off::after { display: none; }
.orb.think { animation: orb-spin 1.6s linear infinite, orb-breathe 1.2s var(--ease) infinite; }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes orb-spin { to { --a: 360deg; } }
@keyframes orb-breathe { 50% { transform: scale(1.06); } }
@keyframes orb-halo { 50% { opacity: .35; transform: scale(1.15); } }

/* ---------- controls ---------- */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font-weight: 560; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: #C9CDDC; background: var(--sheet-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #262357; }
.btn.brand { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.brand:hover { background: var(--indigo-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(23, 21, 58, .05); }
.btn.danger { color: var(--rose); }
.btn.danger:hover { background: var(--rose-bg); border-color: #F3C3CD; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm svg { width: 16px; height: 16px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 560; }
.field small { color: var(--ink-3); font-size: 12px; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: var(--sheet); border-radius: var(--r-ctl); padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(58, 45, 224, .14); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.textarea.code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235D6080' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #CDD0DE; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--indigo); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--indigo); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--sheet-2); border: 1px solid var(--line-2); font-size: 12px; font-weight: 520; color: var(--ink-2); white-space: nowrap; }
.chip.ai { background: var(--lilac); border-color: var(--lilac-2); color: var(--indigo-2); }
.chip.team { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.need { background: var(--amber-bg); border-color: #F6DDB3; color: var(--amber); }
.chip.good { background: var(--mint-bg); border-color: #C3EAD7; color: var(--mint); }
.chip.bad { background: var(--rose-bg); border-color: #F6CCD5; color: var(--rose); }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; display: inline-flex; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art .orb { --s: min(46vw, 520px); position: absolute; right: -12%; top: 50%; translate: 0 -50%; box-shadow: inset 0 -40px 80px rgba(10, 8, 40, .5), 0 60px 160px -40px rgba(58, 45, 224, .8); }
.login-art .orb::after { inset: -20%; background: radial-gradient(circle, rgba(90, 80, 255, .35), transparent 60%); }
.login-art h1 { position: relative; max-width: 11ch; font-size: clamp(40px, 5vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: .98; }
.login-art p { position: relative; max-width: 34ch; color: #B9B7E0; font-size: 15px; }
.brandmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 16px; position: relative; }
.brandmark b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--indigo); color: #fff; font-size: 14px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-form form { width: min(380px, 100%); display: grid; gap: 18px; }
.login-form .err { color: var(--rose); font-size: 13px; min-height: 18px; }

/* ---------- shell ---------- */
.shell { height: 100%; display: grid; grid-template-rows: 68px 1fr; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 20px; gap: 16px; }
.topbar .brandmark { color: var(--ink); }
.topbar .right { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.dock { display: flex; gap: 2px; padding: 4px; background: var(--sheet); border-radius: 99px; box-shadow: var(--shadow-sheet); }
.dock a { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 99px; text-decoration: none; color: var(--ink-2); font-weight: 560; font-size: 13.5px; position: relative; transition: color .15s, background .15s; }
.dock a:hover { color: var(--ink); background: var(--sheet-2); }
.dock a.on { background: var(--ink); color: #fff; }
.dock a svg { width: 16px; height: 16px; }
.dock .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--amber); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

.ai-switch { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 8px; border-radius: 99px; border: 0; background: var(--sheet); box-shadow: var(--shadow-sheet); cursor: pointer; text-align: left; }
.ai-switch .orb { --s: 28px; }
.ai-switch b { display: block; font-size: 13px; font-weight: 650; line-height: 1.1; }
.ai-switch span span { display: block; font-size: 11.5px; color: var(--ink-2); line-height: 1.2; white-space: nowrap; }
.ai-switch:hover { background: var(--sheet-2); }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 650; font-size: 13px; color: var(--ink); background: var(--mist-2); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.me-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.me-btn .avatar { background: var(--sheet); box-shadow: var(--shadow-sheet); width: 40px; height: 40px; }

.main { min-height: 0; padding: 0 20px 20px; }
.sheet { background: var(--sheet); border-radius: var(--r-sheet); box-shadow: var(--shadow-sheet); }

/* ---------- popovers / menus / modals / toasts ---------- */
.menu { position: fixed; z-index: 60; min-width: 220px; background: var(--sheet); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; display: grid; animation: pop .16s var(--ease); }
.menu button, .menu a { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.menu button:hover, .menu button.active, .menu a:hover { background: var(--sheet-2); }
.menu .head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }

.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(23, 21, 58, .32); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--sheet); border-radius: var(--r-sheet); box-shadow: var(--shadow-pop); animation: rise .25s var(--ease); }
.modal.wide { width: min(820px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 24px 6px; }
.modal .body { padding: 14px 24px 8px; display: grid; gap: 16px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.toasts { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-pop); font-size: 13.5px; max-width: min(520px, 90vw); animation: rise .25s var(--ease); }
.toast.bad { background: var(--rose); }

/* ---------- inbox ---------- */
.inbox { height: 100%; display: grid; grid-template-columns: 340px minmax(0, 1fr) 320px; gap: 14px; }
.inbox.no-details { grid-template-columns: 340px minmax(0, 1fr); }
.inbox.no-details .details { display: none; }
.pane { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.list-head { padding: 18px 18px 10px; display: grid; gap: 12px; }
.list-head .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 16px; color: var(--ink-3); }
.search .input { padding-left: 34px; background: var(--sheet-2); border-color: transparent; }
.filters { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.filters button { border: 0; background: none; height: 30px; padding: 0 11px; border-radius: 99px; font-size: 13px; font-weight: 560; color: var(--ink-2); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.filters button:hover { background: var(--sheet-2); color: var(--ink); }
.filters button.on { background: var(--lilac); color: var(--indigo-2); }
.filters em { font-style: normal; font-size: 11.5px; opacity: .75; }

.chats { overflow-y: auto; padding: 4px 8px 12px; flex: 1; }
.chat-row { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 10px; border: 0; background: none; text-align: left; border-radius: 14px; cursor: pointer; position: relative; }
.chat-row:hover { background: var(--sheet-2); }
.chat-row.on { background: var(--mist); }
.chat-row .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-row .name { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row time { font-size: 12px; color: var(--ink-3); flex: none; }
.chat-row .prev { color: var(--ink-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.chat-row .meta { display: flex; gap: 6px; margin-top: 7px; align-items: center; flex-wrap: wrap; }
.chat-row.has-unread { padding-right: 40px; }
.chat-row .unread { position: absolute; right: 12px; top: 50%; translate: 0 -10%; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--indigo); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.chat-row .avatar { position: relative; }
.chat-row .avatar .mode { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--sheet); }
.mode.ai { background: var(--indigo); }
.mode.team { background: var(--ink); }
.empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 40px 24px; color: var(--ink-2); height: 100%; }
.empty .orb { --s: 56px; }

.thread-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.thread-head .who { min-width: 0; flex: 1; }
.thread-head .who h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .who p { font-size: 12.5px; color: var(--ink-2); }
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--sheet-2); border: 1px solid var(--line-2); }
.seg button { border: 0; background: none; height: 32px; padding: 0 14px 0 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; }
.seg button .orb { --s: 18px; }
.seg button.on.ai { background: var(--lilac); color: var(--indigo-2); }
.seg button.on.team { background: var(--ink); color: #fff; }
.seg button .avatar { width: 20px; height: 20px; font-size: 10px; }

.messages { flex: 1; overflow-y: auto; padding: 22px clamp(16px, 4vw, 48px) 12px; display: flex; flex-direction: column; gap: 3px; background: linear-gradient(var(--sheet), var(--sheet)) padding-box; scroll-behavior: smooth; }
.day { align-self: center; margin: 14px 0 8px; font-size: 12px; color: var(--ink-3); font-weight: 560; }
.msg { max-width: min(560px, 78%); display: grid; gap: 4px; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; justify-items: end; }
.msg .who { font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 0 6px; margin-top: 8px; display: inline-flex; gap: 6px; align-items: center; }
.msg .who .orb { --s: 12px; }
.bubble { padding: 9px 13px 7px; border-radius: 18px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; position: relative; }
.msg.in .bubble { background: var(--sheet-2); border: 1px solid var(--line-2); border-bottom-left-radius: 6px; }
.msg.ai .bubble { background: var(--lilac); color: #1E1873; border-bottom-right-radius: 6px; }
.msg.agent .bubble { background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.agent .bubble a { color: #C9C3FF; }
.msg.auto .bubble { background: var(--sheet); border: 1px dashed #B7B1F5; border-bottom-right-radius: 6px; }
.bubble .foot { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; opacity: .65; margin-top: 2px; white-space: nowrap; }
.bubble .foot svg { width: 15px; height: 15px; }
.bubble .foot .read { color: var(--indigo); opacity: 1; }
.msg.agent .bubble .foot .read { color: #A9A0FF; }
.msg.failed .bubble { box-shadow: 0 0 0 2px var(--rose); }
.msg .error { font-size: 12px; color: var(--rose); padding: 0 6px; max-width: 420px; }
.bubble img.media, .bubble video.media { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; margin: 2px 0 6px; background: var(--mist); cursor: zoom-in; }
.bubble audio { display: block; width: 260px; max-width: 100%; margin: 4px 0; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line-2); text-decoration: none; color: inherit; margin: 2px 0 6px; min-width: 220px; }
.msg.agent .file { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); }
.file svg { width: 28px; height: 28px; color: var(--indigo); flex: none; }
.file b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file span { font-size: 11.5px; opacity: .7; }
.note { align-self: center; max-width: min(560px, 90%); margin: 10px 0; padding: 8px 14px; border-radius: 12px; font-size: 12.5px; color: var(--ink-2); text-align: center; background: var(--sheet-2); white-space: pre-wrap; }
.note.private { background: var(--amber-bg); color: #6F4709; text-align: left; align-self: flex-end; border-bottom-right-radius: 4px; }
.note.private b { display: block; font-size: 11.5px; margin-bottom: 2px; }
.typing { align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--indigo-2); padding: 8px 4px; }
.typing .orb { --s: 18px; }

.composer-wrap { padding: 10px 14px 14px; border-top: 1px solid var(--line-2); position: relative; }
.paused-bar { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: 13px; padding: 8px 8px 10px 12px; color: var(--ink-2); }
.paused-bar b { color: var(--ink); }
.composer { border: 1px solid var(--line); border-radius: 18px; background: var(--sheet); transition: border-color .15s, box-shadow .15s, background .15s; }
.composer:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(58, 45, 224, .12); }
.composer.note-mode { background: var(--amber-bg); border-color: #F0CE8F; }
.composer.note-mode:focus-within { box-shadow: 0 0 0 3px rgba(201, 122, 18, .15); }
.composer textarea { display: block; width: 100%; border: 0; outline: none; resize: none; background: transparent; padding: 12px 14px 4px; max-height: 200px; min-height: 46px; line-height: 1.5; }
.composer .bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px 8px; }
.composer .bar .grow { flex: 1; }
.attachments { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px 0; }
.att { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 10px; background: var(--sheet-2); border: 1px solid var(--line-2); font-size: 12.5px; max-width: 240px; }
.att img { width: 36px; height: 36px; object-fit: cover; border-radius: 7px; }
.att .ic { width: 36px; height: 36px; border-radius: 7px; background: var(--lilac); display: grid; place-items: center; color: var(--indigo); }
.att .ic svg { width: 18px; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att.loading { opacity: .6; }
.qr-pop { position: absolute; left: 14px; right: 14px; bottom: calc(100% - 6px); background: var(--sheet); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; max-height: 280px; overflow-y: auto; z-index: 5; }
.qr-pop button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; width: 100%; }
.qr-pop button.on, .qr-pop button:hover { background: var(--sheet-2); }
.qr-pop b { font-weight: 650; }
.qr-pop span { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-hint { position: absolute; inset: 8px; border: 2px dashed var(--indigo); border-radius: 18px; background: rgba(237, 235, 255, .9); display: grid; place-items: center; font-weight: 650; color: var(--indigo-2); z-index: 6; pointer-events: none; }

.details { overflow-y: auto; padding: 22px 20px; display: grid; align-content: start; gap: 22px; }
.details .id { display: grid; justify-items: start; gap: 10px; }
.details .id input { border: 0; padding: 2px 0; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; outline: none; width: 100%; background: none; border-bottom: 1px solid transparent; }
.details .id input:focus { border-bottom-color: var(--indigo); }
.details section { display: grid; gap: 10px; }
.details h3 { font-size: 13px; font-weight: 650; color: var(--ink-2); letter-spacing: 0; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tags input { border: 0; outline: none; width: 110px; font-size: 13px; padding: 3px 4px; background: none; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumbs a { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--sheet-2); display: grid; place-items: center; color: var(--ink-3); font-size: 11px; text-decoration: none; text-align: center; padding: 4px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- generic page layout ---------- */
.page { height: 100%; overflow-y: auto; }
.page-in { max-width: 1180px; margin: 0 auto; padding: 18px 4px 40px; display: grid; gap: 22px; align-content: start; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 8px 4px 0; }
.page-head p { color: var(--ink-2); margin-top: 6px; max-width: 64ch; }
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 99px; background: var(--mist-2); }
.tabs button { border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 99px; font-weight: 580; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 21, 58, .1); }

.split { display: grid; grid-template-columns: 300px 1fr; gap: 14px; min-height: 560px; }
.split > .sheet { min-width: 0; }
.nav-list { padding: 10px; display: grid; gap: 2px; align-content: start; }
.nav-list button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 560; }
.nav-list button:hover { background: var(--sheet-2); }
.nav-list button.on { background: var(--mist); }
.nav-list button .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-list button.off .grow { color: var(--ink-3); }
.nav-list hr { border: 0; border-top: 1px solid var(--line-2); margin: 8px 6px; }
.editor { padding: 24px; display: grid; gap: 16px; align-content: start; }
.editor .title-input { border: 0; outline: none; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; padding: 0; background: none; width: 100%; }
.editor .big { min-height: 420px; font-size: 14.5px; line-height: 1.65; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
.card { padding: 20px; }
.callout { padding: 14px 16px; border-radius: var(--r-card); background: var(--lilac); color: #1E1873; font-size: 13.5px; display: flex; gap: 12px; align-items: flex-start; }
.callout.warn { background: var(--amber-bg); color: #6F4709; }
.callout .orb { --s: 22px; margin-top: 1px; }

/* rules */
.rule-list { display: grid; }
.rule { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line-2); cursor: pointer; }
.rule:first-child { border-top: 0; }
.rule:hover { background: var(--sheet-2); }
.rule h3 { font-size: 15px; }
.rule .kws { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.rule .outcome { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.rule.inactive h3, .rule.inactive .kws { opacity: .5; }
.radio-cards { display: grid; gap: 8px; }
.radio-cards label { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.radio-cards label:has(input:checked) { border-color: var(--indigo); background: var(--lilac); }
.radio-cards input { margin: 3px 0 0; accent-color: var(--indigo); }
.radio-cards b { display: block; font-size: 13.5px; }
.radio-cards span { font-size: 12.5px; color: var(--ink-2); }
.media-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.media-pick .att { cursor: default; }

/* media library */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { overflow: hidden; display: grid; grid-template-rows: 150px auto; }
.tile .pv { background: var(--sheet-2); display: grid; place-items: center; overflow: hidden; color: var(--indigo); }
.tile .pv img, .tile .pv video { width: 100%; height: 100%; object-fit: cover; }
.tile .pv svg { width: 40px; height: 40px; }
.tile .info { padding: 12px 14px 14px; display: grid; gap: 8px; }
.tile .info b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 1.5px dashed #BFC3D6; border-radius: var(--r-sheet); padding: 26px; display: grid; place-items: center; gap: 8px; text-align: center; color: var(--ink-2); cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone:hover, .dropzone.over { background: var(--lilac); border-color: var(--indigo); color: var(--indigo-2); }

/* leads board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--mist-2); border-radius: 18px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 320px; transition: background .15s; }
.col.over { background: var(--lilac-2); }
.col > header { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 4px; font-weight: 650; font-size: 13.5px; }
.col > header span { color: var(--ink-3); font-weight: 560; }
.lead { background: var(--sheet); border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(23, 21, 58, .06); cursor: grab; display: grid; gap: 6px; }
.lead:active { cursor: grabbing; }
.lead b { font-size: 14px; }
.lead p { font-size: 12.5px; color: var(--ink-2); }
.lead .row { gap: 6px; flex-wrap: wrap; }

/* insights */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 18px 20px; display: grid; gap: 6px; }
.stat strong { font-size: 30px; font-weight: 680; letter-spacing: -0.03em; line-height: 1; }
.stat span { font-size: 13px; color: var(--ink-2); }
.chart { padding: 22px; display: grid; gap: 16px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; height: 220px; align-items: end; }
.bars .b { display: flex; flex-direction: column; gap: 6px; height: 100%; min-width: 0; }
.bars .b i { display: block; border-radius: 5px; min-height: 0; }
.bars .b i.in { background: #C9CDDC; }
.bars .b .stack-out { display: flex; flex-direction: column-reverse; border-radius: 5px; overflow: hidden; }
.bars .b .stack-out i { border-radius: 0; }
.bars .b small { font-size: 10.5px; color: var(--ink-3); text-align: center; }
.bars .pair { flex: 1; min-height: 0; display: flex; gap: 2px; align-items: flex-end; }
.bars .pair > * { flex: 1; min-width: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12.5px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }

/* simulator */
.sim { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 28px; align-items: start; }
.phone { width: 100%; height: min(760px, calc(100vh - 150px)); border-radius: 44px; background: var(--ink); padding: 12px; box-shadow: var(--shadow-pop); }
.phone .screen { height: 100%; border-radius: 34px; overflow: hidden; background: var(--sheet); display: flex; flex-direction: column; }
.phone .bar-top { padding: 18px 18px 12px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-2); }
.phone .bar-top .orb { --s: 36px; }
.phone .messages { padding: 16px 14px; }
.phone .msg { max-width: 86%; }
.phone .msg.in { align-self: flex-end; justify-items: end; }
.phone .msg.in .bubble { background: var(--ink); color: #fff; border: 0; border-radius: 18px 18px 6px 18px; }
.phone .msg.out { align-self: flex-start; justify-items: start; }
.phone .msg.out .bubble { background: var(--sheet-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: 18px 18px 18px 6px; }
.phone .msg.out.agent .bubble { background: var(--sheet-2); color: var(--ink); }
.phone .typing { align-self: flex-start; }
.phone form { display: flex; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid var(--line-2); align-items: center; }
.phone form .input { border-radius: 99px; background: var(--sheet-2); border-color: transparent; }
.sim-side { display: grid; gap: 18px; padding-top: 6px; }
.phone .sim-empty { margin: auto; text-align: center; color: var(--ink-3); font-size: 13px; max-width: 26ch; display: grid; gap: 10px; justify-items: center; }
.phone .sim-empty .orb { --s: 44px; }
.sim-side ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); }

/* settings */
.settings-sec { padding: 26px; display: grid; gap: 18px; align-content: start; }
.settings-sec h2 { font-size: 20px; }
.settings-sec > p { color: var(--ink-2); margin-top: -10px; max-width: 70ch; }
.group { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line-2); border-radius: var(--r-card); }
.group > h3 { font-size: 14.5px; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { background: var(--sheet-2); font-size: 13px; }
details.adv summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 4px 0; }
details.adv[open] summary { margin-bottom: 12px; }
.toggle-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.toggle-row b { display: block; font-weight: 600; }
.toggle-row span { font-size: 12.5px; color: var(--ink-2); }
pre.prompt { white-space: pre-wrap; font-size: 12.5px; line-height: 1.6; background: var(--sheet-2); padding: 16px; border-radius: 12px; max-height: 60vh; overflow: auto; margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .inbox { grid-template-columns: 320px minmax(0, 1fr); }
  .inbox .details { position: fixed; right: 20px; top: 84px; bottom: 20px; width: 340px; z-index: 30; box-shadow: var(--shadow-pop); }
}
@media (max-width: 1100px) {
  .dock a span.lbl { display: none; }
  .dock a { padding: 0 12px; }
  .ai-switch span span { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-rows: 60px 1fr 74px; }
  .topbar { grid-template-columns: 1fr auto; padding: 0 14px; }
  .topbar .dock-slot { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 40; display: flex; justify-content: center; }
  .dock { overflow-x: auto; max-width: 100%; box-shadow: var(--shadow-pop); }
  .dock a { padding: 0 13px; }
  .main { padding: 0 10px 0; }
  .ai-switch b { display: none; }
  .ai-switch { padding: 0 8px; }
  .inbox, .inbox.no-details { grid-template-columns: 1fr; }
  .inbox .thread-pane { display: none; }
  .inbox.open .list-pane { display: none; }
  .inbox.open .thread-pane { display: flex; }
  .inbox .details { left: 10px; right: 10px; width: auto; top: 70px; bottom: 84px; }
  .thread-head { gap: 8px; padding: 10px 10px; }
  .thread-head > .avatar { display: none; }
  .thread-head .who h2 { font-size: 15px; }
  .seg .lbl { display: none; }
  .seg button { padding: 0 10px; }
  .composer .bar .btn:not([data-send]) span:not(.orb) { display: none; }
  .paused-bar { flex-wrap: wrap; font-size: 12.5px; padding: 4px 4px 8px; }
  .messages { padding: 14px 12px 10px; }
  .split, .sim, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 260px; padding: 28px; }
  .t-display { font-size: 34px; }
  .msg { max-width: 88%; }
  .phone { height: calc(100vh - 170px); border-radius: 30px; padding: 6px; }
  .phone .screen { border-radius: 25px; }
}
@media (min-width: 861px) { .back-btn { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
