/* Final, token-driven presentation layer for the operator control plane. */
/* One action-notice component for every caller of notify(). */
.toast-region { position:fixed; z-index:100; top:calc(var(--header-height) + var(--space-3)); right:var(--space-4); bottom:auto; display:grid; gap:var(--space-3); width:min(420px,calc(100vw - var(--space-8))); max-height:35dvh; overflow-y:auto; overflow-x:hidden; padding:var(--space-1); scrollbar-width:thin; pointer-events:none; }
.toast { display:grid; grid-template-columns:var(--space-8) minmax(0,1fr) var(--touch-target); align-items:center; gap:var(--space-3); padding:var(--space-3); border:1px solid var(--border); border-inline-start:3px solid var(--positive-dot); border-radius:var(--radius-card); background:var(--surface-raised); color:var(--text-primary); box-shadow:var(--shadow-popover); font:var(--weight-regular) var(--text-body)/var(--line-body) var(--font-sans); pointer-events:auto; animation:toast-in var(--dur-fast) var(--ease); }
.toast-message { min-width:0; overflow-wrap:anywhere; text-align:left; }
.toast-icon { display:grid; place-items:center; width:var(--space-8); height:var(--space-8); border-radius:var(--radius-full); background:var(--positive-bg); color:var(--positive-text); }
.toast-icon svg { display:block; width:var(--space-5); height:var(--space-5); }
.toast.error { border-inline-start-color:var(--critical-dot); }
.toast.error .toast-icon { background:var(--critical-bg); color:var(--critical-text); }
.toast-dismiss { display:grid; place-items:center; width:var(--touch-target); min-width:var(--touch-target); height:var(--touch-target); min-height:var(--touch-target); padding:0; border:1px solid transparent; border-radius:var(--radius-control); background:transparent; color:var(--text-secondary); line-height:1; box-shadow:none; cursor:pointer; }
.toast-dismiss svg { display:block; width:var(--space-4); height:var(--space-4); }
.toast-dismiss:hover, .toast-dismiss:active { background:var(--surface-sunken); color:var(--text-primary); border-color:var(--border); }
.toast-dismiss:focus-visible { outline:2px solid var(--border-focus); outline-offset:2px; }
@keyframes toast-in { from { opacity:0; transform:translateY(calc(-1 * var(--space-1))); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .toast { animation:none; } }
#live-visitors.visitor-workspace { display:grid; grid-template-columns:minmax(0,1fr); align-items:start; gap:20px; }
#live-visitors.visitor-workspace.has-detail { grid-template-columns:minmax(260px, .85fr) minmax(340px,1.15fr); }
#live-visitors .visitor-card-list { display:grid; gap:12px; min-width:0; }
#live-visitors .visitor-summary { width:100%; display:flex; flex-direction:column; gap:9px; text-align:left; background:var(--surface,var(--bg-surface)); border:1px solid var(--border,var(--brand-100)); border-radius:12px; padding:18px; color:var(--text-primary,var(--brand-800)); font:inherit; cursor:pointer; box-shadow:none; white-space:normal; height:auto; }
#live-visitors .visitor-summary:hover, #live-visitors .visitor-summary.selected { border-color:var(--border-strong); background:var(--row-selected); }
#live-visitors .visitor-activity[data-outcome="error"] { color:var(--danger-fg); }
#live-visitors .visitor-summary:focus-visible, #live-visitors .visitor-detail:focus-visible { outline:2px solid var(--accent,var(--positive-dot)); outline-offset:3px; }
#live-visitors .visitor-summary-top { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; width:100%; }
#live-visitors .visitor-person { font-size:var(--text-body); font-weight:600; overflow-wrap:anywhere; }
#live-visitors .visitor-state { display:inline-flex; padding:5px 9px; border-radius:20px; font-size:var(--text-caption); font-weight:var(--weight-strong); background:var(--status-neutral-bg); color:var(--status-neutral); }
#live-visitors .visitor-state.pending, #live-visitors .visitor-state.attention { background:var(--warn-bg); color:var(--warn-fg); }
#live-visitors .visitor-state.connected { background:var(--success-bg); color:var(--success-fg); }
#live-visitors .visitor-meta, #live-visitors .visitor-email, #live-visitors .visitor-account, #live-visitors .visitor-activity { font-size:var(--text-label); font-weight:400; color:var(--text-secondary,var(--text-secondary)); overflow-wrap:anywhere; }
#live-visitors .visitor-summary-reason { font-size:var(--text-label); line-height:1.5; font-weight:400; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
#live-visitors .visitor-open-label { font-size:var(--text-caption); font-weight:var(--weight-strong); color:var(--accent,var(--positive-dot)); }
#live-visitors .visitor-detail { min-width:0; background:var(--surface,var(--bg-surface)); border:1px solid var(--border,var(--brand-100)); border-radius:12px; overflow:hidden; }
#live-visitors .visitor-detail-header { display:flex; align-items:start; justify-content:space-between; padding:20px 20px 12px; gap:12px; }
#live-visitors .visitor-detail h3 { font:var(--weight-heading) var(--text-md)/var(--line-md) var(--font-sans); font-family:inherit; font-size:var(--text-heading); margin:3px 0 9px; }
#live-visitors .visitor-detail h4 { font-family:inherit; font-weight:600; font-size:var(--text-body); margin:0 0 10px; }
#live-visitors .visitor-detail-actions { display:flex; flex-direction:column; align-items:flex-start; padding:0 20px 18px; border-bottom:1px solid var(--border,var(--brand-100)); }
#live-visitors .visitor-detail-actions .visitor-live-offer { display:inline-flex; align-items:center; justify-content:center; align-self:flex-start; flex:none; width:auto; max-width:100%; min-width:0; height:auto; min-height:38px; padding:9px 16px; border-radius:8px; font-family:inherit; font-size:var(--text-label); font-weight:var(--weight-strong); line-height:20px; letter-spacing:normal; text-transform:none; white-space:normal; background:var(--accent,var(--positive-dot)); color:var(--on-accent,var(--bg-surface)); border:1px solid var(--accent,var(--positive-dot)); box-shadow:none; transform:none; animation:none; }
#live-visitors .visitor-detail-actions .visitor-live-offer:hover { background:var(--accent-hover,var(--positive-text)); }
#live-visitors .visitor-detail-actions { padding-top:8px; padding-bottom:24px; gap:14px; }
#live-visitors .visitor-detail-actions .offer-eligibility { width:100%; margin:0; padding:14px 16px; gap:8px; border:1px solid var(--border,var(--brand-100)); border-radius:10px; background:var(--surface,var(--bg-surface)); box-sizing:border-box; }
#live-visitors .visitor-detail-actions .offer-eligibility > span { line-height:1.5; }
#live-visitors .visitor-trigger-details { display:grid; gap:6px; padding-bottom:12px; margin-bottom:4px; border-bottom:1px solid var(--border,var(--brand-100)); }
#live-visitors .visitor-trigger-details .text-btn { justify-self:start; text-align:left; padding:0; white-space:normal; height:auto; font-size:var(--text-body); line-height:1.5; }
#live-visitors .visitor-trigger-details p { margin:0; font-size:var(--text-label); line-height:1.5; }
#live-visitors .visitor-chat-reason { display:grid; gap:6px; padding:10px 0; }
#live-visitors .visitor-chat-reason p { margin:0 0 6px; font-size:var(--text-label); line-height:1.6; overflow-wrap:anywhere; color:var(--text-primary,var(--brand-800)); }
#live-visitors .visitor-detail-actions .offer-eligibility > button { justify-self:start; margin-top:4px; }
#live-visitors .visitor-detail-actions .visitor-live-offer:disabled { opacity:.6; cursor:wait; }
#live-visitors .visitor-detail-actions .visitor-live-offer.unavailable:disabled { cursor:not-allowed; background:var(--surface-muted,var(--brand-50)); color:var(--text-muted); border-color:var(--border,var(--brand-100)); }
#live-visitors .visitor-offer-state { display:inline-flex; align-items:center; align-self:flex-start; width:max-content; max-width:100%; margin-top:6px; padding:4px 8px; border-radius:999px; font-size:var(--text-small); font-weight:var(--weight-strong); line-height:1.25; }
#live-visitors .visitor-offer-state.delivered { background:var(--warning-bg,#fff4d6); color:var(--warning-text,#7a4a00); }
#live-visitors .visitor-offer-state.waiting { background:var(--surface-muted,var(--brand-50)); color:var(--text-muted); }
#live-visitors .visitor-detail-header { position:static; min-height:0; height:auto; background:transparent; box-shadow:none; }
#live-visitors .visitor-detail-header > div { min-width:0; }
#live-visitors .visitor-detail-header h3 { font-family:inherit; font-size:var(--text-heading); font-weight:600; line-height:1.4; overflow-wrap:anywhere; }
#live-visitors .visitor-detail-header .visitor-email { display:block; margin-bottom:8px; }
#live-visitors .visitor-detail-header [data-close-visitor] { flex:none; width:32px; height:32px; min-height:32px; padding:0; display:inline-flex; justify-content:center; align-items:center; border-radius:8px; font-size:var(--text-title); }
#live-visitors .visitor-detail-body .crm-context { margin:12px 0 0; padding:12px; border-radius:8px; }
#live-visitors .visitor-detail-body select { max-width:100%; width:100%; font-family:inherit; font-size:var(--text-label); }
#live-visitors .visitor-detail-body { padding:20px; display:grid; gap:22px; font-size:var(--text-label); line-height:1.6; }
#live-visitors .visitor-detail-body section { min-width:0; }
#live-visitors .visitor-timeline { padding:0; list-style:none; margin:12px 0; }
#live-visitors .visitor-timeline li { display:flex; flex-direction:column; border-left:2px solid var(--border,var(--brand-100)); padding:3px 12px 12px; overflow-wrap:anywhere; }
#live-visitors .visitor-detail small { color:var(--text-secondary,var(--text-secondary)); }
#live-visitors .visitor-technical dl { display:grid; grid-template-columns:110px minmax(0,1fr); gap:8px; }
#live-visitors .visitor-technical dd { margin:0; overflow-wrap:anywhere; }
#live-visitors .visitor-technical summary { cursor:pointer; }
@media(max-width:1000px) { #live-visitors.visitor-workspace.has-detail { grid-template-columns:minmax(0,1fr); } #live-visitors.has-detail .visitor-detail { grid-row:1; } }
:root { --ink: var(--text-primary); --muted: var(--text-secondary); --line: var(--border); --paper: var(--page); --white: var(--surface); --green: var(--accent); --mint: var(--accent-soft); --nav: var(--sidebar); }
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; min-width: 0; height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--page);
  color: var(--text-primary);
  font: 400 var(--text-body)/var(--line-body) var(--font-sans);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { color: inherit; font: inherit; }
button, a, input, select, textarea, summary { transition: border-color var(--motion-fast), background-color var(--motion-fast), color var(--motion-fast), opacity var(--motion-fast); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
h1, h2, h3, h4, h5, h6,
#app h1, #app h2, #app h3, #app h4, #app h5, #app h6 {
  color: var(--text-primary);
  font-family: var(--font-sans) !important;
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.015em;
}
#app label { font-weight:var(--weight-strong); text-transform: none !important; letter-spacing: 0 !important; }
.wizard label, .drawer label, .command-dialog label { font-weight:var(--weight-strong); text-transform: none !important; letter-spacing: 0 !important; }
#app strong, #app b { font-weight: 600; }
#app button { font-weight:var(--weight-strong); }
.wizard button, .drawer button, .command-dialog button { font-weight:var(--weight-strong); }
#app input, #app select, #app textarea { font-weight: 400; }
.wizard input, .wizard select, .wizard textarea,
.drawer input, .drawer select, .drawer textarea { font-weight: 400; }
#app p, #app small { font-weight: 400; }
#app small { font-size: var(--text-caption); line-height: var(--line-caption); }
#app dt { color: var(--text-secondary); font-weight: 400; }
#app dd { font-weight:var(--weight-strong); }
#app .ticket strong,
#app .customer-row strong,
#app .history-row b,
#app .agent-card strong,
#app .connection-main h3 { font-weight: var(--weight-medium); }
#app .sb-status,
#app .connection-pill,
#app .presence-label,
#app .role-badge { font-weight: var(--weight-medium); }
h1 { font-size: var(--text-title); line-height: var(--line-title); }
h2, .settings-panel-head h3 { font-size: var(--text-lg); line-height: var(--line-lg); }
h3, h4 { font-size: var(--text-md); line-height: var(--line-md); }
p { max-width: 70ch; }
code, pre, kbd, time, .conversation-reference, .activity-entry b, .activity-entry small, .activity-history b, .activity-history small,
.audit-action, .audit-detail-panel dd, .catalog-version {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: var(--line-mono);
  font-variant-numeric: tabular-nums;
}
.muted, small, .form-status { color: var(--text-secondary); }
#app .settings-metrics b { font: 500 var(--text-title)/var(--line-title) var(--font-sans); font-variant-numeric: tabular-nums; }
#app .identity-label { display: block; color: var(--text-secondary); font: 400 11px/16px var(--font-sans); letter-spacing: 0; text-transform: none; }
#app .identity-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--text-secondary); font: 400 11px/16px var(--font-sans); overflow-wrap: anywhere; }
#app .identity-meta span { min-width: 0; }
#app .identity-meta b { font-weight:var(--weight-strong); }
#inbox-view .visitor-meta .pulse.unassigned { background: var(--warn-fg); box-shadow: none; animation: none; }
#app .last-tool-time { display: block; margin-top: 3px; color: var(--text-secondary); font: 400 var(--text-meta)/var(--line-meta) var(--font-sans); }
.eyebrow { display: none !important; }

/* Offer state is informational, not a second primary action. */
.offer-eligibility { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.offer-eligibility > span { font-size:var(--text-label); font-weight:var(--weight-strong); }
.offer-eligibility small, .offer-eligibility-note { display: block; font-size:var(--text-caption); line-height: 1.5; color: var(--text-secondary); overflow-wrap: anywhere; }
.offer-eligibility-note { margin-top: 8px; }
.live-visitor-card dd { overflow-wrap: anywhere; }

.app { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: 100dvh; overflow: hidden; background: var(--page); }
.sidebar {
  width: var(--sidebar-width);
  min-width: 0;
  height: 100dvh;
  padding: var(--space-3);
  background: var(--sidebar);
  border-right: 0;
  overflow: hidden;
}
.logo { min-height: var(--header-height); gap: var(--space-2); padding: 0 var(--space-2); font-size: var(--text-md); }
.logo .mark.small { width: var(--control-height); height: var(--control-height); border-radius: var(--radius-control); }
.tenant-card { margin: var(--space-2) 0 var(--space-4); padding: var(--space-3); border-color: var(--sidebar-hover); border-radius: var(--radius-card); background: var(--sidebar-hover); }
.tenant-card small { display: none; }
.tenant-card strong { margin: 0; font-size: var(--text-body); line-height: var(--line-body); }
.sidebar .tenant-card { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; }
.tenant-card .company-avatar { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px; background: var(--positive-bg); color: var(--positive-text); font-size:var(--text-caption); font-weight: var(--weight-heading); letter-spacing: .02em; }
.tenant-card #vendor-name { display: block; order: 1; flex: 1; align-self: center; min-width: 0; margin: 0; padding: 0; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-menu-company { display: block; margin-top: 6px; overflow-wrap: anywhere; color: var(--muted); }
.company-avatar img, .company-logo-preview img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: white; }
.company-logo-controls { display: flex; align-items: center; gap: 24px; margin: 24px 0; }
.company-logo-preview { display: grid; place-items: center; width: 88px; height: 88px; padding: 8px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 16px; background: var(--positive-bg); color: var(--positive-text); font-size:var(--text-display); font-weight: 600; flex-shrink: 0; }
.company-logo-details { min-width: 0; }
.company-logo-details > strong { display: block; font-size: var(--text-body); font-weight: 600; color: var(--ink); }
#company-logo-settings .company-logo-details > p { margin: 4px 0 14px; color: var(--muted); font-size:var(--text-label); line-height: 1.5; }
.company-logo-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.company-logo-buttons button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.company-logo-details > small, .company-logo-save-note, .company-logo-footer { font-size:var(--text-caption); line-height: 1.5; color: var(--muted); }
.company-logo-save-note { white-space: nowrap; }
.company-logo-footer { border-top: 1px solid var(--border); padding-top: 14px; }
#company-logo-status:empty { display: none; }
#company-logo-status { margin: 8px 0 0; font-size:var(--text-label); }
@media (max-width: 520px) { .company-logo-controls { align-items: flex-start; gap: 16px; } .company-logo-preview { width: 64px; height: 64px; font-size:var(--text-title); } .company-logo-save-note { display: none; } }
.sidebar nav { min-height: 0; gap: var(--space-1); overflow-y: auto; scrollbar-width: none; }
.sidebar nav::-webkit-scrollbar { display: none; }
.nav-section {
  height: var(--space-4);
  margin: var(--space-2) var(--space-2) 0;
  padding: 0;
  overflow: hidden;
  border-top: 1px solid var(--sidebar-hover);
  color: transparent;
  font-size: 0;
  line-height: 0;
}
.sidebar .nav {
  width: 100%;
  min-height: var(--control-height);
  justify-content: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  color: var(--green-200);
  font-size: var(--text-body);
  font-weight:var(--weight-strong);
  line-height: var(--line-body);
}
.sidebar .nav:hover { background: var(--sidebar-hover); color: var(--on-accent); }
.sidebar .nav.active { background: var(--sidebar-selected); }
.sidebar .nav > span { width: var(--space-4); color: currentColor; font-size: var(--text-md); text-align: center; }
.sidebar .nav > .nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; }
.sidebar .nav-icon svg { display: block; width: 18px; height: 18px; }
.sidebar .nav b { min-width: var(--space-6); margin-left: auto; padding: 0 var(--space-2); border-radius: var(--radius-full); background: var(--green-100); color: var(--green-900); font-size: var(--text-meta); line-height: var(--line-body); }
.sidebar-foot { min-height: var(--header-height); padding: var(--space-2); border-radius: var(--radius-control); }
.sidebar-foot .avatar { flex: 0 0 32px; width: 32px; min-width: 32px; max-width: 32px; height: 32px; min-height: 32px; max-height: 32px; aspect-ratio: 1; border-radius: 50%; }
.sidebar-foot:hover { background: var(--sidebar-hover); }
.account-menu { bottom: calc(var(--header-height) + var(--space-2)); left: var(--space-3); width: calc(var(--sidebar-width) - var(--space-6)); border-radius: var(--radius-card); background: var(--surface-raised); box-shadow: var(--shadow-popover); color: var(--text-primary); }

