:root {
  --app-bg: #070b17;
  --sidebar-bg: #080d1a;
  --surface-1: #101827;
  --surface-2: #152036;
  --surface-3: #1a263d;
  --border: #243147;
  --text: #f2f5fa;
  --muted: #9aa7bc;
  --muted-2: #748299;
  --accent: #06b6d4;
  --accent-action: #0e7490;
  --accent-light: #ecfeff;
  --accent-dark: #155e75;
  --success: #22c55e;
  --warning: #f59e0b;
  --critical: #f43f5e;
  --topbar-h: 78px;
  --sidebar-w: 270px;
  --sidebar-collapsed: 72px;
  --ai-w: 390px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .26);
  --ease: 180ms ease;
  /* Shared shell controls use these aliases. Keeping them tied to the native
     Customer Success tokens prevents light dropdown surfaces in dark mode. */
  --panel: var(--surface-1);
  --surface: var(--surface-1);
  --line: var(--border);
  --ink: var(--text);
}

/* Functional Customer Success workflows */
.task-card,.onboarding-card,.renewal-card,.escalation-card,.agent-card,.knowledge-card,.conversation-summary{font:inherit;color:inherit;text-align:left;cursor:pointer}
.task-card:hover,.onboarding-card:hover,.renewal-card:hover,.escalation-card:hover,.agent-card:hover,.knowledge-card:hover{border-color:var(--accent);transform:translateY(-1px)}
.conversation-summary{padding:0;border:0;background:transparent}
.notification-item.read{opacity:.58}.notification-item.read .status-dot{background:var(--muted)!important}.notification-badge:empty{display:none}
.workflow-empty{padding:28px;color:var(--muted);text-align:center}
.cs-workflow-form{display:grid;gap:16px}.cs-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.cs-form-grid label{display:grid;gap:7px;color:var(--muted);font-size:11px;font-weight:800}.cs-form-grid .wide{grid-column:1/-1}.cs-form-grid :is(input,select,textarea){width:100%;min-height:42px;padding:10px 12px;border:1px solid var(--border-strong);border-radius:10px;color:var(--text);background:var(--surface-2);font:inherit;outline:0}.cs-form-grid textarea{min-height:90px;resize:vertical;line-height:1.5}.cs-form-grid :is(input,select,textarea):focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}
.cs-checks,.cs-audit-list{display:grid;gap:9px;padding:13px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}.cs-checks label,.cs-audit-list label{display:flex;align-items:flex-start;gap:10px;color:var(--text);font-size:12px}.cs-checks input,.cs-audit-list input{width:17px;height:17px;flex:0 0 17px;accent-color:var(--accent)}.cs-audit-list span{display:grid;gap:4px}.cs-audit-list small{color:var(--muted);line-height:1.45}.cs-profile-tabs{display:flex;flex-wrap:wrap;gap:7px}.cs-profile-tabs button{min-height:36px;padding:0 11px;border:1px solid var(--border);border-radius:9px;color:var(--muted);background:var(--surface-2);font:inherit;cursor:pointer}.cs-profile-tabs button.active{color:#fff;border-color:var(--accent);background:var(--accent)}
.cs-audit-timeline{display:grid;gap:8px}.cs-audit-timeline>div{display:grid;grid-template-columns:92px minmax(0,1fr);gap:10px;align-items:start;padding:9px 10px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2)}.cs-audit-timeline span{color:var(--muted);font-size:11px}.cs-audit-timeline strong{font-size:12px;line-height:1.45}.demo-state-badge{display:block;margin-top:10px;color:var(--accent);font-weight:700}.task-card.is-done{opacity:.72}.task-card.is-done small:first-of-type{text-decoration:line-through}
#modalBody{max-height:min(66vh,680px);overflow:auto}.modal{width:min(760px,calc(100vw - 32px))}
[data-i18n="depersonalizedView"].active{color:#fff;border-color:var(--accent);background:var(--accent)}
@media(max-width:650px){.cs-form-grid{grid-template-columns:1fr}.cs-form-grid .wide{grid-column:auto}.modal{width:100%;max-height:92vh;border-radius:20px 20px 0 0}}

html[data-theme="light"] {
  --app-bg: #f4f7fb;
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef4f8;
  --border: #dce3ee;
  --text: #111827;
  --muted: #667085;
  --muted-2: #98a2b3;
  --shadow: 0 20px 60px rgba(27, 45, 77, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  background: var(--app-bg);
  color: var(--text);
  font-family: "Lexend", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(6, 182, 212, .25);
}
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon-button {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 8px;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
}
.icon-button:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.icon-button:active { transform: translateY(1px); }
.icon-button.small { width: 36px; height: 36px; }
.button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; font-weight: 650;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { background: var(--accent-action); color: #fff; box-shadow: 0 8px 24px rgba(14, 116, 144, .24); }
.button.primary:hover { background: #0891b2; }
.button.secondary { background: var(--surface-1); color: var(--text); border-color: var(--border); }
.button.secondary:hover { border-color: var(--accent); color: var(--accent); }
.button.small { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.button.full { width: 100%; }
.text-button { border: 0; background: transparent; color: var(--accent); padding: 6px; font-weight: 650; }
.text-button:hover { color: #67e8f9; }

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--ai-w);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas: "side top top" "side main ai";
  transition: grid-template-columns 240ms ease;
}
.app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr) var(--ai-w); }
.app-shell.ai-collapsed { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 0; }
.app-shell.sidebar-collapsed.ai-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr) 0; }
.app-shell.portal-mode {
  grid-template-columns: minmax(0, 1fr) var(--ai-w);
  grid-template-areas: "top top" "main ai";
}
.portal-mode .sidebar { display: none; }
.portal-mode .notification-button, .portal-mode .user-wrap { display: none; }


