:root {
  color-scheme: light;
  --bg: #f5f9ff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --ink: #0b1728;
  --muted: #65738a;
  --line: #dbe7f7;
  --blue: #0b63ce;
  --blue-strong: #074ea2;
  --cyan: #0ea5c6;
  --indigo: #334ccf;
  --success: #0b8f6f;
  --warning: #b7791f;
  --danger: #c2413a;
  --shadow: 0 20px 60px rgba(30, 74, 130, 0.14);
  --radius: 8px;
  --sidebar: 260px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(245, 249, 255, 0.82), rgba(245, 249, 255, 0.96)),
    repeating-linear-gradient(90deg, rgba(11, 99, 206, 0.08) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(14, 165, 198, 0.07) 0 1px, transparent 1px 72px),
    var(--bg);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 26px rgba(11, 99, 206, 0.22);
}

.brand-name,
.brand-subtitle,
.eyebrow,
.panel-kicker,
.side-status p {
  margin: 0;
}

.brand-name {
  font-weight: 800;
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.icon-button,
.primary-action,
.secondary-action,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  padding: 0 12px;
  color: #36506f;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  color: var(--blue-strong);
  border-color: #c8dbf4;
  background: #eef6ff;
}

.nav-item svg,
.primary-action svg,
.secondary-action svg,
.icon-button svg,
.send-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.side-status {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.side-status p {
  color: var(--muted);
  font-size: 12px;
}

.side-status strong {
  display: block;
  margin-top: 2px;
  color: var(--blue-strong);
  font-size: 14px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(11, 143, 111, 0.12);
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow,
.panel-kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.18;
}

h2 {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.3;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  width: 42px;
  height: 42px;
  color: var(--blue-strong);
  border-color: var(--line);
  background: var(--panel-strong);
}

.primary-action,
.secondary-action,
.secondary-link {
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-action {
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 14px 28px rgba(11, 99, 206, 0.18);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.secondary-action {
  color: var(--blue-strong);
  border-color: #c8dbf4;
  background: #eef6ff;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #c8dbf4;
  border-radius: var(--radius);
  color: var(--blue-strong);
  background: #eef6ff;
  text-decoration: none;
}

.secondary-link svg {
  width: 18px;
  height: 18px;
}

.primary-action:not(:disabled):hover,
.secondary-action:not(:disabled):hover,
.icon-button:hover,
.send-button:hover {
  transform: translateY(-1px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.customer-shell {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.customer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
}

.customer-hero {
  display: grid;
  align-items: end;
  min-height: 188px;
  margin: 18px 0;
  padding: 28px;
  border: 1px solid rgba(179, 211, 247, 0.88);
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.96), rgba(238, 248, 255, 0.9)),
    repeating-linear-gradient(90deg, rgba(11, 99, 206, 0.1) 0 1px, transparent 1px 56px);
  box-shadow: var(--shadow);
}

.customer-hero h1 {
  max-width: 760px;
  font-size: 48px;
  line-height: 1.08;
}

.customer-hero p:last-child {
  max-width: 720px;
  margin: 14px 0 0;
  color: #36506f;
  font-size: 16px;
  line-height: 1.8;
}

.customer-workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 18px;
  min-height: 680px;
}

.customer-chat-panel {
  min-height: 680px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-hero,
.app-hero {
  margin-top: 18px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: #314864;
  font-weight: 700;
}

.stack-form input,
.search-form input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cbdcf1;
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.stack-form input:focus,
.search-form input:focus,
.composer textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.12);
}

.profile-panel {
  max-width: 720px;
}

.profile-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-form .wide-action {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

.customer-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.small-action {
  min-height: 36px;
  padding: 0 10px;
}

.session-panel {
  align-self: stretch;
  min-height: 680px;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-item {
  width: 100%;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #29415f;
  background: #ffffff;
  text-align: left;
}

.session-item.active {
  border-color: var(--blue);
  background: #eef6ff;
  color: var(--blue-strong);
}

.session-item strong,
.session-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.customer-side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.score-text {
  color: var(--blue-strong);
  font-size: 28px;
  line-height: 1;
}

.requirement-card {
  max-height: 560px;
  overflow: auto;
}

.compact-doc {
  gap: 10px;
}

.compact-doc .doc-section {
  padding-bottom: 9px;
}

.compact-doc .doc-section h3 {
  font-size: 13px;
}

.compact-doc .doc-section p {
  font-size: 13px;
  line-height: 1.62;
}

.wide-action {
  width: 100%;
  margin-top: 14px;
}

.chat-layout,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  min-height: calc(100vh - 132px);
}

.workspace-panel,
.metric-panel {
  border: 1px solid rgba(203, 219, 242, 0.92);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workspace-panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #bee3f8;
  border-radius: 999px;
  color: var(--blue-strong);
  background: #eef8ff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 620px;
}

.message-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 4px 4px 12px;
}

.bounded-stream {
  max-height: 500px;
  min-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message {
  display: grid;
  gap: 5px;
  max-width: min(720px, 88%);
}

.message.customer {
  align-self: flex-end;
}

.message.agent {
  align-self: flex-start;
}

.message-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bubble {
  padding: 12px 14px;
  border-radius: var(--radius);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent .bubble {
  border: 1px solid #cfe2f8;
  background: #ffffff;
}

.customer .bubble {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.composer input,
.composer textarea {
  min-width: 0;
  min-height: 46px;
  max-height: 86px;
  padding: 11px 14px;
  border: 1px solid #cbdcf1;
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  outline: none;
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
}

.composer input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.12);
}

.send-button {
  width: 46px;
  height: 46px;
  color: #ffffff;
  border: 0;
  background: var(--blue);
}

.advisor-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.advisor-panel #completionScore {
  color: var(--blue-strong);
  font-size: 28px;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceafa;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 240ms ease;
}

.field-list {
  display: grid;
  gap: 9px;
}

.field-item {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.field-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
}

.field-item.done .field-dot {
  background: var(--success);
}

.field-item.draft .field-dot {
  background: var(--warning);
}

.field-item span:last-child {
  min-width: 0;
  color: #30445f;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.workflow-map {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.flow-node {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #cbdcf1;
  border-radius: var(--radius);
  color: #3d536e;
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.flow-node.active {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

.flow-line {
  height: 1px;
  min-width: 12px;
  background: #b9cce4;
}

.document-preview {
  display: grid;
  gap: 14px;
  line-height: 1.72;
}

.doc-section {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.doc-section:last-child {
  border-bottom: 0;
}

.doc-section h3 {
  margin: 0 0 6px;
  color: var(--blue-strong);
  font-size: 15px;
}

.doc-section p {
  margin: 0;
  color: #2c3f59;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.confirm-note,
.requirement-flow-card {
  padding: 12px;
  border: 1px solid rgba(74, 163, 255, 0.3);
  border-radius: var(--radius);
  background: rgba(74, 163, 255, 0.08);
}

.confirm-note {
  display: grid;
  gap: 4px;
  color: #d8ecff;
}

.confirm-note strong {
  color: #ffffff;
}

.confirm-note span {
  color: #aebbd0;
  line-height: 1.6;
}

.requirement-flow-card h3 {
  margin: 0 0 10px;
  color: var(--blue-strong);
  font-size: 15px;
}

.requirement-flow {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.flow-step {
  flex: 0 0 138px;
  min-width: 118px;
  min-height: 108px;
  padding: 10px;
  border: 1px solid rgba(151, 174, 218, 0.26);
  border-radius: var(--radius);
  background: rgba(14, 16, 23, 0.54);
}

.flow-step span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #3f9cff, #0e70dc);
  font-size: 12px;
  font-weight: 900;
}

.flow-step strong {
  display: block;
  color: #ffffff;
  font-size: 13px;
}

.flow-step p {
  margin: 6px 0 0;
  color: #aebbd0;
  font-size: 12px;
  line-height: 1.5;
}

.flow-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  color: #7cd7ff;
  font-weight: 900;
}

.status-stack {
  display: grid;
  gap: 10px;
}

.status-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.step-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ffffff;
  background: #94a3b8;
  font-size: 13px;
  font-weight: 800;
}

.status-step.active .step-index {
  background: var(--blue);
}

.status-step.done .step-index {
  background: var(--success);
}

.status-step h3 {
  margin: 0;
  font-size: 14px;
}

.status-step p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-panel {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.metric-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-panel strong {
  color: var(--blue-strong);
  font-size: 28px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 10px;
}

tr[data-conversation-id] {
  cursor: pointer;
}

tr[data-conversation-id]:hover td {
  background: #f4f9ff;
}

.nav-item-badge {
  position: relative;
}

.nav-item-badge b {
  display: none;
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--danger);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.nav-item-badge.has-badge b {
  display: block;
}

.todo-list {
  display: grid;
  gap: 12px;
}

.todo-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #ffd0cc;
  border-radius: var(--radius);
  background: #fff8f7;
}

.todo-item strong {
  display: block;
  color: var(--danger);
}

.todo-item p {
  margin: 6px 0 0;
  color: #445a76;
  line-height: 1.6;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(420px, calc(100% - 36px));
  max-width: 420px;
  padding: 16px 18px;
  border: 1px solid rgba(74, 163, 255, 0.42);
  border-radius: var(--radius);
  color: #f7fbff;
  background: rgba(16, 20, 30, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 800;
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(74, 163, 255, 0.34);
  border-radius: var(--radius);
  color: #d8ecff;
  background: rgba(74, 163, 255, 0.12);
  font-weight: 800;
}

.muted-cell {
  color: #8da0bd;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: #263b55;
  font-size: 14px;
}

.full-height {
  min-height: calc(100vh - 132px);
}

.code-panel,
.message-card {
  width: 100%;
  min-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  border: 1px solid #cbdcf1;
  border-radius: var(--radius);
  color: #102034;
  background:
    linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.95)),
    repeating-linear-gradient(0deg, rgba(11, 99, 206, 0.08) 0 1px, transparent 1px 28px);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.message-card {
  min-height: 420px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 12px;
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  background: #ffffff;
}

.timeline-item strong {
  display: block;
  color: var(--blue-strong);
  margin-bottom: 4px;
}

.timeline-item span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .brand-block {
    margin-bottom: 0;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: center;
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .nav-item span {
    display: none;
  }

  .side-status {
    display: none;
  }

  .chat-layout,
  .two-column,
  .customer-workspace {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-grid,
  .profile-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .customer-shell {
    width: min(100% - 24px, 1220px);
    padding-top: 12px;
  }

  .customer-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-hero {
    min-height: 0;
    padding: 20px;
  }

  .customer-hero h1 {
    font-size: 30px;
  }

  .main {
    padding: 16px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: repeat(5, 1fr);
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .chat-panel,
  .full-height {
    min-height: 560px;
  }

  .message {
    max-width: 100%;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .workflow-map {
    grid-template-columns: 1fr;
  }

  .flow-line {
    height: 10px;
    width: 1px;
    justify-self: center;
  }
}

/* Dark gateway theme */
:root {
  --bg: #101116;
  --panel: rgba(26, 28, 36, 0.84);
  --panel-strong: #1b1e29;
  --ink: #f6f8ff;
  --muted: #a6afc2;
  --line: rgba(141, 156, 188, 0.22);
  --blue: #4aa3ff;
  --blue-strong: #73b8ff;
  --cyan: #35d1c3;
  --indigo: #7d7cff;
  --success: #18c49a;
  --warning: #ffd36b;
  --danger: #ff5d57;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 44% 26%, rgba(58, 93, 183, 0.32), transparent 28%),
    radial-gradient(circle at 36% 48%, rgba(25, 135, 123, 0.2), transparent 25%),
    linear-gradient(180deg, #111218 0%, #101116 100%);
}

.sidebar,
.customer-top {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 16, 22, 0.72);
  backdrop-filter: blur(18px);
}

.brand-mark {
  background: linear-gradient(135deg, #4aa3ff, #35d1c3);
  color: #ffffff;
}

.brand-name,
h1,
h2,
.metric-panel strong {
  color: #ffffff;
}

.brand-subtitle,
.customer-hero p:last-child,
.gateway-hero p,
.doc-section p,
td,
.status-step p,
.field-item span:last-child {
  color: var(--muted);
}

.gateway-hero {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 86px 20px 26px;
}

.gateway-hero h1 {
  margin: 12px 0 16px;
  font-size: 64px;
  line-height: 1.08;
  font-weight: 900;
}

.gateway-hero h1::first-line {
  color: #ffffff;
}

.gateway-hero p {
  max-width: 720px;
  margin: 0;
  font-size: 18px;
  line-height: 1.8;
}

.login-view {
  display: grid;
  justify-items: center;
}

.auth-card {
  width: min(420px, 100%);
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(27, 30, 41, 0.72);
  box-shadow: var(--shadow);
}

.register-link {
  display: inline-flex;
  justify-content: center;
  color: var(--blue-strong);
  text-decoration: none;
  font-weight: 800;
}

.workspace-panel,
.metric-panel,
.side-status,
.field-item,
.status-step,
.timeline-item,
.session-item {
  border-color: rgba(151, 174, 218, 0.2);
  background: rgba(24, 27, 37, 0.82);
  box-shadow: var(--shadow);
}

.customer-hero {
  background:
    linear-gradient(100deg, rgba(25, 29, 41, 0.88), rgba(21, 34, 52, 0.68)),
    repeating-linear-gradient(90deg, rgba(74, 163, 255, 0.07) 0 1px, transparent 1px 64px);
  border-color: rgba(96, 165, 250, 0.3);
}

.nav-item {
  color: #c6cede;
}

.nav-item:hover,
.nav-item.active,
.session-item.active {
  color: #ffffff;
  border-color: rgba(74, 163, 255, 0.48);
  background: rgba(74, 163, 255, 0.14);
}

.status-pill,
.secondary-action,
.secondary-link {
  color: #d8ecff;
  border-color: rgba(74, 163, 255, 0.32);
  background: rgba(74, 163, 255, 0.12);
}

.primary-action,
.send-button {
  background: linear-gradient(135deg, #3f9cff, #0e70dc);
  box-shadow: 0 16px 32px rgba(64, 156, 255, 0.24);
}

.icon-button {
  color: #d8ecff;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.stack-form input,
.search-form input,
.composer textarea,
.composer input {
  color: #ffffff;
  border-color: rgba(151, 174, 218, 0.26);
  background: rgba(14, 16, 23, 0.78);
}

.stack-form input::placeholder,
.search-form input::placeholder,
.composer textarea::placeholder {
  color: #7f8ca4;
}

.bubble {
  color: #f7fbff;
}

.agent .bubble {
  border-color: rgba(151, 174, 218, 0.24);
  background: rgba(21, 24, 34, 0.9);
}

.customer .bubble {
  background: linear-gradient(135deg, #1c7ff0, #3b52dd);
}

.message-meta {
  color: #8da0bd;
}

.doc-section h3 {
  color: var(--blue-strong);
}

.progress-track {
  background: rgba(93, 113, 150, 0.24);
}

.customer-workspace {
  min-height: calc(100vh - 220px);
}

.customer-chat-panel,
.session-panel {
  min-height: calc(100vh - 220px);
}

.chat-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.bounded-stream {
  height: 100%;
  max-height: none;
  min-height: 520px;
  padding-bottom: 8px;
}

.composer {
  padding-top: 8px;
}

.send-button {
  align-self: end;
}

.requirement-card {
  max-height: calc(100vh - 220px);
}

.code-panel,
.message-card {
  color: #e9f2ff;
  border-color: rgba(151, 174, 218, 0.24);
  background:
    linear-gradient(rgba(18, 21, 30, 0.94), rgba(18, 21, 30, 0.94)),
    repeating-linear-gradient(0deg, rgba(74, 163, 255, 0.06) 0 1px, transparent 1px 28px);
}

.compact-code {
  min-height: 240px;
  max-height: 360px;
  margin-top: 16px;
}

.compact-list {
  margin-bottom: 18px;
}

th {
  color: #7cd7ff;
}

th,
td {
  border-color: rgba(151, 174, 218, 0.16);
}

tr[data-conversation-id]:hover td,
tr[data-open-todo]:hover td {
  background: rgba(74, 163, 255, 0.1);
}

@media (max-width: 680px) {
  .gateway-hero {
    padding-top: 40px;
  }

  .gateway-hero h1 {
    font-size: 40px;
  }

  .bounded-stream {
    min-height: 420px;
  }
}

body[data-app="customer"] .customer-hero.app-hero {
  min-height: 128px;
  margin: 12px 0;
  padding: 22px;
}

body[data-app="customer"] .customer-workspace {
  min-height: 0;
  height: clamp(500px, calc(100vh - 238px), 620px);
  align-items: stretch;
}

body[data-app="customer"] .customer-chat-panel,
body[data-app="customer"] .session-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body[data-app="customer"] .session-list,
body[data-app="customer"] .customer-side {
  max-height: 100%;
  overflow: auto;
}

.chat-layout {
  min-height: 0;
}

#conversationDetailPanel {
  height: clamp(500px, calc(100vh - 330px), 640px);
}

.chat-panel {
  min-height: 0;
  overflow: hidden;
}

.bounded-stream {
  min-height: 0;
  height: auto;
  max-height: none;
}

#messageStream,
#adminMessageStream {
  min-height: 0;
}