.app > main { min-width: 0; height: 100dvh; overflow: hidden; background: var(--page); }
.app > main > header {
  position: relative;
  z-index: 40;
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-title h2 { margin: 0; font-size: var(--text-lg); line-height: var(--line-lg); }
.header-actions { min-width: 0; gap: var(--space-2); }
.presence-select { gap: var(--space-2); color: var(--text-secondary); font-size: var(--text-meta); white-space: nowrap; }
.presence-select select { min-width: 104px; font-size: var(--text-meta); }
.live { min-width: 0; max-width: 300px; min-height: var(--control-height); border-color: var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--text-secondary); }
.live span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

button, .secondary, .primary, .icon-btn, .global-tool, input, select, textarea {
  border-radius: var(--radius-control);
}
button { font-weight:var(--weight-strong); }
.primary, button.primary {
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}
.primary:hover, button.primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.secondary, button.secondary {
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: none;
}
.secondary:hover, button.secondary:hover { border-color: var(--accent); background: var(--row-hover); color: var(--accent-hover); }
.compact, button.compact { min-height: var(--control-height-compact); padding: var(--space-1) var(--space-3); font-size: var(--text-meta); line-height: var(--line-meta); }
.icon-btn, button.icon-btn, .global-tool {
  display: inline-grid;
  width: var(--control-height);
  min-width: var(--control-height);
  height: var(--control-height);
  min-height: var(--control-height);
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: none;
}
#global-search-open.search-tool {
  width: 164px;
  min-width: 164px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: stretch;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
}
#global-search-open.search-tool > span:nth-child(2) { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#global-search-open.search-tool kbd { display: inline-flex; width: auto; height: 22px; align-items: center; justify-content: center; padding: 0 5px; font: 400 11px/1 var(--font-sans); letter-spacing: 0; white-space: nowrap; }
.search-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-actions { flex: 1; }
.header-search-group { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin-left: 16px; }
.header-within-brand { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px; background: var(--bg-sidebar); }
.header-within-brand img { display: block; object-fit: contain; }
.header-search-group #global-search-open.search-tool { width: 100%; min-width: 0; flex: 1; grid-template-columns: auto minmax(0, 1fr); padding: 0 14px; }
.header-search-group #global-search-open.search-tool > span:nth-child(2) { display: block; }
.header-search-group #global-search-open.search-tool kbd { display: none; }
@media (max-width: 760px) { .header-search-group { margin-left: 0; gap: 6px; } .header-within-brand { width: 30px; height: 30px; flex-basis: 30px; } }
.icon-btn:hover, button.icon-btn:hover, .global-tool:hover { border-color: var(--border-strong); background: var(--row-hover); color: var(--text-primary); }
.notification-tool { border-radius: var(--radius-full); }
.notification-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
#notifications-open.notification-tool > b {
  top: -5px;
  right: -5px;
  display: grid;
  width: auto;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
  border-radius: var(--radius-full);
  background: var(--danger-fg);
  color: var(--bg-surface);
  font-size:var(--text-caption);
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
  z-index: 2;
}
#notification-panel .notification-item { min-height: 64px; height: auto; align-items: start; }
#notification-panel .notification-item > span:first-child { flex: 0 0 28px; }
#notification-panel .notification-item > span:last-child {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
}
#notification-panel .notification-item b { font-size: var(--text-body); line-height: var(--line-body); }
#notification-panel .notification-item small { margin-top: 2px; font-size: var(--text-meta); line-height: var(--line-meta); }
#my-presence {
  font-size: var(--text-meta) !important;
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--surface);
  opacity: 1;
}
#refresh-live.icon-btn, #inbox-view #refresh.icon-btn, #refresh-audit.icon-btn {
  width: var(--control-height-compact);
  min-width: var(--control-height-compact);
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  flex: 0 0 var(--control-height-compact);
  padding: 0;
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--accent);
  font-size: 0;
}
.refresh-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.refresh-button:hover { border-color: var(--accent); background: var(--row-selected); color: var(--accent-hover); }
.refresh-button:active { transform: translateY(1px); }
.refresh-button:disabled { transform: none; opacity: .52; cursor: wait; }
.icon-btn.spinning { animation: none !important; }
#inbox-view .wait-label, #inbox-view .urgent-label {
  font-family: var(--font-sans);
  font-size:var(--text-caption);
  font-weight:var(--weight-strong);
  letter-spacing: 0;
  text-transform: none;
}
.connection-details dd {
  font-family: var(--font-sans);
  font-size: var(--text-meta);
  font-weight:var(--weight-strong);
}
.connection-details dd:nth-of-type(1),
.connection-details dd:nth-of-type(2),
.connection-details dd:nth-of-type(6) {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
}
.reasoning-control label {
  color: var(--text-secondary);
  font-size: var(--text-meta);
  font-weight:var(--weight-strong);
  letter-spacing: 0;
  text-transform: none;
}
.settings-tab > span:last-child,
.settings-tab > span:last-child b { font-weight: var(--weight-medium); }
.settings-card label,
.settings-form-grid label,
.appearance-controls label { font-weight:var(--weight-strong); }
.catalog-version {
  font-family: var(--font-sans);
  font-size:var(--text-caption);
  font-weight:var(--weight-strong);
  letter-spacing: 0;
}
.system-policy-card dt,
.system-policy-card dd { font-size:var(--text-caption); }
#policies-view .nlp-builder h3 {
  font-size: var(--text-lg);
  line-height: var(--line-lg);
}
#app .recommendation-metrics b {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight:var(--weight-strong);
  line-height: var(--line-lg);
}
#app #recommendations-view strong { font-weight: var(--weight-medium); }
#app #recommendations-view h3 { font-weight: var(--weight-medium); }
.recommendation-metrics span,
.recommendation-metrics small { font-size:var(--text-caption); line-height: 16px; }
.recommendation-detail.empty h3 {
  font-size: var(--text-md);
  line-height: var(--line-md);
}
#app .customer-row b {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  line-height: var(--line-body);
}
.copy-field { font-family: var(--font-sans); }
.copy-field code, .copy-field pre { font-family: var(--font-mono); }
.text-btn, .copy-field button, .install-details summary, .diagnostics summary, .sdk-update a { font-weight: var(--weight-medium); }
.form-status { font-weight:var(--weight-strong); }
.danger-outline { border-color: var(--danger-dot) !important; background: var(--surface) !important; color: var(--danger-fg) !important; }
.danger, button.danger { color: var(--danger-fg); }
input, select, textarea {
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:hover, select:hover, textarea:hover { border-color: var(--text-muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus); }

.view { min-width: 0; min-height: 0; height: calc(100dvh - var(--header-height)); padding: var(--space-4) var(--space-6) var(--space-6); overflow: auto; background: var(--page); }
.section-head, .policy-head, .recommendation-head { min-height: var(--header-height); align-items: center; gap: var(--space-4); margin: 0 0 var(--space-4); }
.section-head h3, .policy-head h3, .recommendation-head h3 { margin: 0; font-size: var(--text-lg); line-height: var(--line-lg); }
.section-head p, .policy-head p, .recommendation-head p { margin: var(--space-1) 0 0; color: var(--text-secondary); font-size: var(--text-body); line-height: var(--line-body); }
.workspace, .customer-workspace, .recommendation-workspace, .agent-card, .connection-card, .integration-grid article,
.settings-card, .service-settings-card, .onboarding-card, .readiness-card, .team-metrics article, .recommendation-metrics article,
.reasoning-control, .system-policy-panel, .policy-form, .policy-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: none;
}