.topbar {
  grid-area: top;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface-1) 90%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  z-index: 50;
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-link {
  height: 58px; display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 10px; transition: background var(--ease);
}
.brand-link:hover { background: var(--surface-2); }
.brand-logo {
  display: block; width: 154px; height: 53px; object-fit: contain; object-position: left center;
  border-radius: 8px;
}
.brand-mark {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: linear-gradient(145deg, #8b5cf6, var(--accent)); color: #fff;
  font-weight: 850; font-size: 17px; box-shadow: 0 8px 26px rgba(109, 40, 217, .28);
}
.brand-word { font-size: 13px; font-weight: 800; letter-spacing: .09em; white-space: nowrap; }
.assistant-identity { display: flex; align-items: center; gap: 10px; margin-left: 6px; padding-left: 16px; border-left: 1px solid var(--border); min-width: 0; }
.identity-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 6px rgba(6, 182, 212, .12), 0 0 22px rgba(6, 182, 212, .55); }
.assistant-identity div { display: grid; line-height: 1.25; min-width: 0; }
.assistant-identity strong { font-size: 14px; white-space: nowrap; }
.assistant-identity span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.language-switch { height: 36px; display: flex; align-items: center; gap: 4px; padding: 0 7px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.language-switch span { color: var(--border); }
.lang-btn { border: 0; background: transparent; color: var(--muted); padding: 4px; font-size: 12px; font-weight: 700; border-radius: 4px; }
.lang-btn.active { color: var(--accent); }
.theme-moon { display: none; }
html[data-theme="light"] .theme-sun { display: none; }
html[data-theme="light"] .theme-moon { display: block; }
.voice-control {
  height: 40px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 8px; padding: 0 10px; color: var(--text);
}
.voice-control .icon { color: var(--accent); width: 17px; height: 17px; }
.voice-label { font-size: 12px; font-weight: 650; }
.voice-status { font-size: 10px; padding: 2px 6px; border-radius: 999px; font-weight: 750; }
.voice-status.off { color: var(--critical); background: rgba(244, 63, 94, .12); }
.voice-status.on { color: var(--success); background: rgba(34, 197, 94, .12); }
.notification-button { position: relative; }
.notification-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--critical); color: #fff; font-size: 9px; font-weight: 800; border: 2px solid var(--surface-1); }
.user-button { height: 48px; display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 4px 7px; min-width: 0; }
.user-button:hover { background: var(--surface-2); border-color: var(--border); }
.user-button img { width: 36px; height: 36px; object-fit: cover; object-position: 50% 28%; border-radius: 10px; border: 1px solid var(--border); }
.user-copy { display: grid; line-height: 1.25; text-align: left; }
.user-copy strong { font-size: 12px; white-space: nowrap; }
.user-copy small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.user-button > .icon { width: 16px; height: 16px; color: var(--muted); }
.popover-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 290px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); z-index: 100; overflow: hidden;
}
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.popover-head span { color: var(--accent); }
.notification-item { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; }
.notification-item:hover { background: var(--surface-2); }
.notification-item > span:last-child { display: grid; gap: 2px; }
.notification-item strong { font-size: 12px; }
.notification-item small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.user-popover { min-width: 180px; padding: 6px; }
.user-popover button { width: 100%; border: 0; background: transparent; text-align: left; padding: 10px; border-radius: 7px; color: var(--text); }
.user-popover button:hover { background: var(--surface-2); }
.mobile-menu { display: none; }

