:root {
  --bg: #eef5ff;
  --bg-soft: #f8fbff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --panel-tint: rgba(233, 244, 255, 0.9);
  --line: rgba(102, 139, 184, 0.18);
  --line-strong: rgba(65, 123, 189, 0.34);
  --text: #10233f;
  --muted: #5e7190;
  --muted-strong: #324663;
  --cyan: #1cc7d6;
  --cyan-soft: rgba(28, 199, 214, 0.14);
  --blue: #2b6fff;
  --blue-soft: rgba(43, 111, 255, 0.14);
  --violet: #6f57ff;
  --violet-soft: rgba(111, 87, 255, 0.14);
  --amber: #ff9d2f;
  --amber-soft: rgba(255, 157, 47, 0.18);
  --green: #0ea76b;
  --green-soft: rgba(14, 167, 107, 0.14);
  --danger: #e45c55;
  --danger-soft: rgba(228, 92, 85, 0.14);
  --shadow: 0 24px 70px rgba(67, 104, 148, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "IBM Plex Sans", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(78, 181, 255, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(104, 90, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #f6fbff 0%, #eef4ff 48%, #f7fbff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(115, 155, 209, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 155, 209, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 90%);
}

.personal-os-page {
  background: #f5f7f8;
  color: #172326;
}

.personal-os-page::before {
  display: none;
}

/* ---- Personal OS 深色模式 ---- */
[data-theme="dark"] .personal-os-page {
  background: #0f0f1a;
  color: #e8e6f0;
}

[data-theme="dark"] .pos-header {
  background: #161625;
  border-bottom-color: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .pos-header h1 {
  color: #f0eeff;
}

[data-theme="dark"] .pos-header p {
  color: #9b97b0;
}

[data-theme="dark"] .pos-tabs {
  background: #161625;
  border-bottom-color: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .pos-tabs a {
  color: #b0adc4;
}

[data-theme="dark"] .pos-tabs a.active,
[data-theme="dark"] .pos-tabs a:hover {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
}

[data-theme="dark"] .pos-band,
[data-theme="dark"] .pos-panel {
  background: #1a1a2e;
  border-color: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .pos-reading-card {
  background: #1e1e35;
  border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .pos-reading-card h2 {
  color: #e0deff;
}

[data-theme="dark"] .pos-reading-card p {
  color: #b0adc4;
}

[data-theme="dark"] .pos-mermaid {
  background: #12122a;
  border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .pos-modal-overlay {
  background: rgba(10, 10, 20, 0.7);
}

[data-theme="dark"] .pos-modal-dialog {
  background: #1a1a2e;
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .pos-modal-head {
  background: #1a1a2e;
  border-bottom-color: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .pos-modal-head h2 {
  color: #e0deff;
}

[data-theme="dark"] .pos-diagram-box {
  background: #1e1e35;
  border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .pos-card-markdown {
  background: #12122a;
  color: #c8c6e0;
  border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .ingest-trace-summary {
  background: #1e1e35;
  border-color: rgba(139, 92, 246, 0.12);
  color: #c8c6e0;
}

[data-theme="dark"] .ingest-trace-item {
  background: #1e1e35;
  border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .ingest-trace-item pre {
  background: #12122a;
  color: #c8c6e0;
}

[data-theme="dark"] .mini-item {
  background: #1e1e35;
  border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .mini-row {
  border-bottom-color: rgba(139, 92, 246, 0.08);
}

[data-theme="dark"] #ingest-band input,
[data-theme="dark"] #ingest-band select {
  background: #1e1e35;
  border-color: rgba(139, 92, 246, 0.2);
  color: #e0deff;
}

[data-theme="dark"] .support-diagnostic-cell {
  background: #1e1e35;
  border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .support-chat-log {
  background: #12122a;
  border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .support-message.from-agent {
  background: #1e1e35;
  border-color: rgba(14, 167, 107, 0.2);
}

[data-theme="dark"] .support-message.from-user {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .ingest-config-panel {
  background: #1e1e35;
  border-color: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .ingest-config-panel .config-title {
  color: #e0deff;
}

[data-theme="dark"] .ingest-config-field input,
[data-theme="dark"] .ingest-config-field select {
  background: #12122a;
  border-color: rgba(139, 92, 246, 0.2);
  color: #e0deff;
}

[data-theme="dark"] .overview-card {
  background: #1a1a2e;
  border-color: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .ghost-btn {
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .ghost-btn:hover {
  background: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .teal-btn {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
}

.pos-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 18px;
  border-bottom: 1px solid rgba(33, 51, 56, 0.12);
  background: #ffffff;
}

.pos-header h1 {
  margin: 4px 0 6px;
  font-size: 34px;
  letter-spacing: 0;
}

.pos-header p {
  margin: 0;
  color: #5c6b70;
}

.pos-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pos-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 32px;
  background: #ffffff;
  border-bottom: 1px solid rgba(33, 51, 56, 0.1);
}

.pos-tabs a {
  color: #2b3b40;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
}

.pos-tabs a.active,
.pos-tabs a:hover {
  background: #e5f1ef;
  color: #0f5f58;
}

.pos-layout {
  padding: 24px 32px 40px;
}

.pos-band,
.pos-panel {
  background: #ffffff;
  border: 1px solid rgba(33, 51, 56, 0.12);
  border-radius: 8px;
}

.pos-band {
  padding: 18px;
  margin-bottom: 18px;
}

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

.pos-panel {
  padding: 16px;
  min-width: 0;
}

.pos-panel.wide {
  grid-row: span 3;
}

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

.pos-reading-card {
  border: 1px solid rgba(33, 51, 56, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.pos-reading-card h2 {
  margin: 4px 0 8px;
  font-size: 18px;
  letter-spacing: 0;
}

.pos-reading-card p {
  color: #405155;
  line-height: 1.55;
}

.pos-mermaid {
  margin: 10px 0;
  padding: 10px;
  overflow-x: auto;
  background: #eef4f3;
  border: 1px solid rgba(33, 51, 56, 0.1);
  border-radius: 6px;
  font-size: 12px;
}

.pos-card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pos-reading-card .pos-card-actions .compact-btn,
.pos-modal-head .pos-card-actions .compact-btn,
#ingest-result .compact-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.pos-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 33, 38, 0.36);
}

.pos-modal-dialog {
  width: min(1040px, 94vw);
  max-height: 88vh;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(33, 51, 56, 0.16);
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(19, 34, 39, 0.22);
}

.pos-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(33, 51, 56, 0.1);
  background: #ffffff;
}

.pos-modal-head h2 {
  margin: 4px 0 6px;
  font-size: 20px;
  letter-spacing: 0;
}

.pos-modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.pos-diagram-stack {
  display: grid;
  gap: 12px;
}

.pos-diagram-box {
  min-height: 120px;
  padding: 12px;
  border: 1px solid rgba(33, 51, 56, 0.1);
  border-radius: 8px;
  background: #fbfcfc;
}

.pos-card-markdown {
  max-height: 46vh;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(33, 51, 56, 0.1);
  border-radius: 8px;
  background: #f6f8f8;
  color: #24373b;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ingest-trace-dialog {
  width: min(1120px, 94vw);
}

.ingest-trace-summary {
  padding: 10px 12px;
  border: 1px solid rgba(33, 51, 56, 0.1);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--ink);
  font-size: 13px;
}

.ingest-trace-list {
  display: grid;
  gap: 10px;
}

.ingest-trace-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(33, 51, 56, 0.1);
  border-radius: 8px;
  background: #ffffff;
}

.ingest-trace-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ingest-trace-line strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.ingest-trace-line time {
  color: var(--muted);
  font-size: 12px;
}

.ingest-trace-index {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(33, 51, 56, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.ingest-trace-item pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafb;
  color: #24363c;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- Visualization Engine ---- */

.mermaid-render-container {
  overflow-x: auto;
}

.mermaid-render-container svg {
  max-width: 100%;
  height: auto;
}

.mermaid-render-container svg .node rect,
.mermaid-render-container svg .node circle,
.mermaid-render-container svg .node polygon {
  stroke-width: 1.5px;
}

.vis-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(33, 51, 56, 0.06);
  font-size: 13px;
}

.mini-row:last-child {
  border-bottom: none;
}

.mini-row span {
  color: var(--muted);
  font-size: 12px;
}

.mini-row strong {
  color: var(--text);
  text-align: right;
}

.mini-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(33, 51, 56, 0.08);
  background: #fbfcfc;
}

.wide-2 {
  grid-column: span 2;
}

#ingest-band input,
#ingest-band select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(33, 51, 56, 0.15);
  background: #fff;
  font-size: 14px;
}

#ingest-band input:focus,
#ingest-band select:focus {
  border-color: rgba(43, 111, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(43, 111, 255, 0.08);
  outline: none;
}

#ingest-band select {
  min-width: 140px;
}

.support-agent-panel {
  padding: 18px;
}

.support-agent-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.support-agent-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  padding: 18px;
  border-right: 1px solid rgba(33, 51, 56, 0.1);
}

.mascot-button {
  position: relative;
  width: 160px;
  height: 188px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.mascot-face {
  position: absolute;
  left: 19px;
  top: 8px;
  width: 122px;
  height: 112px;
  border: 3px solid #253b45;
  border-radius: 42% 42% 46% 46%;
  background: linear-gradient(180deg, #fff7e8, #ffe2cf);
  box-shadow: 0 16px 34px rgba(68, 90, 104, 0.18);
  transition: transform 180ms ease;
}

.mascot-ear {
  position: absolute;
  top: -18px;
  width: 34px;
  height: 42px;
  border: 3px solid #253b45;
  border-bottom: none;
  background: #ffcf86;
  border-radius: 24px 24px 8px 8px;
}

.mascot-ear.left {
  left: 16px;
  transform: rotate(-14deg);
}

.mascot-ear.right {
  right: 16px;
  transform: rotate(14deg);
}

.mascot-eye {
  position: absolute;
  top: 46px;
  width: 14px;
  height: 20px;
  border-radius: 999px;
  background: #1d333b;
  animation: mascotBlink 5s infinite;
}

.mascot-eye.left {
  left: 36px;
}

.mascot-eye.right {
  right: 36px;
}

.mascot-cheek {
  position: absolute;
  top: 70px;
  width: 20px;
  height: 10px;
  border-radius: 999px;
  background: rgba(241, 105, 112, 0.28);
}

.mascot-cheek.left {
  left: 18px;
}

.mascot-cheek.right {
  right: 18px;
}

.mascot-mouth {
  position: absolute;
  left: 52px;
  top: 72px;
  width: 18px;
  height: 10px;
  border-bottom: 3px solid #253b45;
  border-radius: 0 0 999px 999px;
}

.mascot-body {
  position: absolute;
  left: 30px;
  top: 112px;
  width: 100px;
  height: 68px;
  border: 3px solid #253b45;
  border-radius: 26px 26px 18px 18px;
  background: linear-gradient(160deg, #dff7ee, #aee4d6);
  box-shadow: 0 14px 30px rgba(32, 118, 105, 0.14);
}

.mascot-badge {
  position: absolute;
  left: 28px;
  top: 21px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: #0f5f58;
  font-size: 11px;
  font-weight: 800;
}

.mascot-button:hover .mascot-face,
.mascot-button.excited .mascot-face {
  transform: translateY(-4px) rotate(-2deg);
}

.mascot-button.thinking .mascot-face {
  animation: mascotNod 880ms ease-in-out infinite;
}

.support-agent-status {
  text-align: center;
}

.support-agent-status .overview-title {
  font-size: 20px;
}

.support-agent-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.support-diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.support-diagnostic-cell {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(33, 51, 56, 0.1);
  border-radius: 8px;
  background: #fbfcfc;
}

.support-diagnostic-cell.wide {
  grid-column: span 2;
}

.support-diagnostic-cell span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.support-diagnostic-cell strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.support-chat-log {
  min-height: 260px;
  max-height: 46vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(33, 51, 56, 0.1);
  border-radius: 8px;
  background: #f7faf9;
}

.support-message {
  width: min(78%, 760px);
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.support-message span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.support-message.from-agent {
  margin-right: auto;
  border: 1px solid rgba(14, 167, 107, 0.16);
  background: #ffffff;
}

.support-message.from-user {
  margin-left: auto;
  border: 1px solid rgba(43, 111, 255, 0.16);
  background: #eef5ff;
}

.support-chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

/* ---- 拆解参数配置面板（Support Agent 内嵌） ---- */
.ingest-config-panel {
  padding: 16px;
  border: 1px solid rgba(33, 51, 56, 0.12);
  border-radius: 10px;
  background: #f9fbfb;
}

.ingest-config-panel .config-title {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #213338;
}

.ingest-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.ingest-config-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ingest-config-field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.ingest-config-field input,
.ingest-config-field select {
  padding: 7px 10px;
  border: 1px solid rgba(33, 51, 56, 0.16);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #213338;
}

.ingest-config-field input:focus,
.ingest-config-field select:focus {
  border-color: rgba(43, 111, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(43, 111, 255, 0.08);
  outline: none;
}

.ingest-config-field input[type="number"] {
  width: 100%;
}

.ingest-config-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.ingest-config-actions .save-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

@keyframes mascotBlink {
  0%, 94%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

@keyframes mascotNod {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.overview-card.accent-cyan::before {
  background: linear-gradient(135deg, rgba(28, 199, 214, 0.08), transparent 60%);
}

.overview-card.accent-amber::before {
  background: linear-gradient(135deg, rgba(255, 157, 47, 0.08), transparent 60%);
}

.overview-card.accent-violet::before {
  background: linear-gradient(135deg, rgba(111, 87, 255, 0.08), transparent 60%);
}

.pos-panel .pos-reading-card {
  margin-bottom: 8px;
}

.pos-panel .pos-reading-card h2 {
  font-size: 15px;
}

@media (max-width: 900px) {
  .wide-2 {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  .pos-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 18px 16px;
  }

  .pos-tabs,
  .pos-layout {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .support-agent-shell {
    grid-template-columns: 1fr;
  }

  .support-agent-side {
    border-right: none;
    border-bottom: 1px solid rgba(33, 51, 56, 0.1);
  }

  .support-diagnostics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .support-diagnostic-cell.wide {
    grid-column: span 2;
  }

  .support-chat-input {
    grid-template-columns: 1fr;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 438px;
  gap: 14px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar,
.stage,
.dock {
  min-height: 0;
}

.sidebar,
.dock {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-head,
.sidebar-panel,
.stage-top,
.overview-band,
.round-band,
.timeline-wrap,
.dock-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px;
}

.hall-mark {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.sidebar-panel,
.dock-card {
  padding: 16px;
}

.sidebar-panel.fill,
.dock-card.grow {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-panel.compact,
.split-stack,
.mini-stack,
.room-list,
.timeline,
.event-log {
  overflow: auto;
}

.sidebar-title,
.dock-title,
.minor-title,
.timeline-kicker,
.crumb,
.overview-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.crumb {
  color: var(--blue);
  font-weight: 700;
}

.stack-form,
.editor-cards,
.mini-stack,
.split-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subtle-top {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(82, 123, 176, 0.1);
}

.room-item,
.project-chip,
.artifact-chip,
.mini-item,
.event-item,
.editor-card,
.phase-marker,
.bridge-card,
.overview-card {
  border-radius: 18px;
  border: 1px solid rgba(93, 136, 184, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 250, 255, 0.84));
}

.room-item {
  padding: 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.room-item:hover,
.project-chip:hover,
.editor-card:hover,
.overview-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(58, 104, 158, 0.12);
}

.room-item.active {
  border-color: rgba(43, 111, 255, 0.36);
  background: linear-gradient(180deg, rgba(233, 244, 255, 0.98), rgba(243, 248, 255, 0.9));
}

.project-chip.active {
  border-color: rgba(28, 199, 214, 0.28);
  background: linear-gradient(180deg, rgba(236, 255, 252, 0.98), rgba(246, 255, 253, 0.92));
}

.room-title,
.editor-name,
.overview-card h3 {
  font-weight: 800;
  line-height: 1.32;
}

.room-title {
  font-size: 15px;
}

.room-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.delete-session-btn {
  border: 1px solid rgba(224, 86, 86, 0.18);
  background: rgba(255, 242, 242, 0.92);
  color: #b54545;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.delete-session-btn:hover {
  background: #ffe4e4;
  border-color: rgba(224, 86, 86, 0.34);
}

.room-meta,
.field-hint,
.event-time,
.timeline-side-note,
.overview-caption,
.editor-meta {
  color: var(--muted);
  font-size: 12px;
}

.room-meta,
.overview-metrics,
.stage-actions,
.button-row,
.action-help-pair,
.agent-line,
.score-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-actions {
  align-items: flex-start;
}

.action-help-pair {
  align-items: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-chip.closed,
.status-chip.consensus {
  background: var(--green-soft);
  color: var(--green);
}

.status-chip.running {
  background: var(--cyan-soft);
  color: #008d97;
}

.status-chip.awaiting-human {
  background: var(--amber-soft);
  color: #b86a00;
}

.project-chip,
.artifact-chip,
.mini-item,
.event-item,
.bridge-card {
  padding: 12px 14px;
  line-height: 1.55;
}

.teal-btn,
.ghost-btn,
.danger-btn {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.teal-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.help-btn:hover {
  transform: translateY(-1px);
}

.teal-btn {
  background: linear-gradient(135deg, #0d8cff, #1dc8d7);
  color: white;
  box-shadow: 0 12px 28px rgba(31, 145, 224, 0.24);
}

.ghost-btn {
  background: rgba(242, 248, 255, 0.92);
  border-color: rgba(102, 139, 184, 0.18);
  color: var(--muted-strong);
}

.danger-btn {
  background: linear-gradient(135deg, #ff8577, #e45956);
  color: white;
  box-shadow: 0 10px 24px rgba(228, 92, 85, 0.18);
}

.compact-btn {
  padding: 10px 12px;
  white-space: nowrap;
}

button:disabled,
button[data-pending="true"] {
  opacity: 0.72;
  cursor: progress;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(109, 146, 189, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 11px 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(43, 111, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(43, 111, 255, 0.08);
}

textarea {
  resize: vertical;
  min-height: 92px;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.stage-top {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  overflow: hidden;
}

.stage-top::after,
.overview-band::after,
.timeline-wrap::after {
  content: "";
  position: absolute;
  inset: auto -20% 0 auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(28, 199, 214, 0.14), transparent 68%);
  pointer-events: none;
}

.stage-top h1 {
  margin: 8px 0 6px;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #123c72, #2067ff 46%, #13b7c4 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stage-top p {
  margin: 0;
  max-width: 760px;
  line-height: 1.6;
  color: var(--muted);
}

.overview-band {
  padding: 18px 22px;
}

.overview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.overview-title {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--muted-strong);
}

.overview-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.overview-card {
  padding: 16px;
  min-height: 182px;
  position: relative;
  overflow: hidden;
}

.overview-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(43, 111, 255, 0.04), transparent 60%);
  pointer-events: none;
}

.overview-card.accent-cyan::before {
  background: linear-gradient(135deg, rgba(28, 199, 214, 0.08), transparent 60%);
}

.overview-card.accent-amber::before {
  background: linear-gradient(135deg, rgba(255, 157, 47, 0.08), transparent 60%);
}

.overview-card h3 {
  margin: 8px 0 10px;
  font-size: 18px;
}

.overview-card p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted-strong);
}

.overview-metrics {
  margin-top: 16px;
}

.overview-metrics span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(226, 237, 251, 0.86);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.round-band {
  padding: 14px 16px;
}

.round-band-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.round-rail {
  display: flex;
  gap: 10px;
  overflow: auto;
}

.phase-marker {
  min-width: 100px;
  justify-content: center;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.phase-marker.active {
  border-color: rgba(14, 167, 107, 0.24);
  background: linear-gradient(180deg, rgba(232, 255, 244, 0.96), rgba(244, 255, 249, 0.88));
  color: var(--green);
}

.timeline-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 18px 22px 20px;
}

.timeline-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(28, 199, 214, 0.08), transparent 24%, transparent 86%, rgba(43, 111, 255, 0.06)),
    radial-gradient(circle at 0% 0%, rgba(111, 87, 255, 0.1), transparent 22%);
  pointer-events: none;
}

.timeline-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.timeline {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100% - 40px);
  padding-right: 4px;
}

.meeting-start {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(230, 239, 251, 0.9);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.thinking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding-left: 6px;
  font-size: 13px;
}

.thinking-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.timeline-event {
  border-radius: 18px;
  border: 1px solid rgba(93, 136, 184, 0.14);
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.96), rgba(239, 247, 255, 0.92));
  padding: 12px 14px;
  line-height: 1.55;
}

.timeline-event.success {
  border-color: rgba(14, 167, 107, 0.18);
  background: linear-gradient(180deg, rgba(240, 255, 248, 0.96), rgba(247, 255, 251, 0.92));
}

.timeline-event.accent {
  border-color: rgba(43, 111, 255, 0.18);
  background: linear-gradient(180deg, rgba(241, 247, 255, 0.98), rgba(252, 254, 255, 0.94));
}

.timeline-event.danger {
  border-color: rgba(228, 92, 85, 0.2);
  background: linear-gradient(180deg, rgba(255, 245, 245, 0.98), rgba(255, 251, 251, 0.94));
}

.timeline-event-title {
  font-weight: 800;
  color: var(--muted-strong);
}

.timeline-event-detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.debate-card {
  border-radius: 22px;
  padding: 16px 18px;
  border: 1px solid transparent;
  box-shadow: 0 14px 30px rgba(84, 122, 172, 0.12);
}

.debate-card.orange {
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.98), rgba(255, 253, 249, 0.92));
  border-color: rgba(255, 157, 47, 0.2);
}

.debate-card.blue {
  background: linear-gradient(180deg, rgba(241, 247, 255, 0.98), rgba(252, 254, 255, 0.94));
  border-color: rgba(43, 111, 255, 0.18);
}

.debate-card.purple {
  background: linear-gradient(180deg, rgba(247, 243, 255, 0.98), rgba(254, 252, 255, 0.94));
  border-color: rgba(111, 87, 255, 0.18);
}

.debate-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.agent-name {
  font-size: 16px;
}

.agent-subtag {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  background: rgba(225, 236, 248, 0.86);
  color: var(--muted-strong);
}

.score-line {
  font-size: 12px;
}

.score-line .consensus {
  color: var(--green);
}

.score-line .divergence {
  color: #c67400;
}

.score-line .yielding {
  color: #8d63ff;
}

.debate-text {
  margin-top: 12px;
  line-height: 1.72;
  color: var(--text);
}

.markdown-body p {
  margin: 0 0 10px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 14px 0 8px;
  letter-spacing: -0.02em;
  color: #16305d;
}

.markdown-body h1 {
  font-size: 22px;
}

.markdown-body h2 {
  font-size: 18px;
}

.markdown-body h3 {
  font-size: 15px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 8px 0 12px 20px;
  padding: 0;
}

.markdown-body li {
  margin: 4px 0;
}

.markdown-body blockquote {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 4px solid rgba(43, 111, 255, 0.42);
  border-radius: 12px;
  background: rgba(236, 244, 255, 0.72);
  color: var(--muted-strong);
}

.markdown-inline-code {
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(16, 36, 72, 0.08);
  color: #0d4bc7;
  font-size: 0.92em;
}

.markdown-code-shell {
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid rgba(43, 111, 255, 0.16);
  border-radius: 16px;
  background: rgba(7, 20, 43, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.markdown-code-title {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #9fc4ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.markdown-code-shell pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #eef7ff;
  font-size: 12px;
  line-height: 1.62;
}

.markdown-mermaid {
  border-color: rgba(36, 210, 196, 0.32);
  background:
    linear-gradient(135deg, rgba(19, 44, 72, 0.96), rgba(8, 25, 46, 0.96)),
    radial-gradient(circle at top right, rgba(36, 210, 196, 0.2), transparent 34%);
}

.markdown-mermaid .markdown-code-title {
  color: #7df4e8;
}

.debate-foot {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.dock-card.grow {
  overflow: hidden;
}

.dock-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.help-btn {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(43, 111, 255, 0.22);
  background: rgba(236, 244, 255, 0.98);
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.help-btn::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 300px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(10, 30, 57, 0.94);
  color: #eef7ff;
  box-shadow: 0 20px 50px rgba(16, 42, 77, 0.34);
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.help-btn:hover::after,
.help-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.stage-help-btn::after {
  right: auto;
  left: 0;
  width: 340px;
}

.editor-card {
  padding: 14px;
}

.editor-card.is-disabled {
  opacity: 0.7;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.96), rgba(241, 246, 255, 0.92));
}

.editor-card.is-disabled textarea,
.editor-card.is-disabled input:not([type="checkbox"]),
.editor-card.is-disabled select {
  opacity: 0.78;
}

.editor-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  align-items: flex-start;
}

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

.editor-label {
  display: block;
  margin: 8px 0 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-label.inline-label {
  margin: 0;
}

.agent-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(43, 111, 255, 0.14);
  background: rgba(241, 247, 255, 0.88);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.agent-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.agent-switch-ui {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(118, 141, 173, 0.3);
  transition: background 160ms ease;
}

.agent-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 6px 14px rgba(64, 92, 124, 0.2);
  transition: transform 160ms ease;
}

.agent-switch input:checked + .agent-switch-ui {
  background: linear-gradient(135deg, #0d8cff, #1dc8d7);
}

.agent-switch input:checked + .agent-switch-ui::after {
  transform: translateX(16px);
}

.agent-switch-text {
  white-space: nowrap;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.warning-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #b86a00;
  font-size: 11px;
  font-weight: 800;
}

.field-hint {
  margin-top: 10px;
  line-height: 1.6;
}

.field-hint.danger {
  color: #975300;
}

.runtime-candidate-wrap {
  margin-top: 10px;
}

.runtime-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.runtime-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(230, 239, 252, 0.92);
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.warning-card {
  border-color: rgba(255, 157, 47, 0.24);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.98), rgba(255, 251, 244, 0.92));
}

.warning-line + .warning-line {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(212, 143, 63, 0.24);
}

.rate-limit-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rate-limit-editor {
  display: grid;
  grid-template-columns: auto 92px;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.rate-limit-editor input {
  padding: 9px 11px;
}

.rate-limit-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rate-limit-presets .compact-btn {
  min-width: 74px;
}

.topic-input {
  font-size: 15px;
  font-weight: 800;
  border-color: rgba(22, 139, 214, 0.28);
  background: linear-gradient(180deg, #ffffff, #f6fbff);
}

.field-with-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-with-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.event-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.agent-log-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(43, 111, 255, 0.25);
  background: rgba(255, 255, 255, 0.86);
  color: #2b6fff;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.agent-log-btn.inline {
  margin-left: 10px;
  width: 22px;
  height: 22px;
}

.agent-log-btn:hover {
  background: #eaf3ff;
  border-color: rgba(43, 111, 255, 0.48);
}

.agent-log-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(21, 36, 64, 0.28);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.agent-log-dialog {
  width: min(820px, 94vw);
  max-height: 84vh;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(142, 169, 201, 0.38);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.98));
  box-shadow: 0 28px 80px rgba(40, 67, 106, 0.26);
  padding: 20px;
}

.agent-log-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.agent-log-head h3 {
  margin: 4px 0 0;
}

.agent-log-dialog h4 {
  margin: 18px 0 8px;
}

.agent-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-log-line {
  border: 1px solid rgba(190, 207, 226, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
  color: var(--muted-strong);
  line-height: 1.55;
}

.agent-log-line.success {
  border-color: rgba(55, 176, 116, 0.22);
  background: rgba(243, 255, 248, 0.9);
}

.diagnosis-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diagnosis-card {
  border: 1px solid rgba(190, 207, 226, 0.78);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 12px;
}

.diagnosis-card.running {
  border-color: rgba(43, 111, 255, 0.26);
  background: linear-gradient(180deg, #f5f9ff, #ffffff);
}

.diagnosis-card.warning {
  border-color: rgba(255, 157, 47, 0.32);
  background: linear-gradient(180deg, #fff8eb, #ffffff);
}

.diagnosis-card.danger {
  border-color: rgba(224, 86, 86, 0.34);
  background: linear-gradient(180deg, #fff2f2, #ffffff);
}

.diagnosis-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted-strong);
}

.diagnosis-main {
  margin-top: 8px;
  font-weight: 800;
  line-height: 1.55;
}

.diagnosis-grid {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 12px 0;
  font-size: 12px;
}

.diagnosis-grid span {
  color: var(--muted);
  font-weight: 800;
}

.diagnosis-grid strong {
  color: var(--muted-strong);
  word-break: break-all;
}

.event-item strong {
  color: var(--muted-strong);
}

.advanced-actions {
  position: relative;
}

.advanced-actions summary {
  list-style: none;
}

.advanced-actions summary::-webkit-details-marker {
  display: none;
}

.advanced-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 4;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(102, 139, 184, 0.18);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgba(58, 104, 158, 0.16);
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 16px;
  color: white;
  background: rgba(16, 42, 77, 0.94);
  box-shadow: 0 18px 34px rgba(16, 42, 77, 0.24);
  transform: translateY(8px);
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: rgba(14, 167, 107, 0.94);
}

.toast.error {
  background: rgba(228, 92, 85, 0.96);
}

.toast.warning {
  background: rgba(184, 106, 0, 0.96);
}

@media (max-width: 1650px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr) 400px;
  }

  .overview-cards {
    grid-template-columns: 1fr;
  }
}

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

  .stage-top,
  .overview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .stage-actions {
    width: 100%;
  }

  .advanced-menu {
    left: 0;
    right: auto;
  }
}

/* ---- Global floating Support Agent ---- */
.support-agent-drawer {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 80;
  width: min(940px, calc(100vw - 44px));
  max-height: calc(100vh - 132px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(33, 51, 56, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 70px rgba(33, 51, 56, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.985);
  transition: opacity 160ms ease, transform 160ms ease;
}

.support-agent-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.support-agent-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(14, 167, 107, 0.24);
  border-radius: 999px;
  background: #ffffff;
  color: #0f5f58;
  box-shadow: 0 16px 40px rgba(32, 118, 105, 0.2);
  cursor: pointer;
  font-weight: 800;
}

.support-agent-float.is-open,
.support-agent-float:hover {
  background: #eaf8f4;
  transform: translateY(-1px);
}

.support-agent-float-face {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff7e8;
}

@media (max-width: 900px) {
  .support-agent-drawer {
    left: 12px;
    right: 12px;
    bottom: 82px;
    width: auto;
  }
  .support-agent-float {
    right: 16px;
    bottom: 16px;
  }
}
