:root {
  --bg: #f1f1f1;
  --panel: #ffffff;
  --hover: #e8e8e8;
  --active: #e2e2e2;
  --border: #e6e6e6;
  --text: #141414;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --primary: #1f5eff;
  --primary-hover: #154ee0;
  --primary-soft: #e6eeff;
  --bubble-agent: #e4ecfa;
  --bubble-visitor: #f1f1f1;
  --note: #fff6d6;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #ea8a0c;
  --radius: 12px;
  --text2: #333333;
  --soft: #f5f5f5;
  --chip: #e6e6e6;
  --input-border: #d6d6d6;
  --notif-bg: #cfe2ff;
  --danger-soft: #fff5f5;
  --disabled: #c9d3e6;
  --shadow: 0 10px 30px rgba(0,0,0,.12);
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
:root[data-theme="dark"] {
  --bg: #151517;
  --panel: #1f1f22;
  --hover: #2b2b30;
  --active: #33333a;
  --border: #2e2e33;
  --text: #ededef;
  --text2: #c9c9ce;
  --muted: #9a9aa2;
  --faint: #73737b;
  --primary: #3b74ff;
  --primary-hover: #5286ff;
  --primary-soft: #1d2b4d;
  --bubble-agent: #253556;
  --bubble-visitor: #2c2c31;
  --note: #3a321b;
  --soft: #28282d;
  --chip: #36363c;
  --input-border: #44444b;
  --notif-bg: #1c3461;
  --danger-soft: #3a1f22;
  --disabled: #34405c;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  color-scheme: dark;
}
:root[data-theme="dark"] .logo-mark { background: #ededef; color: #151517; }
:root[data-theme="dark"] .bubble.note { border-color: #6b5a24; }
:root[data-theme="dark"] .pill.queued { background: #3d2e12; color: #f5c46b; }
:root[data-theme="dark"] .pill.green { background: #133222; color: #6ee7a0; }
:root[data-theme="dark"] .pill.vip { background: #3a2c10; color: #f5c46b; }
:root[data-theme="dark"] .toast { background: #ededef; color: #151517; }
:root[data-theme="dark"] .modal-bg { background: rgba(0,0,0,.6); }
body.no-labels .rail a .lbl { display: none; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { flex-shrink: 0; }
.hidden { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--input-border); background: var(--panel); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: var(--disabled); border-color: var(--disabled); cursor: default; }
.btn-danger { color: var(--red); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 40px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--text2); }
.icon-btn:hover { background: var(--hover); }
.input, .textarea, select.input { font-weight: 400; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--panel); outline: none; }
.textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 500; }
.field small { color: var(--muted); font-weight: 400; }

/* ---------- avatar ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 13px; position: relative; flex-shrink: 0; text-transform: uppercase; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar .dot { position: absolute; right: -1px; top: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--panel); background: var(--green); }
.avatar .dot.off { background: #bdbdbd; }

/* ---------- login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; background: var(--panel); border-radius: 16px; padding: 32px; box-shadow: 0 8px 30px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 20px; margin: 4px 0 4px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.login-card input { height: 40px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: 8px; }
.login-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.login-error { color: var(--red); min-height: 18px; font-size: 13px; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: #141414; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }

/* ---------- shell ---------- */
.notif-bar { height: 42px; background: var(--notif-bg); display: flex; align-items: center; justify-content: center; gap: 16px; position: relative; font-weight: 500; }
.notif-bar .btn { height: 30px; }
.notif-bar .close { position: absolute; right: 14px; }
.app { display: grid; grid-template-columns: 76px 218px 1fr; grid-template-rows: 50px 1fr; height: 100vh; }
.app.with-bar { height: calc(100vh - 42px); }
.topbar { grid-column: 1 / -1; display: grid; grid-template-columns: 76px 1fr auto 1fr; align-items: center; padding-right: 12px; }
.topbar .logo { display: flex; justify-content: center; }
.served-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 999px; padding: 5px 14px 5px 6px; margin-left: 10px; font-weight: 500; }
.served-pill b { font-weight: 600; }
.served-pill .g { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--green); display: inline-flex; align-items: center; justify-content: center; color: var(--green); }
.search { width: 400px; height: 32px; background: var(--chip); border-radius: 999px; display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); }
.search kbd { font-family: inherit; font-size: 12px; color: var(--muted); }
.top-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.me-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 3px; cursor: pointer; font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.status-dot.off { background: var(--red); }

.rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 6px; }
.rail a { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--text2); padding: 2px 0; position: relative; }
.rail a .ic { width: 36px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.rail a:hover .ic { background: var(--hover); }
.rail a.active .ic { background: var(--chip); }
.rail a.active { font-weight: 600; color: var(--text); }
.rail .badge { position: absolute; top: -2px; right: 10px; }
.rail .spacer { flex: 1; }
.rail .me { margin-bottom: 14px; cursor: pointer; }

.sidebar { overflow-y: auto; padding: 4px 10px 20px 10px; }
.sidebar h2 { font-size: 17px; margin: 10px 2px 18px 2px; display: flex; justify-content: space-between; align-items: center; }
.sidebar h3 { font-size: 14px; margin: 18px 2px 6px 2px; display: flex; justify-content: space-between; align-items: center; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px 0 12px; border-radius: 8px; color: var(--text2); cursor: pointer; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--active); color: var(--text); font-weight: 500; }
.nav-item .count { margin-left: auto; font-size: 13px; color: var(--text2); }
.nav-item .count.hot { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 7px; font-weight: 600; font-size: 12px; line-height: 18px; }
.nav-sep { height: 1px; background: var(--chip); margin: 8px 12px; }
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; }

.main { background: var(--panel); border-radius: var(--radius) 0 0 0; overflow: hidden; display: flex; min-width: 0; min-height: 0; }

/* ---------- inbox ---------- */
.col-list { width: 290px; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.col-head { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.col-head h2 { font-size: 16px; margin: 0; font-weight: 600; }
.list-sub { display: flex; justify-content: space-between; padding: 14px 20px 8px; font-weight: 600; font-size: 14px; }
.list-sub span:last-child { cursor: pointer; }
.list-scroll { overflow-y: auto; flex: 1; padding: 0 8px 8px; }
.chat-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; margin-bottom: 2px; }
.chat-item:hover { background: var(--soft); }
.chat-item.active { background: var(--active); }
.chat-item { position: relative; }
.chat-item .item-actions { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); display: none; gap: 4px; z-index: 1; }
.chat-item:hover .item-actions { display: flex; }
.chat-item:hover .time, .chat-item:hover .row2 .badge { visibility: hidden; }
.chat-item:hover .body { padding-right: 64px; }
.item-actions button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--text2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.item-actions button:hover { background: rgba(0,0,0,.07); }
.item-actions button[data-close] { background: var(--chip); }
.item-actions button[data-close]:hover { background: var(--input-border); color: var(--text); }
.chat-item.confirm-close { background: var(--soft); justify-content: center; align-items: center; gap: 8px; padding: 0 12px; cursor: default; }
.chat-item.confirm-close .btn { height: 34px; padding: 0 16px; border-radius: 9px; font-size: 13px; }
.btn-close-chat { color: var(--red); border-color: var(--red); background: var(--danger-soft); }
.btn-close-chat:hover { background: var(--danger-soft); }
.chat-item .body {flex: 1; min-width: 0; }
.chat-item .row1 { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.chat-item .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .time { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.chat-item .row2 { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 13px; }
.chat-item .preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.unread .name, .chat-item.unread .preview { font-weight: 700; color: var(--text); }
.chat-item .meta { font-size: 11px; color: var(--faint); margin-top: 3px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--chip); color: var(--text2); }
.pill.queued { background: #fff1d6; color: #9a5b00; }
.pill.blue { background: var(--primary-soft); color: var(--primary); }
.pill.green { background: #dcfce7; color: #166534; }
.empty { color: var(--muted); text-align: center; padding: 40px 20px; font-size: 13px; }
.empty.big { margin: auto; }
.empty.big h3 { color: var(--text); font-size: 16px; }

.col-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.chat-head { height: 52px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; flex-shrink: 0; }
.chat-head h2 { font-size: 16px; margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.chat-head .actions { display: flex; gap: 4px; align-items: center; }
.messages { flex: 1; overflow-y: auto; padding: 16px 20px 8px; display: flex; flex-direction: column; }
.msg-group { display: flex; gap: 10px; margin: 10px 0; max-width: 78%; }
.msg-group.agent { align-self: flex-end; flex-direction: row-reverse; }
.msg-group .stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg-group.agent .stack { align-items: flex-end; }
.msg-author { font-size: 12px; font-weight: 600; color: var(--text2); margin: 2px 2px 2px; }
.bubble { padding: 10px 14px; border-radius: 14px; background: var(--bubble-visitor); white-space: pre-wrap; word-break: break-word; line-height: 1.45; max-width: 100%; }
.msg-group.agent .bubble { background: var(--bubble-agent); }
.bubble { position: relative; }
.bubble.deleted { background: transparent !important; border: 1px dashed var(--input-border); color: var(--muted); font-style: italic; }
.msg-tools { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); padding-right: 6px; display: none; gap: 2px; }
.bubble:hover .msg-tools { display: flex; }
.msg-tools button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.msg-tools button:hover { background: var(--soft); color: var(--text); }
.msg-tools button[data-del]:hover { color: var(--red); }
.bubble.note {background: var(--note); border: 1px dashed #e7c75c; }
.bubble .t { display: flex; justify-content: flex-end; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.bubble a { color: var(--primary); text-decoration: underline; }
.event { align-self: center; font-size: 12px; color: var(--muted); margin: 10px 0; text-align: center; }
.chat-start-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 4px 0 10px; max-width: 420px; }
.chat-start-card .k { color: var(--muted); font-size: 12px; }
.chat-start-card .v { margin-bottom: 6px; }
.sneak { align-self: flex-start; color: var(--muted); font-style: italic; font-size: 13px; margin: 6px 0 6px 42px; display: flex; align-items: center; gap: 6px; }
#sneak { max-width: 70%; }
#sneak .stack { flex: 1; min-width: 0; align-items: flex-start; }
.sneak-bubble { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-style: italic; font-size: 12.5px; line-height: 18px; padding: 8px 12px; }
.sneak-bubble .dots { height: 18px; padding: 0 6px; }
.sneak-bubble .sneak-text { flex: 1 1 auto; min-width: 0; }
.sneak-bubble .sneak-text:empty { display: none; }
#sneak.idle .dots i { animation: none; opacity: .5; }
.dots { display: inline-flex; align-items: center; gap: 3px; background: var(--chip); border-radius: 999px; padding: 0 8px; height: 20px; flex-shrink: 0; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); animation: typing-bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45 } 30% { transform: translateY(-3px); opacity: 1 } }

.composer-wrap { padding: 0 16px 16px; flex-shrink: 0; position: relative; }
.composer { border: 1px solid var(--input-border); border-radius: 14px; background: var(--panel); }
.composer.note { background: var(--note); border-color: #e7c75c; }
.composer:focus-within { border-color: var(--input-border); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; padding: 14px 14px 6px; min-height: 52px; max-height: 200px; background: transparent; line-height: 1.45; }
.composer .bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px 8px; }
.composer .mode { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 0; background: transparent; font-weight: 600; cursor: pointer; border-radius: 8px; }
.composer .mode:hover { background: var(--hover); }
.composer .vsep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.composer .grow { flex: 1; }
kbd.k { display: inline-block; border: 1px solid var(--input-border); border-radius: 5px; padding: 0 5px; font-size: 12px; font-family: inherit; color: var(--muted); }
.take-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--soft); }
.closed-bar { text-align: center; color: var(--muted); padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--soft); }