body[data-view="inbox"] #inbox-view { padding-top: var(--space-2); }
.inbox-toolbar { min-height: 52px; height: 52px; margin: 0 0 var(--space-2); align-items: center; gap: var(--space-3); }
.queue-tabs { min-width: 0; padding: var(--space-1); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.queue-tab { min-height: var(--control-height); padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); color: var(--text-secondary); font-size: var(--text-body); }
.queue-tab:hover { background: var(--row-hover); color: var(--text-primary); }
.queue-tab.active { background: var(--row-selected); color: var(--text-primary); }
.queue-tab b { font-size: var(--text-meta); }
.inbox-tools { gap: var(--space-2); }
.inbox-toolbar + .workspace { height: calc(100dvh - var(--header-height) - 76px); min-height: 0; }
.visitor-workspace { grid-template-columns: minmax(272px, 31%) minmax(0, 1fr); overflow: hidden; }
.ticket-list { min-width: 0; border-right: 1px solid var(--border); }
.list-head { min-height: 58px; height: auto; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.list-head strong { font-size: var(--text-md); line-height: var(--line-md); }
.list-head small { color: var(--text-secondary); font-size: var(--text-meta); line-height: var(--line-meta); }
.inbox-search { min-height: var(--control-height-compact); margin-top: var(--space-2); font-size: var(--text-meta); }
#tickets { min-height: 0; overflow-y: auto; }
.ticket { position: relative; min-height: 104px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); border-left: 2px solid transparent; background: var(--surface); color: var(--text-primary); }
.ticket:hover { background: var(--row-hover); }
.ticket.active { border-left-color: var(--accent); background: var(--row-selected); }
.ticket-top strong { min-width: 0; font-size: var(--text-md); line-height: var(--line-md); }
.ticket-issue { margin: var(--space-1) 0 var(--space-2); color: var(--text-secondary); font-size: var(--text-body); line-height: var(--line-body); }
.visitor-meta { color: var(--text-secondary); font-size: var(--text-meta); line-height: var(--line-meta); }
.wait-label.warning { color: var(--warn-fg); }
.wait-label.overdue { color: var(--danger-fg); }
.unread-dot { background: var(--info-dot); box-shadow: none; }
.sb-status { min-height: var(--space-6); padding: var(--space-1) var(--space-2); border-radius: var(--radius-full); font-size: var(--text-meta); line-height: var(--line-meta); }
.sb-status::before { width: 6px; height: 6px; }

.detail { min-width: 0; min-height: 0; overflow: hidden; background: var(--surface); }
.visitor-head { min-height: 72px; padding: var(--space-3) var(--space-4); align-items: center; border-bottom: 1px solid var(--border); }
.conversation-identity { min-width: 0; gap: var(--space-3); }
.conversation-avatar, .message-avatar, .agent-photo, .avatar { border-radius: var(--radius-full); }
.visitor-summary h3 { margin: 0; font-size: var(--text-md); line-height: var(--line-md); }
.conversation-reference { color: var(--text-secondary); }
.conversation-actions { min-width: 0; align-items: flex-end; gap: var(--space-2); }
#inbox-view .assignment-control, #inbox-view .status-control { min-width: 0; gap: 6px; color: var(--text-secondary); font: 500 var(--text-meta)/var(--line-meta) var(--font-sans); text-transform: none; letter-spacing: 0; }
#inbox-view .assignment-control > span, #inbox-view .status-control > span { white-space: nowrap; }
#inbox-view .assignment-control select, #inbox-view .status-control select { min-width: 0; height: var(--control-height); padding: 0 28px 0 10px; border-radius: var(--radius-control); font: 400 var(--text-body)/var(--line-body) var(--font-sans); }
#inbox-view .conversation-actions > button { min-height: var(--control-height); }
.status-control small { display: none; }
.visitor-body { grid-template-columns: minmax(0, 1fr) 320px; }
.conversation { min-width: 0; border-right: 0; }
.conversation-label { height: 44px; padding: 0 var(--space-4); border-bottom: 1px solid var(--border); font-size: var(--text-meta); }
.chat { padding: var(--space-4); background: var(--surface-sunken); scroll-padding-bottom: var(--space-4); }
.message { max-width: 78%; margin: 0 0 var(--space-4); gap: var(--space-2); }
.message.agent { margin-left: auto; flex-direction: row-reverse; }
.message-content { min-width: 0; }
.message-author { color: var(--text-secondary); font-size: var(--text-meta); line-height: var(--line-meta); }
.message.agent .message-author, .message.agent .message-content > small { text-align: right; }
.message-stack { gap: var(--space-1); }
.bubble { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); color: var(--text-primary); font-size: var(--text-body); line-height: var(--line-body); box-shadow: none; }
.message.agent .bubble { border-color: var(--green-700); background: var(--green-700); color: var(--on-accent); }
.message.note .bubble { border-color: var(--warn-dot); background: var(--warn-bg); color: var(--warn-fg); }
.message.system { max-width: none; margin: var(--space-2) 0; }
.system-line { color: var(--text-muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.composer { min-height: 72px; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); background: var(--surface); }
.composer.note-mode { background: var(--warn-bg); }
.composer select { width: 126px; flex: 0 0 126px; }
.composer textarea { min-width: 0; min-height: var(--control-height); max-height: 120px; }
.composer .primary { flex: 0 0 auto; }
.visitor-360 { width: 320px; padding: 0; border-left: 1px solid var(--border); background: var(--surface); }
#ticket-detail .visitor-360 { border-left:1px solid var(--border-strong); background:var(--surface,var(--bg-surface)); box-shadow:none; }
.customer-panel-head { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.customer-context-list { padding: 0 var(--space-4); }
.customer-context-list dt { margin-top: var(--space-3); color: var(--text-secondary); font-size: var(--text-meta); line-height: var(--line-meta); text-transform: none; letter-spacing: 0; }
.customer-context-list dd { margin: var(--space-1) 0 var(--space-3); overflow-wrap: anywhere; color: var(--text-primary); }
.activity-panel { margin: var(--space-4); border-top: 1px solid var(--border); }
#inbox-view .activity-panel-head { align-items: center; flex-wrap: wrap; padding: var(--space-3) 0; }
#inbox-view .activity-panel-head > div:first-child span { color: var(--text-secondary); font: 400 var(--text-meta)/var(--line-meta) var(--font-sans); letter-spacing: 0; text-transform: none; }
.activity-filters { padding: var(--space-1); border-radius: var(--radius-control); background: var(--surface-sunken); }
#inbox-view .activity-filters button { min-height: 28px; padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-secondary); font: 500 var(--text-meta)/var(--line-meta) var(--font-sans); }
.activity-filters button.active { background: var(--surface); color: var(--text-primary); }
.activity-entry { grid-template-columns: var(--space-3) minmax(0, 1fr); gap: var(--space-2); padding: var(--space-2) 0; }
.activity-entry > i { width: var(--space-2); height: var(--space-2); margin-top: 6px; border-radius: var(--radius-full); background: var(--text-muted); }
.activity-entry.success > i { background: var(--success-dot); }
.activity-entry.warning > i { background: var(--warn-dot); }
.activity-entry.danger > i { background: var(--danger-dot); }
.activity-entry b { display: block; overflow-wrap: anywhere; color: var(--text-primary); font-weight:var(--weight-strong); }
.activity-entry small { display: block; color: var(--text-secondary); }
.activity-entry p { margin: var(--space-1) 0 0; color: var(--danger-fg); font-size: var(--text-meta); line-height: var(--line-meta); }
.activity-details summary { color: var(--accent); cursor: pointer; font-size: var(--text-meta); }
.activity-details pre { max-height: 160px; margin: var(--space-2) 0 0; padding: var(--space-2); overflow: auto; border-radius: var(--radius-control); background: var(--surface-sunken); color: var(--text-secondary); white-space: pre-wrap; }
.conversation-marker { margin: var(--space-2) 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--text-meta); }
.conversation-marker span { position: relative; top: -9px; padding-right: var(--space-2); background: var(--surface); }
.tool-summary { margin: 0 auto var(--space-4); max-width: 560px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--text-secondary); }
.tool-summary summary { padding: var(--space-2) var(--space-3); cursor: pointer; font-family: var(--font-sans); font-size:var(--text-label); }
.chat-reason { max-width: 560px; margin: 0 auto var(--space-4); padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); font-family: var(--font-sans); overflow-wrap: anywhere; }
.chat-reason strong { font-size:var(--text-label); font-weight: 600; }
.support-context { max-width: 560px; margin: 0 auto 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); font-family: var(--font-sans); overflow-wrap: anywhere; }
.support-context-label { display: block; color: var(--text-secondary); font-size:var(--text-caption); margin-bottom: 5px; }
.support-context > strong { display: block; font-size:var(--text-body); font-weight: 600; line-height: 1.5; }
.support-context p { margin: 6px 0; font-size:var(--text-label); line-height: 1.5; }
.support-context > small { display: block; color: var(--text-secondary); font-size:var(--text-caption); }
.support-context > details { margin-top: 8px; }
.support-context summary { font-family: var(--font-sans); font-size:var(--text-caption); cursor: pointer; color: var(--accent); }
.support-context pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.chat-reason p { margin: 6px 0; font-size:var(--text-body); line-height: 1.5; }
.chat-reason small { color: var(--text-secondary); font-size:var(--text-caption); }
.tool-summary .activity-entry p { font-family: var(--font-sans); font-size:var(--text-label); line-height: 1.5; overflow-wrap: anywhere; }
.tool-summary .activity-details pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.tool-summary div { padding: 0 var(--space-3) var(--space-3); }