.sidebar {
  grid-area: side; min-width: 0; background: var(--sidebar-bg); border-right: 1px solid #1b2639;
  display: flex; flex-direction: column; overflow: hidden; z-index: 40;
}
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 10px 8px; scrollbar-width: thin; }
.nav-group { margin: 0 0 18px; }
.nav-group-title { padding: 0 10px 7px; color: #66758d; font-size: 10px; font-weight: 800; letter-spacing: .11em; white-space: nowrap; }
.nav-item {
  width: 100%; min-height: 42px; position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  border: 1px solid transparent; background: transparent; color: #9aa7bc; border-radius: 8px; text-align: left;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.nav-item::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.nav-item:hover { color: #e8eef8; background: rgba(6, 182, 212, .08); }
.nav-item:hover .icon { color: var(--accent); }
.nav-item.active { color: #fff; background: rgba(6, 182, 212, .13); border-color: rgba(6, 182, 212, .18); }
.nav-item.active::before { background: var(--accent); }
.nav-item.active .icon { color: var(--accent); }
.nav-item span:not(.nav-badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { margin-left: auto; min-width: 21px; height: 19px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 0 6px; background: rgba(6, 182, 212, .14); color: #67e8f9; font-size: 10px; font-weight: 800; }
.nav-badge.warning { background: rgba(245, 158, 11, .14); color: #fbbf24; }
.nav-badge.critical { background: rgba(244, 63, 94, .14); color: #fb7185; }
.collapse-button { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border: 0; border-top: 1px solid #1b2639; background: #0b1220; color: #7f8da3; text-align: left; }
.collapse-button:hover { color: #fff; background: #101827; }
.collapse-right { display: none; }
.sidebar-collapsed .nav-group-title, .sidebar-collapsed .nav-item span, .sidebar-collapsed .collapse-button span, .sidebar-collapsed .collapse-left { display: none; }
.sidebar-collapsed .collapse-right { display: block; }
.sidebar-collapsed .sidebar-scroll { padding-left: 9px; padding-right: 9px; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 8px; }
.sidebar-collapsed .nav-item::before { left: -9px; }
.sidebar-collapsed .collapse-button { justify-content: center; padding: 0; }

.main-canvas { grid-area: main; min-width: 0; overflow: auto; background: var(--app-bg); }
.page-content { max-width: 1540px; min-height: 100%; padding: 20px 24px 44px; margin: 0 auto; }
.demo-banner { min-height: 34px; display: flex; align-items: center; gap: 9px; padding: 7px 12px; margin-bottom: 18px; border: 1px solid rgba(6, 182, 212, .24); border-radius: 8px; background: rgba(6, 182, 212, .07); color: var(--muted); font-size: 11px; }
.demo-banner .icon { width: 16px; height: 16px; color: var(--accent); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow, .panel-kicker { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.page-header h1 { margin: 5px 0 4px; font-size: 28px; line-height: 34px; letter-spacing: -.02em; }
.page-header p { margin: 0; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 10px; }
.mode-switch { height: 40px; display: flex; align-items: center; padding: 3px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 9px; }
.mode-btn { min-width: 58px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 750; }
.mode-btn.active { background: var(--accent-action); color: #fff; box-shadow: 0 5px 16px rgba(14, 116, 144, .22); }
.screen { display: none; animation: screenIn 220ms ease; }
.screen.active { display: block; }
@keyframes screenIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi-card { min-height: 146px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); box-shadow: 0 8px 24px rgba(0,0,0,.04); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 650; }
.kpi-head .icon { color: var(--accent); width: 18px; height: 18px; }
.kpi-value { margin: 12px 0 2px; font-size: 31px; line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.kpi-value span { margin-left: 2px; color: var(--muted); font-size: 13px; font-weight: 650; }
.kpi-foot { font-size: 11px; font-weight: 700; }
.kpi-foot span { color: var(--muted); font-weight: 500; }
.positive, .positive-text { color: var(--success); }
.negative, .critical-text { color: var(--critical); }
.warning { color: var(--warning); }
.neutral { color: var(--muted); }
.source-line { margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 12px; }
.panel { min-width: 0; padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); box-shadow: 0 8px 24px rgba(0,0,0,.035); }
.panel.wide { grid-column: 1 / -1; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.panel-head h2 { margin: 3px 0 0; font-size: 16px; line-height: 24px; }
.data-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex: 0 0 auto; }
.status-dot.success { background: var(--success); box-shadow: 0 0 0 4px rgba(34, 197, 94, .1); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 0 4px rgba(245, 158, 11, .1); }
.status-dot.critical { background: var(--critical); box-shadow: 0 0 0 4px rgba(244, 63, 94, .1); }
.priority-list { display: grid; gap: 8px; }
.priority-item { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) 48px; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 9px; text-align: left; transition: border-color var(--ease), transform var(--ease), background var(--ease); }
.priority-item:hover { border-color: var(--accent); transform: translateY(-1px); background: color-mix(in srgb, var(--surface-2) 92%, var(--accent)); }
.priority-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 9px; }
.priority-icon .icon { width: 18px; height: 18px; }
.priority-icon.critical { color: var(--critical); background: rgba(244, 63, 94, .11); }
.priority-icon.warning { color: var(--warning); background: rgba(245, 158, 11, .11); }
.priority-icon.success { color: var(--success); background: rgba(34, 197, 94, .11); }
.priority-copy { display: grid; min-width: 0; }
.priority-copy strong { font-size: 12px; }
.priority-copy small { color: var(--muted); font-size: 10px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-meta { display: grid; justify-items: end; }
.priority-meta b { font-size: 16px; }
.priority-meta small { color: var(--muted); font-size: 9px; }
.health-visual { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 4px 0 14px; }
.donut { --value: 82; width: 138px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--accent) calc(var(--value) * 1%), rgba(148, 163, 184, .15) 0); }
.donut::after { content: ""; position: absolute; inset: 12px; border-radius: inherit; background: var(--surface-1); }
.donut > div { position: relative; z-index: 1; display: flex; align-items: baseline; }
.donut strong { font-size: 29px; }
.donut small { color: var(--muted); font-size: 11px; }
.donut.small { width: 116px; margin: 8px auto 14px; }
.legend-list { min-width: 150px; display: grid; gap: 11px; }
.legend-list div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.legend-list span:not(.legend-color) { color: var(--muted); }
.legend-color { width: 9px; height: 9px; border-radius: 3px; }
.legend-color.healthy { background: var(--success); }
.legend-color.attention { background: var(--warning); }
.legend-color.risk { background: var(--critical); }
.insight-strip { display: flex; gap: 9px; padding: 10px 11px; border: 1px solid rgba(6, 182, 212, .16); background: rgba(6, 182, 212, .06); border-radius: 8px; }
.insight-strip .icon { width: 17px; height: 17px; color: var(--accent); margin-top: 1px; }
.insight-strip p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.insight-strip strong { color: var(--text); }
.table-actions { display: flex; gap: 4px; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 790px; }
.data-table th { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); font-size: 11px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--ease); cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td:first-child { display: flex; align-items: center; gap: 9px; }
.data-table td:first-child > div { display: grid; }
.data-table td:first-child small { color: var(--muted); font-size: 9px; }
.company-avatar { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: #fff; font-size: 9px; font-weight: 800; }
.company-avatar.cyan { background: #0891b2; }.company-avatar.purple { background: #7c3aed; }.company-avatar.green { background: #15803d; }.company-avatar.blue { background: #2563eb; }.company-avatar.orange { background: #c2410c; }
.tag { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 2px 8px; border-radius: 999px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.tag.a { background: rgba(6, 182, 212, .13); color: var(--accent); }
.tag.b { background: rgba(139, 92, 246, .13); color: #a78bfa; }
.tag.neutral { background: var(--surface-3); color: var(--muted); }
.tag.warning { background: rgba(245, 158, 11, .13); color: var(--warning); }
.tag.critical { background: rgba(244, 63, 94, .13); color: var(--critical); }
.tag.success { background: rgba(34, 197, 94, .13); color: var(--success); }
.score { min-width: 31px; height: 25px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; font-size: 10px; font-weight: 800; }
.score.good { color: var(--success); background: rgba(34, 197, 94, .11); }.score.attention { color: var(--warning); background: rgba(245, 158, 11, .11); }.score.risk { color: var(--critical); background: rgba(244, 63, 94, .11); }

.module-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 12px; }
.module-grid.two-thirds { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .45fr); }
.filter-bar { display: grid; grid-template-columns: 1fr 160px 160px; gap: 8px; margin-bottom: 13px; }
.filter-bar label { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.filter-bar label .icon { width: 16px; height: 16px; color: var(--muted); }
.filter-bar input { width: 100%; border: 0; background: transparent; color: var(--text); }
select { height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); padding: 0 10px; }
.client-card-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.client-card { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.client-card:hover { border-color: var(--accent); }
.client-card-copy { display: grid; }
.client-card-copy small { color: var(--muted); font-size: 10px; }
.client-card-meta { display: flex; gap: 6px; align-items: center; }
.segment-stack { display: grid; gap: 8px; }
.segment-stack > div { display: grid; grid-template-columns: 40px 40px 1fr; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.segment-stack span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(6, 182, 212, .12); color: var(--accent); font-weight: 800; }
.segment-stack strong { font-size: 18px; }
.segment-stack small { color: var(--muted); }
.segment-stack + .insight-strip { margin-top: 12px; }
.task-board { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; }
.task-column { padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.task-column h3 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 11px; }
.task-column h3 span { color: var(--muted); }
.task-card { padding: 10px; margin-bottom: 7px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
.task-card:last-child { margin-bottom: 0; }
.task-card strong { display: block; font-size: 10px; }
.task-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.metric-big { font-size: 56px; line-height: 1; font-weight: 850; margin: 20px 0 8px; }
.muted { color: var(--muted); }.centered { text-align: center; }
.onboarding-list, .renewal-list, .escalation-list { display: grid; gap: 9px; }
.onboarding-card, .renewal-card, .escalation-card { display: grid; grid-template-columns: minmax(0,1fr) 150px 100px; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.onboarding-card strong, .renewal-card strong, .escalation-card strong { display: block; font-size: 11px; }
.onboarding-card small, .renewal-card small, .escalation-card small { color: var(--muted); font-size: 9px; }
.progress { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(148,163,184,.18); }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-action), var(--accent)); }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.check-list .icon { width: 17px; height: 17px; color: var(--success); }
.driver-list { display: grid; gap: 13px; }
.driver-row { display: grid; grid-template-columns: 170px minmax(0,1fr) 48px 80px; align-items: center; gap: 10px; font-size: 10px; }
.driver-row > span:first-child { color: var(--muted); }
.driver-bar { height: 8px; border-radius: 999px; background: rgba(148,163,184,.16); overflow: hidden; }
.driver-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.driver-row em { font-style: normal; color: var(--muted); text-align: right; }
.recovery-room { border-color: color-mix(in srgb,var(--accent) 38%,var(--border)); background: linear-gradient(135deg,color-mix(in srgb,var(--accent) 7%,var(--surface-1)),var(--surface-1)); }
.recovery-room .panel-head { align-items:center; }
.recovery-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.recovery-summary>div,.recovery-evidence>div { display:grid; gap:5px; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); }
.recovery-summary span,.recovery-evidence span { color:var(--accent); font-size:9px; font-weight:800; letter-spacing:.07em; }
.recovery-summary strong,.recovery-evidence strong { font-size:11px; line-height:1.5; }
.recovery-summary small,.recovery-evidence small { color:var(--muted); font-size:9px; line-height:1.45; }
.recovery-evidence { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
@media(max-width:650px){.recovery-summary,.recovery-evidence{grid-template-columns:1fr}}
.opportunity-card { padding: 11px; margin-bottom: 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.opportunity-card strong { display: block; margin: 8px 0 4px; font-size: 11px; }
.opportunity-card p { margin: 0; color: var(--muted); font-size: 10px; }
.signal-card { display: flex; gap: 12px; padding: 12px; border: 1px solid rgba(245,158,11,.22); border-radius: 9px; background: rgba(245,158,11,.06); }
.signal-card .icon { color: var(--warning); }
.signal-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.horizontal-bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0,1fr) 50px; gap: 10px; align-items: center; font-size: 10px; }
.bar-row span { color: var(--muted); }
.bar-track { height: 9px; border-radius: 999px; background: rgba(148,163,184,.15); overflow: hidden; }
.bar-track i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--accent-action), var(--accent)); }
.bar-row strong { text-align: right; }
.sentiment-stack { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 14px; }
.sentiment { padding: 11px 8px; border-radius: 9px; text-align: center; border: 1px solid var(--border); background: var(--surface-2); }
.sentiment strong { display: block; font-size: 18px; }
.sentiment span { color: var(--muted); font-size: 9px; }
.sentiment.positive strong { color: var(--success); }.sentiment.neutral strong { color: var(--muted); }.sentiment.negative strong { color: var(--critical); }
.conversation-preview, .conversation-list { display: grid; gap: 8px; }
.conversation-row { display: grid; grid-template-columns: 38px minmax(0,1fr) 95px 90px; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.play-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: rgba(6,182,212,.12); color: var(--accent); }
.play-button .icon { width: 15px; height: 15px; }
.conversation-row strong { display: block; font-size: 10px; }
.conversation-row small { color: var(--muted); font-size: 9px; }
.conversation-row .conversation-summary { min-width: 0; }
.conversation-row .conversation-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insight-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.insight-list li { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.insight-list li > span { color: var(--accent); font-weight: 800; }
.insight-list p { margin: 0; color: var(--muted); font-size: 10px; }
.agent-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.agent-card { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.agent-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agent-card-head > div { display: flex; align-items: center; gap: 8px; }
.agent-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-dark); color: #fff; font-size: 10px; font-weight: 800; }
.agent-card h3 { margin: 0; font-size: 11px; }
.agent-card small { color: var(--muted); font-size: 9px; }
.agent-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 10px; }
.agent-metrics div { padding: 7px; border-radius: 7px; background: var(--surface-1); text-align: center; }
.agent-metrics strong { display: block; font-size: 12px; }
.agent-metrics span { color: var(--muted); font-size: 8px; }
.training-list { display: grid; gap: 8px; }
.training-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); text-align: left; }
.training-list button:hover { border-color: var(--accent); }
.training-list button > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: rgba(6,182,212,.12); color: var(--accent); font-size: 9px; font-weight: 800; }
.training-list div { display: grid; }
.training-list strong { font-size: 10px; }
.training-list small { color: var(--muted); font-size: 9px; }
.footnote { color: var(--muted); font-size: 9px; line-height: 1.5; margin: 12px 0 0; }
.knowledge-grid, .report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.knowledge-card, .report-card { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.knowledge-card-head, .report-card-head { display: flex; justify-content: space-between; gap: 8px; }
.knowledge-card strong, .report-card strong { font-size: 11px; }
.knowledge-card p, .report-card p { margin: 6px 0; color: var(--muted); font-size: 9px; }
.knowledge-card small, .report-card small { color: var(--muted-2); font-size: 8px; }
.gap-list { display: grid; gap: 8px; margin-bottom: 12px; }
.gap-list button { width: 100%; display: grid; grid-template-columns: 42px 1fr; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); text-align: left; }
.gap-list strong { color: var(--warning); }.gap-list span { color: var(--muted); font-size: 10px; }
.cadence-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cadence-list li { display: flex; align-items: center; gap: 10px; }
.cadence-list div { display: grid; }.cadence-list small { color: var(--muted); }

.portal-screen { padding-bottom: 30px; }
.portal-top { min-height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 15px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); }
.portal-brand { display: flex; align-items: center; gap: 10px; }
.portal-brand > div { display: grid; }.portal-brand small { color: var(--muted); font-size: 9px; }
.portal-user { justify-self: end; display: flex; align-items: center; gap: 8px; }
.portal-user > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--accent); font-weight: 800; font-size: 10px; }
.portal-user div { display: grid; text-align: right; }.portal-user small { color: var(--muted); font-size: 9px; }
.portal-hero { min-height: 180px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px; margin-bottom: 12px; border: 1px solid rgba(6,182,212,.25); border-radius: 16px; background: radial-gradient(circle at 85% 25%, rgba(6,182,212,.18), transparent 34%), linear-gradient(135deg, var(--surface-1), var(--surface-2)); overflow: hidden; }
.portal-hero h1 { margin: 6px 0; font-size: 30px; }.portal-hero p { margin: 0; color: var(--muted); }
.portal-score { display: flex; align-items: center; gap: 15px; }.portal-score > div:last-child { display: grid; }
.portal-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.goal-list { display: grid; gap: 12px; }
.goal-list > div { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.goal-list > div > span { color: var(--accent); font-weight: 800; }
.goal-list > div > div { display: grid; grid-template-columns: 1fr 34px; gap: 7px; align-items: center; }
.goal-list strong { grid-column: 1 / -1; font-size: 10px; }.goal-list small { color: var(--muted); text-align: right; }
.ticket-list, .resource-list { display: grid; gap: 8px; }
.ticket-list button, .resource-list button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); text-align: left; }
.ticket-id { color: var(--accent); font-size: 9px; font-weight: 800; }
.ticket-list div, .resource-list div { display: grid; }.ticket-list small, .resource-list small { color: var(--muted); font-size: 9px; }
.resource-list button { grid-template-columns: 30px 1fr; }.resource-list .icon { color: var(--accent); }
.portal-actions-list { display: grid; gap: 9px; }
.portal-actions-list > div { display: flex; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.portal-actions-list input { accent-color: var(--accent); }.portal-actions-list span { display: grid; }.portal-actions-list strong { font-size: 10px; }.portal-actions-list small { color: var(--muted); font-size: 9px; }

.ai-panel { grid-area: ai; min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface-1); overflow: hidden; z-index: 35; transition: opacity 160ms ease, transform 220ms ease; }
.ai-collapsed .ai-panel { opacity: 0; transform: translateX(100%); pointer-events: none; }
.ai-panel-head { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.ai-identity { display: flex; align-items: center; gap: 10px; }
.ai-orb { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle at 35% 30%, #67e8f9, var(--accent) 35%, var(--accent-dark) 75%); box-shadow: 0 0 26px rgba(6,182,212,.26); }
.ai-orb i { width: 12px; height: 12px; border-radius: 999px; border: 2px solid rgba(255,255,255,.9); box-shadow: inset 0 0 0 3px rgba(255,255,255,.2); }
.ai-identity > div { display: grid; line-height: 1.3; }.ai-identity strong { font-size: 12px; }.ai-identity small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.ai-context { min-height: 37px; display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 10px; }
.ai-context span { color: var(--muted); }.ai-context strong { color: var(--accent); }
.chat-messages { flex: 1; overflow-y: auto; padding: 13px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.message { display: flex; gap: 8px; align-items: flex-start; }
.message.user { justify-content: flex-end; }
.message-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: rgba(6,182,212,.13); color: var(--accent); font-size: 9px; font-weight: 850; flex: 0 0 auto; }
.message-bubble { max-width: calc(100% - 40px); padding: 10px 11px; border: 1px solid var(--border); border-radius: 4px 12px 12px 12px; background: var(--surface-2); }
.message.user .message-bubble { background: var(--accent-action); color: #fff; border-color: transparent; border-radius: 12px 4px 12px 12px; }
.message-bubble p { margin: 0; font-size: 11px; line-height: 1.55; white-space: pre-line; }
.message-sources { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.message-sources span { padding: 2px 6px; border-radius: 999px; background: var(--surface-1); color: var(--muted); font-size: 8px; }
.message-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.message-actions button { border: 1px solid var(--border); border-radius: 7px; background: var(--surface-1); color: var(--accent); padding: 5px 7px; font-size: 9px; }
.message-actions button:hover { border-color: var(--accent); }
.typing { display: flex; gap: 4px; padding: 4px 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite alternate; }.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}
@keyframes blink { to { opacity: .25; transform: translateY(-2px); } }
.suggested-prompts { display: flex; gap: 6px; overflow-x: auto; padding: 7px 12px 8px; border-top: 1px solid var(--border); scrollbar-width: none; }
.suggested-prompts::-webkit-scrollbar { display: none; }
.suggested-prompts:empty { display: none; }
.suggested-prompts button { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 5px 8px; font-size: 9px; }
.suggested-prompts button:hover { border-color: var(--accent); color: var(--accent); }
.chat-form { padding: 10px 12px 11px; border-top: 1px solid var(--border); }
.chat-input-wrap { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 7px; min-height: 48px; padding: 5px 5px 5px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.chat-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(6,182,212,.1); }
.chat-input-wrap textarea { width: 100%; max-height: 120px; resize: none; border: 0; background: transparent; color: var(--text); padding: 8px 0; font-size: 11px; line-height: 1.4; }
.chat-tools { display: flex; align-items: center; gap: 3px; }
.send-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--accent-action); color: #fff; }
.send-button:hover { background: #0891b2; }.send-button .icon { width: 16px; height: 16px; }
.chat-disclaimer { margin-top: 6px; color: var(--muted-2); font-size: 8px; text-align: center; }
.ai-reopen { position: fixed; right: 0; bottom: 28px; height: 48px; display: none; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--border); border-right: 0; border-radius: 12px 0 0 12px; background: var(--surface-1); box-shadow: var(--shadow); z-index: 80; }
.ai-reopen .ai-orb { width: 34px; height: 34px; border-radius: 9px; }.ai-reopen .icon { width: 15px; height: 15px; color: var(--muted); }
.ai-collapsed .ai-reopen { display: flex; }
.mobile-overlay { display: none; position: fixed; inset: var(--topbar-h) 0 0; background: rgba(0,0,0,.5); z-index: 29; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(2,6,16,.72); backdrop-filter: blur(5px); z-index: 200; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-1); box-shadow: var(--shadow); overflow: hidden; }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 3px 0 0; font-size: 19px; }.modal-body { overflow-y: auto; padding: 16px; }.modal-foot { justify-content: flex-end; border-top: 1px solid var(--border); border-bottom: 0; }
.client-modal-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 13px; }
.client-modal-grid div { padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.client-modal-grid span { color: var(--muted); font-size: 9px; }.client-modal-grid strong { display: block; margin-top: 3px; font-size: 13px; }
.modal-section { margin-top: 14px; }.modal-section h3 { margin: 0 0 8px; font-size: 12px; }.modal-section ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 10px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 300; }
.toast { min-width: 280px; max-width: 380px; display: flex; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); box-shadow: var(--shadow); animation: toastIn 180ms ease; }
.toast .icon { color: var(--accent); }.toast strong { display: block; font-size: 10px; }.toast p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
@keyframes toastIn { from { opacity:0; transform: translateY(8px);} }

