:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #15213a;
  background: #f3f5f9;
  --ink: #15213a;
  --muted: #5d6c83;
  --line: #e4e9f1;
  /* Brand tokens. --brand, --on-brand and --sidebar are replaced at runtime by brand.js (Team & access > Branding). */
  --brand: #3459df;
  --on-brand: #fff;
  --sidebar: #111c30;
  --brand-dark: color-mix(in srgb, var(--brand) 85%, #000);
  --brand-deep: color-mix(in srgb, var(--brand) 70%, #000);
  --brand-ring: color-mix(in srgb, var(--brand) 72%, #fff);
  --brand-light: color-mix(in srgb, var(--brand) 9%, #fff);
  --brand-soft: color-mix(in srgb, var(--brand) 16%, #fff);
  --sidebar-active: color-mix(in srgb, var(--sidebar) 80%, #fff);
  --blue: var(--brand);
  --blue-dark: var(--brand-dark);
  --blue-light: var(--brand-light);
  --surface: #fff;
  --radius: 12px;
}

* { box-sizing: border-box; }
body { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100dvh; margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}
button, h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.sidebar { display: flex; flex-direction: column; min-width: 0; padding: 22px 15px 14px; background: var(--sidebar); color: #eaf0fc; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 5px; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.02em; line-height: 1.3; }
.brand span { display: block; color: #adbad1; margin-top: 2px; font-size: 11px; }
.sidebar-nav { margin-top: 33px; }
.channel-nav { margin-top: 24px; }
.nav-caption { padding: 0 10px 9px; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: #9baac4; }
.nav-item { display: flex; width: 100%; gap: 9px; align-items: center; text-align: left; color: #c6d1e5; background: transparent; border: 0; border-radius: 8px; padding: 9px 10px; min-height: 40px; font-size: 13px; font-weight: 550; }
.nav-item + .nav-item { margin-top: 2px; }
.nav-item .icon { color: #9cafcd; width: 16px; height: 16px; }
.nav-item:hover { background: #1c2a43; color: #fff; }
.nav-item[aria-pressed="true"] { background: var(--sidebar-active); color: #fff; }
.nav-item[aria-pressed="true"] > .icon { color: #a8bcff; }
.nav-item b { font-size: 11px; min-width: 22px; padding: 2px 4px; text-align: center; margin-left: auto; border-radius: 5px; color: #d7e2fa; font-weight: 650; }
.nav-item[aria-pressed="true"] b { background: color-mix(in srgb, var(--sidebar) 62%, #fff); }
.nav-item .channel-badge { width: 20px; height: 20px; border-radius: 6px; }
.nav-item .channel-badge .icon { width: 12px; height: 12px; color: currentColor; }
.sidebar-bottom { margin-top: auto; padding-top: 25px; }
.demo-card { display: flex; align-items: flex-start; gap: 8px; padding: 11px 9px; border-radius: 9px; background: #1d2b43; border: 1px solid #2b3a55; }
.demo-card .icon { width: 15px; height: 15px; margin-top: 1px; color: #9db3ff; }
.demo-card strong, .demo-card span { display: block; }
.demo-card strong { font-size: 11px; }
.demo-card span { color: #afbdd5; margin-top: 3px; font-size: 10px; line-height: 1.4; }
.branch { display: flex; align-items: center; gap: 6px; color: #a6b5ce; font-size: 11px; padding: 12px 2px 0; }
.branch .icon { width: 13px; height: 13px; }
.stage { min-width: 0; height: max(680px, 100dvh); display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; min-height: 60px; padding: 0 23px; background: #fff; border-bottom: 1px solid var(--line); }
.breadcrumb, .topbar-right, .account { display: flex; align-items: center; }
.breadcrumb { gap: 9px; font-size: 12px; color: var(--muted); }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.breadcrumb .icon { width: 12px; height: 12px; color: #8190a7; }
.topbar-right { gap: 16px; }
.demo-badge { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; background: var(--brand-light); color: var(--brand-deep); border: 1px solid var(--brand-soft); border-radius: 20px; padding: 5px 9px; font-size: 11px; font-weight: 650; }
.demo-badge > span { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.account { gap: 8px; }
.account .account-avatar { width: 32px; height: 32px; color: #3b50a3; background: #e9eeff; font-size: 11px; }
.account-name strong, .account-name span { display: block; white-space: nowrap; }
.account-name strong { font-size: 12px; }
.account-name span { font-size: 10px; color: var(--muted); margin-top: 1px; }
.mobile-brand, .mobile-views, .mobile-channel { display: none; }
.main { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 21px 22px 21px; gap: 16px; }
.page-heading { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 14px; }
.page-heading h1 { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.043em; line-height: 1.15; font-weight: 760; }
.page-heading p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; padding: 8px 12px; min-height: 34px; border-radius: 8px; font-weight: 650; font-size: 12px; white-space: nowrap; }
.button .icon { width: 15px; height: 15px; }
.button-primary { background: var(--blue); color: var(--on-brand); box-shadow: 0 1px 2px #182d8130; }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-primary:disabled { background: #e7edfa; color: #526887; box-shadow: none; }
.button-secondary { border-color: #dfe5ef; background: #fff; color: #374762; }
.button-secondary:hover { background: #f3f6fc; }
.metrics { display: grid; flex: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric { display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; text-align: left; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-height: 67px; padding: 9px 13px; box-shadow: 0 1px 1px #15213a04; }
.metric:hover, .metric[data-view]:not([data-view="team"])[aria-pressed="true"] { border-color: #b7c6f4; background: #fcfdff; }
.metric-icon { display: grid; place-items: center; border-radius: 10px; width: 36px; height: 36px; }
.metric-blue { color: var(--brand); background: var(--brand-light); }
.metric-green { color: #08755f; background: #e9f8f2; }
.metric-orange { color: #9a4b0d; background: #fff2e7; }
.metric-label { display: block; font-size: 11px; color: var(--muted); font-weight: 650; }
.metric strong { display: block; margin-top: 2px; font-size: 21px; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.metric-arrow { width: 14px; height: 14px; color: #7786a0; }
.workspace-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(234px, 27fr) minmax(285px, 47fr) minmax(236px, 26fr); position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 16px #15213a08; overflow: hidden; }
.queue, .thread-panel, .details-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.queue { border-right: 1px solid var(--line); }
.queue-controls { padding: 13px 12px 9px; border-bottom: 1px solid var(--line); }
.queue-heading { display: flex; align-items: center; gap: 7px; min-height: 21px; }
.queue-heading h2, .details-heading h2 { font-size: 14px; letter-spacing: -.015em; font-weight: 750; }
.result-count { color: #4e5f7b; background: #edf1f7; font-size: 10px; font-weight: 650; border-radius: 12px; padding: 2px 7px; }
.search-box { display: flex; align-items: center; position: relative; margin-top: 9px; }
.search-box .icon { position: absolute; left: 9px; width: 15px; height: 15px; color: #6d7c94; pointer-events: none; }
.search-box input { width: 100%; min-width: 0; background: #f8f9fc; border: 1px solid #e1e6ef; border-radius: 7px; padding: 7px 8px 7px 30px; font-size: 12px; color: var(--ink); }
.search-box input::placeholder, textarea::placeholder, .dialog-heading p { color: #64748b; }
.queue-filters { display: flex; align-items: center; gap: 3px; margin-top: 9px; }
.queue-filters button { padding: 5px 8px; border: 0; border-radius: 6px; background: #fff; font-size: 11px; font-weight: 650; color: var(--muted); }
.queue-filters button:hover { background: #f3f6fc; }
.queue-filters button[aria-pressed="true"] { color: #2f52c9; background: var(--brand-light); }
.conversation-list { flex: 1; overflow: auto; overscroll-behavior: contain; }
.conversation { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: start; position: relative; text-align: left; padding: 11px 10px 11px 12px; background: #fff; border: 0; border-bottom: 1px solid #edf0f5; color: var(--ink); }
.conversation:hover { background: #f6f8fd; }
.conversation[aria-current="true"] { background: var(--brand-light); }
.conversation[aria-current="true"]::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--blue); }
.conversation:focus-visible { outline-offset: -2px; }
.avatar { display: grid; place-items: center; flex: none; border-radius: 50%; width: 35px; height: 35px; color: #4d438b; background: #eeebfd; font-size: 11px; font-weight: 760; }
.avatar-lavender { color: #4d438b; background: #ebe6fc; }
.avatar-sky { color: #29559b; background: #e2ecff; }
.avatar-mint { color: #1d6c60; background: #dff3ec; }
.avatar-peach { color: #94502c; background: #fcebdd; }
.avatar-rose { color: #9c3f62; background: #f9e5ec; }
.row-avatar { position: relative; }
.channel-badge { display: inline-grid; place-items: center; flex: none; border-radius: 5px; width: 17px; height: 17px; background: var(--brand-light); color: #3158bb; }
.channel-badge .icon { width: 11px; height: 11px; }
.channel-green { color: #08735a; background: #d9f5e8; }
.channel-blue { color: var(--brand-deep); background: var(--brand-soft); }
.channel-pink { color: #a53673; background: #fbe5f2; }
.channel-teal { color: #1a6a73; background: #dff5f6; }
.channel-amber { color: #8a5013; background: #fff1d9; }
.row-avatar .channel-badge { position: absolute; right: -3px; bottom: -3px; border: 1.5px solid #fff; }
.row-main, .row-meta { display: flex; flex-direction: column; min-width: 0; }
.row-name, .row-vehicle, .row-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-name { font-weight: 650; font-size: 12px; }
.conversation[data-unread="true"] .row-name { font-weight: 770; }
.row-vehicle { color: #445775; font-size: 10px; font-weight: 600; margin-top: 2px; }
.row-preview { color: var(--muted); font-size: 11px; margin-top: 4px; }
.row-meta { align-items: flex-end; gap: 7px; color: #586a85; font-size: 10px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.unread-dot { width: 7px; height: 7px; background: var(--brand); border-radius: 50%; }
.queue-footer { border-top: 1px solid var(--line); padding: 8px 12px; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 10px; }
.queue-footer .icon { width: 13px; height: 13px; }
.thread-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 13px; min-height: 65px; border-bottom: 1px solid var(--line); }
.thread-person, .thread-actions { display: flex; gap: 8px; align-items: center; min-width: 0; }
.thread-name { min-width: 0; }
.thread-name h2 { font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-channel { margin-top: 4px; display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: 10px; }
.thread-subject { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-channel .channel-badge { width: 14px; height: 14px; }
.thread-channel .channel-badge .icon { width: 9px; height: 9px; }
.thread-actions { gap: 5px; flex: none; }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 31px; height: 31px; background: #fff; color: #52627d; border: 1px solid #dfe5ef; border-radius: 7px; padding: 0; }
.icon-button:hover { background: #f1f5fd; color: var(--blue); }
.icon-button .icon { width: 15px; height: 15px; }
.back-button, .mobile-details, .details-close { display: none; }
.thread-messages { flex: 1; display: flex; flex-direction: column; gap: 12px; overflow: auto; overscroll-behavior: contain; min-height: 0; padding: 14px 15px 13px; background: #f7f9fc; }
.day-marker { flex: none; text-align: center; font-size: 10px; font-weight: 650; color: #586a85; }
.day-marker span { display: inline-block; padding: 3px 8px; border: 1px solid #e4e9f2; border-radius: 14px; background: #fff; }
.message { display: flex; flex: none; align-items: flex-end; gap: 6px; }
.message .avatar { width: 24px; height: 24px; font-size: 9px; }
.message-content { min-width: 0; max-width: min(90%, 430px); }
.message-reply { justify-content: flex-end; }
.message-reply .message-content { text-align: right; }
.message-note { justify-content: center; }
.message-note .message-content { max-width: 100%; width: 100%; }
.bubble { display: inline-block; text-align: left; color: #273852; background: #fff; border: 1px solid #e0e6f0; border-radius: 11px 11px 11px 3px; padding: 8px 10px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-reply .bubble { background: var(--brand-light); border-color: #dce6ff; border-radius: 11px 11px 3px 11px; }
.message-note .bubble { width: 100%; background: #fff7e6; border-color: #f0ddb0; border-radius: 8px; }
.note-label { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; color: #775215; font-weight: 700; font-size: 10px; }
.note-label .icon, .message-meta .icon { width: 11px; height: 11px; }
.message-meta { display: flex; align-items: center; gap: 4px; margin-top: 3px; color: #586a85; font-size: 10px; }
.message-reply .message-meta { justify-content: flex-end; }
.message-reply .message-meta .icon { color: #365dd7; }
.composer { flex: none; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.composer-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.composer-tabs button, .quick-replies button { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px; border: 0; border-radius: 5px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 650; }
.composer-tabs button:hover, .quick-replies button:hover { background: #f1f4fb; }
.composer-tabs button[aria-pressed="true"] { background: var(--brand-light); color: var(--brand-dark); }
.composer-tabs button[data-mode="note"][aria-pressed="true"] { background: #fff3d8; color: #795013; }
.composer-tabs .icon, .composer-footer .icon { width: 13px; height: 13px; }
.quick-button { margin-left: auto; }
.quick-replies { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px; background: #f4f6fa; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 6px; }
.quick-replies button { background: transparent; }
.composer textarea { width: 100%; min-height: 53px; max-height: 130px; padding: 8px 9px; resize: vertical; border: 1px solid #dce3ef; border-radius: 7px; color: var(--ink); font-size: 12px; line-height: 1.4; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.composer-footer > span { display: flex; align-items: center; gap: 4px; font-size: 10px; line-height: 1.25; color: var(--muted); }
.details-panel { overflow: auto; border-left: 1px solid var(--line); padding: 13px 13px 14px; overscroll-behavior: contain; background: #fff; }
.details-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 22px; margin-bottom: 11px; }
.contact-summary { display: flex; gap: 8px; align-items: center; }
.contact-summary strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.contact-summary p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.lead-status { display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; margin-top: 9px; background: #edf7f3; color: #126653; font-size: 10px; font-weight: 680; padding: 4px 7px; border-radius: 18px; }
.lead-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.lead-status.waiting { background: #fff2e7; color: #964812; }
.lead-status.closed { background: #edf1f7; color: #4f5f7a; }
.detail-section { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.detail-label { color: #596a84; display: block; font-size: 10px; font-weight: 730; letter-spacing: .07em; text-transform: uppercase; margin: 0 0 6px; }
.vehicle-card { display: flex; align-items: center; gap: 8px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.vehicle-icon { display: grid; place-items: center; flex: none; width: 29px; height: 29px; background: var(--brand-light); color: #3659d1; border-radius: 7px; }
.vehicle-icon .icon { width: 17px; height: 17px; }
.vehicle-card strong, .vehicle-card span:not(.vehicle-icon) { display: block; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.vehicle-card span:not(.vehicle-icon) { color: var(--muted); margin-top: 2px; font-size: 10px; }
.details-panel label, dialog label { display: block; font-size: 11px; font-weight: 650; color: #485c77; }
.details-panel label + label, dialog label + label { margin-top: 7px; }
.details-panel select, .details-panel input, dialog input, dialog select, dialog textarea, .mobile-channel select { display: block; width: 100%; min-width: 0; color: var(--ink); background: #fff; border: 1px solid #dfe5ef; border-radius: 6px; padding: 6px 7px; margin-top: 3px; font-size: 11px; }
.details-panel select, .details-panel input { min-height: 29px; }
.follow-up-hint { color: var(--muted); font-size: 10px; line-height: 1.35; margin-top: 5px; }
.follow-up-hint.overdue { color: #9c450e; }
.follow-up-actions { display: flex; gap: 5px; margin-top: 6px; }
.follow-up-actions .button { min-height: 27px; font-size: 10px; padding: 4px 7px; }
.follow-up-actions .icon { width: 12px; height: 12px; }
.empty { display: grid; justify-items: center; align-content: center; gap: 7px; padding: 20px 14px; color: var(--muted); text-align: center; min-height: 145px; height: 100%; }
.empty > .icon { width: 24px; height: 24px; color: #6a80bd; }
.empty strong { font-size: 13px; color: var(--ink); }
.empty p { font-size: 11px; line-height: 1.45; }
.empty .button { margin-top: 2px; }
dialog { padding: 0; width: min(94%, 440px); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: 0 18px 66px #111c3040; }
dialog::backdrop { background: #111c3075; }
dialog form { padding: 17px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 19px; letter-spacing: -.02em; }
.dialog-heading p { margin-top: 3px; font-size: 12px; }
dialog input, dialog select, dialog textarea { padding: 8px 9px; font-size: 13px; }
dialog textarea { resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; }
.toast { position: fixed; z-index: 2; bottom: 18px; right: 18px; max-width: calc(100% - 36px); background: #172640; color: #fff; border-radius: 8px; padding: 9px 13px; font-size: 12px; box-shadow: 0 5px 14px #16213b29; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1130px) {
  body { grid-template-columns: 183px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .main { padding-inline: 16px; }
  .workspace-grid { grid-template-columns: minmax(228px, 38fr) minmax(0, 62fr); }
  .details-panel { display: none; position: absolute; z-index: 1; inset: 0 0 0 auto; width: min(330px, 100%); box-shadow: -10px 0 26px #1b2c511c; }
  .workspace-grid[data-mobile-view="details"] .details-panel { display: flex; }
  .mobile-details, .details-close { display: inline-grid; }
}

@media (max-width: 740px) {
  body { display: block; }
  .sidebar, .breadcrumb, .account-name { display: none; }
  .stage { height: 100dvh; min-height: 480px; }
  .topbar { min-height: 50px; padding-inline: 12px; }
  .topbar-right { gap: 7px; }
  .mobile-brand { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 760; }
  .main { padding: 12px; gap: 10px; }
  .page-heading { gap: 8px; }
  .page-heading p { font-size: 11px; }
  .metrics { gap: 5px; }
  .metric { grid-template-columns: minmax(0, 1fr); min-height: 50px; padding: 7px; }
  .metric-icon, .metric-arrow { display: none; }
  .metric-label { font-size: 10px; }
  .metric strong { font-size: 17px; }
  .mobile-views { display: flex; flex: none; gap: 4px; overflow: auto; }
  .mobile-views button { white-space: nowrap; padding: 5px 7px; font-size: 11px; font-weight: 650; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; }
  .mobile-views button[aria-pressed="true"] { background: var(--brand-light); border-color: #dbe5ff; color: var(--brand-dark); }
  .mobile-channel { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-top: 6px; font-size: 11px; color: var(--muted); }
  .mobile-channel select { max-width: 150px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace-grid[data-mobile-view="list"] .thread-panel { display: none; }
  .workspace-grid:not([data-mobile-view="list"]) .queue { display: none; }
  .workspace-grid[data-mobile-view="details"] .details-panel { width: 100%; border: 0; }
  .main:has(.workspace-grid:not([data-mobile-view="list"])) > :is(.page-heading, .metrics, .mobile-views) { display: none; }
  .queue { border: 0; }
  .back-button { display: inline-grid; }
  .thread-heading { min-height: 56px; padding: 8px; }
  .thread-person { gap: 5px; }
  .thread-messages { padding: 10px 8px; }
  .composer { padding-inline: 8px; }
  .toast { bottom: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

.connections-link { width: 100%; color: inherit; text-align: left; }
.connections-link:hover { background: #293b58; }
.bob-panel { display: grid; flex: none; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 9px 12px; background: #eff3ff; border-bottom: 1px solid #dce5ff; }
.bob-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--brand-dark); background: var(--brand-soft); }
.bob-icon .icon { width: 15px; height: 15px; }
.bob-copy strong { display: block; font-size: 11px; color: var(--brand-deep); }
.bob-copy p { font-size: 11px; line-height: 1.4; margin-top: 3px; color: #40567e; }
.bob-panel .button { min-height: 29px; padding: 4px 7px; font-size: 11px; }
.ai-state { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.ai-on { color: #0f5d3a; background: #dcf5e7; }
.ai-human { color: #7a4a00; background: #fff0d6; }
.ai-off { color: #4d5566; background: #e8ebf0; }
.ai-draft { margin: 6px 0 2px; padding: 7px 9px; border-left: 3px solid var(--brand-dark); border-radius: 6px; background: #fff; font-size: 12px; line-height: 1.45; color: #1d2433; white-space: pre-wrap; }
.ai-meta, .ai-summary, .ai-blocked { font-size: 11px; line-height: 1.4; margin-top: 3px; color: #40567e; }
.ai-blocked { color: #8a2a1b; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ai-chip { padding: 1px 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: 10px; }
.ai-quiet { color: #5b6880; }
.ai-actions { display: flex; flex-direction: column; gap: 4px; }
.lead-source { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--muted); font-size: 10px; margin-top: 5px; line-height: 1.4; }
.sample-badge { display: inline-block; color: #6d4910; background: #fff0cf; border-radius: 4px; padding: 1px 4px; font-weight: 700; }
.contact-lines { display: grid; gap: 4px; margin-top: 7px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.contact-lines a { color: var(--blue-dark); }
.connection-dialog-content { padding: 17px; }
.connection-list { display: grid; gap: 6px; }
.connection-item { display: flex; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px; font-size: 12px; }
.connection-item .channel-badge { width: 20px; height: 20px; }
.connection-item > span:last-child { margin-left: auto; color: var(--muted); font-size: 11px; }
.install-guide { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.install-guide h3 { font-size: 13px; margin: 0 0 7px; }
.install-guide p { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 5px; }
.install-guide .button { margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 7px; }
.form-grid label + label, .form-grid + label { margin-top: 0; }
.form-grid + label { margin-top: 7px; }
dialog .test-checkbox { display: flex; align-items: center; gap: 5px; }
.test-checkbox input { width: auto; margin: 0; }
.message-failed .bubble { border-color: #e8ac9f; }
.message-uncertain .bubble, .message-pending .bubble { border-color: #efd19b; }
.thread-actions .button { padding-inline: 8px; }
@media (max-width: 740px) {
  .install-link { min-height: 29px; padding: 4px 6px; font-size: 10px; }
  .install-link .icon { width: 13px; height: 13px; }
  .bob-panel { padding: 7px 8px; gap: 6px; }
}

/* Sign-in, Team & access, documents */
.auth-dialog::backdrop { background: #111c30e6; }
.auth-heading { justify-content: flex-start; align-items: center; }
.auth-dialog label { display: grid; gap: 4px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.form-error { min-height: 1.2em; color: #b42318; font-size: 12px; }
.auth-help { margin-top: 10px; color: var(--muted); font-size: 12px; }
.team-dialog { width: min(96%, 900px); max-height: 90vh; overflow: auto; padding: 17px; }
.team-dialog section { margin-top: 16px; }
.team-dialog h3 { font-size: 14px; margin-bottom: 8px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table td span { display: block; color: var(--muted); font-size: 11px; }
.data-table code { font-size: 11px; word-break: break-word; }
.data-table tr.inactive { opacity: .55; }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.user-actions .button { padding: 5px 8px; font-size: 12px; }
.new-user-form { display: grid; grid-template-columns: 1fr 1.4fr 1fr auto; gap: 8px; align-items: end; padding: 12px 0 0; }
.new-user-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.role-help { margin-top: 10px; font-size: 12px; color: var(--muted); }
.role-help ul { margin: 6px 0 0 18px; display: grid; gap: 3px; }
.team-secret { margin-top: 10px; padding: 10px; border: 1px solid #f5c26b; background: #fff8eb; border-radius: 10px; font-size: 12px; }
.team-secret input { width: 100%; margin-top: 6px; font-family: ui-monospace, monospace; }
.document-list { list-style: none; display: grid; gap: 6px; margin: 0 0 8px; padding: 0; font-size: 12px; }
.document-list a { color: var(--blue); font-weight: 600; word-break: break-all; }
.document-list span { display: block; color: var(--muted); font-size: 11px; }
.upload-button { cursor: pointer; display: inline-flex; }
#signout-button, #team-button { white-space: nowrap; }
@media (max-width: 760px) {
  .new-user-form { grid-template-columns: 1fr; }
}
a.nav-item { text-decoration: none; }
.mobile-views a { white-space: nowrap; padding: 5px 7px; font-size: 11px; font-weight: 650; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
/* Sales pipeline, customer list and customer profile (v13) */
.sales-nav { margin-top: 24px; }
.crm-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.crm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crm-toolbar .search-box { flex: 1 1 220px; max-width: 340px; }
.crm-filter { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; color: #485c77; }
.crm-filter select { border: 1px solid #dfe5ef; border-radius: 6px; padding: 6px 7px; font-size: 12px; background: #fff; color: var(--ink); }
.crm-check { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #485c77; }
.crm-check input { width: auto; margin: 0; }
.crm-content { flex: 1; min-height: 0; overflow: auto; }
.board { display: flex; gap: 10px; align-items: flex-start; min-height: 100%; padding-bottom: 6px; }
.board-column { flex: 0 0 236px; display: flex; flex-direction: column; max-height: 100%; background: #eef2f8; border: 1px solid var(--line); border-radius: 12px; }
.board-column header { display: flex; justify-content: space-between; align-items: center; padding: 9px 11px 7px; }
.board-column h2 { font-size: 12px; font-weight: 720; letter-spacing: -.01em; }
.board-column header span { font-size: 11px; font-weight: 700; color: #4b5d7c; background: #fff; border-radius: 10px; padding: 1px 7px; }
.board-won header h2 { color: #136650; }
.board-lost { background: #f4f1f1; }
.board-lost header h2 { color: #8a3b2b; }
.board-column.drop-target { outline: 2px dashed var(--brand-ring); outline-offset: -3px; background: #e5ecff; }
.board-cards { display: grid; gap: 7px; padding: 0 7px 8px; overflow: auto; min-height: 50px; }
.board-empty { font-size: 11px; color: #7c8aa1; text-align: center; padding: 12px 0; }
.deal-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; box-shadow: 0 1px 2px #15213a0a; cursor: grab; }
.deal-card.dragging { opacity: .5; }
.deal-waiting { border-left: 3px solid #e07b1f; }
.deal-open { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.deal-name { display: block; font-size: 12.5px; font-weight: 700; overflow-wrap: anywhere; }
.deal-vehicle { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.deal-meta, .deal-flags { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.deal-channels { display: inline-flex; gap: 3px; }
.deal-channels .channel-badge, .customer-link .channel-badge { position: static; width: 18px; height: 18px; border-radius: 5px; border: 0; }
.deal-channels .channel-badge .icon, .customer-link .channel-badge .icon { width: 11px; height: 11px; }
.deal-owner { font-size: 10.5px; font-weight: 650; color: #3b4f78; background: #eef2ff; border-radius: 4px; padding: 1px 5px; }
.deal-age { font-size: 10px; color: #7c8aa1; margin-left: auto; }
.flag { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 650; border-radius: 4px; padding: 1px 5px; background: #eef1f6; color: #4f5f7a; }
.flag .icon { width: 11px; height: 11px; }
.flag-waiting { background: #fff2e7; color: #964812; }
.flag-duplicate { background: #fff4d6; color: #7a5200; }
.deal-move { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 10px; color: var(--muted); }
.deal-move select { flex: 1; min-width: 0; font-size: 11px; border: 1px solid #dfe5ef; border-radius: 5px; padding: 3px 4px; background: #fff; color: var(--ink); }
.customer-table { display: grid; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.customer-row { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(140px, 1.6fr) minmax(90px, 1fr) minmax(80px, .8fr) minmax(70px, .8fr) minmax(60px, .6fr); gap: 10px; align-items: center; text-align: left; background: #fff; border: 0; border-top: 1px solid var(--line); padding: 9px 12px; font-size: 12px; color: var(--ink); }
.customer-row:hover { background: #f7f9fd; }
.customer-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; overflow-wrap: anywhere; }
.customer-head { border-top: 0; background: #f7f9fc; font-size: 10px; font-weight: 730; letter-spacing: .06em; text-transform: uppercase; color: #596a84; cursor: default; }
.customer-head:hover { background: #f7f9fc; }
.stage-pill { display: inline-block; font-size: 10.5px; font-weight: 680; border-radius: 10px; padding: 2px 7px; background: var(--brand-light); color: #2e4fb8; }
.stage-won { background: #e6f6ef; color: #136650; }
.stage-lost { background: #fbeceb; color: #8a3b2b; }
.customer-link p { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.duplicate-hint { color: #7a5200 !important; }
.duplicate-hint .icon { width: 13px; height: 13px; }
.wide-dialog { width: min(96%, 760px); }
.customer-content { padding: 17px; max-height: 86dvh; overflow: auto; }
.customer-content .dialog-heading p { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
.profile-section { margin-top: 12px; border-top: 1px solid var(--line); padding: 10px 0 0; }
.profile-section .detail-label { display: flex; align-items: center; gap: 5px; margin-top: 10px; }
.profile-section .detail-label:first-child { margin-top: 0; }
.profile-section .detail-label .icon { width: 13px; height: 13px; }
.profile-section ul, .profile-section ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.duplicate-section { background: #fffaf0; border: 1px solid #f3dfae; border-radius: 10px; padding: 10px; }
.duplicate-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; }
.duplicate-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.duplicate-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.duplicate-actions .button { min-height: 28px; font-size: 11px; padding: 4px 8px; white-space: normal; }
.conversation-link { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: inherit; font-size: 12px; }
.conversation-link:hover { background: #eef3ff; }
.conversation-link .channel-badge { position: static; flex: none; width: 22px; height: 22px; border: 0; }
.conversation-link > span:not(.flag) { flex: 1; min-width: 0; }
.conversation-link small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-link time { font-size: 10px; color: var(--muted); }
.profile-history li { font-size: 11.5px; color: #3a4a64; line-height: 1.4; }
.profile-history time { color: var(--muted); font-size: 10.5px; margin-right: 4px; }
.pipeline-rows { display: grid; gap: 6px; margin-bottom: 10px; max-height: 56dvh; overflow: auto; }
.pipeline-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px auto 26px repeat(3, 30px); gap: 6px; align-items: center; }
.pipeline-row input[type="text"], .pipeline-row select { margin: 0; }
.pipeline-row .crm-check { margin: 0; }
.pipeline-count { font-size: 11px; color: var(--muted); text-align: center; }
.pipeline-row .icon-button:disabled { opacity: .35; }

@media (max-width: 740px) {
  .board { scroll-snap-type: x mandatory; }
  .board-column { flex-basis: 82vw; scroll-snap-align: start; }
  .crm-toolbar .search-box { max-width: none; }
  .customer-row { grid-template-columns: minmax(0, 1fr) auto; }
  .customer-row > span:nth-child(2), .customer-row > span:nth-child(4), .customer-row > span:nth-child(5) { display: none; }
  .customer-row > span:nth-child(6) { grid-column: 2; grid-row: 1; }
  .customer-row > span:nth-child(3) { grid-column: 1 / -1; }
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .pipeline-row { grid-template-columns: minmax(0, 1fr) 70px auto; }
  .pipeline-row .pipeline-count { display: none; }
}

/* Branding: custom logos, and the Owner's branding editor in Team & access. */
img.custom-logo { width: auto; height: auto; max-width: 132px; max-height: 40px; object-fit: contain; }
img.logo-tile { background: #fff; border-radius: 8px; padding: 4px 6px; }
.brand.has-logo strong { display: none; }
.mobile-brand img.custom-logo { max-width: 88px; max-height: 26px; }
.auth-heading img.custom-logo { max-width: 150px; max-height: 44px; }
.brand-help { color: var(--muted); font-size: 12px; margin: 2px 0 10px; }
.brand-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.logo-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; padding: 14px; text-align: center; font-size: 12px; color: var(--muted); background: #f7f9fc; border: 2px dashed #cfd8e6; border-radius: 12px; cursor: pointer; }
.logo-drop small { font-size: 11px; color: #7c8aa1; }
.logo-drop.dragging { border-color: var(--brand); background: var(--brand-light); }
.logo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.logo-drop:focus-within { outline: 2px solid var(--brand-ring); outline-offset: 2px; }
.logo-drop img { max-width: 100%; max-height: 80px; object-fit: contain; padding: 6px 10px; border-radius: 8px; background: var(--sidebar); }
.logo-drop img.on-white { background: #fff; border: 1px solid var(--line); }
.brand-fields { display: flex; flex-direction: column; gap: 9px; font-size: 12px; }
.brand-fields > button { align-self: flex-start; }
.colour-row { display: flex; gap: 12px; }
.colour-row label { flex: 1; }
dialog .colour-row input[type="color"] { height: 34px; padding: 2px; cursor: pointer; }
dialog .check-row { display: flex; gap: 7px; align-items: center; }
dialog .check-row input { width: auto; margin: 0; }
.form-hint { font-size: 11px; color: #8a5013; min-height: 0; margin-top: 8px; }
.form-hint:empty { display: none; }
#team-brand .dialog-actions { flex-wrap: wrap; }
@media (max-width: 640px) { .brand-editor { grid-template-columns: 1fr; } }
