@font-face {
  font-family: Onest;
  src: url("assets/onest-cyrillic.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest;
  src: url("assets/onest-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300, U+0301, U+0303, U+0309, U+0323, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --canvas: #f3f5f8;
  --paper: #fff;
  --ink: #192231;
  --muted: #505b6c;
  --subtle: #626e80;
  --line: #dce2eb;
  --line-light: #e9edf3;
  --brand: #335ca6;
  --brand-hover: #274b8d;
  --brand-soft: #edf2fb;
  --side: #202b3f;
  --side-text: #c4cfdf;
  --focus: #3e65a9;
  --shadow: 0 18px 55px rgb(24 38 31 / 12%);
  --radius: 14px;
  font-family: Onest, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 310px; min-height: 100dvh; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:not([disabled]), select:not([disabled]) { cursor: pointer; }
button[disabled] { opacity: .55; cursor: wait; }
a { color: inherit; text-decoration: none; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

.boot { min-height: 100dvh; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.button, .icon-button {
  border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px;
  padding: 8px 13px; font-size: 12px; line-height: 1.25; font-weight: 650; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.button:hover, .icon-button:hover { background: #f1f4fa; border-color: #c8d3e5; }
.button--primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button--primary:hover { color: #fff; background: var(--brand-hover); border-color: var(--brand-hover); }
.button--wide { width: 100%; }
.button--light { background: #fff; }
.icon-button { width: 37px; min-width: 37px; padding: 0; color: var(--muted); }
.text-button { background: none; border: 0; color: var(--brand); font-weight: 650; padding: 5px 0; }

.auth-screen {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 34px 18px; background: radial-gradient(ellipse at 50% 0%, #e7edf7 0, transparent 60%), var(--canvas);
}
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); width: min(100%, 420px); padding: 32px; }
.auth-card h1 { font-size: 29px; font-weight: 720; letter-spacing: -.045em; line-height: 1.15; margin-bottom: 23px; }
.auth-card > p { margin-bottom: 20px; color: var(--muted); }
.auth-form { display: grid; gap: 15px; }
.auth-form > .button { margin-top: 3px; min-height: 43px; font-size: 13px; justify-content: space-between; padding-inline: 14px; }
.auth-switch { margin-top: 18px; }

.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  min-width: 0; height: 100dvh; position: sticky; top: 0; background: var(--side); color: #f4f7fc;
  display: flex; flex-direction: column; padding: 23px 13px 12px; overflow: auto;
}
.org-picker {
  display: flex; align-items: center; gap: 8px; position: relative;
  border: 1px solid #53617a; border-radius: 10px; min-height: 43px; margin: 0 4px 23px; padding: 0 9px; background: #293751;
}
.org-picker > svg { position: absolute; left: 9px; pointer-events: none; opacity: .8; }
.org-picker > svg:last-child { left: auto; right: 8px; }
.org-picker select {
  display: block; min-width: 0; width: 100%; padding: 9px 15px 9px 24px;
  border: 0; background: transparent; color: #f5f8fd; appearance: none; text-overflow: ellipsis; font-size: 12px; font-weight: 650;
}
.org-picker select option { background: var(--side); color: #fff; }
.nav { display: grid; align-content: start; gap: 21px; }
.nav-group { display: grid; gap: 3px; }
.nav-label { padding: 0 10px 6px; color: #aebdd4; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .075em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; min-height: 39px;
  background: transparent; color: var(--side-text); border: 0; border-radius: 8px; text-align: left; font-size: 12px; font-weight: 580;
}
.nav-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: #303f59; color: #f6f9ff; }
.nav-item.is-current { background: #354967; color: #fff; font-weight: 700; }
.nav-count { min-width: 19px; margin-left: auto; padding: 1px 4px; border-radius: 5px; background: #ccebd6; color: #204d31; text-align: center; font-size: 10px; }
.sidebar-bottom { display: flex; align-items: center; gap: 5px; border-top: 1px solid #41516d; padding: 13px 1px 2px 4px; margin-top: auto; }
.profile { display: flex; gap: 9px; align-items: center; min-width: 0; flex: 1; }
.profile-text { min-width: 0; }
.profile-text strong, .profile-text small { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.profile-text strong { font-size: 11px; font-weight: 650; }
.profile-text small { color: #bdcde3; font-size: 9px; margin-top: 3px; }
.icon-button.side-logout { background: transparent; color: #d6e2f4; border-color: transparent; min-width: 30px; width: 30px; }
.icon-button.side-logout:hover { background: #354967; }

.workspace { min-width: 0; min-height: 100dvh; }
.topbar {
  min-height: 58px; padding: 9px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--paper); border-bottom: 1px solid var(--line); color: var(--muted);
}
.toptrail { display: flex; min-width: 0; align-items: center; gap: 10px; font-size: 12px; }
.toptrail span:first-child, .toptrail strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toptrail strong { color: var(--ink); font-weight: 700; }
.top-separator { color: #75849a; }
.topbar-actions { display: flex; flex: 0 0 auto; gap: 10px; align-items: center; }
.topbar-actions .icon-button { width: 33px; min-width: 33px; min-height: 33px; }
.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: end; margin-bottom: 19px; }
.page-heading h1 { font-size: clamp(25px, 2.65vw, 36px); letter-spacing: -.055em; line-height: 1.09; font-weight: 750; }
.page-heading p { color: var(--muted); max-width: 65ch; font-size: 13px; line-height: 1.55; margin-top: 7px; }

.inbox-page { padding: 23px 23px 22px; height: calc(100dvh - 58px); min-height: 530px; display: flex; flex-direction: column; }
.inbox-heading { align-items: center; }
.queue-total { background: #e0f2e5; color: #204d31; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.inbox-grid {
  min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(228px, .78fr) minmax(320px, 1.65fr) minmax(222px, .74fr);
  overflow: hidden; background: var(--paper); border: 1px solid #d7dfeb; border-radius: var(--radius);
}
.queue, .conversation, .context { min-width: 0; min-height: 0; }
.queue { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fdfdff; }
.queue-controls { padding: 12px 12px 11px; display: grid; gap: 8px; border-bottom: 1px solid var(--line-light); }
.queue-search {
  display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted);
  border: 1px solid var(--line); background: #f6f8fc; border-radius: 8px;
}
.queue-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.queue-search input { padding: 8px 0; min-width: 0; width: 100%; border: none; background: transparent; color: var(--ink); font-size: 12px; outline: none; }
.queue-filterline { display: flex; gap: 7px; align-items: center; }
.small-select {
  display: flex; align-items: center; gap: 4px; min-width: 0; padding: 0 5px 0 6px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: white;
}
.small-select select { min-width: 0; max-width: 100%; padding: 5px 0; font-size: 10.5px; font-weight: 650; color: var(--ink); border: none; background: transparent; }
.queue-list { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; padding: 5px 6px; }
.queue-row {
  position: relative; display: flex; align-items: flex-start; text-align: left; min-height: 84px; padding: 11px 9px; gap: 8px;
  width: 100%; border: 0; border-bottom: 1px solid #ecf0f5; border-radius: 8px 8px 0 0; color: var(--ink); background: transparent;
}
.queue-row:hover { background: #f2f6fd; }
.queue-row.is-selected { background: #e9f0fd; border-color: #e9f0fd; border-radius: 8px; box-shadow: inset 3px 0 #3c68b6; }
.queue-row:focus-visible { outline-offset: -2px; }
.avatar {
  display: inline-grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 10px;
  font-size: 10px; font-weight: 740; line-height: 1; user-select: none;
}
.avatar--large { flex-basis: 39px; width: 39px; height: 39px; font-size: 11px; border-radius: 12px; }
.avatar--slate { background: #e4eaf4; color: #3d4c68; }
.avatar--lilac { background: #eee5f5; color: #63477c; }
.avatar--sky { background: #dcebf7; color: #345d75; }
.avatar--sand { background: #fdebd2; color: #73552e; }
.avatar--rose { background: #f7e2e0; color: #763d4a; }
.avatar--amber { background: #f8cd87; color: #3e3323; }
.queue-copy { display: grid; min-width: 0; flex: 1; gap: 4px; }
.queue-title { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; min-width: 0; }
.queue-title strong { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 740; }
.queue-title time, .message time { color: var(--subtle); font-size: 10px; white-space: nowrap; }
.queue-meta { display: flex; gap: 4px; color: var(--muted); align-items: center; min-width: 0; font-size: 10px; }
.queue-owner, .chat-state { border-inline-start: 1px solid var(--line); padding-inline-start: 6px; }
.queue-owner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-snippet { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); line-height: 1.4; }
.queue-row:has(.unread-count) .queue-snippet { padding-right: 20px; }
.channel-stamp {
  height: 18px; min-width: 18px; border-radius: 5px; padding: 0 3px; display: inline-grid; place-items: center;
  font-size: 8px; line-height: 1; font-weight: 800; letter-spacing: -.015em;
}
.channel--sky { background: #dceefc; color: #194f74; }
.channel--blue { background: #dfe9fe; color: #234b9e; }
.channel--purple { background: #ece4fb; color: #61489b; }
.channel--plum { background: #f3e5ef; color: #743e62; }
.channel--amber { background: #f4e9d9; color: #765529; }
.unread-count {
  position: absolute; right: 10px; bottom: 12px; background: #335ca6; color: #fff;
  border-radius: 50px; min-width: 16px; padding: 2px 3px; text-align: center; font-size: 9px; line-height: 1.2; font-weight: 700;
}
.conversation { display: flex; flex-direction: column; background: #fbfcfe; }
.chat-header {
  display: flex; align-items: center; gap: 9px; min-height: 64px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.chat-person { flex: 1; min-width: 0; }
.chat-person strong { display: block; font-size: 13px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-person > span { display: flex; gap: 4px; align-items: center; font-size: 10px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.chat-person .channel-stamp { width: 16px; height: 15px; min-width: 16px; font-size: 7px; }
.chat-actions { display: flex; gap: 5px; align-items: center; }
.chat-actions .button { min-height: 33px; padding: 6px 8px; font-size: 11px; }
.chat-actions .icon-button { min-height: 33px; width: 33px; min-width: 33px; }
.assign-button { max-width: 145px; }
.assign-button > span { overflow: hidden; text-overflow: ellipsis; }
.mobile-back, .context-toggle, .context-close { display: none; }
.chat-messages {
  flex: 1; min-height: 100px; overflow: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 13px; padding: 12px clamp(12px, 2vw, 27px) 20px;
}
.day-divider { display: flex; align-items: center; justify-content: center; padding-block: 4px; }
.day-divider span { display: inline-block; padding: 3px 8px; border-radius: 5px; background: #ebeff6; color: var(--muted); font-size: 10px; font-weight: 560; }
.message { display: grid; gap: 3px; max-width: 86%; min-width: 0; align-self: flex-start; justify-items: start; }
.message-label { display: inline-flex; align-items: center; gap: 4px; color: #495972; font-size: 11px; font-weight: 660; }
.message--operator .message-label { color: #24597c; }
.message--operator { align-self: flex-end; justify-items: end; }
.bubble {
  padding: 9px 11px; border: 1px solid #e5e9ee; border-radius: 11px 11px 11px 4px;
  white-space: pre-wrap; overflow-wrap: anywhere; background: #f0f2f5; color: var(--ink); font-size: 13.5px; line-height: 1.53;
}
.message--bot .bubble { background: #fff3d9; border-color: #f1e4c6; }
.message--operator .bubble { background: #e5f1fc; border-color: #d6e9f9; border-radius: 11px 11px 4px 11px; }
.composer {
  padding: 12px 14px 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px 8px;
  border-top: 1px solid var(--line); background: var(--paper);
}
.composer textarea {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; color: var(--ink); background: #f8fafd;
  resize: vertical; font-size: 13px; line-height: 1.4;
}
.send-button { width: 43px; min-height: 43px; padding: 0; }
.composer-help { grid-column: 1 / -1; color: var(--subtle); display: block; font-size: 10px; }
.composer-disabled { padding: 12px 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.composer .form-error { grid-column: 1 / -1; }
.context { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fdfdff; }
.context-heading { border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 14px 13px; min-height: 64px; }
.context-heading h2 { font-size: 14px; letter-spacing: -.025em; font-weight: 740; }
.context-body { overflow-y: auto; padding: 0 13px 15px; scrollbar-width: thin; }
.lead-fields { display: grid; }
.lead-fields > div { padding: 9px 0; border-bottom: 1px solid var(--line-light); display: grid; gap: 3px; }
.lead-fields dt { color: var(--muted); font-size: 11px; }
.lead-fields dd { min-width: 0; font-weight: 650; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.lead-fields dd.unset { color: var(--subtle); font-weight: 450; }
.lead-note { padding-top: 9px; font-size: 11px; line-height: 1.44; }
.lead-note > span { color: var(--subtle); font-size: 10px; }
.lead-note > p { margin-top: 4px; color: var(--muted); }
.agent-hint { padding: 9px; border: 1px solid #dce6f6; border-radius: 9px; margin-block: 12px; background: #eef4ff; font-size: 11px; line-height: 1.45; color: #2c4778; }
.agent-hint > div { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; font-size: 11px; }
.lead-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); border-top: 1px solid var(--line-light); padding-top: 10px; }
.lead-owner span, .lead-owner strong { display: block; font-size: 10px; }
.lead-owner strong { margin-top: 3px; font-size: 11px; color: var(--ink); }
.empty { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; min-height: 140px; padding: 20px; color: var(--muted); }
.conversation > .empty, .context > .empty { flex: 1; }
.empty > strong { font-weight: 710; color: var(--ink); }
.empty > p { max-width: 35ch; font-size: 12px; }
.empty-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }

.section-page { padding: 25px 24px 35px; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.settings-layout { display: grid; grid-template-columns: minmax(180px, 230px) minmax(0, 1fr); gap: 14px; align-items: start; }
.bot-list { padding: 11px; display: grid; gap: 7px; }
.bot-list h2 { font-size: 12px; font-weight: 680; color: var(--muted); margin: 3px 3px 5px; }
.bot-item {
  width: 100%; display: flex; gap: 9px; align-items: center; padding: 8px;
  min-width: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); text-align: left;
}
.bot-item.is-selected { border-color: #dbe5f3; background: #eff4fc; }
.bot-item:hover { background: #edf2fb; }
.bot-item strong { display: block; font-size: 13px; font-weight: 730; line-height: 1.25; overflow-wrap: anywhere; margin-bottom: 4px; }
.bot-icon { display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px; }
.bot-avatar-image { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.message--bot > .bot-avatar-image { width: 22px; height: 22px; border-radius: 50%; }
.bot-title, .avatar-editor { display: flex; align-items: center; gap: 10px; }
.bot-title { min-width: 0; }
.avatar-editor { flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.avatar-editor .field { min-width: 0; max-width: 100%; }
.avatar-editor .form-error { flex-basis: 100%; }
.chat-option { display: flex; gap: 7px; align-items: center; font-size: 13px; }
.booking-policy-warning { color: #704807; background: #fff4da; padding: 10px 12px; border-radius: 7px; margin-top: 12px; max-width: 550px; font-size: 13px; }
.model-settings-form { display: grid; gap: 12px; max-width: 430px; }
.invite-bots { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.invite-bots legend { padding-inline: 5px; font-size: 12px; }
.invite-bots .chat-option + .chat-option { margin-top: 6px; }
.chat-links { display: flex; flex-wrap: wrap; gap: 12px; }
.chat-links a { color: var(--brand); text-decoration: underline; }
.status { display: inline-flex; gap: 5px; align-items: center; color: #526075; background: #ecf0f5; padding: 3px 6px; border-radius: 5px; font-size: 10px; font-weight: 640; white-space: nowrap; }
.status--blue { color: #294f90; background: #e7effd; }
.status--red { color: #842b35; background: #fae6e6; }
.bot-heading { display: flex; justify-content: space-between; align-items: start; gap: 9px; padding: 17px 18px; }
.bot-heading h2 { font-size: 21px; font-weight: 730; letter-spacing: -.035em; overflow-wrap: anywhere; }
.bot-heading p, .panel-heading p { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.45; }
.tabs { display: flex; gap: 14px; overflow: auto; border-bottom: 1px solid var(--line); padding: 0 17px; }
.tabs > button { padding: 9px 2px; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 12px; font-weight: 620; }
.tabs > button.is-selected { border-color: var(--brand); font-weight: 720; color: var(--brand); }
.bot-content { padding: 18px; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.panel-heading h3 { font-size: 15px; font-weight: 720; letter-spacing: -.02em; }
.simple-list { display: grid; gap: 7px; }
.simple-row { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 58px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.simple-row > .channel-stamp { width: 30px; height: 30px; min-width: 30px; font-size: 9px; border-radius: 8px; }
.simple-row > div:not(.row-end), .simple-row > span:not(.avatar,.channel-stamp) { min-width: 0; flex: 1; }
.simple-row strong, .simple-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.simple-row strong { font-size: 12px; font-weight: 700; }
.simple-row small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.channel-status { margin-top: 4px; }
.channel-status .status { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.simple-row input { accent-color: var(--brand); width: 17px; height: 17px; }
.simple-row .row-end { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.row-end .icon-button { border: none; min-width: 29px; width: 29px; min-height: 29px; }
.bot-staff-form > .button { margin-top: 13px; }
.connection-fields { max-width: 520px; }
.api-info { max-width: 600px; border-radius: 8px; margin-top: 13px; background: #f1f5fb; padding: 12px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.api-info > p { margin-bottom: 6px; }

.appearance-heading { align-items: center; }
.appearance-layout { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(190px, 1.05fr); align-items: start; gap: 15px; }
.appearance-form fieldset { display: grid; gap: 11px; margin: 0; padding: 0; border: 0; min-width: 0; }
.appearance-form > .button { margin-top: 12px; }
.two-fields { display: grid; grid-template-columns: minmax(60px, .48fr) minmax(110px,1fr); gap: 10px; }
input.color-field { padding: 4px; min-width: 54px; min-height: 35px; }
.widget-preview { display: flex; flex-direction: column; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #f6f8fc; }
.widget-preview-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.widget-preview-stage { min-width: 0; position: relative; overflow: hidden; border: 1px dashed #d4deee; border-radius: 9px; background: #edf1f8; }
.widget-preview-frame { position: absolute; top: 0; left: 0; border: 0; transform-origin: top left; }
.widget-channel-settings summary { cursor: pointer; font-weight: 620; color: var(--ink); }
.widget-channel-settings > div { display: grid; gap: 9px; margin-top: 10px; }
.preview-caption { font-size: 10px; color: var(--muted); font-weight: 620; }
.panels-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px),1fr)); gap: 13px; }
.organization-card, .tool-card { padding: 17px; display: grid; align-content: start; gap: 10px; min-width: 0; }
.organization-card h2, .tool-card h2 { font-size: 16px; font-weight: 710; overflow-wrap: anywhere; }
.organization-card p, .tool-card p { color: var(--muted); font-size: 12px; max-width: 40ch; line-height: 1.44; }
.organization-card > .button { justify-self: start; margin-top: 4px; }
.section-note {
  display: flex; gap: 7px; align-items: flex-start; max-width: 78ch; padding: 10px 0 13px; color: var(--muted); font-size: 12px;
}
.table-panel { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table th { color: var(--muted); font-size: 11px; font-weight: 650; background: #f8fafd; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-light); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-person { display: flex; align-items: center; gap: 10px; }
.table-person strong, .table-person small { display: block; overflow-wrap: anywhere; }
.table-person strong { font-size: 12px; font-weight: 690; }
.table-person small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.field { display: grid; gap: 5px; min-width: 0; font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea, .copy-line input {
  width: 100%; min-width: 0; border: 1px solid #d4deee; border-radius: 8px; color: var(--ink);
  background: #fbfcfe; padding: 8px 9px; min-height: 36px; font-size: 12px; font-weight: 500;
}
.field textarea { resize: vertical; line-height: 1.4; }
.field input[type="color"] { padding: 4px 6px; }
.field-help { font-size: 11px; line-height: 1.45; color: var(--muted); }
.form-error { font-size: 12px; font-weight: 570; color: #8e2e33; line-height: 1.5; }
#dialog { color: var(--ink); padding: 0; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); width: min(430px, calc(100% - 24px)); }
#dialog::backdrop { background: rgb(20 36 28 / 44%); }
.modal-heading, .modal-footer { display: flex; align-items: center; gap: 8px; padding: 13px 16px; }
.modal-heading { justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-heading h2 { font-size: 19px; letter-spacing: -.04em; }
.modal-heading .icon-button { border: 0; }
.modal-fields { display: grid; gap: 12px; padding: 16px; }
.modal-fields > p { font-size: 12px; color: var(--muted); }
.modal-fields .form-error { color: #8e2e33; }
.modal-footer { border-top: 1px solid var(--line); justify-content: end; }
.copy-line { display: flex; min-width: 0; gap: 6px; align-items: center; }
.copy-line input { min-width: 0; flex: 1; }
.toast {
  position: fixed; z-index: 5; bottom: 20px; right: 20px; max-width: min(360px, calc(100% - 40px));
  display: block; padding: 11px 15px; color: white; background: #253a59; box-shadow: var(--shadow); border-radius: 9px; font-size: 12px;
}
.toast[data-variant="error"] { background: #812c38; }

@media (min-width: 1450px) {
  .shell { grid-template-columns: 228px minmax(0,1fr); }
  .inbox-grid { grid-template-columns: minmax(245px,.73fr) minmax(380px,1.65fr) minmax(240px,.69fr); }
  .queue-title strong { font-size: 13px; }
}
@media (max-width: 1160px) {
  .shell { grid-template-columns: 177px minmax(0,1fr); }
  .sidebar { padding-inline: 8px; }
  .topbar { padding-inline: 15px; }
  .inbox-page, .section-page { padding-inline: 14px; }
  .inbox-grid { grid-template-columns: minmax(190px,.82fr) minmax(285px,1.55fr) minmax(168px,.75fr); }
  .queue-row { gap: 6px; padding-inline: 7px; }
  .queue-controls { padding-inline: 8px; }
  .chat-header { padding-inline: 8px; }
  .context-heading, .context-body { padding-inline: 10px; }
}
@media (max-width: 1000px) {
  .inbox-grid { grid-template-columns: minmax(205px,.75fr) minmax(300px, 1.4fr); position: relative; }
  .context { display: none; }
  .context-open > .context {
    display: flex; position: absolute; right: 0; top: 0; bottom: 0; width: min(280px, 90%);
    z-index: 1; box-shadow: -13px 0 30px rgb(28 47 38 / 12%); background: #fff;
  }
  .context-close, .context-toggle { display: inline-flex; }
  .settings-layout { grid-template-columns: minmax(166px, 195px) minmax(0, 1fr); }
  .appearance-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .shell { grid-template-columns: 61px minmax(0,1fr); }
  .sidebar { padding: 13px 6px 9px; }
  .nav-label, .nav-item > span, .nav-count, .profile-text { display: none; }
  .nav { gap: 10px; }
  .nav-item { justify-content: center; padding-inline: 2px; }
  .org-picker { margin: 0 2px 12px; padding: 0; justify-content: center; min-height: 35px; }
  .org-picker > svg { left: 50%; transform: translateX(-50%); }
  .org-picker > svg:last-child { display: none; }
  .org-picker select { font-size: 0; padding: 0; width: 100%; min-height: 34px; }
  .org-picker select option { font-size: 13px; }
  .sidebar-bottom { display: grid; justify-items: center; gap: 3px; padding: 8px 0 0; }
  .profile { display: grid; place-items: center; }
  .side-logout { min-height: 28px; }
}
@media (max-width: 600px) {
  .shell { grid-template-columns: 49px minmax(0,1fr); }
  .sidebar { padding-inline: 4px; }
  .topbar { padding: 8px; min-height: 48px; }
  .toptrail { gap: 5px; font-size: 10px; }
  .topbar-actions .icon-button { width: 29px; min-width: 29px; min-height: 29px; }
  .inbox-page { height: calc(100dvh - 48px); min-height: 450px; padding: 13px 8px 8px; }
  .inbox-heading { margin-bottom: 10px; }
  .inbox-heading h1 { font-size: 25px; }
  .inbox-grid { display: flex; }
  .queue, .conversation { flex: 1; }
  .queue { border-right: 0; }
  .inbox-grid:not(.mobile-detail) .conversation { display: none; }
  .mobile-detail .queue { display: none; }
  .mobile-back { display: inline-flex; }
  .chat-header { min-height: 54px; padding: 6px; gap: 5px; }
  .chat-header .avatar { display: none; }
  .chat-header .assign-button { max-width: 83px; padding-inline: 5px; gap: 3px; }
  .chat-header .assign-button > svg:first-child { display: none; }
  .chat-header .icon-button { min-width: 27px; width: 27px; min-height: 29px; }
  .chat-person > strong { font-size: 12px; }
  .chat-person > span { font-size: 9px; }
  .chat-person .channel-stamp { display: none; }
  .composer { padding: 7px; }
  .composer-help { display: none; }
  .section-page { padding: 14px 8px 22px; }
  .section-page .page-heading { align-items: start; margin-bottom: 13px; }
  .section-page .page-heading p { font-size: 12px; }
  .settings-layout { grid-template-columns: 1fr; gap: 9px; }
  .bot-list { display: flex; overflow-x: auto; padding: 7px; }
  .bot-list h2 { display: none; }
  .bot-item { flex: 0 0 auto; width: auto; }
  .bot-item .bot-icon { display: none; }
  .bot-heading { padding: 12px; }
  .bot-content { padding: 10px; }
  .tabs { padding-inline: 9px; gap: 9px; }
  .tabs button { font-size: 10.5px; }
  .simple-row { padding: 6px 7px; gap: 6px; }
  .simple-row .row-end { flex-direction: column; }
  .simple-row .row-end .status { font-size: 8px; }
  .data-table th, .data-table td { padding: 9px 7px; }
}
@media (max-width: 370px) {
  .auth-card { padding: 22px 18px; }
  .auth-card h1 { font-size: 24px; }
  .toptrail span:first-child, .top-separator { display: none; }
  .sidebar { padding-top: 9px; }
  .chat-header .assign-button { max-width: 58px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }

.dataset-page { display: grid; gap: 18px; align-content: start; }
.dataset-page .page-heading { margin: 0; }
.dataset-block { display: grid; gap: 8px; min-width: 0; }
.dataset-block h2, .dataset-panel h2 { font-size: 15px; font-weight: 700; }
.dataset-empty { padding: 16px; font-size: 13px; color: var(--muted); }
.data-scroll { overflow: auto; }
.dataset-panel { min-width: 0; padding: 16px; }
.dataset-search { max-width: 420px; }
.dataset-count { color: var(--muted); font-size: 11px; padding-block: 10px; }
.dataset-material { border-top: 1px solid var(--line-light); }
.dataset-material summary { padding: 12px 0; cursor: pointer; }
.dataset-material summary strong { font-size: 13px; }
.dataset-material summary span { display: block; margin: 3px 0 0 15px; color: var(--muted); font-size: 11px; }
.dataset-meta { display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: 12px; padding: 10px 0; }
.dataset-meta dt { color: var(--muted); }
.dataset-meta dd { font-weight: 650; margin-top: 3px; }
.dataset-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; padding-bottom: 14px; }
.dataset-prompt { overflow: auto; max-height: 55vh; padding: 10px; background: var(--canvas); border-radius: 8px; }
.more-materials { margin-top: 12px; }

.worktools-frame { display: block; width: 100%; height: calc(100dvh - 59px); border: 0; background: var(--canvas); }
.chat-file { display: block; margin-top: 6px; color: var(--brand); text-decoration: underline; overflow-wrap: anywhere; }
.case-action { margin-top: 10px; max-width: 100%; white-space: normal; }

.telegram-channel { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.telegram-channel h3 { font-size: 15px; margin-bottom: 8px; }
#telegram-details p, .telegram-link { font-size: 12px; }
#telegram-details p { margin-bottom: 6px; }
.telegram-link { color: var(--brand); text-decoration: underline; }
.telegram-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.telegram-form { display: grid; gap: 11px; margin-top: 14px; max-width: 540px; }
.telegram-problems { margin-top: 12px; max-width: 540px; }

.profile-page { display:grid; gap:14px; align-content:start; }
.profile-page .page-heading { margin:0; }
.profile-page .worktools-frame { height: 72dvh; min-height: 460px; }
.profile-control { display:grid; gap:12px; }
.profile-control > label { max-width: 450px; }
.profile-bot-list { border:0; margin:0 0 8px; padding:0; display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; }
.profile-bot-list legend { font-size:12px; font-weight:650; margin-bottom:6px; }
.profile-bot-list label { display:inline-flex; align-items:center; gap:5px; font-size:12px; }
.profile-bot-list input { accent-color: var(--brand); }
.profile-control form .button { margin-top:8px; }
.profile-settings { display:grid; gap:11px; max-width:900px; }