@media (max-width: 1360px) {
  :root { --ai-w: 350px; }
  .assistant-identity span { max-width: 180px; }
  .user-copy { display: none; }
}
@media (max-width: 1180px) {
  .app-shell, .app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr) 0; }
  .sidebar .nav-group-title, .sidebar .nav-item span, .sidebar .collapse-button span, .sidebar .collapse-left { display: none; }
  .sidebar .collapse-right { display: block; }
  .sidebar .nav-item { justify-content: center; padding: 8px; }
  .sidebar .collapse-button { justify-content: center; padding: 0; }
  .ai-panel { position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: min(430px, 100vw); transform: translateX(100%); opacity: 0; box-shadow: var(--shadow); }
  .app-shell.ai-mobile-open .ai-panel { transform: translateX(0); opacity: 1; pointer-events: auto; }
  .app-shell.ai-mobile-open .mobile-overlay { display: block; }
  .ai-reopen, .ai-collapsed .ai-reopen { display: flex; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1000px) {
  .app-shell, .app-shell.sidebar-collapsed, .app-shell.ai-collapsed, .app-shell.sidebar-collapsed.ai-collapsed {
    grid-template-columns: minmax(0,1fr); grid-template-rows: var(--topbar-h) minmax(0,1fr); grid-template-areas: "top" "main";
  }
  .topbar { padding: 0 10px; }
  .mobile-menu { display: inline-flex; }
  .assistant-identity, .voice-label, .voice-status, .language-switch, .user-button > .icon { display: none; }
  .voice-control { width: 40px; justify-content: center; padding: 0; }
  .sidebar { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-100%); transition: transform 220ms ease; box-shadow: var(--shadow); }
  .app-shell.mobile-nav-open .sidebar { transform: translateX(0); }
  .app-shell.mobile-nav-open .mobile-overlay { display: block; }
  .sidebar .nav-group-title, .sidebar .nav-item span, .sidebar .collapse-button span { display: block; }
  .sidebar .nav-item { justify-content: flex-start; padding: 8px 10px; }
  .sidebar .nav-badge { display: inline-flex; }
  .sidebar .collapse-button { display: none; }
  .ai-panel {
    top: 0;
    bottom: auto;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    z-index: 120;
  }
  .page-content { padding: 16px 14px 36px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: space-between; }
  .page-actions .button.secondary { flex: 1; }
  .dashboard-grid, .module-grid, .module-grid.two-thirds { grid-template-columns: 1fr; }
  .panel.wide { grid-column: auto; }
  .portal-top { grid-template-columns: 1fr auto; }
  .portal-brand { display: none; }
  .portal-grid { grid-template-columns: 1fr; }
  .portal-hero { align-items: flex-start; flex-direction: column; }
  .filter-bar { grid-template-columns: 1fr 1fr; }.filter-bar label { grid-column: 1/-1; }
}
@media (max-width: 620px) {
  :root { --topbar-h: 66px; }
  .topbar-actions { gap: 4px; }.topbar-left { gap: 2px; }
  .brand-link { height: 48px; padding: 2px 3px; }.brand-logo { width: 108px; height: 42px; }.brand-mark { width: 32px; height: 32px; }
  .user-button { padding: 3px; }.user-button img { width: 34px; height: 34px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { min-height: 130px; padding: 13px; }.kpi-value { font-size: 25px; }
  .page-header h1 { font-size: 23px; line-height: 29px; }
  .page-actions { align-items: stretch; flex-direction: column; }.mode-switch { width: 100%; }.mode-btn { flex: 1; }
  .health-visual { align-items: flex-start; flex-direction: column; }.donut { margin: 0 auto; }.legend-list { width: 100%; }
  .client-card-list, .agent-grid, .knowledge-grid, .report-grid { grid-template-columns: 1fr; }
  .task-board { grid-template-columns: 1fr; }
  .onboarding-card, .renewal-card, .escalation-card { grid-template-columns: 1fr; }
  .driver-row { grid-template-columns: 120px 1fr 34px; }.driver-row em { display: none; }
  .conversation-row { grid-template-columns: 34px minmax(0,1fr) 70px; }.conversation-row > :last-child { display: none; }
  .bar-row { grid-template-columns: 105px 1fr 40px; }
  .portal-user div { display: none; }
  .portal-hero { padding: 20px; }.portal-hero h1 { font-size: 24px; }
  .client-modal-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }.modal { max-height: calc(100vh - 20px); }
  .toast-region { left: 12px; right: 12px; bottom: 12px; }.toast { min-width: 0; max-width: none; }
}
@media (max-width: 430px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 118px; }
  .page-content { padding-left: 10px; padding-right: 10px; }
  .panel { padding: 14px; }
  .demo-banner { align-items: flex-start; }
  .popover { position: fixed; top: 70px; left: 10px; right: 10px; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* CyberCompany card emphasis, without changing semantic status colours. */
:root {
  --cc-card-hover-surface: #111827;
  --cc-card-hover-ink: #f8fafc;
  --cc-card-hover-muted: #cbd5e1;
  --cc-card-hover-border: color-mix(in srgb, var(--accent) 68%, #475569);
}
html[data-theme="light"] {
  --cc-card-hover-surface: #f8fafc;
  --cc-card-hover-ink: #111827;
  --cc-card-hover-muted: #667085;
  --cc-card-hover-border: color-mix(in srgb, var(--accent) 58%, #cbd5e1);
}
.kpi-card,.priority-item,.insight-strip,.insight-list li,.client-card,.agent-card,.knowledge-card,.report-card {
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
@media (hover:hover) and (pointer:fine) {
  :is(.kpi-card,.priority-item,.insight-strip,.insight-list li,.client-card,.agent-card,.knowledge-card,.report-card):hover {
    color: var(--cc-card-hover-ink);
    background: var(--cc-card-hover-surface);
    border-color: var(--cc-card-hover-border);
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(15,23,42,.18);
  }
  :is(.kpi-card,.priority-item,.insight-strip,.insight-list li,.client-card,.agent-card,.knowledge-card,.report-card):hover :is(.kpi-head,.source-line,.priority-copy small,.priority-meta small,.insight-strip p,.insight-list p,.client-card-copy small,.agent-card small,.knowledge-card p,.knowledge-card small,.report-card p,.report-card small) { color: var(--cc-card-hover-muted); }
}
:is(.kpi-card,.priority-item,.insight-strip,.insight-list li,.client-card,.agent-card,.knowledge-card,.report-card):focus-visible {
  color: var(--cc-card-hover-ink);
  background: var(--cc-card-hover-surface);
  border-color: var(--cc-card-hover-border);
}

/* CEO shell standard · AI Customer Success · original cyan identity preserved. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.app-shell { font-family: "Lexend", Arial, Helvetica, sans-serif; font-size: 13px; }
.app-shell :is(h1,h2,h3,.button.primary) { font-family: "Lexend Giga", "Lexend", Arial, Helvetica, sans-serif; }
.app-shell :is(p,li,label,td,th) { font-size: 12px; line-height: 1.55; }
.app-shell small { font-size: 11px !important; line-height: 1.4; }
.app-shell :is(button,input,select,textarea) { font-size: 12px; }
.app-shell :is(.source-line,.priority-meta small,.data-table th,.data-table td:first-child small,.company-avatar,.tag,.task-card small,.onboarding-card small,.renewal-card small,.escalation-card small,.sentiment span,.conversation-row small,.agent-metrics span,.training-list button > span,.knowledge-card p,.report-card p,.knowledge-card small,.report-card small,.portal-brand small,.portal-user small,.ticket-id,.ticket-list small,.resource-list small,.portal-actions-list small,.ai-identity small,.message-sources span,.message-actions button,.suggested-prompts button,.chat-disclaimer,.client-modal-grid span,.toast p) { font-size: 10px !important; }
.app-shell .message-bubble p { font-size: 12px; }

.topbar {
  height: 78px;
  padding: 0 24px;
  gap: 14px;
}
.topbar-left { flex: 1; min-width: 180px; }
.topbar .assistant-identity { display: none !important; }
.topbar-greeting { min-width: 0; flex: 1; display: grid; line-height: 1.2; }
.topbar-greeting strong {
  min-width: 0;
  overflow: hidden;
  font-family: "Lexend Giga", "Lexend", Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-greeting span {
  min-width: 0;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions { flex: 0 0 auto; gap: 8px; }
.topbar .icon-button,
.topbar #cc-editor-launch {
  width: 40px;
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-1);
}
.topbar .icon-button:hover,
.topbar #cc-editor-launch:hover {
  color: var(--accent);
  border-color: color-mix(in srgb,var(--accent) 52%,var(--border));
  background: color-mix(in srgb,var(--accent) 9%,var(--surface-1));
}
.topbar .icon-button .icon,
.topbar #cc-editor-launch svg { width: 19px; height: 19px; }
.topbar-search-wrap { position: relative; }
.topbar-search-panel {
  position: absolute;
  z-index: 120;
  top: 48px;
  right: 0;
  width: min(330px,calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb,var(--surface-1) 97%,transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.topbar-search-panel label { display: block; margin: 0 0 7px; color: var(--muted); font-weight: 800; }
.topbar-search-panel input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface-2); }
.topbar-search-panel > div { display: grid; gap: 3px; margin-top: 7px; }
.topbar-search-panel > div button { min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; text-align: left; }
.topbar-search-panel > div button:hover { color: var(--text); background: rgba(6,182,212,.1); }
.topbar-search-panel > div p { margin: 8px; color: var(--muted); }
.voice-control {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 11px;
}
.voice-control .icon { width: 19px; height: 19px; color: currentColor; }
.voice-control.active { color: #159663; border-color: rgba(21,150,99,.38); background: rgba(21,150,99,.09); }
.voice-control.inactive { color: #dc4c62; border-color: rgba(220,76,98,.4); background: rgba(220,76,98,.09); }
.notification-badge { top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; }
.user-button {
  min-width: 205px;
  min-height: 46px;
  height: 46px;
  margin-left: 4px;
  padding: 3px 8px 3px 13px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0 12px 12px 0;
  text-align: left;
}
.user-button img { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; }
.user-copy strong {
  font-family: "Lexend Giga", "Lexend", Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 650;
}
.user-copy small {
  margin-top: 4px;
  font-family: "Lexend Giga", "Lexend", Arial, Helvetica, sans-serif;
  font-size: 11px !important;
  font-weight: 500;
}

.sidebar { width: 270px; background: #111827; }
.sidebar-scroll { padding: 14px 10px 8px; }
.nav-group { margin-bottom: 18px; }
.nav-group-title {
  margin: 8px 8px 7px;
  padding: 0;
  color: #78849a;
  font-family: "Lexend Giga", "Lexend", Arial, Helvetica, sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .13em !important;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sidebar .nav-group-title::after { display: none; }
.nav-item {
  min-height: 46px;
  height: auto;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-family: "Lexend Giga", "Lexend", Arial, Helvetica, sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
.nav-item::before { display: none; }
.nav-item > .icon {
  width: 28px;
  height: 28px;
  padding: 4px;
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 9px;
  color: #9aa7ba;
  background: rgba(255,255,255,.035);
}
.nav-item:hover {
  color: #fff;
  border-color: color-mix(in srgb,var(--accent) 34%,transparent);
  background: color-mix(in srgb,var(--accent) 12%,transparent);
}
.nav-item:hover > .icon {
  color: #67e8f9;
  border-color: color-mix(in srgb,var(--accent) 36%,transparent);
  background: color-mix(in srgb,var(--accent) 16%,transparent);
}
.nav-item.active {
  color: #fff;
  border-color: color-mix(in srgb,var(--accent) 42%,transparent);
  background: linear-gradient(90deg,rgba(6,182,212,.30),rgba(6,182,212,.10));
  box-shadow: inset 3px 0 var(--accent),0 8px 22px rgba(2,6,23,.14);
}
.nav-item.active > .icon { color: #fff; border-color: rgba(103,232,249,.46); background: rgba(6,182,212,.23); }

.ai-panel-head { min-height: 78px; padding: 9px 12px; }
.ai-bot-frame {
  position: relative;
  width: 76px;
  height: 60px;
  flex: 0 0 76px;
  overflow: hidden;
  border: 1px solid rgba(6,182,212,.34);
  border-radius: 16px;
  background: rgba(6,182,212,.09);
}
.ai-bot-frame img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 52px;
  max-width: 100%;
  object-fit: contain;
  transform: translate(-50%,-50%) scale(.98);
}
.ai-identity strong { font-family: "Lexend Giga", "Lexend", Arial, Helvetica, sans-serif; font-size: 13px; font-weight: 650; }
.message-avatar { position: relative; width: 34px; height: 34px; overflow: hidden; border-radius: 10px; }
.message-avatar img { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; max-width: 100%; object-fit: contain; transform: translate(-50%,-50%) scale(.98); }
.assistant-actions { padding: 8px 12px; display: grid; gap: 6px; border-top: 1px solid var(--border); }
.assistant-actions button { min-height: 40px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface-2); text-align: left; }
.assistant-actions button:hover { color: var(--accent); border-color: var(--accent); background: rgba(6,182,212,.09); }
.assistant-support {
  min-height: 42px;
  margin: 2px 12px 8px;
  border: 1px solid color-mix(in srgb,var(--accent) 38%,var(--border));
  border-radius: 11px;
  color: var(--accent);
  background: rgba(6,182,212,.09);
  font-weight: 800;
}
.assistant-support:hover { border-color: var(--accent); background: rgba(6,182,212,.14); }
.ai-reopen {
  right: 26px;
  bottom: 26px;
  width: 70px;
  height: 70px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(6,182,212,.42);
  border-radius: 22px;
  background: linear-gradient(145deg,rgba(6,182,212,.16),var(--surface-1));
  box-shadow: 0 18px 42px rgba(15,23,42,.26),0 0 0 5px rgba(6,182,212,.08);
}
.ai-reopen img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  max-width: 100%;
  object-fit: contain;
  transform: translate(-50%,-50%) scale(.96);
}
.ai-reopen:hover { transform: translateY(-3px); border-color:#67e8f9; box-shadow:0 22px 50px rgba(6,182,212,.30),0 0 0 6px rgba(6,182,212,.1); }

@media (min-width:1001px) and (max-width:1360px) {
  .user-copy { display: grid; }
}
@media (min-width:1001px) and (max-width:1180px) {
  .app-shell { grid-template-columns: var(--sidebar-w) minmax(0,1fr) 0; }
  .app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0,1fr) 0; }
  .app-shell:not(.cc-sidebar-collapsed):not(.sidebar-collapsed) .sidebar .nav-group-title { display: flex; }
  .app-shell:not(.cc-sidebar-collapsed):not(.sidebar-collapsed) .sidebar .nav-item { justify-content: flex-start; padding: 6px 9px; }
  .app-shell:not(.cc-sidebar-collapsed):not(.sidebar-collapsed) .sidebar .nav-item span { display: inline-flex; }
  .topbar-greeting strong { font-size: 19px; }
  .topbar-greeting span { font-size: 12px; }
  .user-button { min-width: 184px; }
}
@media (max-width:1000px) {
  .topbar { height: 66px; padding: 0 10px; }
  .topbar-greeting { display: none !important; }
  .topbar-left { flex: 0 0 auto; min-width: 0; }
  .mobile-menu { display: grid; place-items: center; }
  .ai-panel {
    top: 74px;
    right: 10px;
    bottom: 100px;
    left: 10px;
    width: auto;
    height: auto;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15,23,42,.3);
  }
  .ai-panel-head { min-height: 66px; }
  .ai-panel-head,.ai-context,.assistant-actions,.assistant-support,.chat-form { flex-shrink: 0; }
  .chat-messages { min-height: 100px; flex: 1 1 0; }
  .assistant-actions { padding: 6px 10px; gap: 4px; }
  .assistant-actions button { min-height: 36px; padding: 6px 9px; }
  .assistant-support { min-height: 40px !important; height: 40px; max-height: 40px; margin: 2px 10px 6px; }
  .suggested-prompts { display: none; }
  .chat-form { padding: 8px 10px 9px; }
  .ai-reopen,.ai-collapsed .ai-reopen { display: none; }
  .page-content { padding-bottom: 112px; }
  .user-button { min-width: 48px; width: 48px; padding: 4px; border-left: 0; border-radius: 12px; justify-content: center; }
  .user-copy,.user-button > .icon { display: none !important; }
}
@media (max-width:650px) {
  .topbar-search-wrap,.voice-control { display: none; }
  .topbar-actions { gap: 5px; }
  .topbar .icon-button,.topbar #cc-editor-launch { width:38px;min-width:38px;height:38px; }
  .notification-badge { top:-5px;right:-5px; }
}

/* Standard popup copilot: identical interaction model to the CEO shell. */
.app-shell,
.app-shell.ai-collapsed {
  grid-template-columns:var(--sidebar-w) minmax(0,1fr);
  grid-template-areas:"side top" "side main";
}
.app-shell.sidebar-collapsed,
.app-shell.sidebar-collapsed.ai-collapsed {
  grid-template-columns:var(--sidebar-collapsed) minmax(0,1fr);
}
.app-shell.portal-mode {
  grid-template-columns:minmax(0,1fr);
  grid-template-areas:"top" "main";
}
.ai-panel {
  position:fixed;
  top:auto;
  right:24px;
  bottom:108px;
  width:min(390px,calc(100vw - 32px));
  height:auto;
  max-height:min(640px,calc(100vh - 130px));
  z-index:92;
  border:1px solid var(--border-strong);
  border-radius:20px;
  background:var(--surface-1);
  box-shadow:0 28px 80px rgba(0,0,0,.38);
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:none;
  transform-origin:right bottom;
  transition:opacity .2s ease,transform .2s ease,visibility 0s;
}
.app-shell.ai-collapsed .ai-panel {
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(14px) scale(.98);
  transition:opacity .2s ease,transform .2s ease,visibility 0s linear .2s;
}
.app-shell:not(.ai-collapsed) .ai-reopen { display:none; }

[data-theme="light"] .ai-panel { color:#102329; background:#fff; border-color:#58b9ca; }
[data-theme="light"] .ai-panel .chat-messages,
[data-theme="light"] .ai-panel .chat-form { background:#fff; }
[data-theme="light"] .ai-panel .ai-panel-head,
[data-theme="light"] .ai-panel .ai-context,
[data-theme="light"] .ai-panel .assistant-actions { border-color:#a7dfe7; }
[data-theme="light"] .ai-panel .message.assistant .message-bubble { color:#102329; background:#eefbfc; border-color:#8fd8e2; }
[data-theme="light"] .ai-panel .assistant-actions button { color:#12313a; background:#f2fbfc; border-color:#8fd8e2; }
[data-theme="light"] .ai-panel .assistant-support { color:#075f6d; background:#e6f9fb; border-color:#58b9ca; }
[data-theme="dark"] .ai-panel { color:#f8fafc; background:#0d1627; border-color:#2f7f8e; }
[data-theme="dark"] .ai-panel .chat-messages,
[data-theme="dark"] .ai-panel .chat-form { background:#0d1627; }
[data-theme="dark"] .ai-panel .message.assistant .message-bubble { color:#f8fafc; background:#112d3a; border-color:#2b7180; }
[data-theme="dark"] .ai-panel .assistant-actions button { color:#f8fafc; background:#122435; border-color:#315666; }
[data-theme="dark"] .ai-panel .assistant-support { color:#67e8f9; background:#10313d; border-color:#2b7180; }

@media (max-width:1000px) {
  .app-shell,
  .app-shell.ai-collapsed,
  .app-shell.sidebar-collapsed,
  .app-shell.sidebar-collapsed.ai-collapsed {
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"top" "main";
  }
  .ai-panel {
    top:74px;
    right:10px;
    bottom:100px;
    left:10px;
    width:auto;
    max-height:none;
    border-radius:18px;
  }
}