.popover { position: absolute; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 50; padding: 6px; min-width: 220px; max-height: 320px; overflow-y: auto; }
.popover .opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.popover .opt:hover, .popover .opt.sel { background: var(--soft); }
.popover .opt small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.popover .title { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; font-weight: 600; }
.canned-pop { bottom: 100%; left: 16px; right: 16px; margin-bottom: 6px; }
.emoji-pop { display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; min-width: 0; }
.emoji-pop span { font-size: 20px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; }
.emoji-pop span:hover { background: var(--soft); }

/* details */
.col-details { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; }
.details-scroll { overflow-y: auto; flex: 1; }
.d-card { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.d-visitor { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.d-visitor .nm { font-weight: 600; font-size: 15px; }
.d-visitor .st { color: var(--muted); font-size: 13px; }
.d-line { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: var(--text2); }
.d-line svg { color: var(--text2); }
.d-line .linkish { color: var(--text2); cursor: pointer; }
.d-line .linkish:hover { text-decoration: underline; }
.d-stats { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.d-stats .pill { padding: 3px 10px; font-size: 12px; }
.d-sec-title { display: flex; justify-content: space-between; align-items: center; font-weight: 600; cursor: pointer; user-select: none; }
.d-sec-title svg { transition: transform .15s; }
.d-sec.collapsed .d-sec-body { display: none; }
.d-sec.collapsed .d-sec-title svg { transform: rotate(-90deg); }
.d-sec-body { margin-top: 12px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-all; display: flex; align-items: center; gap: 6px; }
.kv .v a { color: var(--primary); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 4px 2px 9px; border-radius: 999px; color: #fff; }
.tag button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; opacity: .8; }
.round-add { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--input-border); background: var(--panel); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.hist-item { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.hist-item:hover { background: var(--soft); }
.hist-item .p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item .m { color: var(--muted); font-size: 12px; margin-top: 2px; }
.page-item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; }
.page-item a { color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-item span { color: var(--muted); flex-shrink: 0; }
.inline-edit { border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -6px; background: transparent; outline: none; width: 100%; }
.inline-edit:hover { border-color: var(--input-border); }
.inline-edit:focus { border-color: var(--primary); background: var(--panel); }

/* ---------- generic page ---------- */
.page { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page-head { height: 52px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.page-head h2 { font-size: 16px; margin: 0; font-weight: 600; }
.page-body { flex: 1; overflow: auto; padding: 20px; }
.page-body.narrow { max-width: 760px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-weight: 600; color: var(--text2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
table.grid tr:hover td { background: var(--soft); }
.cell-name { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.act { display: inline-flex; align-items: center; gap: 6px; }
.act::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.act.off::before { background: #bdbdbd; }
.act.chatting::before { background: var(--primary); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .n { font-size: 26px; font-weight: 700; margin-top: 6px; }
.card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 36px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.bars .b em { font-style: normal; font-size: 11px; color: var(--text2); }
.seg { display: inline-flex; background: var(--chip); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 6px; cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code { background: var(--soft); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.form-row { display: flex; gap: 8px; align-items: center; }

/* profile panel */
.avatar.xl { width: 52px; height: 52px; font-size: 20px; }
.popover.pp-pop { width: 340px; padding: 14px; border-radius: 16px; max-height: calc(100vh - 20px); }
.pp-head { display: flex; align-items: center; gap: 14px; padding: 8px 8px 16px; }
.pp-name { font-weight: 700; font-size: 15px; }
.pp-mail { color: var(--muted); font-size: 13px; margin-top: 2px; word-break: break-all; }
.pp-group { background: var(--soft); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 16px; font-weight: 600; }
.pp-group .pp-row + .pp-row { border-top: 1px solid var(--border); }
.pp-row.link { cursor: pointer; }
.pp-row.link:hover { background: var(--hover); }
.pp-row small { color: var(--muted); font-weight: 400; font-size: 12px; }
.pp-row svg { color: var(--text2); }
.pp-logout { border-radius: 12px; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--input-border); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.theme-seg { display: inline-flex; background: var(--chip); border-radius: 10px; padding: 3px; gap: 2px; }
.theme-seg button { width: 38px; height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); }
.theme-seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* item menu */
.popover.menu-pop { padding: 6px; min-width: 260px; border-radius: 12px; }
.popover .menu-opt { padding: 10px 12px; gap: 12px; font-size: 14px; }
.menu-sep { height: 1px; background: var(--border); margin: 4px -6px; }
.vip-ic { display: inline-flex; color: #d97706; margin-left: 5px; vertical-align: -1px; }
.pill.vip { background: #fef3c7; color: #b45309; }

/* modal */
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal.modal-wide { width: 640px; padding: 24px 28px; }
.tm-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.tm-tabs span { display: inline-block; padding: 10px 16px; font-weight: 600; border-bottom: 2px solid var(--text); margin-bottom: -1px; }
.tm-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--input-border); border-radius: 8px; padding: 0 10px; height: 36px; width: 260px; color: var(--muted); margin-bottom: 8px; }
.tm-search input { border: 0; outline: none; flex: 1; background: transparent; }
.tm-list { height: 300px; overflow-y: auto; }
.tm-sec { padding: 12px 10px 6px; color: var(--text2); }
.tm-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.tm-item:hover { background: var(--soft); }
.tm-item.sel { background: var(--primary-soft); }
.tm-item .nm { font-weight: 500; }
.tm-item .sub { color: var(--muted); font-size: 13px; }
.tm-item .ck { margin-left: auto; color: var(--primary); }
.tm-note { margin-top: 8px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.tm-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tm-check input { width: 18px; height: 18px; }
.btn-danger-solid { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn-danger-solid:hover { background: #dc2626; }

/* empty inbox */
.inbox-empty { flex: 1; display: flex; flex-direction: column; }
.inbox-empty .center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text2); padding-bottom: 40px; }
.inbox-empty .center svg { color: var(--faint); margin-bottom: 14px; }
.inbox-empty h3 { margin: 0 0 8px; font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.inbox-empty p { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--text2); }
.inbox-empty .btn { height: 38px; padding: 0 18px; font-size: 14px; font-weight: 500; border-radius: 9px; border: 0; background: var(--text); color: var(--panel); }
.inbox-empty .btn:hover { background: var(--text); opacity: .88; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--panel); border-radius: 14px; width: 440px; max-width: 92vw; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #141414; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 200; font-size: 13px; }
.conn-lost { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--orange); color: #fff; padding: 6px 14px; border-radius: 8px; z-index: 200; font-size: 13px; font-weight: 600; }

/* collapsible sidebar */
.app { transition: grid-template-columns .18s ease; }
.app.sb-collapsed { grid-template-columns: 76px 0 1fr; }
.app.sb-collapsed .sidebar { visibility: hidden; padding: 0; overflow: hidden; }
.sidebar h2 .sb-toggle { width: 30px; height: 30px; color: var(--muted); }
.sidebar h2 .sb-toggle:hover { color: var(--text); }
.sb-sec-title { cursor: pointer; user-select: none; border-radius: 6px; }
.sb-sec-title svg { color: var(--muted); transition: transform .15s; }
.sb-sec.closed .sb-sec-title svg { transform: rotate(-90deg); }
.sb-sec.closed .sb-sec-body { display: none; }

/* "Tümü" list: status line instead of message preview */
.chat-item.status-mode { padding-top: 12px; padding-bottom: 12px; align-items: center; }
.chat-item.status-mode .time { display: none; }
.chat-item.status-mode .row1 .name { font-weight: 600; }
.chat-item.status-mode .row2 { color: var(--muted); }

/* top-right online team */
.team-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 999px; padding: 3px; }
.team-faces { display: inline-flex; align-items: center; border: 0; background: transparent; cursor: pointer; padding: 0 6px 0 0; border-radius: 999px; color: var(--text); }
.team-faces:hover { background: var(--hover); }
.team-faces .face { margin-right: -8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--chip); display: inline-flex; }
.team-faces .face .avatar { width: 28px; height: 28px; font-size: 12px; }
.team-faces .face .avatar .dot { width: 9px; height: 9px; }
.team-count { margin-left: 16px; font-weight: 600; font-size: 13px; }
.team-add { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.team-add:hover { background: var(--hover); }
.popover.team-pop { min-width: 280px; padding: 8px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.team-row .grow { flex: 1; min-width: 0; }
.team-row .nm { font-weight: 500; }
.team-row .you { color: var(--muted); font-weight: 400; }
.team-row .sub, .team-row.sub { color: var(--muted); font-size: 12.5px; }
.avatar .dot.away { background: var(--orange); }

/* ---------- settings ---------- */
.sb-top { margin-bottom: 6px; }
.nav-item .count.on-badge { color: var(--green); font-weight: 700; font-size: 12px; }
.head-actions { display: flex; gap: 8px; }
.set-body { padding: 28px 24px 60px; }
.set-wrap { max-width: 860px; margin: 0 auto; }
.set-wrap.wide { max-width: 1180px; }
.set-h { font-size: 17px; margin: 6px 0 14px; }
.set-desc { color: var(--text2); margin: 0 0 18px; line-height: 1.5; }
.set-desc a, .set-note a { color: var(--primary); }
.set-hint { color: var(--muted); font-size: 12.5px; }
.set-note { background: var(--soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; color: var(--text2); }
.set-card { background: var(--soft); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.set-card.pad { padding: 20px 22px; }
.set-card h3 { margin: 0 0 14px; font-size: 15px; }
.set-cap { font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 18px 22px 4px; color: var(--text2); }
.set-empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--soft); border-radius: 14px; }
.set-empty h3 { color: var(--text); margin: 10px 0 6px; }
.set-empty.small { padding: 22px; text-align: left; }
.nrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; padding: 10px 22px; font-weight: 500; }
.nrow small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 3px; }
.nr-right { display: inline-flex; align-items: center; gap: 14px; }
.snd { border: 0; background: transparent; color: var(--faint); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.snd.on { color: var(--text2); }
.snd:hover { background: var(--hover); }
.ncheck { display: flex; align-items: center; gap: 10px; padding: 0 22px 10px; color: var(--text2); cursor: pointer; }
.ncheck input { width: 17px; height: 17px; }
.switch.locked { opacity: .55; cursor: not-allowed; }
.switch .lock { position: absolute; right: 6px; top: 5px; color: #fff; display: inline-flex; z-index: 1; font-style: normal; }
.acc-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs span.on { border-color: var(--text); }
.tm-search.big { width: 340px; height: 40px; background: var(--panel); }

/* teammates */
.tm-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
table.grid.mates td { padding: 10px 12px; white-space: normal; }
table.grid.mates tr { cursor: pointer; }
table.grid.mates tr.sel td { background: var(--active); }
table.grid.mates small { color: var(--muted); }
.you { color: var(--muted); font-weight: 400; }
.role { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.role.owner { background: var(--chip); color: var(--text); }
.tm-profile { background: var(--soft); border-radius: 14px; padding: 20px; position: sticky; top: 0; }
.tp-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.tp-sec { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.tp-title { font-weight: 600; margin-bottom: 10px; }
.tp-team { padding: 4px 0; }
.team-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.sq { width: 20px; height: 20px; border-radius: 5px; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sq.lg { width: 36px; height: 36px; border-radius: 9px; font-size: 15px; }

/* teams */
.team-line { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.set-card .team-line + .team-line { border-top: 1px solid var(--border); }
.team-line .grow { flex: 1; min-width: 0; }
.team-line .sub { color: var(--muted); font-size: 13px; }
.faces { display: inline-flex; }
.faces .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--soft); }
.color-pick { display: flex; gap: 8px; }
.color-pick button { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.color-pick button.on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--panel); }
.member-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-weight: 400; }
.member:hover { background: var(--soft); }
.member .grow { flex: 1; }
.member input { width: 17px; height: 17px; }

/* routing */
table.grid.rules td { white-space: normal; vertical-align: middle; padding: 14px 12px; }
.prio { display: inline-flex; align-items: center; gap: 2px; }
.prio b { margin-left: 8px; }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.cond code { background: var(--chip); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.row-actions { text-align: right; white-space: nowrap; }
.set-card.fallback { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-top: 18px; font-weight: 500; }
.set-card.fallback select { width: 240px; }
.fb-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--chip); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* canned */
.canned-card { position: relative; background: var(--soft); border-radius: 14px; padding: 18px 22px; margin-bottom: 12px; }
.cc-short { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 8px; padding: 3px 10px; font-weight: 600; }
.cc-text { margin: 12px 0; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.cc-text a { color: var(--primary); }
.cc-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.cc-tools { position: absolute; top: 14px; right: 14px; display: none; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 3px; box-shadow: var(--shadow); }
.canned-card:hover .cc-tools { display: flex; }
.cc-tools button { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text2); display: inline-flex; align-items: center; justify-content: center; }
.cc-tools button:hover { background: var(--hover); color: var(--text); }
.cc-tools button[data-del]:hover { color: var(--red); }

/* timeout */
.to-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; }
.set-card .to-row + .to-row { border-top: 1px solid var(--border); }
.to-l { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.to-l input { width: 18px; height: 18px; flex-shrink: 0; }
.to-r { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.input.num { width: 80px; text-align: center; }

.pill.inactive { margin-left: 6px; font-size: 10px; padding: 0 6px; background: var(--chip); color: var(--muted); }

/* hide scrollbars everywhere, keep scrolling */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* banned customers */
.ban-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.ban-allow { display: inline-flex; align-items: center; gap: 10px; color: var(--text2); white-space: nowrap; cursor: pointer; }
table.grid.bans td { padding: 14px 12px; white-space: nowrap; }
table.grid.bans small { color: var(--muted); }
a.link { color: var(--primary); }
.cc-modal { position: relative; text-align: center; padding: 26px 10px 8px; }
.cc-modal .cc-x { position: absolute; top: -6px; right: -6px; }
.cc-modal .cc-ic { color: var(--muted); margin-bottom: 8px; }
.cc-modal h3 { font-size: 20px; margin: 0 0 10px; }
.cc-modal p { margin: 0 auto 22px; max-width: 380px; line-height: 1.5; color: var(--text2); }
.cc-foot { display: flex; justify-content: center; gap: 10px; }
.cc-foot .btn { height: 42px; padding: 0 20px; }

/* ---------- smooth transitions ---------- */
@keyframes rc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rc-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rc-modal { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes rc-toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.anim-in { animation: rc-in .24s cubic-bezier(.2,.7,.3,1) backwards; }
.anim-fade { animation: rc-fade .2s ease backwards; }
.popover.pop-in { animation: rc-pop .14s ease-out backwards; }
.modal-bg { animation: rc-fade .16s ease backwards; transition: opacity .16s ease; }
.modal-bg .modal { animation: rc-modal .2s cubic-bezier(.2,.7,.3,1) backwards; transition: transform .16s ease, opacity .16s ease; }
.modal-bg.closing { opacity: 0; }
.modal-bg.closing .modal { transform: translateY(6px) scale(.98); opacity: 0; }
.toast { animation: rc-toast .2s ease backwards; transition: opacity .2s ease, transform .2s ease; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }
.chat-item, .nav-item, .btn, .icon-btn, .pp-row.link, .tm-item, .team-line, .switch span, .switch span::after { transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- customers table ---------- */
.cust-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cust-count { padding: 18px 20px 10px; font-weight: 700; font-size: 16px; }
.cust-wrap { flex: 1; overflow: auto; min-height: 0; cursor: default; }
.cust-wrap.dragging { cursor: grabbing; user-select: none; }
table.grid.cust { width: max-content; min-width: 100%; font-size: 14px; }
table.grid.cust th { color: var(--text2); font-weight: 600; padding: 14px 18px; z-index: 2; }
table.grid.cust th.sortable { cursor: pointer; user-select: none; }
table.grid.cust th.sortable:hover, table.grid.cust th.sorted { background: var(--soft); }
table.grid.cust th svg { vertical-align: -2px; margin-left: 6px; }
table.grid.cust td { padding: 12px 18px; height: 64px; max-width: 320px; }
table.grid.cust .num { text-align: right; }
table.grid.cust .stick { position: sticky; left: 0; background: var(--panel); z-index: 1; }
table.grid.cust th.stick { z-index: 3; }
table.grid.cust tr:hover td.stick { background: var(--soft); }
table.grid.cust .cell-name { gap: 12px; }
table.grid.cust .cell-name.ic { gap: 8px; font-weight: 400; }
table.grid.cust .cn { font-weight: 500; }
.colpick-th { position: sticky !important; right: 0; width: 56px; text-align: center !important; border-left: 1px solid var(--border); padding: 8px !important; }
.row-more { position: sticky; right: 0; width: 56px; text-align: center; background: transparent !important; }
.row-more .icon-btn { visibility: hidden; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); }
table.grid.cust tr:hover .row-more .icon-btn { visibility: visible; }
.cact-wrap { display: inline-flex; gap: 6px; }
.btn.cact { height: 38px; border-radius: 9px; font-size: 14px; }
.btn.cact.start { background: #6eb4ff; border-color: #6eb4ff; color: #0b1b33; padding: 0 26px; }
.btn.cact.start:hover { background: #8ac3ff; }
.btn.cact.send { width: 40px; padding: 0; background: #6eb4ff; border-color: #6eb4ff; color: #0b1b33; }
.btn.cact.outline { background: transparent; min-width: 190px; }
.flag { display: inline-flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; width: 22px; height: 15px; border-radius: 3px; background: #e11d2e; color: #fff; }
.muted-link { text-decoration: underline dotted var(--faint); text-underline-offset: 4px; }
.mono { font-family: Consolas, monospace; font-size: 12.5px; color: var(--text2); }
.act.queued::before { background: var(--orange); }
.popover.colpick-pop { max-height: 420px; }
.colopt { gap: 10px; cursor: pointer; }
.colopt input { width: 16px; height: 16px; }

/* logo */
.topbar .logo { color: var(--text); }
.logo-svg { display: block; }
.login-logo { color: var(--text); justify-content: center; margin-bottom: 8px; }
.logo-word { display: block; height: auto; }
table.grid.cust td.stick, table.grid.cust th.stick { box-shadow: 1px 0 0 var(--border); min-width: 220px; }
.cust-wrap.scrolled table.grid.cust .stick { box-shadow: 6px 0 10px -6px rgba(0,0,0,.25); }

/* ---------- inbox + / tickets ---------- */
.sb-title-actions { display: inline-flex; align-items: center; gap: 4px; }
.sb-plus { width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--text); color: var(--panel); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sb-plus:hover { opacity: .85; }
.ticket-item .name { font-weight: 600; }
.ticket-item .meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.ticket-item .meta .avatar.sm { width: 18px; height: 18px; font-size: 9px; }
.tstatus { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; flex-shrink: 0; }
.tstatus.open { background: var(--primary-soft); color: var(--primary); }
.tstatus.pending { background: #fff1d6; color: #9a5b00; }
.tstatus.solved { background: #dcfce7; color: #166534; }
:root[data-theme="dark"] .tstatus.pending { background: #3d2e12; color: #f5c46b; }
:root[data-theme="dark"] .tstatus.solved { background: #133222; color: #6ee7a0; }
.tprio { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 5px; background: var(--chip); }
.tprio.high { color: var(--orange); }
.tprio.urgent { color: #fff; background: var(--red); }
.tnum { color: var(--muted); font-weight: 600; flex-shrink: 0; }
.tsubject { font-size: 16px; font-weight: 600; min-width: 200px; }
.chat-head h2 { min-width: 0; flex: 1; }
.tk-chat { margin: 14px 0; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--soft); }
.tk-chat summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.tk-chat summary::-webkit-details-marker { display: none; }
.tk-line { padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.tk-line:first-of-type { margin-top: 10px; }
.tk-line .t { color: var(--muted); font-size: 11px; }
.tk-line div { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.input.sm { height: 32px; font-size: 13px; }
.tk-kv { grid-template-columns: 96px 1fr; align-items: center; }

/* ---------- reports ---------- */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --good: #0ca30c; --bad: #d03b3b; --gridl: #e7e6e1; --axis: #c3c2b7; --good-t: #006300;
  --q1: #cde2fb; --q2: #9ec5f4; --q3: #6da7ec; --q4: #3987e5; --q5: #256abf; --q6: #184f95; }
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --gridl: #2c2c2f; --axis: #3d3d42; --good-t: #0ca30c;
  --q1: #0d366b; --q2: #184f95; --q3: #256abf; --q4: #3987e5; --q5: #6da7ec; --q6: #9ec5f4; }
.ph-sub { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 10px; }
.seg.big button { padding: 6px 16px; font-weight: 600; }
.rep-tb { display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.input.tb { width: auto; height: 36px; font-weight: 500; padding-right: 28px; }
.tz { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: 8px; color: var(--text2); font-weight: 500; }
.rep-body { padding: 24px 24px 40px; }
.rep-wrap { max-width: 1240px; margin: 0 auto; }
.rep-sec { margin-bottom: 18px; }
.rep-sec-t { display: flex; justify-content: space-between; align-items: center; font-size: 18px; margin: 4px 0 14px; cursor: pointer; user-select: none; }
.rep-sec-t svg { color: var(--muted); transition: transform .15s; }
.rep-sec.closed .rep-sec-t svg { transform: rotate(-90deg); }
.rep-sec.closed .rep-sec-b { display: none; }
.card2 { border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; margin-bottom: 16px; background: var(--panel); position: relative; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .card2 { margin-bottom: 0; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 18px; }
.kpi-row .kpi2 + .kpi2 { border-left: 1px solid var(--border); padding-left: 24px; }
.k-l { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.k-v { font-size: 30px; font-weight: 500; margin: 10px 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; letter-spacing: -.01em; }
.k-v small { font-size: 15px; color: var(--text2); font-weight: 400; }
.k-p { color: var(--text2); font-size: 13.5px; }
.dlt { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 7px; letter-spacing: 0; }
.dlt.good { background: rgba(12,163,12,.12); color: var(--good-t); }
.dlt.bad { background: rgba(208,59,59,.12); color: var(--bad); }
.dlt.flat { background: var(--chip); color: var(--muted); }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); } .sw.s4 { background: var(--s4); }
.sw.good { background: var(--good); } .sw.bad { background: var(--bad); }
.lg { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text2); font-size: 13px; margin-bottom: 8px; }
.lg span { display: inline-flex; align-items: center; gap: 7px; }
.chart { position: relative; width: 100%; }
.lc { display: block; overflow: visible; }
.lc .grid { stroke: var(--gridl); stroke-width: 1; }
.lc .base { stroke: var(--axis); stroke-width: 1; }
.lc .yl { fill: var(--muted); font-size: 11.5px; text-anchor: end; font-variant-numeric: tabular-nums; }
.lc .xl { fill: var(--muted); font-size: 11.5px; text-anchor: middle; }
.lc .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc .ln.dash { stroke-dasharray: 5 4; }
.lc .area { stroke: none; opacity: .14; }
.lc .ln.s1, .lc .pt.s1 { stroke: var(--s1); } .lc .area.s1 { fill: var(--s1); }
.lc .ln.s2, .lc .pt.s2 { stroke: var(--s2); }
.lc .ln.s3, .lc .pt.s3 { stroke: var(--s3); }
.lc .ln.s4, .lc .pt.s4 { stroke: var(--s4); }
.lc .pt { fill: var(--panel); stroke-width: 2; transition: r .1s; }
.lc .pt.on { r: 5.5; }
.lc .pt.s1.on { fill: var(--s1); } .lc .pt.s2.on { fill: var(--s2); } .lc .pt.s3.on { fill: var(--s3); } .lc .pt.s4.on { fill: var(--s4); }
.lc .xh { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }
.lc .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: fixed; z-index: 300; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 0 0 6px; min-width: 170px; pointer-events: none; display: none; font-size: 13px; }
.chart-tip .tt-h { padding: 8px 12px; font-weight: 600; background: var(--soft); border-radius: 10px 10px 0 0; margin-bottom: 4px; }
.chart-tip .tt-r { display: flex; align-items: center; gap: 8px; padding: 4px 12px; color: var(--text2); white-space: nowrap; }
.chart-tip .tt-r b { color: var(--text); font-variant-numeric: tabular-nums; }
.tt-sub { color: var(--muted); font-size: 12px; }
.csat-card { display: flex; align-items: center; gap: 24px; }
.csat-card .grow { flex: 1; }
.csat-rows { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.csat-rows div { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.csat-rows b { margin-left: auto; margin-right: 10px; font-variant-numeric: tabular-nums; }
.stack2 .sep { height: 1px; background: var(--border); margin: 14px 0; }
.ring-bg { fill: none; stroke: var(--chip); stroke-width: 7; }
.ring-good { fill: none; stroke: var(--good); stroke-width: 7; stroke-linecap: round; }
.ring-bad { fill: none; stroke: var(--bad); stroke-width: 7; }
.ring-t { fill: var(--text); font-size: 22px; font-weight: 600; text-anchor: middle; }
.bd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.bd-head h3 { margin: 0; font-size: 16px; }
.bd-wrap { overflow-x: auto; }
table.grid.bd { width: max-content; min-width: 100%; }
table.grid.bd th, table.grid.bd td { padding: 11px 16px; }
table.grid.bd .num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid.bd th:first-child, table.grid.bd td:first-child { position: sticky; left: 0; background: var(--panel); min-width: 200px; z-index: 1; }
table.grid.bd tr.grp td { font-weight: 700; background: var(--soft); }
table.grid.bd tr.grp td:first-child { background: var(--soft); }
.hm { display: grid; gap: 2px; font-size: 12px; }
.hm-c { text-align: center; color: var(--text2); padding-bottom: 6px; }
.hm-r { color: var(--muted); text-align: right; padding-right: 8px; font-variant-numeric: tabular-nums; line-height: 18px; }
.hm-x { height: 18px; border-radius: 3px; background: var(--soft); }
.hm-x.q1 { background: var(--q1); } .hm-x.q2 { background: var(--q2); } .hm-x.q3 { background: var(--q3); }
.hm-x.q4 { background: var(--q4); } .hm-x.q5 { background: var(--q5); } .hm-x.q6 { background: var(--q6); }
.hm-x[data-t]:hover { outline: 2px solid var(--text); outline-offset: -1px; }
.hm-scale { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 12px; }
.hm-scale i { width: 22px; height: 12px; display: inline-block; }
.hm-scale span { margin: 0 6px; }
.tm { position: relative; }
.tm-cell { position: absolute; border-radius: 8px; padding: 12px 14px; overflow: hidden; display: flex; flex-direction: column; gap: 4px; color: #fff; cursor: default; }
.tm-cell b { font-weight: 600; }
.tm-cell.q2, .tm-cell.q3 { color: #0b0b0b; }
:root[data-theme="dark"] .tm-cell.q2, :root[data-theme="dark"] .tm-cell.q3 { color: #fff; }
:root[data-theme="dark"] .tm-cell.q5, :root[data-theme="dark"] .tm-cell.q6 { color: #0b0b0b; }
.tm-cell.q2 { background: var(--q2); } .tm-cell.q3 { background: var(--q3); } .tm-cell.q4 { background: var(--q4); } .tm-cell.q5 { background: var(--q5); } .tm-cell.q6 { background: var(--q6); }
.tm-cell:hover { filter: brightness(1.08); }
.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: end; padding-top: 8px; }
.fn-l { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.fn-l span { color: var(--text2); font-variant-numeric: tabular-nums; }
.fn-bar-wrap { display: flex; flex-direction: column; }
.fn-drop { display: flex; align-items: flex-end; justify-content: center; color: var(--bad); font-size: 12px; font-weight: 600; padding-bottom: 6px; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--soft) 6px 8px); border-radius: 6px 6px 0 0; }
.fn-bar { border-radius: 4px 4px 0 0; display: flex; justify-content: center; align-items: flex-start; padding-top: 6px; color: #fff; font-weight: 700; font-size: 12.5px; min-height: 24px; }
.fn-bar.s1 { background: var(--s1); }
.fn-conv { margin-top: 10px; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.pick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pick { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; position: relative; }
.pick.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pk-l { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.pk-l::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--input-border); box-sizing: border-box; }
.pick.on .pk-l::before { border: 5px solid var(--text); }
.pk-v { font-size: 26px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.bw { display: flex; }
.bw div { padding: 0 20px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.bw span { color: var(--muted); font-size: 12.5px; }
.bw small { color: var(--muted); }
.row-act { display: inline-flex; gap: 8px; align-items: center; }
table.grid.perf { width: 100%; }
table.grid.perf td { padding: 12px 16px; white-space: nowrap; vertical-align: middle; }
table.grid.perf .num { text-align: right; }
table.grid.perf td .dlt { margin-top: 4px; }
.act-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 13px; }
.act-cell span { display: inline-flex; align-items: center; gap: 6px; }
.act-cell .sw { width: 7px; height: 7px; border-radius: 50%; }
.rep-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 24px; line-height: 1.6; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

/* custom select */
.cselect { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; font-weight: 500; text-align: left; transition: border-color .15s ease, box-shadow .15s ease; }
.cselect:hover { border-color: var(--faint); }
.cselect:focus-visible, .cselect.open { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cselect:disabled { opacity: .55; cursor: not-allowed; }
.cselect .cs-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cselect svg { color: var(--muted); transition: transform .15s ease; flex-shrink: 0; }
.cselect.open svg { transform: rotate(180deg); }
.cselect.tb { width: auto; height: 36px; font-weight: 600; }
.cselect.sm { height: 32px; font-size: 13px; }
.popover.cs-pop { z-index: 160; padding: 5px; max-height: 300px; border-radius: 10px; }
.popover .cs-opt { justify-content: space-between; gap: 16px; padding: 8px 10px; border-radius: 7px; white-space: nowrap; }
.popover .cs-opt.sel { font-weight: 600; background: transparent; }
.popover .cs-opt.sel svg { color: var(--primary); }
.popover .cs-opt:hover, .popover .cs-opt.kb { background: var(--hover); }
.popover .cs-opt.dis { opacity: .45; cursor: default; }

/* ---------- shell polish (closer to reference layout) ---------- */
.app { grid-template-columns: 80px 252px 1fr; }
.app.sb-collapsed { grid-template-columns: 80px 0 1fr; }
.main { border-radius: 16px; border: 1px solid var(--border); margin: 0 8px 8px 4px; }
:root[data-theme="dark"] .main { border-color: #2a2a2f; }
.notif-bar { gap: 14px; font-weight: 600; }
.notif-bar .nb-ic { display: inline-flex; color: var(--primary); }
:root[data-theme="dark"] .notif-bar .nb-ic { color: #9ec5f4; }
.notif-bar .btn { height: 32px; padding: 0 16px; border-radius: 9px; }
:root[data-theme="dark"] .notif-bar #notifOn { background: #151517; border-color: #3a3a40; color: #fff; }
.served-pill { padding: 6px 18px 6px 7px; height: 38px; font-size: 14.5px; }
.served-pill .g { width: 24px; height: 24px; }
.rail { gap: 14px; padding-top: 10px; }
.rail a { width: 72px; gap: 5px; font-size: 12px; font-weight: 500; }
.rail a .ic { width: 44px; height: 40px; border-radius: 12px; }
.rail a.active .ic { background: var(--active); }
:root[data-theme="dark"] .rail a.active .ic { background: #3a3a40; color: #fff; }
.rail a.active { font-weight: 700; }
.rail .badge { right: 12px; }
.sidebar { padding: 4px 14px 20px 12px; }
.sidebar h2 { font-size: 19px; margin: 12px 2px 20px 4px; }
.sidebar h3 { font-size: 15px; margin: 20px 4px 8px 4px; }
.nav-item { height: 38px; font-size: 14.5px; padding: 0 12px 0 14px; border-radius: 9px; }
.nav-item .count { font-size: 14px; }
.sb-plus { width: 34px; height: 34px; border-radius: 9px; }
:root[data-theme="dark"] .sb-plus { background: #ececee; color: #151517; }
.sb-title-actions { gap: 6px; }
.page-head, .col-head, .chat-head { height: 58px; }
.page-head h2, .col-head h2 { font-size: 17px; }
.inbox-empty .center svg { margin-bottom: 16px; }
.inbox-empty h3 { font-size: 21px; margin-bottom: 10px; }
.inbox-empty p { font-size: 15px; margin-bottom: 20px; }
.inbox-empty .btn { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
:root[data-theme="dark"] .inbox-empty .btn { background: #ececee; color: #151517; }

/* empty inbox: compact */
.inbox-empty .center svg { width: 40px; height: 40px; margin-bottom: 12px; }
.inbox-empty h3 { font-size: 17px; margin-bottom: 6px; }
.inbox-empty p { font-size: 13.5px; line-height: 1.45; margin-bottom: 16px; }
.inbox-empty .btn { height: 34px; padding: 0 14px; font-size: 13.5px; border-radius: 8px; }

/* rail: reference-style icons */
.rail { gap: 16px; padding-top: 8px; }
.rail a { width: 76px; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rail a .ic { width: 50px; height: 46px; border-radius: 13px; color: var(--muted); }
.rail a:hover, .rail a:hover .ic { color: var(--text); }
.rail a.active, .rail a.active .ic { color: var(--text); font-weight: 700; }
.rail a.active .ic { background: var(--active); }
:root[data-theme="dark"] .rail a.active .ic { background: #36363c; color: #fff; }
:root[data-theme="dark"] .rail a.active { color: #fff; }
.rail .badge { top: -3px; right: 8px; }

/* sidebar + rail: one step smaller */
.app { grid-template-columns: 72px 228px 1fr; }
.app.sb-collapsed { grid-template-columns: 72px 0 1fr; }
.rail { gap: 10px; padding-top: 6px; }
.rail a { width: 68px; gap: 4px; font-size: 11.5px; }
.rail a .ic { width: 44px; height: 40px; border-radius: 11px; }
.rail a .ic svg { width: 22px; height: 22px; }
.rail .badge { right: 6px; }
.sidebar { padding: 2px 10px 16px 10px; }
.sidebar h2 { font-size: 17px; margin: 10px 2px 16px 4px; }
.sidebar h3 { font-size: 13.5px; margin: 16px 4px 6px 4px; }
.nav-item { height: 34px; font-size: 13.5px; padding: 0 10px 0 12px; border-radius: 8px; gap: 9px; }
.nav-item svg { width: 15px; height: 15px; }
.nav-item .count { font-size: 13px; }
.sb-plus { width: 30px; height: 30px; border-radius: 8px; }
.sb-plus svg { width: 16px; height: 16px; }
.sidebar h2 .sb-toggle { width: 28px; height: 28px; }

/* ---------- avatars with pictures ---------- */
.avatar.has-img { background: var(--chip); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.xxl { width: 112px; height: 112px; font-size: 40px; }
.avatar.xxl .dot { width: 20px; height: 20px; border-width: 3px; top: 4px; right: 4px; }

/* ---------- agent profile page ---------- */
.back-h { display: flex; align-items: center; gap: 8px; }
.back-h .icon-btn { margin-left: -8px; }
.set-wrap.prof { max-width: 960px; }
.prof-head { display: flex; align-items: center; gap: 22px; margin: 8px 0 26px; }
.prof-head h1 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 12px; }
.prof-head .role { font-size: 13px; padding: 3px 10px; }
.prof-av { position: relative; }
.prof-edit { position: absolute; right: -2px; bottom: 2px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.prof-edit:hover { background: var(--hover); }
.prof-tabs { margin-bottom: 26px; }
.prof-tabs span { cursor: pointer; padding: 10px 18px; color: var(--muted); }
.prof-tabs span.on { color: var(--text); }
.prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.input.lg { height: 44px; font-size: 15px; padding: 0 14px; border-radius: 10px; }
.copy-in { position: relative; }
.copy-in .icon-btn { position: absolute; right: 6px; top: 6px; }
.copy-in .input { padding-right: 44px; }
.btn.lgb { height: 42px; padding: 0 18px; border-radius: 10px; font-size: 14.5px; }
.prof-sec { font-size: 17px; margin: 28px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.prof-sec.danger { color: var(--red); }
.prof-role p { margin: 4px 0 0; color: var(--text2); }
.role-opt, .radio-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; cursor: pointer; }
.role-opt input, .radio-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--text); }
.role-opt small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; font-weight: 400; }
.radio-row span { font-size: 15px; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--input-border); border-radius: 10px; overflow: hidden; height: 44px; }
.stepper .input { width: 64px; border: 0; border-radius: 0; height: 100%; text-align: center; font-size: 16px; box-shadow: none; -moz-appearance: textfield; }
.stepper .input::-webkit-outer-spin-button, .stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-btns { display: flex; flex-direction: column; border-left: 1px solid var(--input-border); }
.st-btns button { flex: 1; width: 34px; border: 0; background: transparent; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.st-btns button + button { border-top: 1px solid var(--input-border); }
.st-btns button:hover { background: var(--hover); color: var(--text); }
.popover .menu-opt.danger { color: var(--red); }
.gal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; max-height: 420px; overflow-y: auto; padding: 6px 4px 10px; }
.gal-i { width: 92px; height: 92px; border-radius: 50%; border: 3px solid transparent; padding: 0; background: none; cursor: pointer; justify-self: center; transition: transform .12s ease, border-color .12s ease; }
.gal-i img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.gal-i:hover { transform: scale(1.05); }
.gal-i.on { border-color: var(--primary); }
@media (max-width: 900px) { .prof-grid { grid-template-columns: 1fr; } }

/* ---------- customer details panel (reference layout) ---------- */
.det-head { padding: 0 12px 0 14px; }
.det-tabs { display: flex; gap: 6px; }
.det-tab { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); }
.det-tab.on { background: var(--active); color: var(--text); }
body.det-hidden .col-details { display: none; }
.det-show { display: none; }
body.det-hidden .det-show { display: inline-flex; }
.col-details .d-card { padding: 18px 20px; }
.v-card .v-title { gap: 14px; justify-content: flex-start; }
.v-card .v-title > svg:last-child { margin-left: auto; }
.v-id { flex: 1; min-width: 0; }
.v-id .nm { font-weight: 600; font-size: 16px; }
.v-id .st { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.v-card .d-sec-body { margin-top: 14px; }
.d-line { gap: 12px; padding: 7px 0; font-size: 14px; }
.d-line svg { color: var(--text2); flex-shrink: 0; }
.d-line.editable { position: relative; margin: 1px -10px; padding: 6px 10px; border-radius: 10px; border: 1px solid transparent; cursor: text; transition: background-color .12s ease, border-color .12s ease; }
.d-line.editable .inline-edit { border: 0; padding: 2px 0; margin: 0; background: transparent; box-shadow: none; flex: 1; min-width: 0; font-size: 14px; }
.d-line.editable .inline-edit::placeholder { color: var(--muted); }
.d-line.editable .pen { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text2); display: none; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.d-line.editable:hover { background: var(--soft); }
.d-line.editable:hover .pen { display: inline-flex; }
.d-line.editable:focus-within { background: transparent; border-color: var(--input-border); }
.d-line.editable:focus-within .pen { display: none; }
.flag { background: var(--chip); color: var(--text2); width: auto; padding: 0 5px; height: 17px; font-size: 10px; border-radius: 4px; }
.d-stats { gap: 8px; margin-top: 12px; }
.stat-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 9px; background: var(--chip); font-size: 13.5px; font-weight: 500; color: var(--text); }
.stat-chip svg { color: var(--text2); }
.stat-chip.blue { background: var(--primary-soft); color: var(--primary); }
:root[data-theme="dark"] .stat-chip.blue { color: #cfe0ff; }
.cnt-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 600; margin-left: 8px; margin-right: auto; }
.d-sec-title { gap: 4px; }
.conv-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--soft); margin-bottom: 8px; cursor: pointer; transition: background-color .12s ease; }
.conv-card:hover { background: var(--hover); }
.conv-card.cur { cursor: default; }
.conv-card > svg { color: var(--text2); margin-top: 2px; flex-shrink: 0; }
.cv-b { min-width: 0; flex: 1; }
.cv-p { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-m { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.tl { position: relative; }
.tl-i { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-i > i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); margin-top: 5px; flex-shrink: 0; position: relative; z-index: 1; margin-left: 3px; }
.tl-i.now > i { width: 13px; height: 13px; margin-left: 1px; margin-top: 3px; background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.25); }
.tl-i:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: 0; width: 1px; background: var(--border); }
.tl-i > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-i a { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.tl-i a:hover { text-decoration: underline; }
.tl-i span { color: var(--muted); font-size: 12.5px; }
.dev-chips { gap: 6px; }
.dchip { width: 30px; height: 30px; border-radius: 8px; background: var(--chip); display: inline-flex; align-items: center; justify-content: center; color: var(--text2); }
.col-details .kv { grid-template-columns: 112px 1fr; gap: 12px 10px; font-size: 13.5px; }

/* ---------- mobile (phones) ---------- */
.m-back, .m-only { display: none; }
#mBackdrop { display: none; }
@media (max-width: 760px) {
  html, body { height: 100%; }
  .app, .app.with-bar { height: 100dvh; grid-template-columns: 62px 1fr !important; grid-template-rows: 52px 1fr; }
  .app.with-bar { height: calc(100dvh - var(--nb-h, 0px)); }
  .notif-bar { height: auto; flex-wrap: wrap; padding: 10px 40px; gap: 8px; text-align: center; font-size: 14px; }
  .notif-bar .close { top: 10px; }

  /* top bar: logo · visitors · search icon · + */
  .topbar { grid-template-columns: 62px auto 1fr auto; padding-right: 8px; gap: 6px; position: relative; }
  .served-pill { margin-left: 0; height: 34px; padding: 4px 12px 4px 5px; }
  .served-pill .sp-txt { display: none; }
  .search { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }
  .search input, .search kbd { width: 0; padding: 0; opacity: 0; }
  .search:focus-within { position: absolute; left: 8px; right: 8px; width: auto; border-radius: 999px; padding: 0 14px; justify-content: flex-start; z-index: 20; background: var(--chip); box-shadow: var(--shadow); }
  .search:focus-within input { width: auto; flex: 1; opacity: 1; }
  .team-faces { display: none; }
  .team-pill { background: transparent; padding: 0; }
  .team-add { width: 36px; height: 36px; background: var(--chip); }

  /* left rail stays, just narrower */
  .rail { gap: 6px; padding-top: 4px; }
  .rail a { width: 58px; font-size: 10.5px; gap: 3px; }
  .rail a .ic { width: 40px; height: 36px; }
  .rail a .ic svg { width: 21px; height: 21px; }
  .rail .badge { right: 2px; }

  /* section menu becomes a drawer */
  .sidebar, .app.sb-collapsed .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); z-index: 120; background: var(--bg); padding: 14px 14px 24px; visibility: visible; overflow-y: auto;
    transform: translateX(-105%); transition: transform .22s cubic-bezier(.2,.7,.3,1); box-shadow: var(--shadow); }
  body.sb-open .sidebar { transform: none; }
  .sidebar h2 .sb-toggle { display: none; }
  body.sb-open #mBackdrop, body.det-open #mBackdrop { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.45); animation: rc-fade .18s ease; }

  /* main card */
  .main { grid-column: 2; margin: 0 6px 6px 0; border-radius: 14px; }
  .col-head h2, .page-head h2:not(.back-h) { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
  .col-head h2::after, .page-head h2:not(.back-h)::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); margin-left: 4px; }
  .chat-head h2::after { display: none; }

  /* inbox / tickets / archive: one pane at a time */
  .col-list { width: 100%; border-right: 0; }
  .col-chat, .col-details { display: none; }
  body.has-id .col-list { display: none; }
  body.has-id .col-chat { display: flex; width: 100%; border-right: 0; }
  body.det-open .col-details { display: flex; position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 120; background: var(--panel); box-shadow: var(--shadow); animation: rc-slide .22s cubic-bezier(.2,.7,.3,1); }
  .m-back, .m-only, .det-show { display: inline-flex; }
  .m-back { margin-left: -8px; margin-right: 2px; }
  .chat-head { padding: 0 8px 0 14px; }
  .chat-head h2 { font-size: 16px; min-width: 0; }
  .chat-head .actions { gap: 0; }
  .chat-head .actions .btn { padding: 0 10px; }
  .chat-head .actions .btn svg + * { display: none; }
  #aCopy { display: none; }
  .messages { padding: 12px 12px 6px; }
  .msg-group { max-width: 92%; }
  .composer-wrap { padding: 0 8px 8px; }
  .canned-pop { left: 8px; right: 8px; }
  .item-actions { display: flex !important; }
  .chat-item .time { visibility: visible !important; }
  .tsubject { min-width: 0; }

  /* pages */
  .page-head { height: auto; min-height: 54px; flex-wrap: wrap; gap: 8px; padding: 8px 14px; }
  .page-head .seg.big button { padding: 6px 10px; font-size: 13px; }
  .head-actions .btn { height: 34px; font-size: 13px; padding: 0 12px; }
  .set-body, .rep-body { padding: 16px 12px 40px; }
  .rep-tb { padding: 10px 12px; overflow-x: auto; flex-wrap: nowrap; }
  .rep-tb > * { flex-shrink: 0; }
  .grid2, .prof-grid, .tm-layout { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr; gap: 14px; }
  .kpi-row .kpi2 + .kpi2 { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 14px; }
  .card2 { padding: 16px; border-radius: 14px; }
  .k-v { font-size: 26px; }
  .funnel { grid-template-columns: repeat(5, minmax(110px, 1fr)); overflow-x: auto; }
  .csat-card { flex-direction: column; align-items: flex-start; }
  .ban-top, .card-h { flex-direction: column; align-items: flex-start; }
  .tm-search.big { width: 100%; }
  .tm-profile { position: static; }
  .prof-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .avatar.xxl { width: 88px; height: 88px; font-size: 32px; }
  .to-row, .nrow { flex-direction: column; align-items: flex-start; }
  .set-card.fallback { flex-direction: column; align-items: stretch; }
  .set-card.fallback select, .set-card.fallback .cselect { width: 100% !important; }
  .cust-count { padding: 14px 14px 8px; }
  .inbox-empty .center { padding: 0 20px 40px; }

  /* overlays */
  .modal, .modal.modal-wide { width: 94vw; padding: 18px 16px; max-height: 90dvh; overflow-y: auto; }
  .gal { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .gal-i { width: 64px; height: 64px; }
  .popover.pp-pop { width: min(340px, 94vw); }
  .popover { max-width: 94vw; }
  .toast { bottom: 14px; max-width: 90vw; text-align: center; }
}
@keyframes rc-slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) {
  body { display: flex; flex-direction: column; height: 100dvh; }
  .notif-bar { flex-shrink: 0; }
  .app, .app.with-bar { height: auto; flex: 1; min-height: 0; }
}
@media (max-width: 760px) {
  .search { gap: 0; }
  #searchIcon { display: inline-flex; }
  .item-actions { display: none !important; }
  .chat-item:hover .row2 .badge { visibility: visible; }
  .chat-item:hover .body { padding-right: 0; }
  .ph-sub { display: none; }
  .prof-grid { gap: 4px; }
  .bw { flex-wrap: wrap; gap: 8px; }
  .bw div { border-left: 0; padding: 0 12px 0 0; }
}
@media (max-width: 760px) {
  .search:not(:focus-within) { position: relative; }
  .search:not(:focus-within) input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; }
  .search kbd { display: none; }
  .search:focus-within input { position: static; width: auto; height: auto; }
}
@media (max-width: 760px) { .search:focus-within { gap: 8px; } }

/* mobile: list close / more buttons always visible, content keeps room for them */
@media (max-width: 760px) {
  .chat-item .item-actions { display: flex !important; right: 8px; }
  .chat-item .body, .chat-item:hover .body { padding-right: 70px; }
  .chat-item:hover .time, .chat-item .time { visibility: visible !important; }
  .chat-item.status-mode .time { display: none; }
  .item-actions button { width: 30px; height: 30px; }
}

/* ---------- widget appearance settings ---------- */
.wg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
.wg-right { position: sticky; top: 0; }
.wg-prev-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.wg-stage { height: 680px; border-radius: 18px; background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0 / 22px 22px; border: 1px solid var(--border); overflow: hidden; }
.wg-stage iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; color-scheme: normal; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.th-card { border: 2px solid var(--border); border-radius: 14px; background: var(--panel); padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; text-align: left; color: var(--text); }
.th-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.th-card:disabled { cursor: default; }
.th-prev { height: 74px; border-radius: 9px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid rgba(127,127,127,.25); }
.th-prev i { display: block; height: 10px; width: 62%; border-radius: 6px; }
.th-prev i.me { align-self: flex-end; width: 40%; background: var(--wg-accent, #ffd66b); }
.ac-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); transition: transform .12s; }
.ac:hover { transform: scale(1.08); }
.ac.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.ac-custom { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px dashed var(--input-border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; color: var(--text2); }
.ac-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-box { width: 56px; height: 56px; border-radius: 50%; background: var(--soft); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; font-size: 10px; color: var(--muted); text-align: center; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.wg-save { position: sticky; bottom: 0; display: flex; align-items: center; gap: 14px; padding: 14px 0; background: linear-gradient(to top, var(--panel) 70%, transparent); }
.wg-save .btn { height: 40px; padding: 0 20px; }
@media (max-width: 1100px) { .wg-layout { grid-template-columns: 1fr; } .wg-right { position: static; order: -1; } .wg-stage { height: 560px; } }

/* preview always fits the screen (it is sticky, so a taller box would hide the widget bottom) */
.wg-stage { height: min(680px, calc(100dvh - 262px)); min-height: 420px; }
.wg-right { top: 4px; }

/* resizable columns (desktop) */
@media (min-width: 761px) {
  .app { grid-template-columns: 72px var(--sbw, 228px) 1fr; }
  .app.sb-collapsed { grid-template-columns: 72px 0 1fr; }
  .col-list { width: var(--listw, 290px); }
  .col-details { width: var(--detw, 340px); }
}
.rz-line { position: fixed; z-index: 200; width: 2px; background: var(--primary); opacity: .7; pointer-events: none; display: none; border-radius: 2px; }
body.rz-hover, body.rz-hover * { cursor: col-resize !important; }
body.rz-drag, body.rz-drag * { cursor: col-resize !important; user-select: none !important; }
body.rz-drag .app { transition: none; }
body.rz-drag iframe { pointer-events: none; }

/* message hover tools on visitor bubbles sit on the right */
.msg-tools.right { right: auto; left: 100%; padding-right: 0; padding-left: 6px; }

/* widget settings: save button lives in the page header */
#setActions { display: flex; align-items: center; gap: 14px; }
#setActions .wg-dirty { margin: 0; white-space: nowrap; }
#setActions #saveWidget { height: 38px; padding: 0 18px; }
.wg-stage { height: min(680px, calc(100dvh - 250px)); min-height: 340px; }

/* widget settings: banner + promo card */
.bn-box { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 1; max-height: 160px; border-radius: 12px; background: var(--soft); border: 1px dashed var(--border); overflow: hidden; margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
.set-card .bn-box { background: var(--panel); }
.bn-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bn-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bn-act .set-hint { margin: 0; }
.bn-spec { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.bn-spec b { color: var(--text); font-weight: 600; }
#prBody { margin-top: 10px; transition: opacity .15s; }
#prBody.off { opacity: .45; pointer-events: none; }
.pr-btn { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1.2fr) auto auto auto; gap: 6px; align-items: center; margin-top: 8px; }
.pr-sw { display: flex; gap: 6px; margin: 6px 0 4px 40px; }
.pr-sw .ac { width: 18px; height: 18px; }
.pr-color { position: relative; width: 34px; height: 34px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); flex: none; cursor: pointer; display: inline-block; }
.pr-color input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); border: 0; padding: 0; cursor: pointer; }
#prBtns + .btn { margin-top: 10px; }
@media (max-width: 760px) { .pr-btn { grid-template-columns: 34px minmax(0, 1fr) auto auto auto; } .pr-btn input[data-k="url"] { grid-column: 2 / -1; grid-row: 2; } .pr-sw { margin-left: 0; } }

/* widget settings: pre-chat questions */
.pq { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin: 8px 0 10px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.pq-h { display: flex; align-items: center; gap: 6px; }
.pq-h b { font-weight: 600; margin-right: auto; }
.pq-req { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-right: 6px; white-space: nowrap; }
.pq .textarea { min-height: 70px; }
.pq-opts { display: flex; flex-direction: column; gap: 6px; }
.pq-o { display: flex; align-items: center; gap: 8px; }
.pq-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.pq-add { align-self: flex-start; }

/* attachments + visitor reactions in the agent chat */
.bubble { position: relative; }
.bubble.has-att .att-img { display: block; line-height: 0; margin: -2px -4px 4px; }
.bubble.has-att .att-img img { max-width: 260px; max-height: 280px; border-radius: 10px; display: block; object-fit: cover; }
.bubble .att { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 2px 0 4px; max-width: 260px; }
.bubble .att span { display: flex; flex-direction: column; min-width: 0; }
.bubble .att b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble .att small { color: var(--muted); font-size: 12px; }
.bubble.reacted { margin-bottom: 12px; }
.m-react { position: absolute; left: 8px; bottom: -13px; font-size: 14px; line-height: 1; padding: 4px 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* details: visited pages (title + time on page) and compact visit info */
.tl.vp .tl-i a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--text); }
.tl.vp .tl-i span { color: var(--muted); }
.kv .v.ell { min-width: 0; overflow: hidden; }
.kv .v.ell a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }

#svBody { margin-top: 10px; transition: opacity .15s; }
#svBody.off { opacity: .45; pointer-events: none; }
.sv-sub { margin: -2px 0 12px; }
.sv-sub .pq-req { display: inline-flex; }

/* reactions */
.m-react.by-a { cursor: pointer; }
.msg-group.agent .m-react { left: auto; right: 8px; }
.react-popover { padding: 6px !important; min-width: 0 !important; }
.react-pop { display: flex; gap: 2px; }
.react-pop button { width: 38px; height: 38px; border: 0; background: transparent; border-radius: 50%; font-size: 20px; cursor: pointer; transition: transform .12s, background .12s; }
.react-pop button:hover { background: var(--soft); transform: scale(1.15); }
.react-pop button.on { background: var(--soft); box-shadow: inset 0 0 0 2px var(--primary); }

/* reaction badge on the bubble's bottom-right corner, like the widget */
.bubble.reacted { margin-bottom: 14px; }
.m-react, .msg-group.agent .m-react { left: auto; right: -8px; bottom: -14px; font-size: 15px; padding: 4px 7px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); }

.bubble .t .tick { display: inline-flex; align-items: center; }
.bubble .t .tick.read { color: #60a5fa; }

/* post-chat survey card in the conversation */
.survey-card { align-self: center; width: min(420px, 92%); margin: 10px auto 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sc-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sc-ic { width: 26px; height: 26px; border-radius: 50%; background: #fbbf24; color: #111; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sc-h b { font-weight: 600; font-size: 14px; flex: 1; }
.sc-t { font-size: 12px; color: var(--muted); }
.sc-r { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.sc-r span { color: var(--muted); }
.sc-chip { font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; }
.sc-chip.good { background: rgba(34,197,94,.15); color: #16a34a; }
.sc-chip.bad { background: rgba(239,68,68,.15); color: #dc2626; }
:root[data-theme="dark"] .sc-chip.good { color: #4ade80; }
:root[data-theme="dark"] .sc-chip.bad { color: #f87171; }
.sc-cm { border-top: 1px solid var(--border); padding-top: 8px; font-size: 13.5px; }
.sc-cm span { color: var(--muted); }
.sc-cm p { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--soft); white-space: pre-wrap; word-break: break-word; border-left: 3px solid #fbbf24; }

/* avatar gallery */
.gal-tabs { margin-bottom: 6px; }
.gal-tabs span { cursor: pointer; }
.gal { max-height: min(460px, 60vh); overflow-y: auto; scrollbar-width: none; }
.gal::-webkit-scrollbar { display: none; }
.gal-i { position: relative; }
.gal-i img { object-fit: cover; background: #e5e7eb; }
.gal-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed var(--border) !important; color: var(--muted); font-size: 12px; background: transparent; }
.gal-add:hover { color: var(--text); border-color: var(--primary) !important; }
.gal-del { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; display: none; align-items: center; justify-content: center; }
.gal-i:hover .gal-del { display: flex; }
.gal-empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 30px 10px; font-size: 14px; }

/* ---- top-right team pill: tooltip + expanding invite button ---- */
.team-pill { position: relative; }
.team-add { display: inline-flex; align-items: center; height: 34px; min-width: 34px; padding: 0 8px; border-radius: 999px; border: 1.5px solid transparent; background: var(--panel); color: var(--text); cursor: pointer; overflow: hidden; transition: padding .3s cubic-bezier(.2,.8,.3,1), border-color .25s, background .2s; }
.team-add:hover { background: var(--soft); }
.team-add .ti-ic { display: inline-flex; flex: none; transition: transform .3s cubic-bezier(.2,.8,.3,1.3); }
.team-add .ti-t { max-width: 0; opacity: 0; white-space: nowrap; font-weight: 600; font-size: 14px; transition: max-width .32s cubic-bezier(.2,.8,.3,1), opacity .2s .05s, margin .32s; margin-left: 0; }
.team-add.open { padding: 0 14px 0 10px; border-color: var(--muted); }
.team-add.open .ti-t { max-width: 90px; opacity: 1; margin-left: 6px; }
.team-add.open .ti-ic { transform: rotate(90deg); }
.team-add.still, .team-add.still .ti-t, .team-add.still .ti-ic { transition: none; }
.tp-tip { position: absolute; top: calc(100% + 12px); right: 0; z-index: 60; min-width: 190px; padding: 12px 16px; border-radius: 14px; background: #e5e7eb; color: #111827; box-shadow: 0 10px 30px rgba(0,0,0,.25); pointer-events: none; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s; display: flex; flex-direction: column; gap: 8px; }
.tp-tip::before { content: ""; position: absolute; top: -7px; right: 70px; width: 14px; height: 14px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.tp-tip b { font-size: 14px; }
.tp-tip-r { display: flex; align-items: center; gap: 10px; font-size: 14px; }
:root:not([data-theme="dark"]) .tp-tip { background: #1f2937; color: #f9fafb; }
.team-faces:hover ~ .tp-tip, .tp-tip:has(~ .team-faces:hover) { opacity: 1; transform: none; transition-delay: .25s; }
.team-pill:has(.team-faces:hover) .tp-tip { opacity: 1; transform: none; transition-delay: .25s; }
.team-pill .team-add { width: auto; padding: 0 6.5px; }
.team-pill .team-add.open { padding: 0 14px 0 10px; }

/* ---- search palette ---- */
.sp-back { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,0); display: flex; justify-content: center; align-items: flex-start; padding-top: 4px; transition: background .18s; }
.sp-back.in { background: rgba(0,0,0,.35); }
.sp-back.out { background: rgba(0,0,0,0); }
.sp { width: min(960px, calc(100vw - 32px)); max-height: min(780px, calc(100dvh - 24px)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.45); overflow: hidden; opacity: 0; transform: translateY(-10px) scale(.98); transition: opacity .18s ease, transform .22s cubic-bezier(.2,.8,.3,1); }
.sp-back.in .sp { opacity: 1; transform: none; }
.sp-back.out .sp { opacity: 0; transform: translateY(-8px) scale(.985); }
.sp-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); color: var(--muted); }
.sp-head input { flex: 1; border: 0; outline: none; background: transparent; color: var(--text); font-size: 17px; }
.sp-x { border: 0; background: transparent; color: var(--text); cursor: pointer; display: flex; padding: 4px; border-radius: 8px; }
.sp-x:hover { background: var(--soft); }
.sp-tabs { position: relative; display: none; gap: 6px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.sp-tabs.on { display: flex; animation: spFade .2s ease-out; }
.sp-tabs button { border: 0; background: transparent; color: var(--muted); font-size: 15px; padding: 14px 16px; cursor: pointer; font-weight: 500; }
.sp-tabs button.on { color: var(--text); font-weight: 600; }
.sp-ind { position: absolute; bottom: -1px; height: 3px; border-radius: 3px; background: var(--text); transition: left .25s cubic-bezier(.2,.8,.3,1), width .25s cubic-bezier(.2,.8,.3,1); }
.sp-body { flex: 1; overflow-y: auto; padding: 8px 10px 12px; scrollbar-width: none; }
.sp-body::-webkit-scrollbar { display: none; }
.sp-sec { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 8px; }
.sp-sep { height: 1px; background: var(--border); margin: 8px 2px; }
.sp-i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; min-height: 52px; animation: spItem .26s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(var(--i, 0) * 22ms); }
.sp-i.sel { background: var(--soft); }
.sp-i b { font-weight: 500; font-size: 15.5px; white-space: nowrap; }
.sp-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text); }
.sp-i.sel .sp-ic { background: var(--panel); }
.sp-sn { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.sp-t { color: var(--muted); font-size: 13.5px; white-space: nowrap; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.sp-del { margin-left: auto; display: none; padding: 4px; border-radius: 6px; color: var(--text); }
.sp-i.sel .sp-del, .sp-i:hover .sp-del { display: flex; }
.sp-del:hover { background: var(--panel); }
.sp-more { min-height: 40px; color: var(--muted); font-size: 15px; gap: 6px; }
.sp-more.sel { color: var(--text); }
.sp mark, .arch-item mark { background: #facc15; color: #111; border-radius: 3px; padding: 0 1px; }
.sp-empty { text-align: center; color: var(--muted); padding: 40px 10px; animation: spFade .2s; }
.sp-load { display: flex; justify-content: center; gap: 6px; padding: 36px; }
.sp-load i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: spDot 1s infinite ease-in-out; }
.sp-load i:nth-child(2) { animation-delay: .15s; } .sp-load i:nth-child(3) { animation-delay: .3s; }
.sp-foot { display: flex; gap: 28px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--soft); color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.sp-foot kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; margin: 0 2px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: 600 12.5px/1 inherit; }
@keyframes spItem { from { opacity: 0; transform: translateY(6px); } }
@keyframes spFade { from { opacity: 0; } }
@keyframes spDot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@media (max-width: 760px) { .sp-ft-tabs { display: none; } .sp-foot { gap: 14px; } .sp-sn { display: none; } }
/* ---- archive list ---- */
.arch-search { display: flex; align-items: center; gap: 8px; margin: 12px 12px 4px; padding: 0 10px 0 12px; height: 42px; border: 1px solid var(--input-border, var(--border)); border-radius: 12px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.arch-search:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }
.arch-search .as-ic { color: var(--muted); display: flex; }
.arch-search input { flex: 1; border: 0; outline: none; background: transparent; color: var(--text); font-size: 15px; min-width: 0; }
.as-x { border: 0; background: transparent; color: var(--text); cursor: pointer; display: flex; padding: 4px; border-radius: 6px; animation: spFade .15s; }
.as-x:hover { background: var(--soft); }
.arch-item { animation: spItem .28s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(var(--i, 0) * 25ms); }
.arch-agent { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.arch-item .preview { color: var(--text); opacity: .85; }

/* widget settings: logo shape + size sliders */
.logo-shape { margin-top: 8px; width: fit-content; }
.logo-box.shape-square { border-radius: 12px; }
.logo-box.shape-wide { width: 140px; height: 48px; border-radius: 10px; }
.logo-box.shape-wide img { background: transparent; }
.sz-row { display: grid; grid-template-columns: 140px 1fr 64px; align-items: center; gap: 12px; margin-top: 10px; font-size: 14px; }
.sz-row input[type=range] { width: 100%; accent-color: var(--primary); }
.sz-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* profile: explicit save */
.pf-save { display: flex; align-items: center; gap: 14px; margin: 4px 0 22px; }
.pf-save .set-hint { margin: 0; }

/* close-confirm row: buttons share the width and never overflow a narrow list */
.chat-item.confirm-close { padding: 0 10px; gap: 8px; overflow: hidden; }
.chat-item.confirm-close .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; }
.col-list { container-type: inline-size; }
.chat-item.confirm-close .cc-s { display: none; }
@container (max-width: 250px) { .chat-item.confirm-close .cc-l { display: none; } .chat-item.confirm-close .cc-s { display: inline; } }

/* Ayarlar > Profiller */
.ps-list { padding: 6px 0; }
.ps-row { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-radius: 12px; transition: background .2s; }
.ps-row + .ps-row { border-top: 1px solid var(--border); border-radius: 0; }
.ps-row.ps-new { animation: psIn .45s cubic-bezier(.16,1,.3,1) both; }
@keyframes psIn { from { opacity: 0; transform: translateY(-6px); background: var(--soft); } }
.ps-av { position: relative; width: 48px; height: 48px; flex: none; border: 0; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer; background: var(--soft); }
.ps-av:disabled { cursor: default; }
.ps-av img, .ps-av > span { width: 100%; height: 100%; display: grid; place-items: center; object-fit: cover; color: #fff; font-weight: 700; font-size: 18px; }
.ps-av i { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; opacity: 0; transition: opacity .2s; }
.ps-av:not(:disabled):hover i, .ps-av:focus-visible i { opacity: 1; }
.ps-name { flex: 1; max-width: 360px; font-weight: 600; }
.ps-name:not(:focus) { border-color: transparent; background: transparent; }
.ps-name:not(:focus):not(:disabled):hover { background: var(--soft); }
.ps-row > [data-del] { margin-left: auto; }

/* Profiller: actions on the far right + animations */
.ps-acts { margin-left: auto; display: flex; gap: 4px; opacity: .6; transition: opacity .2s; }
.ps-row:hover .ps-acts, .ps-acts:focus-within { opacity: 1; }
.ps-acts .icon-btn { transition: background .2s, color .2s, transform .15s; }
.ps-acts .icon-btn:active { transform: scale(.88); }
.ps-acts .ps-del:hover { color: #ef4444; background: rgba(239,68,68,.12); }
.ps-row:hover { background: color-mix(in srgb, var(--soft) 60%, transparent); }
.ps-av img, .ps-av > span { transition: transform .35s cubic-bezier(.2,.8,.3,1.3); }
.ps-av:not(:disabled):hover img, .ps-av:not(:disabled):hover > span { transform: scale(1.08); }
/* first load: blocks rise in, rows one after another */
#set.ps-enter > * { animation: psUp .5s cubic-bezier(.16,1,.3,1) both; }
#set.ps-enter > *:nth-child(2) { animation-delay: .06s; }
#set.ps-enter > *:nth-child(3) { animation-delay: .12s; }
#set.ps-enter > *:nth-child(4) { animation-delay: .18s; }
#set.ps-enter .ps-row { animation: psUp .5s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(.18s + var(--i, 0) * 60ms); }
@keyframes psUp { from { opacity: 0; transform: translateY(12px); } }
/* new row / changed photo / deleted row */
.ps-row.ps-new { animation: psNew .55s cubic-bezier(.16,1,.3,1) both; }
@keyframes psNew { from { opacity: 0; transform: translateY(-10px) scale(.98); background: color-mix(in srgb, var(--primary) 18%, transparent); } }
.ps-row.ps-pop .ps-av, .pm-av.pm-pop { animation: psPop .5s cubic-bezier(.2,.8,.3,1.5); }
@keyframes psPop { 0% { transform: scale(.7); opacity: .4; } }
.ps-row.ps-out { overflow: hidden; transition: height .3s cubic-bezier(.4,0,.2,1), opacity .25s, transform .3s, padding .3s; height: 0 !important; opacity: 0; transform: translateX(24px); padding-top: 0; padding-bottom: 0; }
/* edit dialog */
.pm-top { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.pm-av { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex: none; background: var(--soft); }
.pm-av img, .pm-av > span { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; color: #fff; font-size: 30px; font-weight: 700; }
.pm-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-btns .btn { display: inline-flex; align-items: center; gap: 6px; }
.pm-rm:hover { color: #ef4444; }
@media (prefers-reduced-motion: reduce) { #set.ps-enter *, .ps-row.ps-new, .ps-row.ps-pop .ps-av, .pm-av.pm-pop { animation: none !important; } }

/* Profiller: stronger, clearly visible motion */
#set.ps-enter > * { animation: psRise .7s cubic-bezier(.16,1,.3,1) both; }
#set.ps-enter > *:nth-child(2) { animation-delay: .08s; }
#set.ps-enter > *:nth-child(3) { animation-delay: .16s; }
#set.ps-enter > *:nth-child(4) { animation-delay: .24s; }
@keyframes psRise { from { opacity: 0; transform: translateY(34px) scale(.97); filter: blur(4px); } }
#set.ps-enter .ps-row { animation: psSlide .65s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(.28s + var(--i, 0) * 90ms); }
@keyframes psSlide { from { opacity: 0; transform: translateX(-36px); } }
#set.ps-enter .ps-row .ps-av { animation: psAvIn .7s cubic-bezier(.2,.8,.3,1.4) both; animation-delay: calc(.34s + var(--i, 0) * 90ms); }
@keyframes psAvIn { from { opacity: 0; transform: scale(.4) rotate(-25deg); } }
#set.ps-enter .ps-row .ps-acts { animation: psFade .5s ease both; animation-delay: calc(.5s + var(--i, 0) * 90ms); }
@keyframes psFade { from { opacity: 0; transform: translateX(12px); } }
/* a freshly added profile grows in and glows */
.ps-row.ps-new { animation: psGrow .6s cubic-bezier(.16,1,.3,1) both, psGlow 1.6s ease-out .1s both; }
.ps-row.ps-new .ps-av { animation: psAvIn .7s cubic-bezier(.2,.8,.3,1.4) .1s both; }
@keyframes psGrow { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes psGlow { 0% { background: color-mix(in srgb, var(--primary) 26%, transparent); box-shadow: inset 3px 0 0 var(--primary); } 100% { background: transparent; box-shadow: inset 3px 0 0 transparent; } }
/* hover: row nudges, photo grows */
.ps-row { transition: background .25s, transform .3s cubic-bezier(.2,.8,.3,1); }
.ps-row:hover { transform: translateX(4px); }
.ps-name { transition: border-color .25s, background .25s, box-shadow .25s; }
.ps-name:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent); }
/* switch hint text and toggle feedback */
#set[data-view=personas] .nrow small { animation: psFade .4s ease both; }
#set[data-view=personas] .switch span { transition: background .3s, box-shadow .3s; }
#set[data-view=personas] .switch input:checked + span { box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 22%, transparent); }
/* empty state */
#set[data-view=personas] .set-empty svg { animation: psFloat 3s ease-in-out infinite; }
@keyframes psFloat { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { #set[data-view=personas] *, .ps-row.ps-new { animation: none !important; transition: none !important; } }

/* ---- Ayarlar > Oto mod ---- */
.am-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.am-main { transition: box-shadow .4s, background .4s; }
.am-main.on { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #22c55e 55%, transparent); background: color-mix(in srgb, #22c55e 7%, var(--card, transparent)); }
.am-main.on .am-title svg { color: #22c55e; animation: amBob 2.4s ease-in-out infinite; }
@keyframes amBob { 50% { transform: translateY(-2px) rotate(-6deg); } }
.am-as { gap: 16px; }
.am-as .seg { flex: none; }
.am-name { margin: 4px 18px 16px; }
.set-card > #amFb { display: block; width: calc(100% - 36px); margin: 0 18px 16px; }
.am-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.am-head .btn { display: inline-flex; align-items: center; gap: 6px; }
.am-badge { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; margin-left: 6px; border-radius: 11px; background: var(--soft); font-size: 12.5px; vertical-align: 2px; }
.am-rule { padding: 16px 18px 18px; transition: opacity .3s, box-shadow .3s; }
.am-rule.off { opacity: .55; }
.am-rule.hit { animation: amHit 1.6s ease-out; }
@keyframes amHit { 0%, 30% { box-shadow: 0 0 0 2px #22c55e, 0 0 24px color-mix(in srgb, #22c55e 35%, transparent); } 100% { box-shadow: 0 0 0 2px transparent; } }
.am-rh { display: flex; align-items: center; gap: 10px; min-width: 0; }
.am-rh b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-num { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary); font-weight: 700; font-size: 13px; }
.am-cnt { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.am-ra { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.am-del:hover { color: #ef4444; background: rgba(239,68,68,.12); }
.am-lbl { font-size: 12.5px; font-weight: 600; color: var(--text2); margin: 14px 0 7px; }
.am-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; cursor: text; transition: border-color .2s, box-shadow .2s; }
.am-chips:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.am-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 16%, var(--soft)); font-size: 13.5px; font-weight: 500; }
.am-chip button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .6; cursor: pointer; padding: 0; }
.am-chip button:hover { opacity: 1; background: rgba(0,0,0,.2); }
.am-chip.in { animation: amChipIn .35s cubic-bezier(.2,.8,.3,1.5) both; }
.am-chip.out { animation: amChipOut .18s ease-in both; }
@keyframes amChipIn { from { opacity: 0; transform: scale(.5); } }
@keyframes amChipOut { to { opacity: 0; transform: scale(.5); } }
.am-ci { flex: 1; min-width: 180px; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; padding: 5px 4px; }
.am-reply { width: 100%; resize: vertical; }
.am-try { display: flex; gap: 8px; }
.am-try .input { flex: 1; }
.am-out:empty { display: none; }
.am-out { margin-top: 12px; }
.am-out.show { animation: psUp .4s cubic-bezier(.16,1,.3,1) both; }
.am-res { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 8px; }
.am-res.ok { color: #22c55e; }
.am-res.ok span { color: var(--text); }
.am-res.no { color: var(--muted); }
.am-bub { display: inline-block; max-width: 85%; padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: var(--soft); white-space: pre-wrap; line-height: 1.45; font-size: 14px; }
.am-rule.am-new { animation: psGrow .6s cubic-bezier(.16,1,.3,1) both, amGlow 1.6s ease-out .1s both; }
@keyframes amGlow { 0% { box-shadow: 0 0 0 2px var(--primary), 0 0 26px color-mix(in srgb, var(--primary) 35%, transparent); } 100% { box-shadow: 0 0 0 2px transparent; } }
.am-rule.am-out { overflow: hidden; transition: height .3s cubic-bezier(.4,0,.2,1), opacity .25s, transform .3s, padding .3s, margin .3s; height: 0 !important; opacity: 0; transform: translateX(28px); padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; }
.am-rule.shake { animation: amShake .45s; box-shadow: 0 0 0 2px #ef4444; }
@keyframes amShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
#set.ps-enter .am-rule { animation: psSlide .65s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(.3s + var(--i, 0) * 80ms); }
#amSave.pulse { animation: amPulse 1.8s ease-in-out infinite; }
@keyframes amPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 25%, transparent); } }
/* chat view: automatic replies */
.avatar.bot-av { display: grid; place-items: center; background: color-mix(in srgb, #22c55e 22%, var(--soft)); color: #22c55e; }
.auto-tag { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, #22c55e 18%, transparent); color: #22c55e; font-weight: 600; font-size: 10.5px; vertical-align: 1px; }
@media (prefers-reduced-motion: reduce) { #set[data-view=automod] *, .am-rule, #amSave.pulse { animation: none !important; transition: none !important; } }

/* Oto mod: "Dene" card spacing */
.set-card.am-test { padding: 16px 18px 18px; }
.am-test .am-lbl { margin: 0 0 9px; }
.am-try { align-items: stretch; }
.am-try .input { height: 44px; }
.am-try .btn { height: 44px; padding: 0 20px; flex: none; }
.am-test .am-bub { background: color-mix(in srgb, var(--primary) 20%, var(--bg, #1c1c1e)); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }

/* Oto mod: foldable cards + editable title */
.am-rh { cursor: pointer; user-select: none; }
.am-fold { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text2); cursor: pointer; transition: background .2s, transform .35s cubic-bezier(.2,.8,.3,1.2); }
.am-fold:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.am-rule.folded .am-fold { transform: rotate(-90deg); }
.am-tw { position: relative; display: flex; align-items: center; min-width: 0; flex: 0 1 auto; }
.am-rname { width: auto; min-width: 60px; max-width: 360px; field-sizing: content; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: 16px; padding: 4px 26px 4px 8px; outline: 0; text-overflow: ellipsis; transition: border-color .2s, background .2s, box-shadow .2s; cursor: text; }
.am-rname::placeholder { color: var(--text); opacity: 1; }
.am-rname:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 7%, transparent); }
.am-rname:focus { border-color: var(--primary); background: var(--bg, rgba(0,0,0,.25)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.am-rname:focus::placeholder { opacity: .4; }
.am-pen { position: absolute; right: 7px; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity .2s; }
.am-tw:hover .am-pen { opacity: 1; }
.am-rname:focus + .am-pen, .am-rname:disabled + .am-pen { opacity: 0; }
/* body folds with a height animation (grid 1fr -> 0fr) */
.am-rb { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .4s cubic-bezier(.16,1,.3,1), opacity .3s; }
.am-rbi { overflow: hidden; min-height: 0; }
.am-rule.folded .am-rb { grid-template-rows: 0fr; opacity: 0; }
.am-rule { transition: opacity .3s, box-shadow .3s, padding .35s; }
.am-rule.folded { padding-bottom: 14px; }
.am-sum { display: grid; grid-template-rows: 0fr; opacity: 0; color: var(--muted); font-size: 13.5px; margin-left: 76px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: grid-template-rows .4s, opacity .3s, margin .3s; max-height: 0; }
.am-rule.folded .am-sum { opacity: 1; max-height: 24px; margin-top: 4px; }
.am-hb { display: flex; gap: 8px; }
.am-hb .btn { display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .am-rb, .am-sum, .am-fold { transition: none !important; } }

.am-mlbl { font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.am-out .am-bub + .am-bub { margin-top: 6px; }
.am-out .am-bub { display: table; }
/* inbox: chats Oto mod is answering */
.pill.pill-bot { display: inline-flex; align-items: center; gap: 3px; background: color-mix(in srgb, #22c55e 18%, transparent); color: #22c55e; }
