:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f8;
  --text: #0f172a;
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d8dee8;
  --brand: #1377A9;
  --brand-dark: #0f628a;
  --navy: #0b1220;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b42318;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  resize: vertical;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(19, 119, 169, 0.42);
  box-shadow: 0 0 0 4px rgba(19, 119, 169, 0.08);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  background:
    radial-gradient(circle at top left, rgba(19, 119, 169, 0.14), transparent 28%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  color: #ffffff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, #0f8bca 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.06em;
  box-shadow: 0 14px 30px rgba(19, 119, 169, 0.3);
}

.brand-copy h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
}

.brand-copy p {
  margin: 5px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.workspace-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(12px);
}

.workspace-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-row + .workspace-row {
  margin-top: 10px;
}

.workspace-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.workspace-value {
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
}

.workspace-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-pill.live {
  background: rgba(21, 128, 61, 0.18);
  color: #9ce5b2;
  border: 1px solid rgba(156, 229, 178, 0.2);
}

.nav-group {
  margin-top: 26px;
}

.nav-group-title {
  margin: 0 0 10px;
  padding: 0 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.46);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.82);
  padding: 13px 14px;
  border-radius: 14px;
  transition: 0.2s ease;
  text-align: left;
  font-weight: 600;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(19, 119, 169, 0.22), rgba(19, 119, 169, 0.12));
  box-shadow: inset 0 0 0 1px rgba(19, 119, 169, 0.26);
  color: #ffffff;
}

.nav-bullet {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  flex-shrink: 0;
}