.notification-wrap, .saved-view-wrap { position: relative; }
.notification-panel, .saved-views-panel, .account-menu, .conversation-menu {
  z-index: 70;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-popover);
}
.notification-panel {
  top: calc(100% + var(--space-2));
  right: auto;
  left: 0;
  width: min(360px, calc(100vw - var(--sidebar-width) - var(--space-8)));
  min-width: 272px;
  max-height: min(520px, calc(100dvh - var(--header-height) - var(--space-4)));
  overflow-y: auto;
}
.popover-head { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.popover-head small { color: var(--text-secondary); font-size: var(--text-meta); line-height: var(--line-meta); }
.notification-item { gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text-primary); }
.notification-item:hover { background: var(--row-hover); }
.notification-item > span { border-radius: var(--radius-control); background: var(--warn-bg); color: var(--warn-fg); }
.notification-item small { color: var(--text-secondary); font-size: var(--text-meta); line-height: var(--line-meta); }
.notification-tool > b { border-color: var(--surface); border-radius: var(--radius-full); background: var(--danger-dot); color: var(--on-accent); font-size: var(--text-meta); }
.saved-views-panel { width: 320px; }

.customer-workspace { grid-template-columns: minmax(280px, 32%) minmax(0, 1fr); }
.customer-row { min-height: 72px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); border-left: 2px solid transparent; background: var(--surface); }
.customer-row:hover { background: var(--row-hover); }
.customer-row.active { border-left-color: var(--accent); background: var(--row-selected); }
.customer-row b { font-size: var(--text-md); line-height: var(--line-md); }
.customer-row small, .customer-profile-meta, .history-row small { color: var(--text-secondary); font-size: var(--text-meta); line-height: var(--line-meta); }
.customer-detail { padding: var(--space-4); }
.customer-profile-head { padding-bottom: var(--space-3); }
.customer-profile-meta { gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4); padding: var(--space-2) 0; }
.customer-history-grid { gap: var(--space-3); }
.history-card { border-color: var(--border); border-radius: var(--radius-card); background: var(--surface); }
.history-card > h4, .history-row { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); background: var(--surface); }

.agent-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.agent-card, .connection-card, .integration-grid article { padding: var(--space-4); }
.agent-card h3, .connection-card h3, .integration-grid h3 { margin: 0; font-size: var(--text-md); }
.agent-card p, .connection-card p, .integration-grid p { color: var(--text-secondary); font-size: var(--text-meta); }
.connection-card { align-items: start; gap: var(--space-4); }
.connection-actions { align-items: center; gap: var(--space-2); }
.connection-details { grid-template-columns: 124px minmax(0, 1fr); gap: var(--space-2) var(--space-3); }
.connection-details dt { color: var(--text-secondary); font-size: var(--text-meta); }
.sdk-update { border-color: var(--warn-dot); background: var(--warn-bg); color: var(--warn-fg); }

.settings-shell { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.settings-rail { background: var(--surface-sunken); border-right: 1px solid var(--border); }
.settings-tab { min-height: var(--header-height); border-radius: var(--radius-control); color: var(--text-secondary); }
.settings-tab:hover { background: var(--row-hover); }
.settings-tab.active { background: var(--row-selected); color: var(--text-primary); }
.settings-tab small, .settings-identity small { color: var(--text-secondary); }
.settings-help { background: var(--surface-sunken); color: var(--text-secondary); border-color: var(--border); }
.settings-person { border-color: var(--border); }
.role-badge { background: var(--success-bg); color: var(--success-fg); }
.settings-form-grid input[readonly], .settings-form-grid input:disabled { background: var(--surface-sunken); color: var(--text-secondary); }
.live, .live span { color: var(--text-primary); }
.sidebar .nav.active { color: var(--green-100); }
.settings-content { padding: var(--space-6); }
.settings-panel-head { margin-bottom: var(--space-4); }
.settings-card, .service-settings-card { padding: var(--space-4); }
.settings-card-head, .settings-actions { gap: var(--space-4); }
.appearance-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }

.command-backdrop, .wizard-backdrop, .drawer-backdrop { background: var(--overlay); }
.command-dialog, .wizard, .drawer { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface-raised); box-shadow: var(--shadow-popover); }
/* Portaled dialogs live outside #app: keep their typography on the same scale. */
.wizard, .drawer, .command-dialog { color: var(--text-primary); font: 400 var(--text-body)/var(--line-body) var(--font-sans); }
.wizard .form-title { align-items: flex-start; gap: 16px; }
.wizard .form-title > div { min-width: 0; }
.wizard .form-title h3, .drawer h3, .command-dialog h3 { margin: 0; font: 600 var(--text-lg)/var(--line-lg) var(--font-sans); letter-spacing: -.015em; overflow-wrap: anywhere; }
#app .form-title h3 { font: 600 var(--text-lg)/var(--line-lg) var(--font-sans); }
#policies-view #policy-editor-status { margin: 6px 0 0; font: 400 var(--text-sm)/1.5 var(--font-sans); color: var(--text-muted); }
#policies-view .policy-history { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
#policies-view .policy-history > summary { display: flex; justify-content: space-between; gap: 16px; cursor: pointer; color: var(--text); }
#policies-view .policy-history > summary span { color: var(--text-muted); font-size: var(--text-sm); }
#policies-view #policy-history-list { display: grid; gap: 8px; margin-top: 12px; }
#policies-view #policy-history-list article { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-sunken); }
#policies-view #policy-history-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#policies-view #policy-history-list p, #policies-view #policy-history-list small { margin: 5px 0 0; color: var(--text-muted); }
#policies-view.policy-flow-active > .policy-layout > .nlp-builder,
#policies-view.policy-flow-active > .policy-layout > .policy-head,
#policies-view.policy-flow-active > .policy-layout > .policy-list,
#policies-view.policy-flow-active > .policy-defaults-details,
#policies-view.policy-flow-active > .policy-team-link { display: none !important; }
#policies-view .policy-flow-steps { display: flex; gap: 0; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: policy-step; }
#policies-view .policy-flow-steps li { display: flex; align-items: center; color: var(--text-muted); font-size: var(--text-sm); }
#policies-view .policy-flow-steps li::before { counter-increment: policy-step; content: counter(policy-step); display: grid; place-items: center; width: 24px; height: 24px; margin-right: 7px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); font-size:var(--text-caption); }
#policies-view .policy-flow-steps li:not(:last-child)::after { content: ''; width: 30px; height: 1px; margin: 0 10px; background: var(--border); }
#policies-view .policy-flow-steps li.current { color: var(--text); font-weight: 600; }
#policies-view .policy-flow-steps li.current::before { color: var(--bg-surface); border-color: var(--accent); background: var(--accent); }
#policies-view .policy-flow-steps li.complete::before { content: '✓'; color: var(--accent); border-color: var(--accent); }
#policies-view .policy-list-publish { grid-column: 1 / -1; justify-self: end; margin-top: 4px; }
.policy-form label { margin: 12px 0; }
#policies-view { max-width: 1140px; margin-inline: auto; width: 100%; box-sizing: border-box; }
#policies-view .policy-layout > .nlp-builder { margin: var(--space-3) 0 24px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); }
#policies-view .policy-layout > .nlp-builder h3 { font: 500 22px/1.35 var(--font-sans); margin: 5px 0 10px; }
#policies-view .policy-layout > .nlp-builder p { line-height: 1.6; }
#policies-view > .policy-form { margin: 0 0 28px; padding: 24px; }
#policies-view .policy-layout { display: block; }
#policies-view .policy-head { margin: 0 0 14px; gap: 16px; }
#policies-view .policy-head h3 { font: 500 18px/1.4 var(--font-sans); }
#policies-view .policy-head p { color: var(--text-secondary); font-size:var(--text-label); line-height: 1.5; }
.business-intent-routing { margin: 0 0 24px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.business-intent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.business-intent-head .eyebrow { margin: 0 0 4px; color: var(--action-brand); font: 600 11px/16px var(--font-sans); letter-spacing: .12em; }
.business-intent-head h3 { margin: 0 0 4px; font: 600 var(--text-heading)/var(--line-heading) var(--font-sans); }
.business-intent-head p { max-width: 720px; margin: 0; color: var(--text-secondary); line-height: 1.5; }
.business-intent-summary { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 5px 9px; border-radius: var(--radius-full); background: var(--positive-bg); color: var(--positive-text); font: 600 var(--text-caption)/var(--line-caption) var(--font-sans); }
.business-intent-summary i { width: 6px; height: 6px; border-radius: 50%; background: var(--positive-dot); }
.business-intent-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); }
.business-intent-note > span { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text-primary); font: 600 11px/1 var(--font-sans); }
.business-intent-note p { margin: 0; font: 400 var(--text-caption)/var(--line-caption) var(--font-sans); }
.business-intent-list { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 20px; }
.business-intent-group { min-width: 0; }
.business-intent-group h4 { margin: 0; padding: 0 0 8px; border-bottom: 1px solid var(--border); color: var(--text-secondary); font: 600 var(--text-caption)/var(--line-caption) var(--font-sans); text-transform: uppercase; letter-spacing: .08em; }
.business-intent-columns, .business-intent-row { display: grid; grid-template-columns: minmax(280px, 1fr) repeat(4, 104px); align-items: center; gap: 12px; }
.business-intent-routing.monitoring-paused .business-intent-columns, .business-intent-routing.monitoring-paused .business-intent-row { grid-template-columns: minmax(280px, 1fr) repeat(3, 104px); }
.business-intent-columns { padding: 8px 0; border-bottom: 1px solid var(--border-strong); color: var(--text-secondary); font: 600 10px/14px var(--font-sans); letter-spacing: .05em; text-transform: uppercase; }
.business-intent-columns span:not(:first-child) { text-align: center; }
.business-intent-row { min-width: 0; min-height: 76px; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--border); }
.business-intent-row > span { display: grid; min-width: 0; gap: 2px; }
.business-intent-row b { font: 600 var(--text-label)/var(--line-label) var(--font-sans); }
.routing-origin { display: inline-flex; margin-left: 8px; padding: 2px 7px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--bg-subtle); color: var(--text-secondary); font: 600 10px/14px var(--font-sans); font-style: normal; vertical-align: middle; }
.routing-rule-name { color: var(--action-brand) !important; }
.routing-owner-note { margin: 12px 0 0; color: var(--text-secondary); font-size: var(--text-caption); }
.business-intent-row small { max-width: 430px; color: var(--text-secondary); font: 400 var(--text-caption)/var(--line-caption) var(--font-sans); }
.business-intent-action { display: grid; justify-items: center; gap: 4px; margin: 0; color: var(--text-secondary); font: 500 10px/14px var(--font-sans); cursor: pointer; }
.business-intent-action > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#app .business-intent-row input, #app .revenue-action input { appearance: none; position: relative; flex: 0 0 36px; width: 36px; min-width: 36px; max-width: 36px; height: 20px; min-height: 20px; max-height: 20px; padding: 0; border: 1px solid var(--border-control); border-radius: var(--radius-full); background: var(--n-200); cursor: pointer; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.business-intent-row input::after, .revenue-action input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(28,28,25,.18); transition: left var(--dur-fast) var(--ease); }
#app .business-intent-row input:checked, #app .revenue-action input:checked { border-color: var(--action-brand); background: var(--action-brand); }
.business-intent-row input:checked { border-color: var(--action-brand); background: var(--action-brand); }
.business-intent-row input:checked::after, .revenue-action input:checked::after { left: 18px; }
.business-intent-row input:focus-visible, .revenue-action input:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.business-intent-row input:disabled, .revenue-action input:disabled { cursor: not-allowed; opacity: .6; }
.business-intent-routing.read-only .business-intent-row { opacity: .78; }
.business-intent-routing .form-status { min-height: 0; margin: 12px 0 0; color: var(--positive-text); font-size: var(--text-caption); }
.business-intent-routing .form-status:empty { display: none; }
.revenue-signal-actions { margin-top: 0; }
.revenue-signal-columns, .revenue-signal-row { display: grid; grid-template-columns: minmax(280px, 1fr) repeat(2, 104px); align-items: center; column-gap: 12px; }
.revenue-signal-actions.monitoring-paused .revenue-signal-columns, .revenue-signal-actions.monitoring-paused .revenue-signal-row { grid-template-columns: minmax(280px, 1fr) 104px; }
.revenue-signal-columns { margin-top: 20px; padding: 0 12px 8px; border-bottom: 1px solid var(--border-strong); color: var(--text-secondary); font: 600 11px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.revenue-signal-columns span:not(:first-child) { text-align: center; }
.revenue-signal-row { min-height: 72px; padding: 12px; border-bottom: 1px solid var(--border); }
.revenue-signal-row:hover { background: var(--bg-subtle); }
.revenue-signal-copy { display: grid; min-width: 0; gap: 3px; }
.revenue-signal-copy b { font: 600 var(--text-label)/var(--line-label) var(--font-sans); }
.revenue-signal-copy small { max-width: 600px; color: var(--text-secondary); font: 400 var(--text-caption)/var(--line-caption) var(--font-sans); }
.revenue-action { display: grid; justify-items: center; gap: 4px; margin: 0; cursor: pointer; }
.revenue-action > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.revenue-signal-actions.read-only .revenue-action { cursor: default; }
.policy-defaults-details { margin-top: 24px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); }
.policy-defaults-details > summary { padding: 16px 18px; cursor: pointer; font: 14px/1.5 var(--font-sans); }
.policy-defaults-details > summary strong { font-weight:var(--weight-strong); }
.policy-defaults-details > summary span { margin-left: 12px; color: var(--text-secondary); font-size:var(--text-caption); }
.policy-defaults-details .system-policy-panel { border: 0; margin: 0; background: transparent; }
.policy-team-link { margin-top: 14px; }
.team-availability-details { margin-top: 24px; }
.team-availability-details > summary { font: 14px/1.5 var(--font-sans); cursor: pointer; padding: 12px 0; }
@media(max-width:650px) { #policies-view .policy-layout > .nlp-builder, #policies-view > .policy-form { padding: 16px; } .policy-defaults-details > summary span { display: block; margin-left: 16px; } .business-intent-routing { padding: 16px; } .business-intent-head { flex-direction: column; gap: 12px; } .business-intent-list { grid-template-columns: 1fr; gap: 20px; } .business-intent-columns { display: none; } .business-intent-row { grid-template-columns: 1fr 1fr; gap: 12px 8px; padding: 14px 0; } .business-intent-row > span:first-child { grid-column: 1 / -1; } .business-intent-action > span { position: static; width: auto; height: auto; clip: auto; white-space: normal; } .revenue-signal-columns { display: none; } .revenue-signal-list { display: grid; gap: 12px; margin-top: 18px; } .revenue-signal-row { grid-template-columns: repeat(2, 1fr); gap: 14px 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); } .revenue-signal-copy { grid-column: 1 / -1; } .revenue-action > span { position: static; width: auto; height: auto; clip: auto; color: var(--text-secondary); font: 500 11px/16px var(--font-sans); white-space: normal; } }
@media(max-width:650px) { .business-intent-routing.monitoring-paused .business-intent-row { grid-template-columns: 1fr 1fr; } .revenue-signal-actions.monitoring-paused .revenue-signal-row { grid-template-columns: repeat(2, 1fr); } }
.wizard .form-title .icon-btn { flex: 0 0 var(--control-height); }
.wizard label, .drawer label { min-width: 0; gap: 6px; margin: 16px 0; font-size:var(--text-label); line-height: 20px; }
.wizard input:not([type="checkbox"]):not([type="radio"]), .wizard select, .wizard textarea { width: 100%; min-width: 0; padding: 9px 12px; border-color: var(--border-strong); border-radius: var(--radius-control); font-family: var(--font-sans); font-size:var(--text-body); line-height: 20px; }
.wizard textarea { resize: vertical; }
.wizard-panel > label { margin: 0; }
.wizard p, .wizard small { color: var(--text-secondary); font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.wizard .error { color: var(--danger-fg); }
.wizard .error:empty { display: none; }
.wizard small { font-size:var(--text-caption); }
.wizard strong, .wizard b, .drawer strong, .drawer b { font-weight: 600; }
.wizard-backdrop { padding: 24px; }
.wizard { max-width: calc(100vw - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; padding: 24px; }
.manual-offer-dialog { width: 600px; }
.offer-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; margin: 20px 0; }
.offer-fields label { margin: 0; }
.offer-fields .full { grid-column: 1 / -1; }
.offer-ai-fields { margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-sunken); }
.offer-ai-fields legend { padding: 0 6px; font: 600 var(--text-label)/var(--line-label) var(--font-sans); }
.offer-ai-fields label + label { margin-top: 12px; }
.offer-ai-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.offer-ai-actions small { color: var(--text-secondary); line-height: 18px; }
.offer-preview { padding: 16px; border: 1px solid var(--green-200); border-radius: var(--radius-control); background: var(--accent-soft); }
.offer-preview h4 { margin: 0 0 8px; font: 500 14px/20px var(--font-sans); }
.offer-preview p { margin: 8px 0 0; font-size:var(--text-caption); line-height: 18px; }
.offer-preview [data-reason-preview] { color: var(--text-primary); font-size:var(--text-label); }
.offer-preview-label { display: block; margin-bottom: 8px; font: 500 12px/18px var(--font-sans); color: var(--text-secondary); }
.manual-offer-dialog .dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); background: var(--surface-raised); }
.manual-offer-dialog .dialog-actions button { width: auto; min-width: 96px; }
.manual-offer-dialog .wizard-lead { margin: 8px 0 0; }
.drawer-backdrop { z-index: 60; }
.drawer { z-index: 61; max-width: 100vw; border-radius: var(--radius-card) 0 0 var(--radius-card); }
.drawer .form-title { align-items: flex-start; gap: 12px; }
.drawer .form-title .icon-btn { flex: 0 0 var(--control-height); }
@media (max-width: 600px) {
  .wizard-backdrop { padding: 12px; }
  .wizard { padding: 20px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .offer-fields { grid-template-columns: minmax(0, 1fr); }
  .manual-offer-dialog .dialog-actions button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { } }
.command-group-label { color: var(--text-secondary); font-size: var(--text-meta); text-transform: none; letter-spacing: 0; }
.command-dialog b, .command-dialog strong { font-weight:var(--weight-strong); }
.command-result { border-radius: var(--radius-control); background: var(--surface); }
.command-result:hover, .command-result.active { background: var(--row-selected); }
.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); padding: var(--space-4); }
.shortcut-grid div { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-control); }
.shortcut-grid kbd { padding: var(--space-1) var(--space-2); border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface-sunken); }

