:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  color: #17213a;
  background: #f2f5fb;
  --text: #17213a;
  --muted: #56627a;
  --line: #dce3ef;
  --surface: #fff;
  --field: #f2f5fb;
  --indigo: #4337a3;
  --indigo-deep: #352887;
  --tint: #eeebff;
  --green: #136244;
  --mint: #e2f6ec;
  --amber: #775013;
  --sand: #fff0d5;
  --danger: #9c2a49;
  --rose: #fae8ee;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 310px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
a { color: var(--indigo); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--indigo); outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd, blockquote { margin: 0; }
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.23; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); font-weight: 720; }
h2 { font-size: 1.35rem; font-weight: 690; }
h3 { font-size: 1rem; font-weight: 690; }
p, dd, blockquote { overflow-wrap: anywhere; }
small, .muted { color: var(--muted); }
small, .meta, .subtle { font-size: .875rem; }
.subtle { color: var(--muted); line-height: 1.5; }
.icon { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.mast {
  min-height: 72px; padding: 12px clamp(14px, 3vw, 32px); display: flex; align-items: center;
  justify-content: space-between; gap: 12px; background: #19223b; color: #f7f8ff;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 37px; height: 37px; flex: none; border-radius: 10px;
  background: #c9c0ff; color: #2a205f; font-weight: 760; font-size: 1.35rem; line-height: 1;
}
.brand strong { display: block; font-size: 1.15rem; letter-spacing: -.045em; line-height: 1.2; }
.brand small { display: block; color: #c8d0e5; font-size: .78rem; }
.account { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.account-name { font-size: .87rem; }
.account .button { color: #f0f2ff; background: #252e49; border-color: #47516d; font-size: .85rem; min-height: 35px; }
.account .button:hover { background: #343d5c; }
.demo-pill { color: #efebff; background: #3a3860; border-radius: 6px; padding: 4px 9px; font-size: .8rem; }
.shell { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: calc(100dvh - 72px); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line); padding: 20px 11px;
  position: sticky; top: 0; align-self: start; min-height: calc(100dvh - 72px);
}
.sidebar nav { display: grid; gap: 4px; }
.sidebar button {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; min-height: 45px;
  border: 0; border-radius: 9px; padding: 8px 12px; color: var(--text); background: transparent;
}
.sidebar button[aria-current="page"], .sidebar button:hover { color: var(--indigo); background: var(--tint); }
.nav-count { display: grid; place-items: center; min-width: 24px; padding: 2px 5px; margin-inline-start: auto; border-radius: 6px; background: var(--mint); color: var(--green); font-size: .78rem; }
.workspace { width: 100%; max-width: 1530px; margin-inline: auto; min-width: 0; padding: clamp(17px, 3.3vw, 48px); }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; column-gap: 14px; row-gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead p { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.page-tools { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.page-tools small { font-size: .78rem; }
.live-indicator { display:inline-flex; align-items:center; gap:5px; color:var(--amber); }
.live-indicator::before { content:''; width:7px; height:7px; border-radius:50%; background:currentColor; }
.live-indicator.connected { color:var(--green); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.padded { padding: clamp(14px, 2vw, 24px); }
.split { display: grid; grid-template-columns: minmax(210px, .75fr) minmax(0, 1.55fr); gap: 15px; align-items: start; }
.stack { display: grid; gap: 12px; }
.client-card.is-hot { border-inline-start: 4px solid #d64a4a; }
.client-actions { flex-wrap: wrap; align-items: flex-end; }
.section { display: grid; gap: 10px; margin-top: 18px; }
.section + .section { padding-top: 16px; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.list { padding: 5px; }
.list-item {
  min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center;
  width: 100%; padding: 9px 10px; min-height: 52px; background: transparent; border: 1px solid transparent;
  color: var(--text); border-radius: 8px; text-align: left; line-height: 1.35;
}
.list-item + .list-item { margin-top: 2px; }
.list-item.is-current, .list-item:hover { background: var(--tint); color: var(--indigo); }
.list-item strong { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.list-item small { display: block; margin-top: 3px; font-size: .78rem; }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  background: var(--tint); color: var(--indigo); font-size: .79rem; font-weight: 720; flex: none;
}
.avatar:nth-child(2n) { background: #e3edff; color: #245181; }
.badge {
  display: inline-flex; align-items: center; width: fit-content; gap: 6px; white-space: normal;
  border-radius: 6px; padding: 3px 8px; background: var(--field); color: var(--muted); font-size: .81rem; font-weight: 600;
}
.badge.good { background: var(--mint); color: var(--green); }
.badge.warn { background: var(--sand); color: var(--amber); }
.badge.error { background: var(--rose); color: var(--danger); }
.badge.accent { background: var(--tint); color: var(--indigo); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px;
  padding: 7px 11px; border: 1px solid #cfd8e9; border-radius: 7px; background: var(--surface);
  color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 620; line-height: 1.3;
}
.button:hover, .button[aria-pressed="true"] { background: var(--tint); border-color: #d6ccf6; color: var(--indigo); }
.button.primary { background: var(--indigo); color: white; border-color: var(--indigo); }
.button.primary:hover { background: var(--indigo-deep); }
.button:disabled { background: var(--field); border-color: var(--line); color: var(--muted); cursor: default; }
.button.small { min-height: 33px; padding: 5px 8px; font-size: .81rem; }
.button.quiet { border-color: transparent; background: transparent; color: var(--indigo); }
.alert { color: var(--amber); background: var(--sand); border: 1px solid #f0dfbd; border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: .89rem; }
.file-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; background: var(--field);
}
.file-row .icon { color: var(--green); }
.file-row strong { overflow-wrap: anywhere; font-weight: 610; font-size: .93rem; }
.request { line-height: 1.52; white-space: pre-wrap; }
.entry + .entry { padding-top: 10px; border-top: 1px solid var(--line); }
.company-profiles { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.profile { display: grid; gap: 14px; align-content: start; }
.profile dl { display: grid; gap: 8px; }
.profile dt { font-size: .79rem; color: var(--muted); }
.profile dd { font-size: .91rem; }
.profile header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile .button { justify-self: start; }
.filters { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.group { display: grid; gap: 8px; margin-bottom: 8px; }
.contact-list { max-height: 60vh; overflow: auto; scrollbar-gutter: stable; }
.contact-list, .transcript, #feed-content { overflow-anchor: none; }
.history { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.history summary, .editor summary { color: var(--indigo); font-weight: 620; font-size: .9rem; }
.history summary { width: fit-content; padding-block: 4px; }
.transcript { display: grid; gap: 7px; margin-top: 10px; max-height: 56vh; overflow: auto; scrollbar-gutter: stable; }
.bubble { max-width: 92%; width: fit-content; border-radius: 10px 10px 10px 3px; background: var(--field); margin-right: auto; padding: 7px 11px; white-space: pre-wrap; line-height: 1.46; }
.bubble.out { border-radius: 10px 10px 3px 10px; color: #292358; background: var(--tint); margin-right: 0; margin-left: auto; }
.bubble small { display: block; font-size: .76rem; margin-bottom: 3px; }
.panel-footer { margin-top: 15px; padding-top: 10px; border-top: 1px solid var(--line); display:flex; flex-wrap:wrap; gap:7px; }
.queue-card { display: grid; gap: 9px; }
.queue-card blockquote {
  border-left: 3px solid #a286e8; border-radius: 0 8px 8px 0; padding: 7px 11px;
  background: #f7f5ff; font-size: clamp(1rem,1.8vw,1.16rem); white-space: pre-wrap;
}
.queue-card .meta { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.queue-card .row .button:first-child { min-width: min(160px,100%); }
.agent-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr)); gap:8px; margin-bottom:14px; }
.agent-card { padding:12px; display:grid; gap:4px; color:var(--text); text-align:left; }
.agent-card:hover,.agent-card[aria-pressed="true"] { border-color:#d6ccf6; background:var(--tint); color:var(--indigo); }
.agent-card small { line-height:1.45; }
.feed-card { display:grid; gap:6px; }
.feed-card h2 { font-size:1.12rem; }
.feed-card time { font-size:.81rem; color:var(--muted); }
.report-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr)); gap:6px 15px; margin-top:3px; }
.report-metrics dt,.report-lines { color:var(--muted); font-size:.86rem; }
.report-metrics dd { font-weight:650; }
.report-lines { margin:4px 0 0; padding-left:20px; }
.empty { padding: 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 5px; }
.editor { padding: 13px; }
.editor form { display: grid; gap: 9px; margin-top: 11px; }
.editor form .button, .form-footer .button { justify-self: start; }
label.field { display: grid; min-width: 0; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 600; }
input:not([type="checkbox"]), select, textarea {
  min-width: 0; width: 100%; border: 1px solid #d0daea; border-radius: 7px; padding: 8px 9px;
  min-height: 39px; color: var(--text); background: var(--surface); font-size: .91rem; font-weight: 400;
}
textarea { min-height: 84px; resize: vertical; }
.filters label { width: auto; width: clamp(134px, 20vw, 210px); }
.filters select { text-overflow: ellipsis; }
form.search { display: flex; align-items: end; gap: 5px; }
.check-grid { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 5px 14px; }
.check-grid legend { color: var(--muted); padding: 0 0 4px; font-weight: 600; font-size: .85rem; }
.check-grid label { display: inline-flex; align-items: center; gap: 5px; font-size: .9rem; cursor: pointer; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--indigo); }
.access-account + .access-account { border-top: 1px solid var(--line); padding-top: 12px; }
.auth-shell { min-height: calc(100dvh - 72px); display: grid; align-items: start; justify-items: center; padding: clamp(24px, 8vh, 110px) 12px 22px; }
.auth-panel { display: grid; gap: 12px; padding: clamp(18px, 4vw, 28px); width: min(100%, 435px); }
.auth-panel p { font-size: .93rem; color: var(--muted); }
.auth-panel form { display: grid; gap: 12px; }
.auth-panel code { font-size: .82rem; overflow-wrap: anywhere; }
.auth-error { color: var(--danger) !important; }
.loading { padding: 30px; color: var(--muted); }
.notification {
  position: fixed; z-index: 2; inset: auto 14px 14px auto; width: max-content; max-width: min(520px, calc(100vw - 28px));
  background: #251d45; color: white; padding: 10px 14px; border-radius: 9px; box-shadow: 0 8px 24px #28304c2b; overflow-wrap: anywhere;
}
.notification.is-error { background: #7f2641; }
@media (max-width: 930px) {
  .shell { grid-template-columns: 172px minmax(0,1fr); }
  .sidebar { padding-inline: 7px; }
  .workspace { padding: 20px; }
}
@media (max-width: 700px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: static; padding: 3px 7px; min-height: auto; border: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar button { width: auto; flex: 1 1 105px; min-height: 43px; padding: 6px 7px; gap: 5px; justify-content:center; }
  .sidebar .nav-count { margin-inline-start: 0; }
  .workspace { padding: 16px; }
}
@media (max-width: 535px) {
  .mast { min-height: 60px; }
  .workspace { padding: 13px; }
  .split { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .company-list, .contact-list { max-height: 34vh; overflow: auto; }
  .file-row { grid-template-columns: auto minmax(0,1fr); }
  .file-row .button { grid-column: 2; justify-self: start; }
  .auth-shell { padding-top: 18px; }
  .account-name { max-width: 105px; overflow-wrap: anywhere; }
}
@media (pointer: coarse) { .button, input:not([type="checkbox"]), select { min-height: 44px; } }