.nav-item.active .nav-bullet {
  background: #5fc4f0;
  box-shadow: 0 0 0 6px rgba(95, 196, 240, 0.14);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 8px 2px;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  font-weight: 600;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.footer-note {
  margin: 12px 2px 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
}

.main-panel {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.topbar-copy {
  flex: 1;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.topbar h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.topbar-subtext {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.session-card {
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.session-card strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.session-badge.good {
  background: #ecfdf3;
  color: var(--success);
}

.session-badge.warn {
  background: #fff7ed;
  color: var(--warning);
}

.session-badge.bad {
  background: #fef2f2;
  color: var(--danger);
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.primary-btn,
.ghost-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  transition: 0.18s ease;
}

.small-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
}

.primary-btn {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(19, 119, 169, 0.18);
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.ghost-btn {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.ghost-btn:hover {
  background: #f8fafc;
}

.system-notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #dbe7f2;
  background: #f7fbff;
  color: #245374;
  font-size: 14px;
  line-height: 1.6;
}

.system-notice.good {
  background: #ecfdf3;
  border-color: #cdeed8;
  color: #166534;
}

.system-notice.warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.system-notice.bad {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

.hero-card,
.panel-card,
.kpi-card,
.knowledge-hero-card {
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-md);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  padding: 26px;
  border-radius: var(--radius-xl);
  margin-bottom: 22px;
  background:
    radial-gradient(circle at top right, rgba(19, 119, 169, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.hero-main h3,
.knowledge-hero-main h3 {
  margin: 0;
  max-width: 760px;
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.hero-text,
.knowledge-hero-main p {
  margin: 14px 0 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef6fb;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-card {
  background: #0f172a;
  color: #ffffff;
  border-radius: 20px;
  padding: 20px;
}

.summary-label {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.58);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 800;
}

.summary-card h4 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.summary-meta {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.summary-mini {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.mini-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 800;
}

.summary-mini strong {
  font-size: 15px;
}

.kpi-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.kpi-card {
  border-radius: 20px;
  padding: 20px;
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.kpi-trend {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 9px;
  border-radius: 999px;
}

.kpi-trend.up {
  background: #ecfdf3;
  color: var(--success);
}

.kpi-trend.good {
  background: #eef6fb;
  color: var(--brand);
}

.kpi-trend.warn {
  background: #fff7ed;
  color: var(--warning);
}

.kpi-trend.neutral {
  background: #f3f4f6;
  color: #475467;
}

.kpi-card h4 {
  margin: 14px 0 12px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.kpi-foot {
  display: inline-block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sparkline {
  height: 34px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  align-items: end;
}

.sparkline span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(19, 119, 169, 0.22), rgba(19, 119, 169, 0.78));
}

.sparkline span:nth-child(1) { height: 10px; }
.sparkline span:nth-child(2) { height: 18px; }
.sparkline span:nth-child(3) { height: 14px; }
.sparkline span:nth-child(4) { height: 24px; }
.sparkline span:nth-child(5) { height: 20px; }
.sparkline span:nth-child(6) { height: 28px; }

.dashboard-grid,
.panel-grid,
.knowledge-top-grid,
.knowledge-bottom-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.dashboard-main,
.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-grid.two-up,
.knowledge-top-grid,
.knowledge-bottom-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-grid.split-2 {
  grid-template-columns: 0.95fr 1.05fr;
}

.chat-workspace-grid {
  grid-template-columns: 0.9fr 1.1fr;
}

.panel-card,
.knowledge-hero-card {
  border-radius: var(--radius-lg);
  padding: 22px;
}

.knowledge-hero-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at top right, rgba(19, 119, 169, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.knowledge-hero-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.knowledge-mini-stat {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 18px;
  padding: 16px;
}

.knowledge-mini-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 800;
}

.knowledge-mini-stat strong {
  font-size: 16px;
  line-height: 1.4;
}

.knowledge-catalog-card,
.knowledge-editor-card,
.knowledge-queue-card,
.knowledge-guide-card {
  min-height: 100%;
}

.knowledge-head {
  margin-bottom: 16px;
}

.knowledge-mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eef6fb;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.knowledge-form {
  gap: 16px;
}

.knowledge-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.knowledge-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pipeline-list,
.activity-list,
.status-list,
.stack-list,
.dynamic-list,
.message-list,
.training-preview-list,
.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fbfdff;
}

.pipeline-index {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #eef6fb;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.pipeline-copy h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.pipeline-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 14px;
  padding: 2px 0 2px 2px;
}

.activity-line {
  position: relative;
}

.activity-line::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 6px rgba(19, 119, 169, 0.1);
}

.activity-copy h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.activity-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.activity-copy span {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475467;
}

.status-row,
.stack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fbfdff;
  font-size: 14px;
}

.state-good {
  color: var(--success);
  font-weight: 800;
}

.state-bad {
  color: var(--danger);
  font-weight: 800;
}

.chat-item {
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: #fbfdff;
  border: 1px solid var(--line);
  text-align: left;
  transition: 0.18s ease;
}

.chat-item:hover {
  border-color: #cdd6e1;
  background: #ffffff;
}

.chat-item.active {
  border-color: rgba(19, 119, 169, 0.3);
  background: #f5fbff;
}

.chat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

.chat-copy h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.chat-copy p,
.chat-time {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.chat-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chat-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef6fb;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.selected-chat-meta-card,
.training-source-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.6;
}

.selected-chat-actions {
  display: flex;
  gap: 10px;
  margin: 14px 0 16px;
  flex-wrap: wrap;
}

.message-list {
  min-height: 420px;
}

.message-bubble {
  max-width: 86%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fbfdff;
}

.message-bubble.customer {
  align-self: flex-start;
  background: #ffffff;
}

.message-bubble.merchant {
  align-self: flex-end;
  background: #eef6fb;
  border-color: rgba(19, 119, 169, 0.18);
}

.message-bubble.ai {
  align-self: flex-end;
  background: #f5fbff;
  border-color: rgba(19, 119, 169, 0.24);
}

.message-role {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475467;
}

.message-text {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-meta {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.data-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fbfdff;
}

.data-card.compact {
  padding: 14px 16px;
}

.data-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.data-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.data-meta {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #475467;
}

.data-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.knowledge-toolbar {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-bottom: 14px;
}

.knowledge-search-field,
.knowledge-filter-field {
  margin: 0;
}

.knowledge-results-meta {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.6;
}

.clean-list,
.clean-steps {
  margin: 0;
  padding-left: 18px;
}

.clean-list li,
.clean-steps li {
  margin-bottom: 12px;
  line-height: 1.7;
  color: var(--text);
}

.code-block {
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  background: #0f172a;
  color: #dbe7f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.test-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.output-box {
  min-height: 220px;
  border-radius: 16px;
  padding: 18px;
  background: #fbfdff;
  border: 1px solid var(--line);
  color: var(--text);
  line-height: 1.7;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-status {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.form-status.good {
  background: #ecfdf3;
  border-color: #cdeed8;
  color: #166534;
}

.form-status.bad {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.note-box {
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.note-box p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .hero-card,
  .dashboard-grid,
  .panel-grid.two-up,
  .panel-grid.split-2,
  .chat-workspace-grid,
  .knowledge-toolbar,
  .knowledge-hero-card,
  .knowledge-top-grid,
  .knowledge-bottom-grid,
  .knowledge-form-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 760px) {
  .main-panel {
    padding: 18px;
  }

  .topbar h2,
  .hero-main h3,
  .knowledge-hero-main h3 {
    font-size: 28px;
  }

  .kpi-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .topbar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .selected-chat-actions,
  .knowledge-actions {
    width: 100%;
  }

  .topbar-actions .ghost-btn,
  .topbar-actions .primary-btn,
  .auth-actions .ghost-btn,
  .auth-actions .primary-btn,
  .selected-chat-actions .ghost-btn,
  .selected-chat-actions .primary-btn,
  .knowledge-actions .ghost-btn,
  .knowledge-actions .primary-btn {
    flex: 1;
  }

  .message-bubble {
    max-width: 100%;
  }
}