.app[data-density="compact"] .ticket { min-height: 76px; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.app[data-density="compact"] .ticket-issue { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app[data-density="compact"] .agent-card,
.app[data-density="compact"] .connection-card,
.app[data-density="compact"] .integration-grid article,
.app[data-density="compact"] .settings-card { padding: var(--space-3); }
.app[data-density="compact"] .customer-row,
.app[data-density="compact"] .notification-item,
.app[data-density="compact"] .history-row { padding-top: var(--space-2); padding-bottom: var(--space-2); }

@media (max-width: 1100px) {
  :root { --sidebar-width: 208px; }
  .view { padding-right: var(--space-4); padding-left: var(--space-4); }
  #global-search-open.search-tool > span:nth-child(2), #global-search-open.search-tool kbd { display: none; }
  #global-search-open.search-tool { width: var(--control-height); min-width: var(--control-height); grid-template-columns: 1fr; padding: 0; text-align: center; }
  .presence-select { font-size: 0; }
  .visitor-workspace.has-selection .ticket-list { display: none; }
  .visitor-workspace.has-selection { grid-template-columns: minmax(0, 1fr); }
  .visitor-body { grid-template-columns: minmax(0, 1fr); }
  .visitor-360 { position: absolute; z-index: 35; inset: 0 0 0 auto; width: min(360px, 88%); height: 100%; box-shadow: var(--shadow-popover); }
  .detail:not(.context-open) .visitor-360 { display: none; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: 0px; --header-height: 56px; }
  .app { display: block; }
  .sidebar { position: fixed; z-index: 100; width: min(288px, 86vw); transform: translateX(-100%); transition: transform var(--motion-fast); visibility: hidden; box-shadow: none; }
  .sidebar.mobile-open { transform: translateX(0); visibility: visible; box-shadow: var(--shadow-popover); }
  .mobile-menu-button { display: inline-grid; }
  .app > main > header { padding: 0 var(--space-3); }
  .header-title { flex: 0 0 auto; }
  .header-title h2 { display: none; }
  .header-actions { gap: var(--space-1); }
  .presence-select { display: none; }
  .live { max-width: 148px; }
  .view { padding: var(--space-3); }
  .notification-panel { position: fixed; top: calc(var(--header-height) + var(--space-2)); right: var(--space-3); left: var(--space-3); width: auto; min-width: 0; }
  .inbox-toolbar { height: auto; min-height: 48px; flex-wrap: wrap; }
  .queue-tabs { order: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; flex: 0 0 100%; overflow: visible; }
  .queue-tab { min-width: 0; padding: var(--space-2) var(--space-1); white-space: nowrap; }
  .inbox-tools { margin-left: auto; }
  .inbox-toolbar + .workspace { height: calc(100dvh - var(--header-height) - 112px); }
  .visitor-workspace { grid-template-columns: minmax(0, 1fr); }
  .visitor-workspace:not(.has-selection) .detail { display: none; }
  .visitor-workspace.has-selection .ticket-list { display: none; }
  .visitor-head { align-items: flex-start; flex-direction: column; }
  .conversation-actions { width: 100%; flex-wrap: wrap; }
  .assignment-control, .status-control { flex: 1 1 132px; }
  .assignment-control select, .status-control select { width: 100%; }
  .message { max-width: 92%; }
  .composer { flex-wrap: wrap; }
  .composer select { width: 112px; flex-basis: 112px; }
  .composer textarea { flex: 1 1 calc(100% - 120px); }
  .customer-workspace, .recommendation-workspace { grid-template-columns: 1fr; }
  .customer-list-panel, .recommendation-list-panel { border-right: 0; }
  .customer-detail:not(.empty), .recommendation-detail:not(.empty) { position: absolute; inset: 0; z-index: 20; }
  .section-head, .policy-head, .recommendation-head { align-items: flex-start; flex-direction: column; }
  .connection-card { grid-template-columns: auto minmax(0, 1fr); }
  .connection-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .appearance-controls, .shortcut-grid { grid-template-columns: 1fr; }
  .settings-layout { display: block; }
  .settings-rail { position: static; height: auto; padding: var(--space-3); border-right: 0; border-bottom: 1px solid var(--border); }
  .settings-rail nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); margin: 0; overflow: visible; }
  .settings-tab { width: 100%; min-width: 0; }
  .settings-tab > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .settings-content { padding: var(--space-4) var(--space-3) var(--space-8); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
.shadow-comparisons { margin: 0 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, var(--bg-surface)); }
.shadow-heading, .shadow-pair-label, .shadow-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shadow-heading { align-items: flex-start; }
.shadow-heading h4 { margin: 0 0 4px; font: 500 14px/20px var(--font-sans); }
.shadow-heading p, .shadow-empty { margin: 0; color: var(--muted); font: 400 12px/18px var(--font-sans); }
.shadow-state { flex-shrink: 0; padding: 5px 8px; border-radius: 7px; background: var(--surface-sunken); color: var(--text-secondary); font-size:var(--text-caption); }
.shadow-pair { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.shadow-pair-label { font-size:var(--text-caption); margin-bottom: 8px; }
.shadow-pair-label small, .shadow-verdict small, .shadow-pagination { color: var(--muted); font-size:var(--text-caption); }
.shadow-verdicts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shadow-verdict { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.shadow-verdict > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size:var(--text-caption); }
#app .shadow-verdict strong { font-size:var(--text-caption); font-weight:var(--weight-strong); }
.shadow-verdict p { margin: 8px 0; font-size:var(--text-caption); line-height: 18px; overflow-wrap: anywhere; }
.shadow-verdict small { display: block; margin-top: 4px; }
.shadow-pair details { margin-top: 8px; font-size:var(--text-caption); }
.shadow-pair summary { cursor: pointer; color: var(--muted); }
.shadow-pair pre { max-height: 280px; overflow: auto; padding: 12px; border-radius: 8px; background: var(--surface-sunken); font-size:var(--text-caption); white-space: pre-wrap; overflow-wrap: anywhere; }
.shadow-pagination { margin-top: 12px; justify-content: flex-end; }
.shadow-pagination > span { margin-right: auto; }
.shadow-empty { margin-top: 12px; }
@media (max-width: 760px) { .shadow-verdicts { grid-template-columns: 1fr; } .shadow-heading, .shadow-pair-label { flex-direction: column; align-items: flex-start; } }
.ai-settings-actions, .ai-settings-actions > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-settings-actions { justify-content: space-between; }
#settings-ai .settings-form-grid label { display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; }
#settings-ai input, #settings-ai select { min-width: 0; width: 100%; height: 38px; min-height: 38px; margin: 0; padding: 8px 12px; }
#settings-ai .settings-form-grid small { font-weight: 400; line-height: 1.5; }
#settings-ai .form-status { overflow-wrap: anywhere; }
@media (max-width: 600px) { .ai-settings-actions > div { width: 100%; } .ai-settings-actions button { flex: 1; } }
/* Decision-first reasoning controls; raw weights are intentionally disclosure-only. */
.reasoning-diagnostics { margin-top: 10px; color: var(--muted); font-size:var(--text-caption); }
.reasoning-diagnostics summary, #reasoning-thresholds summary { cursor: pointer; font-weight: 400; }
.reasoning-diagnostics p { overflow-wrap: anywhere; }
#reasoning-settings { flex-wrap: wrap; align-items: flex-start; }
#reasoning-thresholds { max-width: 340px; min-width: 0; font-size:var(--text-caption); color: var(--muted); }
#reasoning-thresholds p, #reasoning-stage-help { font-size:var(--text-caption); line-height: 1.5; color: var(--muted); }
#reasoning-stage-help { grid-column: 1 / -1; margin: 0; }
.reasoning-threshold-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 760px) { #reasoning-thresholds { grid-column: 1 / -1; max-width: none; } }
.reasoning-primary-decision { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-sunken); }
.reasoning-primary-decision strong { font-size:var(--text-heading); font-weight: 600; }
.reasoning-primary-decision p { margin: 6px 0; color: var(--ink); line-height: 1.5; }
.reasoning-primary-decision span { color: var(--muted); font-size:var(--text-caption); }
.reasoning-tuning { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.reasoning-tuning > summary { cursor: pointer; font-weight:var(--weight-strong); }
.reasoning-tuning > p, .comparison-diagnostic { color: var(--muted); font-size:var(--text-caption); }
.routing-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.routing-preview legend { padding: 0 5px; font-weight:var(--weight-strong); }
.routing-preview label { display: grid; gap: 4px; color: var(--muted); font-size:var(--text-caption); }
.routing-preview input, .routing-preview select { width: 100%; }
.routing-preview output { grid-column: 1 / -1; color: var(--ink); font-size:var(--text-caption); line-height: 1.5; }
.reasoning-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reasoning-feedback > span { flex-basis: 100%; font-weight:var(--weight-strong); }
.reasoning-feedback small { flex-basis: 100%; color: var(--muted); }
@media (max-width: 760px) { .routing-preview { grid-template-columns: 1fr; } .routing-preview output { grid-column: auto; } }
.logo .within-brand-mark { background: transparent; border-radius: 0; flex-shrink: 0; }
.logo .within-brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; }

#ai-guidance-form { margin-top: 16px; }
.ai-locked-rules { margin: 16px 0; font-size:var(--text-label); }
.ai-locked-rules summary { cursor: pointer; font-weight:var(--weight-strong); }
.ai-locked-rules pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; max-height: 260px; overflow-y: auto; padding: 12px; background: var(--paper); border-radius: 8px; }
#ai-guidance-form .settings-actions, #ai-guidance-form .settings-actions > div { flex-wrap: wrap; gap: 8px; }
#ai-guidance-cards { display: grid; gap: 16px; }
.ai-guidance-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ai-guidance-card.is-disabled { background: var(--surface-sunken); border-style: dashed; }
.ai-guidance-card label { min-width: 0; margin: 0 0 12px; font-size:var(--text-label); font-weight:var(--weight-strong); }
.ai-guidance-card label:last-child { margin-bottom: 0; }
.ai-guidance-card-top { display: flex; gap: 12px; align-items: center; }
.ai-guidance-card-top > label:first-child { flex: 1; }
.ai-guidance-card input:not([type="checkbox"]), .ai-guidance-card select, .ai-guidance-card textarea { width: 100%; min-width: 0; font-size:var(--text-body); font-weight: 400; background: var(--surface); color: var(--ink); }
.ai-guidance-card textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.ai-guidance-card .ai-guidance-toggle { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; white-space: nowrap; }
#app .ai-guidance-toggle input { appearance: none; position: relative; width: 32px; min-width: 32px; max-width: 32px; height: 20px; min-height: 20px; max-height: 20px; padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--text-secondary); cursor: pointer; flex: 0 0 32px; }
.ai-guidance-toggle input::after { content: ''; position: absolute; width: 14px; height: 14px; top: 2px; left: 2px; border-radius: 50%; background:var(--surface); }
#app .ai-guidance-toggle input:checked { background: var(--green); border-color: var(--green); }
.ai-guidance-toggle input:checked::after { left: 14px; }
.ai-guidance-toggle input:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.ai-guidance-card-top > button { margin-top: 12px; }
.ai-guidance-scope-warning { color: var(--status-warning); font-size:var(--text-label); }
.ai-guidance-empty { padding: 16px; background: var(--surface-sunken); border-radius: 8px; }
@media (max-width: 600px) { .ai-guidance-card-top { flex-wrap: wrap; gap: 8px; } .ai-guidance-card-top > label:first-child { flex-basis: 100%; } .ai-guidance-card-top > button, .ai-guidance-card .ai-guidance-toggle { margin-top: 0; margin-bottom: 12px; } }
/* Slack setup is a readable, scrollable walkthrough, not a dense technical checklist. */
#slack-guide .slack-guide { width: min(840px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
#slack-guide .slack-guide-before { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
#slack-guide h4 { font-family: var(--font-sans); font-size:var(--text-body); font-weight:var(--weight-strong); }
#slack-guide p, #slack-guide .slack-clicks, #slack-guide dd { font-family: var(--font-sans); font-size:var(--text-label); font-weight: 400; line-height: 1.65; }
#slack-guide b { font-weight: 600; }
#slack-guide .slack-path-title { margin: 20px 0 12px; }
#slack-guide .slack-step-location { color: var(--green); margin: 6px 0 12px; }
#slack-guide .slack-clicks { display: block; list-style: decimal; padding-left: 20px; margin: 0; color: var(--ink); }
#slack-guide .slack-clicks > li { display: list-item; margin: 0 0 10px; padding: 0 0 0 4px; border: 0; background: none; }
#slack-guide .slack-step-check { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
#slack-guide .slack-troubleshooting { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
#slack-guide .slack-troubleshooting summary { cursor: pointer; font-weight:var(--weight-strong); }
#slack-guide .slack-troubleshooting dt { margin-top: 14px; font-weight:var(--weight-strong); }
#slack-guide .slack-troubleshooting dd { margin: 4px 0 0; color: var(--muted); }
#slack-guide code, #slack-guide a { overflow-wrap: anywhere; }
#slack-guide .copy-field { min-width: 0; flex-wrap: wrap; }
#slack-guide .copy-field pre { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 560px) {
  #slack-guide.wizard-backdrop { padding: 8px; }
  #slack-guide .slack-guide { max-height: calc(100dvh - 16px); padding: 16px; }
  #slack-guide .slack-install-steps > li { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  #slack-guide .slack-install-steps > li > span { display: none; }
}
/* Credential settings share the compact notification form layout. */
#slack-connection-settings:empty { display: none; }
#slack-connection-settings { margin: 16px 0; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
#slack-connection-settings fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#slack-connection-settings .notification-field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
#slack-connection-settings label { display: flex; flex-direction: column; gap: 7px; font-size:var(--text-label); font-weight:var(--weight-strong); }
#slack-connection-settings input { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text-primary); }
#slack-connection-settings input:focus-visible { outline: 2px solid var(--positive-dot); outline-offset: 2px; }
#slack-connection-settings small, #slack-connection-settings p { font-size:var(--text-caption); font-weight: 400; color: var(--text-secondary); line-height: 1.6; overflow-wrap: anywhere; }
#slack-connection-settings strong { font-weight:var(--weight-strong); color: var(--text-primary); }
#slack-connection-settings .slack-workspace span { margin-right: 8px; }
#slack-connection-settings .slack-settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
#slack-connection-settings #slack-connection-result { min-height: 1.5em; margin-bottom: 0; }
@media (max-width: 640px) {
  #slack-connection-settings { padding: 16px; }
  #slack-connection-settings .notification-field-pair { grid-template-columns: 1fr; }
  #slack-connection-settings .section-head { align-items: flex-start; flex-direction: column; }
}
.connection-technical { margin-top: 12px; font-size: var(--text-meta); color: var(--text-secondary); }
.connection-technical summary { cursor: pointer; width: fit-content; padding: 6px 0; font-weight:var(--weight-strong); }
.connection-technical .connection-details { margin-top: 8px; }
.connection-technical code, .connection-technical a { overflow-wrap: anywhere; }
.visitor-recommendation { margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-page); display: grid; gap: 6px; min-width: 0; font-size:var(--text-label); }
.visitor-recommendation > span { font-weight:var(--weight-strong); color: var(--positive-text); }
.visitor-recommendation p { margin: 0; font-weight: 400; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.visitor-recommendation small, .visitor-recommendation-scope { color: var(--text-secondary); font-size:var(--text-caption); font-weight: 400; }
.visitor-recommendation .text-btn { justify-self: start; padding: 4px 0; font-size:var(--text-label); }
.visitor-recommendation-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; }
.visitor-recommendation-dialog h3 { font-size:var(--text-heading); font-weight:var(--weight-strong); }
.visitor-recommendation-dialog p { overflow-wrap: anywhere; }
.visitor-recommendation-dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size:var(--text-caption); max-height: 300px; overflow-y: auto; }
.visitor-recommendation-dialog summary { cursor: pointer; margin-bottom: 12px; }
.visitor-ai-review { background: var(--surface); color: var(--text-primary); }
.visitor-ai-review > .visitor-review-label { color: var(--text-secondary); font-size:var(--text-caption); }
.visitor-ai-review > strong { font-size:var(--text-body); font-weight:var(--weight-strong); }
.visitor-ai-review small { color: var(--text-secondary); }

/* Sign-in is a standalone surface; never apply these rules to dashboard forms. */
#login.login-wrap { width: 100%; height: 100dvh; min-height: 0; overflow-y: auto; padding: 48px 20px; box-sizing: border-box; display: flex; align-items: safe center; justify-content: center; background: var(--page); color: var(--text-primary); font-family: var(--font-sans); }
#login.hidden, #login [hidden] { display: none !important; }
#login .login-shell { width: 100%; max-width: 440px; }
#login .login-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 24px; font-size:var(--text-body); font-weight:var(--weight-strong); }
#login .login-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--green-500, var(--positive-dot)); }
#login .login-logo img { display: block; object-fit: contain; filter: brightness(0) invert(1); }
#login #login-environment { margin-left: auto; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; font-size:var(--text-caption); font-weight: 400; color: var(--text-secondary); background: var(--surface); }
#login .login-card { width: 100%; margin: 0; box-sizing: border-box; padding: 30px; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 6px 24px var(--sidebar-border); background: var(--surface); }
#login h1 { font: 500 26px/1.25 var(--font-sans); letter-spacing: -.6px; margin: 0 0 8px; }
#login .login-intro { margin: 0 0 24px; font-size:var(--text-body); line-height: 1.5; color: var(--text-secondary); }
#login .login-methods { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; margin-bottom: 22px; background: var(--surface-sunken); border-radius: 10px; }
#login .login-methods button { font: 500 13px/20px var(--font-sans); border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-secondary); padding: 8px; min-height: 38px; cursor: pointer; }
#login .login-methods button[aria-pressed="true"] { color: var(--text-primary); background: var(--surface); border-color: var(--border); box-shadow: 0 1px 3px var(--sidebar-border); }
#login label { display: block; font: 500 13px/20px var(--font-sans); margin: 18px 0 6px; color: var(--text-primary); }
#login input { display: block; width: 100%; min-height: 44px; margin: 0; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: 9px; padding: 10px 12px; background: var(--surface); color: var(--text-primary); font: 400 14px/22px var(--font-sans); }
#login input::placeholder { color: var(--text-muted); }
#login small { display: block; margin-top: 7px; color: var(--text-secondary); font: 400 12px/18px var(--font-sans); }
#login .login-secret { position: relative; }
#login .login-secret input { padding-right: 65px; }
#login #login-reveal { position: absolute; right: 5px; top: 5px; height: 34px; width: 54px; padding: 0; border: none; border-radius: 6px; background: transparent; color: var(--text-secondary); font: 500 12px var(--font-sans); cursor: pointer; }
#login #login-reveal:hover { background: var(--surface-sunken); }
#login #login-submit { width: 100%; min-height: 44px; margin: 22px 0 0; padding: 10px 14px; border-radius: 9px; font: 500 14px/22px var(--font-sans); }
#login button:disabled { cursor: wait; opacity: .65; }
#login :is(input,button,summary,a):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#login .login-teammate { margin-top: 14px; }
#login summary { cursor: pointer; font: 400 12px/20px var(--font-sans); color: var(--text-secondary); }
#login .login-help { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
#login .login-help p { font: 400 12px/19px var(--font-sans); color: var(--text-secondary); margin: 10px 0 0; }
#login #login-error { min-height: 0; margin: 18px 0 0; padding: 11px 12px; border-radius: 8px; font: 400 13px/20px var(--font-sans); }
#login #login-error.error { color: var(--danger-fg); background: var(--danger-bg); }
#login #login-error.login-success { color: var(--text-primary); background: var(--accent-soft); }
#login #login-dev-link { margin-top: 12px; overflow-wrap: anywhere; }
#login #login-dev-open { color: var(--accent); font-size:var(--text-label); }
#login .login-footer { text-align: center; margin: 20px 12px 0; color: var(--text-secondary); font: 400 12px/18px var(--font-sans); }
.pilot-note, #pilot-invite-result p, #pilot-accept p { font: 400 13px/1.6 var(--font-sans); color: var(--text-secondary); overflow-wrap: anywhere; }
#pilot-customers .pilot-check { display: flex; align-items: flex-start; gap: 10px; font-size:var(--text-label); font-weight: 400; margin: 16px 0; }
#pilot-customers .pilot-check input { width: 16px; height: 16px; min-height: 16px; flex-shrink: 0; margin: 3px 0 0; }
#pilot-status, #pilot-copy-status { font-size:var(--text-label); overflow-wrap: anywhere; }
#pilot-invite-result { padding: 14px; background: var(--accent-soft); border-radius: 10px; margin: 16px 0; }
.pilot-customer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.pilot-customer-row strong { font-size:var(--text-body); font-weight:var(--weight-strong); }
.pilot-customer-row small { display: block; font-size:var(--text-caption); color: var(--text-secondary); overflow-wrap: anywhere; margin-top: 4px; }
#rail-toggle { align-self:flex-end; color:var(--on-accent); background:transparent; border:1px solid var(--backdrop); border-radius:8px; width:44px; height:44px; font-size:var(--text-title); cursor:pointer; }
@media(min-width:761px) {
  #app.nav-collapsed { grid-template-columns:80px minmax(0,1fr); }
  #app.nav-collapsed .sidebar { padding:16px 10px; width:80px; min-width:0; }
  .nav-collapsed .sidebar .logo > span:last-child, .nav-collapsed .tenant-card, .nav-collapsed .nav-section, .nav-collapsed .account-identity, .nav-collapsed .account-chevron { display:none; }
  .nav-collapsed .sidebar .nav { font-size:0; justify-content:center; gap:0; padding:12px; min-height:48px; position:relative; }
  .nav-collapsed .sidebar .nav b { position:absolute; right:2px; top:2px; display:grid; place-items:center; width:16px; height:16px; min-width:16px; margin:0; padding:0; border-radius:50%; font-size:var(--text-caption); line-height:1; font-variant-numeric:tabular-nums; }
  .nav-collapsed .sidebar .nav-icon { width:20px; height:20px; flex:0 0 20px; }
  .nav-collapsed #rail-toggle { align-self:center; }
  .nav-collapsed .sidebar-foot { padding:8px; justify-content:center; }
}
/* Team directory and shared compact header. */
.header-search-group { max-width:480px; }
#global-search-open { justify-content:flex-start; text-align:left; }
#global-search-open > span { flex:0 1 auto; text-align:left; }
#app .header-search-group #global-search-open.search-tool { display:flex; justify-content:flex-start; gap:12px; text-align:left; }
#app .header-search-group #global-search-open.search-tool > span { flex:0 1 auto; text-align:left; }
#app .sb-status[data-tone="neutral"] { background:var(--status-neutral-bg); color:var(--status-neutral); }
#app .sb-status[data-tone="warning"] { background:var(--warn-bg); color:var(--warn-fg); }
#settings-view .settings-person small, #settings-view .role-badge { text-transform:none; }
#overview-view .onboarding-step.complete { background:var(--surface-sunken); border-color:var(--border); color:var(--text-secondary); box-shadow:none; }
#overview-view .onboarding-step.complete b { font-weight:var(--weight-regular); }
#overview-view .onboarding-step:disabled { opacity:1; cursor:default; }
#team-view { max-width:1280px; margin-inline:auto; width:100%; }
#pending-invitations { margin-bottom:var(--space-6); border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface); }
.invitation-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:var(--space-4); padding:var(--space-4); }
.invitation-row + .invitation-row { border-top:1px solid var(--border); }
.invitation-info { display:grid; flex:1 1 240px; min-width:0; gap:var(--space-1); overflow-wrap:anywhere; }
.invitation-info > b { font:var(--weight-strong) var(--text-body)/var(--line-body) var(--font-sans); }
.invitation-email { color:var(--text-secondary); font:var(--text-body)/var(--line-body) var(--font-sans); }
.invitation-meta { display:flex; flex-wrap:wrap; gap:var(--space-1) var(--space-3); color:var(--text-secondary); font:var(--text-caption)/var(--line-caption) var(--font-sans); }
#pending-invitations .invitation-row > button.secondary { flex:none; min-height:var(--touch-target); }
#team-view > .section-head h3 { display:none; }
#team-view > .section-head { margin-bottom:8px; }
#team-view #new-agent { background:var(--text-primary); color:var(--surface); border-color:var(--text-primary); min-height:44px; border-radius:12px; padding:10px 20px; }
#team-view .team-metrics { display:flex; flex-wrap:wrap; gap:16px; margin:0 0 24px; padding:0; }
#team-view .team-metrics article { display:flex; flex-direction:row-reverse; align-items:baseline; gap:5px; padding:0; min-height:0; background:transparent; border:0; border-radius:0; box-shadow:none; }
#team-view .team-metrics article b, #team-view .team-metrics article span { font:400 14px/1.5 var(--font-sans); color:var(--text-secondary); }
.team-filters { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
.team-filters input, .team-filters select { min-height:44px; padding:10px 14px; border:1px solid var(--border); border-radius:12px; background:var(--surface); font-size:var(--text-body); }
.team-filters input { width:min(300px,100%); }
#agent-list.team-table-wrap { display:block; overflow-x:auto; width:100%; }
.team-table { width:100%; border-collapse:collapse; font-size:var(--text-body); }
.team-table th, .team-table td { text-align:left; border-bottom:1px solid var(--border); padding:16px 12px; white-space:nowrap; }
.team-table thead th { color:var(--text-secondary); font-weight:400; }
.team-table th:first-child { padding-left:0; }
.team-person { display:flex; align-items:center; gap:12px; }
.team-person .agent-photo { width:44px; height:44px; display:grid; place-items:center; background:var(--surface-sunken); color:var(--text-secondary); border-radius:50%; flex:none; }
.team-person strong { font-weight:var(--weight-strong); }
#app .team-person small { display:block; font-size:var(--text-label); color:var(--text-secondary); margin-top:4px; }
.team-row-action { min-height:44px; border:1px solid var(--border); border-radius:10px; padding:8px 12px; background:var(--surface); white-space:nowrap; }
.team-muted { color:var(--text-secondary); }
.team-empty { text-align:center!important; padding:32px!important; }
@media(max-width:1100px) {
  #agent-list.team-table-wrap { overflow:visible; }
  .team-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .team-table tbody { display:block; }
  .team-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3) var(--space-4); padding:var(--space-4) 0; border-bottom:1px solid var(--border); }
  .team-table td { display:block; border:0; padding:0; white-space:normal; overflow-wrap:anywhere; min-width:0; }
  .team-table tbody th { grid-column:1/-1; border:0; padding:0; white-space:normal; }
  .team-table td:not(:first-child)::before { content:attr(data-label); display:block; font:var(--text-meta)/var(--line-meta) var(--font-sans); color:var(--text-secondary); margin-bottom:var(--space-1); }
}
@media(max-width:768px) {
  #team-view .team-metrics { gap:var(--space-2) var(--space-4); margin-bottom:var(--space-4); }
  #team-view .team-filters { margin-bottom:var(--space-3); }
  #app #sdk-connection { min-width:44px; flex-shrink:0; }
  #app #global-search-open { min-width:44px; }
}
@media(min-width:601px) and (max-width:1100px) {
  .team-table tbody tr { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .team-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .team-filters input { grid-column:1/-1; width:100%; }
  .team-filters select { width:100%; min-width:0; }
}
@media(max-width:600px) {
  #team-view > .section-head h3 { display:block; font:var(--weight-heading) var(--text-title)/var(--line-title) var(--font-sans); margin:0 0 var(--space-2); }
}
@media(max-width:480px) {
  #app #global-search-open > span, #app #global-search-open kbd { display:none; }
  #app .header-search-group { flex:0 0 44px; width:44px; }
  #app #global-search-open { width:44px; justify-content:center; padding:0; }
}
@media(max-width:600px) {
  #inbox-view .queue-tabs { display:flex; flex-wrap:wrap; overflow:visible; width:100%; }
  #inbox-view .queue-tab { flex:0 1 auto; white-space:nowrap; }
  #inbox-view .inbox-toolbar { display:flex; flex-direction:column; align-items:stretch; gap:var(--space-2); }
  #inbox-view .inbox-tools { align-self:flex-end; }
}
.code-ref { display:inline-flex; align-items:center; gap:8px; max-width:160px; padding:6px 8px; min-height:44px; border:0; border-radius:6px; background:var(--page); }
.code-ref code { font:400 12px/1.5 var(--font-mono); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#team-view .team-availability-details { border:1px solid var(--border); border-radius:var(--radius-control); padding:0; margin-top:var(--space-6); background:var(--surface); overflow:hidden; }
#team-view .team-availability-details > summary { min-height:var(--touch-target); padding:var(--space-3) var(--space-4); font:var(--weight-medium) var(--text-body)/var(--line-body) var(--font-sans); cursor:pointer; color:var(--text-primary); }
#team-view .team-availability-details > summary:hover { background:var(--row-hover); }
#team-view .team-availability-details[open] > summary { border-bottom:1px solid var(--border); }
#team-view .availability-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,1fr); gap:var(--space-6); border:0; margin:0; padding:var(--space-4); border-radius:0; }
#team-view .availability-panel small { font:var(--weight-regular) var(--text-body)/var(--line-body) var(--font-sans); }
#team-view #representative-list { display:grid; gap:var(--space-3); min-width:0; }
#team-view .rep-control { display:grid; grid-template-columns:34px minmax(0,1fr) auto; gap:var(--space-3); }
#team-view .rep-control > span:nth-child(2) { min-width:0; }
#team-view .rep-control b { font-weight:var(--weight-medium); }
#team-view .availability-panel .eyebrow { display:none; }
@media(max-width:768px) { #team-view .availability-panel { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) { .team-filters input { width:100%; } .team-filters select { flex:1; min-width:0; } }
#sidebar #rail-toggle { margin-top:auto; margin-bottom:4px; align-self:flex-end; border:0; background:transparent; color:var(--brand-200); font-size:var(--text-heading); width:44px; height:36px; min-height:36px; opacity:.75; }
#sidebar #rail-toggle:hover, #sidebar #rail-toggle:focus-visible { opacity:1; background:var(--sidebar-border); color:var(--bg-surface); }
#app.nav-collapsed #sidebar #rail-toggle { align-self:center; }
#sidebar .account-wrap { margin-top:0; }
/* Shared operational controls preserve layout while meeting keyboard/touch sizing. */
#app select:not([multiple]):not([size]) {
  appearance:none;
  padding-right:40px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a6458' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:16px;
}
@media(forced-colors:active) {
  #app select:not([multiple]):not([size]) { appearance:auto; background-image:none; }
}
#app :where(button,input:not([type="checkbox"]):not([type="radio"]),select) { min-height:var(--touch-target); }
#app :where(.icon-btn,.global-tool) { min-width:var(--touch-target); }
#app :where(button,a,input,select,textarea,summary):focus-visible { outline:var(--focus-width) solid var(--accent); outline-offset:var(--focus-offset); }
#app .visitor-detail-actions [data-visitor-ticket] { width:100%; background:var(--text-primary); color:var(--surface); border-color:var(--text-primary); }
#app .visitor-detail-actions .offer-eligibility:has([data-visitor-ticket]) { display:flex; flex-direction:column; }
#app .visitor-detail-actions [data-visitor-ticket] { order:-1; }
#app .visitor-detail-actions .offer-eligibility:has([data-visitor-ticket]) > span:first-child { display:none; }
#app .view-load-error { padding:var(--space-3); border:1px solid var(--danger-dot); border-radius:var(--radius-control); background:var(--danger-bg); color:var(--danger-fg); }
.pilot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#pilot-accept a { display: inline-block; margin-top: 16px; font-size:var(--text-label); color: var(--accent); }
@media (max-width: 650px) { .pilot-customer-row { align-items: flex-start; flex-direction: column; } }
@media (max-width: 480px) { #login.login-wrap { padding: 24px 16px; } #login .login-card { padding: 24px 20px; } #login h1 { font-size:var(--text-display); } #login input { font-size:var(--text-heading); } #login .login-brand { gap: 8px; } }
@media (min-width: 481px) and (max-height: 800px) { #login.login-wrap { padding: 24px 20px; } #login .login-brand { margin-bottom: 16px; } #login .login-card { padding: 24px 30px; } #login .login-intro { margin-bottom: 18px; } #login .login-methods { margin-bottom: 16px; } #login .login-help { margin-top: 16px; padding-top: 14px; } #login .login-footer { margin-top: 14px; } }
.integration-disclosure { margin-block: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.integration-disclosure > summary { padding: var(--space-4); min-height: 44px; cursor: pointer; font-weight: var(--weight-medium); }
.integration-disclosure > summary:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
.integration-disclosure[open] > summary { border-bottom: 1px solid var(--border); }
#local-review-help, #reasoning-settings-note { grid-column: 1 / -1; margin: 0; }
.reasoning-control #local-review-help { font-size: var(--text-meta); line-height: var(--line-meta); color: var(--text-secondary); }
/* Long machine identifiers remain available in Details, not multi-line headers. */
.conversation-identity .identity-meta { min-width:0; }
.conversation-identity .identity-meta > span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#inbox-view .composer-error { position:static; grid-column:1/-1; width:100%; margin:0; font:var(--text-meta)/var(--line-meta) var(--font-sans); color:var(--danger-fg); overflow-wrap:anywhere; }
#inbox-view .composer-error:empty { display:none; }
@media(max-width:600px) {
  #inbox-view .conversation-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; }
  #inbox-view .conversation-actions label { display:grid; width:100%; min-width:0; gap:var(--space-1); }
  #inbox-view .assignment-control select, #inbox-view .status-control select { width:100%; min-width:0; }
}


/* Within audit remediation */
#app small,
#app :where(.visitor-meta,.message-author,.system-line,.shadow-state,.shadow-pair-label small,.shadow-verdict small,.shadow-pagination,.routing-preview label),
#login #login-environment { font-size:var(--text-caption); line-height:var(--line-caption); }
#app :where(button,input:not([type="checkbox"]):not([type="radio"]),select,summary,[role="button"]),
#login :where(button,input,summary) { min-height:var(--touch-target) !important; }
#app :where(.icon-btn,.global-tool), #login #login-reveal { min-width:var(--touch-target); min-height:var(--touch-target); height:var(--touch-target); }
#login .login-logo { width:var(--touch-target); height:var(--touch-target); border-radius:var(--radius-md); }
#login .login-methods button, #login #login-submit, #login input, #login #login-error { border-radius:var(--radius-sm); }
#login .login-card { border-radius:var(--radius-md); box-shadow:none; }
#app :where(.section-head,.policy-head,.recommendation-head) > div { min-width:0; }
#app :where(.section-head,.policy-head,.recommendation-head) h3 { min-width:0; overflow-wrap:anywhere; }
#app.nav-collapsed { grid-template-columns:var(--sidebar-width-collapsed) minmax(0,1fr); }
#app.nav-collapsed .sidebar { width:var(--sidebar-width-collapsed); padding-inline:var(--space-2); }
#sidebar #rail-toggle { width:var(--touch-target); height:var(--touch-target); min-height:var(--touch-target); margin-bottom:var(--space-1); }
#app :where(button,a,input,select,textarea,summary) { transition:opacity var(--dur-fast) var(--ease),transform var(--dur-base) var(--ease); }
.notification-test-disclosure { margin-top:var(--space-4); border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); }
.notification-test-disclosure > summary { padding:var(--space-3) var(--space-4); font-weight:var(--weight-strong); }
.notification-test-disclosure[open] > summary { border-bottom:1px solid var(--border); }
.notification-test-disclosure > :not(summary) { margin-inline:var(--space-4); }
.notification-test-disclosure .notification-test-actions { margin-block:var(--space-3) var(--space-4); }
@media(min-width:761px) and (max-width:1099px) { :root { --sidebar-width:var(--sidebar-width-collapsed); } }

/* Keep the account popover outside the clipped navigation rail. */
#sidebar:has(#account-menu:not(.hidden)) { overflow:visible; }
#app .account-menu {
  position:fixed;
  right:var(--space-4);
  bottom:var(--space-4);
  left:var(--space-4);
  width:auto;
  max-height:calc(100dvh - var(--space-8));
  overflow-y:auto;
}
@media(min-width:761px) {
  #app .account-menu {
    right:auto;
    bottom:var(--space-3);
    left:calc(var(--sidebar-width) + var(--space-3));
    width:min(280px, calc(100vw - var(--sidebar-width) - var(--space-6)));
  }
  #app.nav-collapsed .account-menu {
    left:calc(var(--sidebar-width-collapsed) + var(--space-3));
    width:min(280px, calc(100vw - var(--sidebar-width-collapsed) - var(--space-6)));
  }
}

/* Release visibility is rendered from the versioned feature inventory. */
.integration-summary { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-5); margin-bottom:var(--space-5); padding:var(--space-5); border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface); }
.integration-summary-copy { max-width:360px; }
.integration-summary-copy h3 { margin:0 0 var(--space-2); }
.integration-summary-copy p:not(.eyebrow) { margin:0; color:var(--text-secondary); }
.integration-summary-stats { display:grid; grid-template-columns:repeat(5,minmax(100px,1fr)); gap:var(--space-4); width:min(760px,65%); margin:0; }
.integration-summary-stats div { min-width:0; }
.integration-summary-stats dt { margin-bottom:var(--space-1); color:var(--text-secondary); font-size:var(--text-caption); }
.integration-summary-stats dd { margin:0; overflow-wrap:anywhere; color:var(--text-primary); font-weight:var(--weight-strong); text-transform:capitalize; }
@media(max-width:1000px) { .integration-summary { flex-direction:column; } .integration-summary-stats { width:100%; grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:620px) { .integration-summary-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
#release-status-view { max-width:1280px; width:100%; margin-inline:auto; box-sizing:border-box; }
#release-status-content { display:grid; gap:var(--space-5); }
.release-status-head { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-5); }
.release-status-head h3 { margin:0 0 var(--space-2); }
.release-status-head p:not(.eyebrow), .release-inventory-heading p { margin:0; color:var(--text-secondary); }
.release-status-head dl { display:flex; flex-wrap:wrap; gap:var(--space-4); margin:0; }
.release-status-head dl div { display:grid; gap:var(--space-1); }
.release-status-head dt { color:var(--text-secondary); font-size:var(--text-caption); }
.release-status-head dd { margin:0; font-weight:var(--weight-strong); }
.release-badge { display:inline-flex; align-items:center; width:max-content; padding:3px 8px; border-radius:var(--radius-full); font-size:var(--text-caption); font-weight:var(--weight-strong); line-height:1.4; vertical-align:middle; }
.release-badge[data-status="local_only"] { border:1px solid var(--local-only-border); background:var(--local-only-bg); color:var(--local-only-text); }
.release-badge[data-status="approved_for_staging"] { background:var(--accent-soft); color:var(--accent); }
.release-badge[data-status="released"] { background:var(--positive-bg); color:var(--positive-text); }
.staging-differences { padding:var(--space-5); border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface); }
.staging-differences > div, .release-inventory-heading, .release-feature-card > div { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); }
.staging-differences h4, .release-inventory-heading h4, .release-feature-card h4 { margin:0; }
.staging-differences > div > span { color:var(--text-secondary); }
.staging-differences ul { display:grid; gap:var(--space-3); margin:var(--space-4) 0 0; padding:0; list-style:none; }
.staging-differences li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:var(--space-1) var(--space-3); padding-top:var(--space-3); border-top:1px solid var(--border); }
.staging-differences li p { grid-column:1/-1; margin:0; color:var(--text-secondary); }
.release-feature-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3); margin-top:var(--space-3); }
.release-feature-card { padding:var(--space-4); border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface); }
.release-feature-card p { min-height:3em; margin:var(--space-3) 0; color:var(--text-secondary); }
.release-feature-card small { color:var(--text-secondary); }
.manual-offer-dialog .release-badge, .offer-card-release .release-badge { margin-left:var(--space-2); }
.local-feature-title { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); }
.local-feature-title h4 { margin:0; }
.local-feature-heading { display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-2); }
.local-feature-heading h3 { margin:0; }
.reasoning-control [data-local-feature-badge] { margin-left:auto; }
@media(max-width:760px) { .release-status-head, .release-inventory-heading { align-items:flex-start; flex-direction:column; } .release-feature-grid { grid-template-columns:1fr; } }
