/*
 * AI 觀測台共用視覺系統
 * 只在 ewoooc_base.html 的 .momo-observability-mode 啟用，避免污染一般後台頁。
 *
 * Governance:
 * - 新增觀測頁時，優先使用本檔 token / utility class，不要在 template 內重建一套 hero/table/card。
 * - 標題與 KPI 數字使用 --obs-title-size / --obs-value-size，不要再硬寫超大 clamp。
 * - 圖表容器使用 .obs-chart-frame 系列；只有資料百分比 width 可保留 inline style。
 * - 視覺語言固定為暖色焦糖系、Noto Sans TC、點陣方格；禁止回到紫色、純黑、Times/Georgia。
 */
.momo-observability-mode {
  --obs-ink: var(--momo-ink, #302720);
  --obs-muted: var(--momo-muted, #8b8077);
  --obs-paper: var(--momo-paper, #fff8ef);
  --obs-accent: var(--momo-accent, #c96442);
  --obs-accent-soft: rgba(201, 100, 66, 0.12);
  --obs-line: rgba(86, 64, 48, 0.14);
  --obs-card: rgba(255, 252, 246, 0.92);
  --obs-green: #4f8a5b;
  --obs-amber: #b8792f;
  --obs-red: #b94b45;
  --obs-blue: #4f6f8f;
  --obs-radius-lg: 8px;
  --obs-radius-md: 8px;
  --obs-shadow: 0 18px 44px rgba(70, 46, 28, 0.09);
  --obs-dot:
    radial-gradient(circle, rgba(201, 100, 66, 0.18) 1px, transparent 1.3px);
  --obs-title-size: 2.25rem;
  --obs-value-size: 2rem;
}

.momo-observability-mode .momo-content {
  background:
    var(--obs-dot),
    radial-gradient(circle at 8% 4%, rgba(201, 100, 66, 0.12), transparent 24rem),
    radial-gradient(circle at 100% 20%, rgba(79, 111, 143, 0.11), transparent 26rem),
    linear-gradient(180deg, rgba(255, 248, 239, 0.65), rgba(255, 253, 248, 0.96));
  background-size: 18px 18px, auto, auto, auto;
  color: var(--obs-ink);
  font-family: var(--momo-font-display, "Inter", "Noto Sans TC", system-ui, sans-serif);
}

.momo-observability-mode .momo-content::before {
  content: "";
  position: fixed;
  inset: 64px 0 auto 260px;
  height: 180px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.92), rgba(255, 248, 239, 0));
  z-index: 0;
}

.momo-observability-mode .container-fluid,
.momo-observability-mode .obs-warroom,
.momo-observability-mode .agent-page,
.momo-observability-mode .biz-warroom,
.momo-observability-mode .runtime-page,
.momo-observability-mode .calls-page,
.momo-observability-mode .gov-page,
.momo-observability-mode .gate-page,
.momo-observability-mode .rag-page,
.momo-observability-mode .quality-page,
.momo-observability-mode .ppt-page {
  position: relative;
  z-index: 1;
}

.momo-observability-mode .container-fluid > h2:first-child {
  position: relative;
  margin-bottom: 1.1rem !important;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--obs-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 10%, rgba(201, 100, 66, 0.16), transparent 20rem),
    linear-gradient(135deg, rgba(255, 248, 239, 0.96), rgba(255, 255, 255, 0.76));
  box-shadow: 0 18px 42px rgba(70, 46, 28, 0.08);
  color: var(--obs-ink);
  font-family: var(--momo-font-display, "Inter", "Noto Sans TC", system-ui, sans-serif);
  font-size: var(--obs-title-size);
  letter-spacing: 0;
}

.momo-observability-mode .container-fluid > h2:first-child small {
  display: block;
  margin-top: 0.3rem;
  color: var(--obs-muted) !important;
  font-family: var(--momo-font-family, "Inter", "Noto Sans TC", system-ui, sans-serif);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
}

.momo-observability-mode .card {
  border: 1px solid var(--obs-line);
  border-radius: 22px;
  background: var(--obs-card);
  box-shadow: 0 14px 34px rgba(70, 46, 28, 0.07);
  overflow: hidden;
}

.momo-observability-mode .card-header {
  border-bottom: 1px solid var(--obs-line);
  background: linear-gradient(90deg, rgba(255, 248, 239, 0.92), rgba(255, 255, 255, 0.72)) !important;
  color: var(--obs-ink);
  font-weight: 800;
}

.momo-observability-mode .card-body {
  color: var(--obs-ink);
}

.momo-observability-mode .card-footer {
  border-top: 1px solid var(--obs-line);
  background: rgba(255, 248, 239, 0.56);
}

.momo-observability-mode .text-muted {
  color: var(--obs-muted) !important;
}

.momo-observability-mode h3,
.momo-observability-mode h4,
.momo-observability-mode h5 {
  letter-spacing: 0;
}

.momo-observability-mode h1,
.momo-observability-mode h2,
.momo-observability-mode h3,
.momo-observability-mode h4,
.momo-observability-mode h5,
.momo-observability-mode h6 {
  color: var(--obs-ink);
  font-family: var(--momo-font-display, "Inter", "Noto Sans TC", system-ui, sans-serif) !important;
  font-weight: 850;
}

.momo-observability-mode .obs-title,
.momo-observability-mode .agent-title,
.momo-observability-mode .biz-command h1,
.momo-observability-mode .runtime-title,
.momo-observability-mode .calls-title,
.momo-observability-mode .gov-title,
.momo-observability-mode .gate-title,
.momo-observability-mode .rag-title,
.momo-observability-mode .quality-title,
.momo-observability-mode .ppt-title {
  max-width: 780px;
  font-family: var(--momo-font-display, "Inter", "Noto Sans TC", system-ui, sans-serif) !important;
  font-size: clamp(1.9rem, 3.2vw, 2.75rem) !important;
  line-height: 1.12 !important;
  letter-spacing: 0!important;
  font-weight: 860 !important;
}

.momo-observability-mode .obs-hero,
.momo-observability-mode .agent-hero,
.momo-observability-mode .biz-command,
.momo-observability-mode .runtime-hero,
.momo-observability-mode .calls-hero,
.momo-observability-mode .gov-hero,
.momo-observability-mode .gate-hero,
.momo-observability-mode .rag-hero,
.momo-observability-mode .quality-hero,
.momo-observability-mode .ppt-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201, 100, 66, 0.16) !important;
  border-radius: 28px !important;
  box-shadow: var(--obs-shadow) !important;
  padding-top: clamp(1.05rem, 2vw, 1.65rem) !important;
  padding-bottom: clamp(1.05rem, 2vw, 1.65rem) !important;
}

.momo-observability-mode .obs-hero::after,
.momo-observability-mode .agent-hero::after,
.momo-observability-mode .biz-command::after,
.momo-observability-mode .runtime-hero::after,
.momo-observability-mode .calls-hero::after,
.momo-observability-mode .gov-hero::after,
.momo-observability-mode .gate-hero::after,
.momo-observability-mode .rag-hero::after,
.momo-observability-mode .quality-hero::after,
.momo-observability-mode .ppt-hero::after,
.momo-observability-mode .obs-panel::after,
.momo-observability-mode .agent-panel::after,
.momo-observability-mode .biz-panel::after,
.momo-observability-mode .runtime-panel::after,
.momo-observability-mode .calls-panel::after,
.momo-observability-mode .gov-panel::after,
.momo-observability-mode .gate-panel::after,
.momo-observability-mode .rag-panel::after,
.momo-observability-mode .quality-panel::after,
.momo-observability-mode .ppt-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 220px;
  height: 120px;
  pointer-events: none;
  opacity: 0.46;
  background-image: var(--obs-dot);
  background-size: 12px 12px;
  mask-image: linear-gradient(135deg, transparent, #000);
}

.momo-observability-mode .obs-kicker,
.momo-observability-mode .agent-kicker,
.momo-observability-mode .biz-kicker,
.momo-observability-mode .runtime-kicker,
.momo-observability-mode .calls-kicker,
.momo-observability-mode .gov-kicker,
.momo-observability-mode .gate-kicker,
.momo-observability-mode .rag-kicker,
.momo-observability-mode .quality-kicker,
.momo-observability-mode .ppt-kicker,
.momo-observability-mode [class$="-label"] {
  color: color-mix(in srgb, var(--obs-accent) 74%, var(--obs-muted)) !important;
  font-size: 0.74rem !important;
  font-weight: 850 !important;
  letter-spacing: 0.11em !important;
  text-transform: uppercase;
}

.momo-observability-mode .obs-subtitle,
.momo-observability-mode .agent-subtitle,
.momo-observability-mode .biz-command p,
.momo-observability-mode .runtime-subtitle,
.momo-observability-mode .calls-subtitle,
.momo-observability-mode .gov-subtitle,
.momo-observability-mode .gate-subtitle,
.momo-observability-mode .rag-subtitle,
.momo-observability-mode .quality-subtitle,
.momo-observability-mode .ppt-subtitle {
  color: color-mix(in srgb, var(--obs-ink) 62%, var(--obs-muted)) !important;
  font-size: 0.94rem !important;
  line-height: 1.68 !important;
  letter-spacing: 0 !important;
}

.momo-observability-mode .obs-signal,
.momo-observability-mode .agent-signal,
.momo-observability-mode .biz-signal,
.momo-observability-mode .runtime-signal,
.momo-observability-mode .calls-signal,
.momo-observability-mode .gov-signal,
.momo-observability-mode .gate-signal,
.momo-observability-mode .rag-signal,
.momo-observability-mode .quality-signal,
.momo-observability-mode .ppt-signal,
.momo-observability-mode .obs-panel,
.momo-observability-mode .agent-panel,
.momo-observability-mode .biz-panel,
.momo-observability-mode .runtime-panel,
.momo-observability-mode .calls-panel,
.momo-observability-mode .gov-panel,
.momo-observability-mode .gate-panel,
.momo-observability-mode .rag-panel,
.momo-observability-mode .quality-panel,
.momo-observability-mode .ppt-panel,
.momo-observability-mode .obs-table-shell,
.momo-observability-mode [class$="-table-shell"] {
  position: relative;
  border: 1px solid var(--obs-line) !important;
  border-radius: var(--obs-radius-lg) !important;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(255, 248, 241, 0.9)),
    var(--obs-dot) !important;
  background-size: auto, 14px 14px !important;
  box-shadow: var(--obs-shadow) !important;
}

.momo-observability-mode .obs-signal-value,
.momo-observability-mode .agent-value,
.momo-observability-mode .biz-signal .value,
.momo-observability-mode .runtime-value,
.momo-observability-mode .calls-value,
.momo-observability-mode .gov-value,
.momo-observability-mode .gate-value,
.momo-observability-mode .rag-value,
.momo-observability-mode .quality-value,
.momo-observability-mode .ppt-value {
  font-size: clamp(1.55rem, 3vw, 2.25rem) !important;
  line-height: 1.05 !important;
  letter-spacing: 0!important;
  font-weight: 900 !important;
}

.momo-observability-mode .obs-panel-title,
.momo-observability-mode .agent-panel-title,
.momo-observability-mode .biz-panel-head h3,
.momo-observability-mode .runtime-panel-title,
.momo-observability-mode .calls-panel-title,
.momo-observability-mode .gov-panel-title,
.momo-observability-mode .gate-panel-title,
.momo-observability-mode .rag-panel-title,
.momo-observability-mode .quality-panel-title,
.momo-observability-mode .ppt-panel-title,
.momo-observability-mode [class$="-table-title"] h3 {
  font-size: clamp(1.05rem, 2vw, 1.45rem) !important;
  line-height: 1.25 !important;
  letter-spacing: 0!important;
}

.momo-observability-mode code,
.momo-observability-mode .momo-mono,
.momo-observability-mode table td,
.momo-observability-mode table th {
  font-variant-numeric: tabular-nums;
}

.momo-observability-mode .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 248, 239, 0.46);
  color: var(--obs-ink);
  margin-bottom: 0;
  font-size: 0.9rem;
}

.momo-observability-mode .table thead,
.momo-observability-mode .table-light {
  --bs-table-bg: rgba(255, 248, 239, 0.9);
  color: var(--obs-muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.momo-observability-mode .table td,
.momo-observability-mode .table th {
  border-color: rgba(86, 64, 48, 0.1);
  vertical-align: middle;
  padding: 0.78rem 0.82rem;
}

.momo-observability-mode .table-responsive {
  border-radius: 18px;
  overflow-x: auto;
}

.momo-observability-mode table code,
.momo-observability-mode .biz-table code {
  color: #7c402e;
  background: rgba(201, 100, 66, 0.08);
  border-radius: 0.45rem;
  padding: 0.12rem 0.36rem;
}

.momo-observability-mode .biz-panel-body.table-responsive {
  max-width: 100%;
  overflow-x: auto;
}

.momo-observability-mode .biz-table {
  min-width: 760px;
  max-width: 100%;
}

.momo-observability-mode .biz-table td,
.momo-observability-mode .biz-table th {
  overflow-wrap: anywhere;
}

.momo-observability-mode .biz-table td:nth-child(3),
.momo-observability-mode .biz-table td:last-child {
  max-width: 220px;
}

.momo-observability-mode .btn {
  border-radius: 999px;
  font-weight: 760;
  letter-spacing: 0;
  min-height: 2.25rem;
  padding-inline: 0.9rem;
  box-shadow: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.momo-observability-mode .btn-primary,
.momo-observability-mode .btn-warning,
.momo-observability-mode .btn-success {
  border-color: var(--obs-accent) !important;
  background: var(--obs-accent) !important;
  color: #fff8ef !important;
}

.momo-observability-mode .btn-outline-primary,
.momo-observability-mode .btn-outline-secondary,
.momo-observability-mode .btn-outline-info,
.momo-observability-mode .btn-outline-warning,
.momo-observability-mode .btn-outline-danger,
.momo-observability-mode .btn-outline-success {
  border-color: rgba(201, 100, 66, 0.34) !important;
  color: var(--obs-accent) !important;
  background: rgba(255, 255, 255, 0.5);
}

.momo-observability-mode .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(201, 100, 66, 0.14);
}

.momo-observability-mode .badge.bg-secondary,
.momo-observability-mode .badge.bg-primary,
.momo-observability-mode .badge.bg-info {
  background: rgba(79, 111, 143, 0.14) !important;
  color: var(--obs-blue) !important;
}

.momo-observability-mode .badge.bg-warning {
  background: rgba(184, 121, 47, 0.14) !important;
  color: var(--obs-amber) !important;
}

.momo-observability-mode .badge.bg-danger {
  background: rgba(185, 75, 69, 0.14) !important;
  color: var(--obs-red) !important;
}

.momo-observability-mode .badge.bg-success {
  background: rgba(79, 138, 91, 0.14) !important;
  color: var(--obs-green) !important;
}

.momo-observability-mode .alert {
  border-radius: 18px;
  border-color: rgba(184, 121, 47, 0.24);
  background: rgba(184, 121, 47, 0.08);
  color: var(--obs-amber);
}

.momo-observability-mode .obs-empty,
.momo-observability-mode .agent-empty,
.momo-observability-mode .biz-empty,
.momo-observability-mode .runtime-empty,
.momo-observability-mode .calls-empty,
.momo-observability-mode .gov-empty,
.momo-observability-mode .gate-empty,
.momo-observability-mode .rag-empty,
.momo-observability-mode .quality-empty,
.momo-observability-mode .ppt-empty,
.momo-observability-mode .text-center.text-muted {
  border: 1px dashed rgba(201, 100, 66, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 248, 239, 0.74), rgba(255, 252, 247, 0.82)),
    var(--obs-dot);
  background-size: auto, 14px 14px;
}

.momo-observability-mode canvas {
  max-width: 100%;
}

/* Data surface polish: tables, matrices, lists */
.momo-observability-mode .obs-table-shell,
.momo-observability-mode [class$="-table-shell"],
.momo-observability-mode .table-responsive {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(255, 248, 241, 0.9)),
    var(--obs-dot);
  background-size: auto, 14px 14px;
}

.momo-observability-mode .table {
  border-collapse: separate;
  border-spacing: 0;
}

.momo-observability-mode .table thead th {
  position: relative;
  background: rgba(255, 243, 232, 0.92) !important;
  color: #7a5b4d !important;
  border-bottom: 1px solid rgba(201, 100, 66, 0.18) !important;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.momo-observability-mode .table tbody tr {
  transition: background-color 140ms ease, transform 140ms ease;
}

.momo-observability-mode .table tbody tr:hover {
  background: rgba(201, 100, 66, 0.045);
}

.momo-observability-mode .table tbody td {
  color: color-mix(in srgb, var(--obs-ink) 88%, var(--obs-muted));
}

.momo-observability-mode .table td small,
.momo-observability-mode .table td .text-muted {
  line-height: 1.45;
}

.momo-observability-mode .table td:last-child {
  max-width: 360px;
}

.momo-observability-mode .table td:last-child small,
.momo-observability-mode .table td:last-child .text-muted {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.momo-observability-mode .agent-table-shell .table td,
.momo-observability-mode .agent-table-shell .table th {
  text-align: center;
}

.momo-observability-mode .agent-table-shell .table td:first-child,
.momo-observability-mode .agent-table-shell .table th:first-child {
  text-align: left;
  min-width: 190px;
}

.momo-observability-mode .agent-card,
.momo-observability-mode .rec-card,
.momo-observability-mode .fix-card,
.momo-observability-mode .root-card,
.momo-observability-mode .episode-card,
.momo-observability-mode .biz-decision-card,
.momo-observability-mode .obs-route-card {
  box-shadow: 0 10px 24px rgba(70, 46, 28, 0.055);
}

.momo-observability-mode .agent-card:hover,
.momo-observability-mode .rec-card:hover,
.momo-observability-mode .fix-card:hover,
.momo-observability-mode .root-card:hover,
.momo-observability-mode .episode-card:hover,
.momo-observability-mode .biz-decision-card:hover,
.momo-observability-mode .obs-route-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(70, 46, 28, 0.09);
}

.momo-observability-mode .progress,
.momo-observability-mode .agent-meter {
  background: rgba(86, 64, 48, 0.09) !important;
  box-shadow: inset 0 1px 2px rgba(70, 46, 28, 0.08);
}

.momo-observability-mode .progress-bar {
  background: linear-gradient(90deg, var(--obs-accent), #e3a65b) !important;
}

.momo-observability-mode .form-control,
.momo-observability-mode .form-select {
  border-color: rgba(201, 100, 66, 0.18);
  border-radius: 14px;
  background-color: rgba(255, 252, 247, 0.88);
  color: var(--obs-ink);
}

.momo-observability-mode .form-control:focus,
.momo-observability-mode .form-select:focus {
  border-color: rgba(201, 100, 66, 0.52);
  box-shadow: 0 0 0 0.2rem rgba(201, 100, 66, 0.12);
}

.momo-observability-mode .badge {
  border-radius: 999px;
  font-weight: 850;
  letter-spacing: 0;
  padding: 0.36em 0.62em;
}

.momo-observability-mode .obs-chart-frame {
  height: 250px;
  min-height: 220px;
}

.momo-observability-mode .obs-chart-frame-tall {
  height: 260px;
}

.momo-observability-mode .obs-chart-frame-slim {
  height: 86px;
  min-height: 72px;
}

.momo-observability-mode .obs-progress-xs {
  height: 6px;
}

.momo-observability-mode .obs-progress-sm {
  height: 8px;
}

.momo-observability-mode .obs-modal-preview {
  border: 1px solid rgba(201, 100, 66, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.94), rgba(255, 248, 241, 0.84)),
    var(--obs-dot);
  background-size: auto, 13px 13px;
}

.momo-observability-mode .quality-distribution-cell {
  width: 200px;
}

.momo-observability-mode .budget-input {
  width: 110px;
  max-width: 100%;
}

.momo-observability-mode .alert-input {
  width: 80px;
  max-width: 100%;
}

/* Cross-page layout hardening */
.momo-observability-mode .momo-content {
  overflow-x: hidden;
}

.momo-observability-mode .obs-warroom,
.momo-observability-mode .agent-page,
.momo-observability-mode .biz-warroom,
.momo-observability-mode .runtime-page,
.momo-observability-mode .calls-page,
.momo-observability-mode .gov-page,
.momo-observability-mode .gate-page,
.momo-observability-mode .rag-page,
.momo-observability-mode .quality-page,
.momo-observability-mode .ppt-page,
.momo-observability-mode .container-fluid {
  max-width: 1480px;
  margin-inline: auto;
}

.momo-observability-mode .obs-grid,
.momo-observability-mode .agent-grid,
.momo-observability-mode .biz-layout,
.momo-observability-mode .runtime-grid,
.momo-observability-mode .calls-grid,
.momo-observability-mode .gov-grid,
.momo-observability-mode .gate-grid,
.momo-observability-mode .rag-grid,
.momo-observability-mode .quality-grid,
.momo-observability-mode .ppt-grid {
  gap: 1rem !important;
}

.momo-observability-mode .obs-command-strip,
.momo-observability-mode .agent-command,
.momo-observability-mode .biz-signal-grid,
.momo-observability-mode .runtime-command,
.momo-observability-mode .calls-command,
.momo-observability-mode .gov-command,
.momo-observability-mode .gate-command,
.momo-observability-mode .rag-command,
.momo-observability-mode .quality-command,
.momo-observability-mode .ppt-command {
  align-items: stretch;
}

.momo-observability-mode .obs-signal,
.momo-observability-mode .agent-signal,
.momo-observability-mode .biz-signal,
.momo-observability-mode .runtime-signal,
.momo-observability-mode .calls-signal,
.momo-observability-mode .gov-signal,
.momo-observability-mode .gate-signal,
.momo-observability-mode .rag-signal,
.momo-observability-mode .quality-signal,
.momo-observability-mode .ppt-signal {
  min-width: 0;
}

.momo-observability-mode .obs-panel-body,
.momo-observability-mode .agent-panel-body,
.momo-observability-mode .biz-panel-body,
.momo-observability-mode .runtime-panel-body,
.momo-observability-mode .calls-panel-body,
.momo-observability-mode .gov-panel-body,
.momo-observability-mode .gate-panel-body,
.momo-observability-mode .rag-panel-body,
.momo-observability-mode .quality-panel-body,
.momo-observability-mode .ppt-panel-body {
  min-width: 0;
}

.momo-observability-mode [class$="-panel-head"],
.momo-observability-mode [class$="-table-title"] {
  min-width: 0;
}

.momo-observability-mode [class$="-panel-head"] > div,
.momo-observability-mode [class$="-table-title"] > div {
  min-width: 0;
}

.momo-observability-mode [class$="-panel-head"] p,
.momo-observability-mode [class$="-table-title"] p,
.momo-observability-mode .text-muted {
  overflow-wrap: anywhere;
}

.momo-observability-mode .obs-route-card,
.momo-observability-mode .agent-card,
.momo-observability-mode .biz-decision-card,
.momo-observability-mode .rec-card,
.momo-observability-mode .fix-card,
.momo-observability-mode .root-card {
  min-width: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.momo-observability-mode .obs-route-card:focus-visible,
.momo-observability-mode .btn:focus-visible,
.momo-observability-mode .form-control:focus-visible,
.momo-observability-mode .form-select:focus-visible {
  outline: 3px solid rgba(201, 100, 66, 0.28);
  outline-offset: 2px;
}

.momo-observability-mode .alert {
  overflow-wrap: anywhere;
}

.momo-observability-mode .modal-content {
  border: 1px solid var(--obs-line);
  border-radius: 24px;
  background: var(--obs-paper);
  box-shadow: 0 24px 70px rgba(70, 46, 28, 0.18);
}

.momo-observability-mode .modal-header,
.momo-observability-mode .modal-footer {
  border-color: var(--obs-line);
}

@media (max-width: 1180px) {
  .momo-observability-mode .obs-grid,
  .momo-observability-mode .agent-grid,
  .momo-observability-mode .biz-layout,
  .momo-observability-mode .runtime-grid,
  .momo-observability-mode .calls-grid,
  .momo-observability-mode .gov-grid,
  .momo-observability-mode .gate-grid,
  .momo-observability-mode .rag-grid,
  .momo-observability-mode .quality-grid,
  .momo-observability-mode .ppt-grid {
    grid-template-columns: 1fr !important;
  }

  .momo-observability-mode .obs-command-strip,
  .momo-observability-mode .agent-command,
  .momo-observability-mode .biz-signal-grid,
  .momo-observability-mode .runtime-command,
  .momo-observability-mode .calls-command,
  .momo-observability-mode .gov-command,
  .momo-observability-mode .gate-command,
  .momo-observability-mode .rag-command,
  .momo-observability-mode .quality-command,
  .momo-observability-mode .ppt-command {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .momo-observability-mode .container-fluid {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .momo-observability-mode .momo-content {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .momo-observability-mode .table-responsive,
  .momo-observability-mode .card-body.p-0 {
    overflow-x: auto;
  }

  .momo-observability-mode .obs-title,
  .momo-observability-mode .agent-title,
  .momo-observability-mode .biz-command h1,
  .momo-observability-mode .runtime-title,
  .momo-observability-mode .calls-title,
  .momo-observability-mode .gov-title,
  .momo-observability-mode .gate-title,
  .momo-observability-mode .rag-title,
  .momo-observability-mode .quality-title,
  .momo-observability-mode .ppt-title {
    font-size: clamp(1.8rem, 10vw, 2.45rem) !important;
  }

  .momo-observability-mode .obs-command-strip,
  .momo-observability-mode .agent-command,
  .momo-observability-mode .biz-signal-grid,
  .momo-observability-mode .runtime-command,
  .momo-observability-mode .calls-command,
  .momo-observability-mode .gov-command,
  .momo-observability-mode .gate-command,
  .momo-observability-mode .rag-command,
  .momo-observability-mode .quality-command,
  .momo-observability-mode .ppt-command {
    grid-template-columns: 1fr !important;
  }

  .momo-observability-mode .obs-hero,
  .momo-observability-mode .agent-hero,
  .momo-observability-mode .biz-command,
  .momo-observability-mode .runtime-hero,
  .momo-observability-mode .calls-hero,
  .momo-observability-mode .gov-hero,
  .momo-observability-mode .gate-hero,
  .momo-observability-mode .rag-hero,
  .momo-observability-mode .quality-hero,
  .momo-observability-mode .ppt-hero {
    border-radius: 22px !important;
  }

  .momo-observability-mode .obs-panel,
  .momo-observability-mode .agent-panel,
  .momo-observability-mode .biz-panel,
  .momo-observability-mode .runtime-panel,
  .momo-observability-mode .calls-panel,
  .momo-observability-mode .gov-panel,
  .momo-observability-mode .gate-panel,
  .momo-observability-mode .rag-panel,
  .momo-observability-mode .quality-panel,
  .momo-observability-mode .ppt-panel,
  .momo-observability-mode [class$="-table-shell"] {
    border-radius: 20px !important;
  }

  .momo-observability-mode .table {
    font-size: 0.84rem;
  }

  .momo-observability-mode .btn {
    min-height: 2.45rem;
  }

  .momo-observability-mode .momo-content::before {
    left: 0;
  }
}

/* v2.2 professional polish: cross-page hierarchy, tables, buttons, and dense data layouts. */
.momo-observability-mode {
  --obs-surface-warm: rgba(255, 248, 238, 0.72);
  --obs-surface-glass: rgba(255, 252, 246, 0.78);
  --obs-focus-ring: 0 0 0 3px rgba(201, 100, 66, 0.18);
}

.momo-observability-mode .momo-content {
  font-feature-settings: "tnum" 1, "kern" 1;
}

.momo-observability-mode .obs-hero,
.momo-observability-mode .agent-hero,
.momo-observability-mode .biz-command,
.momo-observability-mode .runtime-hero,
.momo-observability-mode .calls-hero,
.momo-observability-mode .gov-hero,
.momo-observability-mode .gate-hero,
.momo-observability-mode .rag-hero,
.momo-observability-mode .quality-hero,
.momo-observability-mode .ppt-hero {
  background:
    radial-gradient(circle at 14% 16%, rgba(201, 100, 66, 0.19), transparent 24rem),
    radial-gradient(circle at 86% 10%, rgba(79, 111, 143, 0.14), transparent 24rem),
    linear-gradient(135deg, rgba(255, 248, 238, 0.98), rgba(255, 252, 246, 0.82) 58%, rgba(247, 234, 219, 0.92)) !important;
}

.momo-observability-mode .obs-panel,
.momo-observability-mode .agent-panel,
.momo-observability-mode .biz-panel,
.momo-observability-mode .runtime-panel,
.momo-observability-mode .calls-panel,
.momo-observability-mode .gov-panel,
.momo-observability-mode .gate-panel,
.momo-observability-mode .rag-panel,
.momo-observability-mode .quality-panel,
.momo-observability-mode .ppt-panel,
.momo-observability-mode .card {
  position: relative;
  background:
    linear-gradient(180deg, var(--obs-surface-glass), rgba(255, 255, 255, 0.7)) !important;
  backdrop-filter: blur(10px);
}

.momo-observability-mode .obs-panel-head,
.momo-observability-mode .agent-panel-head,
.momo-observability-mode .biz-panel-head,
.momo-observability-mode .runtime-panel-head,
.momo-observability-mode .calls-panel-head,
.momo-observability-mode .gov-panel-head,
.momo-observability-mode .gate-panel-head,
.momo-observability-mode .rag-panel-head,
.momo-observability-mode .quality-panel-head,
.momo-observability-mode .ppt-panel-head,
.momo-observability-mode .card-header {
  min-height: 54px;
  align-items: center;
}

.momo-observability-mode .obs-panel-title,
.momo-observability-mode .agent-panel-title,
.momo-observability-mode .biz-panel-title,
.momo-observability-mode .runtime-panel-title,
.momo-observability-mode .calls-panel-title,
.momo-observability-mode .gov-panel-title,
.momo-observability-mode .gate-panel-title,
.momo-observability-mode .rag-panel-title,
.momo-observability-mode .quality-panel-title,
.momo-observability-mode .ppt-panel-title,
.momo-observability-mode .card-title {
  color: var(--obs-ink) !important;
  font-size: clamp(1rem, 1.35vw, 1.16rem) !important;
  line-height: 1.34;
}

.momo-observability-mode .obs-value,
.momo-observability-mode .agent-value,
.momo-observability-mode .biz-value,
.momo-observability-mode .runtime-value,
.momo-observability-mode .calls-value,
.momo-observability-mode .gov-value,
.momo-observability-mode .gate-value,
.momo-observability-mode .rag-value,
.momo-observability-mode .quality-value,
.momo-observability-mode .ppt-value,
.momo-observability-mode .obs-signal-value,
.momo-observability-mode .display-4,
.momo-observability-mode .display-5,
.momo-observability-mode .h1 {
  font-family: var(--momo-font-mono, "JetBrains Mono", ui-monospace, monospace) !important;
  font-size: var(--obs-value-size) !important;
  font-weight: 850 !important;
  letter-spacing: 0!important;
}

.momo-observability-mode .table,
.momo-observability-mode table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--obs-ink);
  color: var(--obs-ink);
  border-collapse: separate !important;
  border-spacing: 0 0.42rem !important;
  font-size: 0.9rem;
}

.momo-observability-mode .table thead th,
.momo-observability-mode table thead th {
  border: 0 !important;
  color: color-mix(in srgb, var(--obs-ink) 70%, var(--obs-muted)) !important;
  background: transparent !important;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.momo-observability-mode .table tbody tr,
.momo-observability-mode table tbody tr {
  box-shadow: 0 8px 20px rgba(70, 46, 28, 0.045);
}

.momo-observability-mode .table tbody td,
.momo-observability-mode table tbody td {
  padding: 0.72rem 0.78rem !important;
  border-top: 1px solid var(--obs-line) !important;
  border-bottom: 1px solid var(--obs-line) !important;
  background: rgba(255, 255, 255, 0.62) !important;
  vertical-align: middle;
}

.momo-observability-mode .table tbody td:first-child,
.momo-observability-mode table tbody td:first-child {
  border-left: 1px solid var(--obs-line) !important;
  border-radius: 14px 0 0 14px;
}

.momo-observability-mode .table tbody td:last-child,
.momo-observability-mode table tbody td:last-child {
  border-right: 1px solid var(--obs-line) !important;
  border-radius: 0 14px 14px 0;
}

.momo-observability-mode .btn {
  border-radius: 999px !important;
  font-weight: 850 !important;
  letter-spacing: 0.01em;
  box-shadow: none !important;
}

.momo-observability-mode .btn:focus-visible,
.momo-observability-mode a:focus-visible,
.momo-observability-mode button:focus-visible {
  outline: 0;
  box-shadow: var(--obs-focus-ring) !important;
}

.momo-observability-mode .btn-primary,
.momo-observability-mode .btn-warning,
.momo-observability-mode .btn-danger,
.momo-observability-mode .btn-success {
  color: #fff8ee !important;
  border-color: transparent !important;
}

.momo-observability-mode .btn-outline-primary,
.momo-observability-mode .btn-outline-secondary,
.momo-observability-mode .btn-outline-warning,
.momo-observability-mode .btn-outline-danger,
.momo-observability-mode .btn-outline-success {
  background: rgba(255, 248, 238, 0.58) !important;
  border-color: rgba(201, 100, 66, 0.28) !important;
}

.momo-observability-mode .badge,
.momo-observability-mode .obs-pill,
.momo-observability-mode [class$="-pill"] {
  border: 1px solid rgba(201, 100, 66, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.momo-observability-mode .progress {
  height: 0.62rem;
  border-radius: 999px;
  background: rgba(70, 46, 28, 0.08);
  overflow: hidden;
}

.momo-observability-mode .list-group-item,
.momo-observability-mode .dropdown-menu,
.momo-observability-mode .modal-content,
.momo-observability-mode .alert {
  border-color: var(--obs-line) !important;
  background: rgba(255, 252, 246, 0.96) !important;
  color: var(--obs-ink) !important;
  box-shadow: 0 16px 38px rgba(70, 46, 28, 0.08);
}

.momo-observability-mode .obs-chart-frame,
.momo-observability-mode .chart-frame,
.momo-observability-mode .chart-container {
  position: relative;
  min-height: 240px;
  padding: 0.85rem;
  border: 1px solid var(--obs-line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 12px 12px, rgba(201, 100, 66, 0.13) 1px, transparent 1.35px),
    rgba(255, 255, 255, 0.52);
  background-size: 13px 13px, auto;
}

.momo-observability-mode canvas {
  max-width: 100%;
}

@media (max-width: 992px) {
  .momo-observability-mode .obs-command-strip,
  .momo-observability-mode .obs-grid,
  .momo-observability-mode .obs-metric-grid,
  .momo-observability-mode .agent-grid,
  .momo-observability-mode .biz-grid,
  .momo-observability-mode .runtime-grid,
  .momo-observability-mode .calls-grid,
  .momo-observability-mode .gov-grid,
  .momo-observability-mode .gate-grid,
  .momo-observability-mode .rag-grid,
  .momo-observability-mode .quality-grid,
  .momo-observability-mode .ppt-grid {
    grid-template-columns: 1fr !important;
  }

  .momo-observability-mode .obs-host-card {
    grid-template-columns: 1fr !important;
  }
}

/* v3 alignment: the observability cockpit must obey the same production UI
 * guardrails as the refreshed V3 pages, even when older page-level inline CSS
 * is still present in individual templates.
 */
.momo-observability-mode {
  --obs-title-size: 2.25rem;
  --obs-value-size: 2rem;
  --obs-radius-lg: 8px;
  --obs-radius-md: 8px;
  --obs-card: rgba(255, 252, 246, 0.94);
  --obs-surface-warm: rgba(255, 248, 238, 0.72);
  --obs-surface-glass: rgba(255, 252, 246, 0.82);
}

.momo-observability-mode .momo-content {
  background:
    var(--obs-dot),
    linear-gradient(180deg, rgba(255, 248, 239, 0.72), rgba(255, 253, 248, 0.96)) !important;
  background-size: 18px 18px, auto !important;
}

.momo-observability-mode .container-fluid > h2:first-child,
.momo-observability-mode .obs-hero,
.momo-observability-mode .agent-hero,
.momo-observability-mode .biz-command,
.momo-observability-mode .runtime-hero,
.momo-observability-mode .calls-hero,
.momo-observability-mode .gov-hero,
.momo-observability-mode .gate-hero,
.momo-observability-mode .rag-hero,
.momo-observability-mode .quality-hero,
.momo-observability-mode .ppt-hero {
  border-radius: 8px !important;
  background:
    linear-gradient(135deg, rgba(255, 248, 239, 0.98), rgba(247, 234, 219, 0.88)) !important;
}

.momo-observability-mode .card,
.momo-observability-mode .obs-signal,
.momo-observability-mode .agent-signal,
.momo-observability-mode .biz-signal,
.momo-observability-mode .runtime-signal,
.momo-observability-mode .calls-signal,
.momo-observability-mode .gov-signal,
.momo-observability-mode .gate-signal,
.momo-observability-mode .rag-signal,
.momo-observability-mode .quality-signal,
.momo-observability-mode .ppt-signal,
.momo-observability-mode .obs-panel,
.momo-observability-mode .agent-panel,
.momo-observability-mode .biz-panel,
.momo-observability-mode .runtime-panel,
.momo-observability-mode .calls-panel,
.momo-observability-mode .gov-panel,
.momo-observability-mode .gate-panel,
.momo-observability-mode .rag-panel,
.momo-observability-mode .quality-panel,
.momo-observability-mode .ppt-panel,
.momo-observability-mode .obs-table-shell,
.momo-observability-mode [class$="-table-shell"],
.momo-observability-mode .agent-card,
.momo-observability-mode .rec-card,
.momo-observability-mode .fix-card,
.momo-observability-mode .root-card,
.momo-observability-mode .episode-card,
.momo-observability-mode .biz-decision-card,
.momo-observability-mode .obs-route-card,
.momo-observability-mode [class$="-mini"],
.momo-observability-mode .strategy-card,
.momo-observability-mode .episode-text,
.momo-observability-mode .similar-box,
.momo-observability-mode .host-lane,
.momo-observability-mode .list-group-item,
.momo-observability-mode .dropdown-menu,
.momo-observability-mode .modal-content,
.momo-observability-mode .alert,
.momo-observability-mode .obs-chart-frame,
.momo-observability-mode .chart-frame,
.momo-observability-mode .chart-container,
.momo-observability-mode .obs-modal-preview,
.momo-observability-mode .table-responsive {
  border-radius: 8px !important;
}

.momo-observability-mode .obs-panel,
.momo-observability-mode .agent-panel,
.momo-observability-mode .biz-panel,
.momo-observability-mode .runtime-panel,
.momo-observability-mode .calls-panel,
.momo-observability-mode .gov-panel,
.momo-observability-mode .gate-panel,
.momo-observability-mode .rag-panel,
.momo-observability-mode .quality-panel,
.momo-observability-mode .ppt-panel,
.momo-observability-mode .card,
.momo-observability-mode .obs-signal,
.momo-observability-mode .agent-signal,
.momo-observability-mode .biz-signal,
.momo-observability-mode .runtime-signal,
.momo-observability-mode .calls-signal,
.momo-observability-mode .gov-signal,
.momo-observability-mode .gate-signal,
.momo-observability-mode .rag-signal,
.momo-observability-mode .quality-signal,
.momo-observability-mode .ppt-signal {
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(255, 248, 241, 0.9)) !important;
}

.momo-observability-mode .obs-title,
.momo-observability-mode .agent-title,
.momo-observability-mode .biz-command h1,
.momo-observability-mode .runtime-title,
.momo-observability-mode .calls-title,
.momo-observability-mode .gov-title,
.momo-observability-mode .gate-title,
.momo-observability-mode .rag-title,
.momo-observability-mode .quality-title,
.momo-observability-mode .ppt-title {
  font-size: var(--obs-title-size) !important;
  letter-spacing: 0 !important;
  line-height: 1.14 !important;
}

.momo-observability-mode .obs-signal-value,
.momo-observability-mode .obs-value,
.momo-observability-mode .agent-value,
.momo-observability-mode .biz-value,
.momo-observability-mode .biz-signal .value,
.momo-observability-mode .runtime-value,
.momo-observability-mode .calls-value,
.momo-observability-mode .gov-value,
.momo-observability-mode .gate-value,
.momo-observability-mode .rag-value,
.momo-observability-mode .quality-value,
.momo-observability-mode .ppt-value,
.momo-observability-mode .display-4,
.momo-observability-mode .display-5,
.momo-observability-mode .h1,
.momo-observability-mode [class$="-mini"] strong {
  font-size: var(--obs-value-size) !important;
  letter-spacing: 0 !important;
}

.momo-observability-mode .obs-panel-title,
.momo-observability-mode .agent-panel-title,
.momo-observability-mode .biz-panel-title,
.momo-observability-mode .biz-panel-head h3,
.momo-observability-mode .runtime-panel-title,
.momo-observability-mode .calls-panel-title,
.momo-observability-mode .gov-panel-title,
.momo-observability-mode .gate-panel-title,
.momo-observability-mode .rag-panel-title,
.momo-observability-mode .quality-panel-title,
.momo-observability-mode .ppt-panel-title,
.momo-observability-mode [class$="-table-title"] h3,
.momo-observability-mode .card-title {
  font-size: 1.1rem !important;
  letter-spacing: 0 !important;
}

.momo-observability-mode .btn,
.momo-observability-mode .form-control,
.momo-observability-mode .form-select {
  border-radius: 8px !important;
}

.momo-observability-mode .table tbody td:first-child,
.momo-observability-mode table tbody td:first-child {
  border-radius: 8px 0 0 8px !important;
}

.momo-observability-mode .table tbody td:last-child,
.momo-observability-mode table tbody td:last-child {
  border-radius: 0 8px 8px 0 !important;
}

@media (max-width: 768px) {
  .momo-observability-mode {
    --obs-title-size: 1.75rem;
    --obs-value-size: 1.55rem;
  }

  .momo-observability-mode .obs-command-strip,
  .momo-observability-mode .agent-command,
  .momo-observability-mode .biz-signal-grid,
  .momo-observability-mode .runtime-command,
  .momo-observability-mode .calls-command,
  .momo-observability-mode .gov-command,
  .momo-observability-mode .gate-command,
  .momo-observability-mode .rag-command,
  .momo-observability-mode .quality-command,
  .momo-observability-mode .ppt-command {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }

  .momo-observability-mode .obs-hero,
  .momo-observability-mode .agent-hero,
  .momo-observability-mode .biz-command,
  .momo-observability-mode .runtime-hero,
  .momo-observability-mode .calls-hero,
  .momo-observability-mode .gov-hero,
  .momo-observability-mode .gate-hero,
  .momo-observability-mode .rag-hero,
  .momo-observability-mode .quality-hero,
  .momo-observability-mode .ppt-hero {
    padding: 1rem !important;
  }

  .momo-observability-mode .obs-signal,
  .momo-observability-mode .agent-signal,
  .momo-observability-mode .biz-signal,
  .momo-observability-mode .runtime-signal,
  .momo-observability-mode .calls-signal,
  .momo-observability-mode .gov-signal,
  .momo-observability-mode .gate-signal,
  .momo-observability-mode .rag-signal,
  .momo-observability-mode .quality-signal,
  .momo-observability-mode .ppt-signal {
    min-height: 84px !important;
    padding: 0.78rem !important;
  }
}

/* v3.2 strict alignment: keep all AI observability pages on the production
 * design spec even when older inline template CSS appears later in the DOM.
 */
.momo-observability-mode {
  --obs-ink: var(--momo-text-primary, #2a2520);
  --obs-muted: var(--momo-text-secondary, #6b6155);
  --obs-paper: var(--momo-bg-surface, #faf6ec);
  --obs-card: var(--momo-bg-elevated, #fdfaf2);
  --obs-accent: var(--momo-page-accent, var(--momo-warm-saffron, #b8792f));
  --obs-accent-soft: var(--momo-page-accent-soft, rgba(184, 121, 47, 0.13));
  --obs-line: var(--momo-border, rgba(42, 37, 32, 0.16));
  --obs-green: var(--momo-success, #5a7a3f);
  --obs-amber: var(--momo-warning, #b8792f);
  --obs-red: var(--momo-danger, #a84428);
  --obs-blue: var(--momo-info, #4a6b85);
  --obs-radius-lg: 8px;
  --obs-radius-md: 8px;
  --obs-shadow: var(--momo-shadow-soft, 0 2px 6px rgba(42, 37, 32, 0.06));
  --obs-title-size: 1.8rem;
  --obs-value-size: 1.85rem;
  --obs-surface-warm: var(--momo-bg-paper, #f5efe2);
  --obs-surface-glass: var(--momo-bg-elevated, #fdfaf2);
}

.momo-observability-mode .momo-content {
  background-color: var(--momo-bg-body, #f0ebe1) !important;
  background-image: var(--obs-dot) !important;
  background-size: 18px 18px !important;
  color: var(--obs-ink);
  font-family: var(--momo-font-family, "Inter", "Noto Sans TC", system-ui, sans-serif) !important;
  overflow-x: clip;
}

.momo-observability-mode .momo-content::before,
.momo-observability-mode .obs-hero::after,
.momo-observability-mode .agent-hero::after,
.momo-observability-mode .biz-command::after,
.momo-observability-mode .runtime-hero::after,
.momo-observability-mode .calls-hero::after,
.momo-observability-mode .gov-hero::after,
.momo-observability-mode .gate-hero::after,
.momo-observability-mode .rag-hero::after,
.momo-observability-mode .qa-hero::after,
.momo-observability-mode .quality-hero::after,
.momo-observability-mode .ppt-hero::after,
.momo-observability-mode .obs-panel::after,
.momo-observability-mode .agent-panel::after,
.momo-observability-mode .biz-panel::after,
.momo-observability-mode .runtime-panel::after,
.momo-observability-mode .calls-panel::after,
.momo-observability-mode .gov-panel::after,
.momo-observability-mode .gate-panel::after,
.momo-observability-mode .rag-panel::after,
.momo-observability-mode .qa-panel::after,
.momo-observability-mode .quality-panel::after,
.momo-observability-mode .ppt-panel::after {
  display: none !important;
}

.momo-observability-mode .container-fluid > h2:first-child,
.momo-observability-mode .obs-hero,
.momo-observability-mode .agent-hero,
.momo-observability-mode .biz-command,
.momo-observability-mode .runtime-hero,
.momo-observability-mode .calls-hero,
.momo-observability-mode .gov-hero,
.momo-observability-mode .gate-hero,
.momo-observability-mode .rag-hero,
.momo-observability-mode .qa-hero,
.momo-observability-mode .quality-hero,
.momo-observability-mode .ppt-hero {
  border: 1px solid var(--obs-line) !important;
  border-radius: 8px !important;
  background-color: var(--momo-bg-surface, #faf6ec) !important;
  background-image: var(--obs-dot) !important;
  background-size: 16px 16px !important;
  box-shadow: var(--obs-shadow) !important;
  color: var(--obs-ink) !important;
  padding: 1rem 1.2rem !important;
}

.momo-observability-mode .card,
.momo-observability-mode .obs-signal,
.momo-observability-mode .agent-signal,
.momo-observability-mode .biz-signal,
.momo-observability-mode .runtime-signal,
.momo-observability-mode .calls-signal,
.momo-observability-mode .gov-signal,
.momo-observability-mode .gate-signal,
.momo-observability-mode .rag-signal,
.momo-observability-mode .qa-signal,
.momo-observability-mode .quality-signal,
.momo-observability-mode .ppt-signal,
.momo-observability-mode .obs-panel,
.momo-observability-mode .agent-panel,
.momo-observability-mode .biz-panel,
.momo-observability-mode .runtime-panel,
.momo-observability-mode .calls-panel,
.momo-observability-mode .gov-panel,
.momo-observability-mode .gate-panel,
.momo-observability-mode .rag-panel,
.momo-observability-mode .qa-panel,
.momo-observability-mode .quality-panel,
.momo-observability-mode .ppt-panel,
.momo-observability-mode .obs-table-shell,
.momo-observability-mode .agent-table-shell,
.momo-observability-mode .biz-table-shell,
.momo-observability-mode .runtime-table-shell,
.momo-observability-mode .calls-table-shell,
.momo-observability-mode .gov-table-shell,
.momo-observability-mode .gate-table-shell,
.momo-observability-mode .rag-table-shell,
.momo-observability-mode .qa-table-shell,
.momo-observability-mode .quality-table-shell,
.momo-observability-mode .ppt-table-shell,
.momo-observability-mode .agent-card,
.momo-observability-mode .caller-card,
.momo-observability-mode .rec-card,
.momo-observability-mode .fix-card,
.momo-observability-mode .root-card,
.momo-observability-mode .episode-card,
.momo-observability-mode .biz-decision-card,
.momo-observability-mode .obs-route-card,
.momo-observability-mode [class$="-mini"],
.momo-observability-mode .strategy-card,
.momo-observability-mode .episode-text,
.momo-observability-mode .similar-box,
.momo-observability-mode .host-lane,
.momo-observability-mode .list-group-item,
.momo-observability-mode .dropdown-menu,
.momo-observability-mode .modal-content,
.momo-observability-mode .alert,
.momo-observability-mode .obs-chart-frame,
.momo-observability-mode .chart-frame,
.momo-observability-mode .chart-container,
.momo-observability-mode .obs-modal-preview,
.momo-observability-mode .table-responsive {
  border-color: var(--obs-line) !important;
  border-radius: 8px !important;
  background-color: var(--obs-card) !important;
  background-image: none !important;
  box-shadow: var(--obs-shadow) !important;
  backdrop-filter: none !important;
}

.momo-observability-mode .obs-table-shell,
.momo-observability-mode .agent-table-shell,
.momo-observability-mode .biz-table-shell,
.momo-observability-mode .runtime-table-shell,
.momo-observability-mode .calls-table-shell,
.momo-observability-mode .gov-table-shell,
.momo-observability-mode .gate-table-shell,
.momo-observability-mode .rag-table-shell,
.momo-observability-mode .qa-table-shell,
.momo-observability-mode .quality-table-shell,
.momo-observability-mode .ppt-table-shell,
.momo-observability-mode .obs-chart-frame,
.momo-observability-mode .chart-frame,
.momo-observability-mode .chart-container,
.momo-observability-mode .obs-modal-preview {
  background-color: var(--momo-bg-surface, #faf6ec) !important;
  background-image: var(--obs-dot) !important;
  background-size: 14px 14px !important;
}

.momo-observability-mode h1,
.momo-observability-mode h2,
.momo-observability-mode h3,
.momo-observability-mode h4,
.momo-observability-mode h5,
.momo-observability-mode h6,
.momo-observability-mode .obs-title,
.momo-observability-mode .agent-title,
.momo-observability-mode .biz-command h1,
.momo-observability-mode .runtime-title,
.momo-observability-mode .calls-title,
.momo-observability-mode .gov-title,
.momo-observability-mode .gate-title,
.momo-observability-mode .rag-title,
.momo-observability-mode .qa-title,
.momo-observability-mode .quality-title,
.momo-observability-mode .ppt-title {
  color: var(--obs-ink) !important;
  font-family: var(--momo-font-display, "Inter", "Noto Sans TC", system-ui, sans-serif) !important;
  letter-spacing: 0 !important;
  text-wrap: pretty;
}

.momo-observability-mode .obs-title,
.momo-observability-mode .agent-title,
.momo-observability-mode .biz-command h1,
.momo-observability-mode .runtime-title,
.momo-observability-mode .calls-title,
.momo-observability-mode .gov-title,
.momo-observability-mode .gate-title,
.momo-observability-mode .rag-title,
.momo-observability-mode .qa-title,
.momo-observability-mode .quality-title,
.momo-observability-mode .ppt-title {
  font-size: var(--obs-title-size) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  max-width: 820px;
}

.momo-observability-mode .obs-signal-value,
.momo-observability-mode .obs-value,
.momo-observability-mode .agent-value,
.momo-observability-mode .biz-value,
.momo-observability-mode .biz-signal .value,
.momo-observability-mode .runtime-value,
.momo-observability-mode .calls-value,
.momo-observability-mode .gov-value,
.momo-observability-mode .gate-value,
.momo-observability-mode .rag-value,
.momo-observability-mode .qa-value,
.momo-observability-mode .quality-value,
.momo-observability-mode .ppt-value,
.momo-observability-mode .display-4,
.momo-observability-mode .display-5,
.momo-observability-mode .h1,
.momo-observability-mode [class$="-mini"] strong {
  font-family: var(--momo-font-mono, "JetBrains Mono", ui-monospace, monospace) !important;
  font-size: var(--obs-value-size) !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  line-height: 1.12 !important;
  font-variant-numeric: tabular-nums;
}

.momo-observability-mode .obs-kicker,
.momo-observability-mode .agent-kicker,
.momo-observability-mode .biz-kicker,
.momo-observability-mode .runtime-kicker,
.momo-observability-mode .calls-kicker,
.momo-observability-mode .gov-kicker,
.momo-observability-mode .gate-kicker,
.momo-observability-mode .rag-kicker,
.momo-observability-mode .qa-kicker,
.momo-observability-mode .quality-kicker,
.momo-observability-mode .ppt-kicker,
.momo-observability-mode [class$="-label"],
.momo-observability-mode .obs-signal-label,
.momo-observability-mode .obs-section-eyebrow,
.momo-observability-mode .obs-route-code {
  color: color-mix(in srgb, var(--obs-accent) 72%, var(--obs-muted)) !important;
  font-family: var(--momo-font-family, "Inter", "Noto Sans TC", system-ui, sans-serif) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
}

.momo-observability-mode .obs-subtitle,
.momo-observability-mode .agent-subtitle,
.momo-observability-mode .biz-command p,
.momo-observability-mode .runtime-subtitle,
.momo-observability-mode .calls-subtitle,
.momo-observability-mode .gov-subtitle,
.momo-observability-mode .gate-subtitle,
.momo-observability-mode .rag-subtitle,
.momo-observability-mode .qa-subtitle,
.momo-observability-mode .quality-subtitle,
.momo-observability-mode .ppt-subtitle,
.momo-observability-mode .obs-signal-note,
.momo-observability-mode .qa-note,
.momo-observability-mode .text-muted {
  color: var(--obs-muted) !important;
  font-size: 0.92rem !important;
  line-height: 1.55 !important;
  letter-spacing: 0 !important;
}

.momo-observability-mode .obs-panel-title,
.momo-observability-mode .agent-panel-title,
.momo-observability-mode .biz-panel-title,
.momo-observability-mode .biz-panel-head h3,
.momo-observability-mode .runtime-panel-title,
.momo-observability-mode .calls-panel-title,
.momo-observability-mode .gov-panel-title,
.momo-observability-mode .gate-panel-title,
.momo-observability-mode .rag-panel-title,
.momo-observability-mode .qa-panel-title,
.momo-observability-mode .quality-panel-title,
.momo-observability-mode .ppt-panel-title,
.momo-observability-mode [class$="-table-title"] h3,
.momo-observability-mode .card-title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  line-height: 1.4 !important;
}

.momo-observability-mode .obs-command-strip,
.momo-observability-mode .agent-command,
.momo-observability-mode .biz-signal-grid,
.momo-observability-mode .runtime-command,
.momo-observability-mode .calls-command,
.momo-observability-mode .gov-command,
.momo-observability-mode .gate-command,
.momo-observability-mode .rag-command,
.momo-observability-mode .qa-command,
.momo-observability-mode .quality-command,
.momo-observability-mode .ppt-command {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0.75rem !important;
}

.momo-observability-mode .obs-grid,
.momo-observability-mode .agent-grid,
.momo-observability-mode .biz-layout,
.momo-observability-mode .runtime-grid,
.momo-observability-mode .runtime-main,
.momo-observability-mode .calls-grid,
.momo-observability-mode .gov-grid,
.momo-observability-mode .gate-grid,
.momo-observability-mode .rag-grid,
.momo-observability-mode .qa-grid,
.momo-observability-mode .quality-grid,
.momo-observability-mode .ppt-grid {
  display: grid !important;
  gap: 1rem !important;
}

.momo-observability-mode .btn,
.momo-observability-mode .form-control,
.momo-observability-mode .form-select {
  border-radius: 8px !important;
  font-family: var(--momo-font-family, "Inter", "Noto Sans TC", system-ui, sans-serif) !important;
  letter-spacing: 0 !important;
}

.momo-observability-mode .btn-primary,
.momo-observability-mode .btn-warning,
.momo-observability-mode .btn-danger,
.momo-observability-mode .btn-success,
.momo-observability-mode .progress-bar,
.momo-observability-mode .agent-meter span,
.momo-observability-mode .caller-meter span {
  background-color: var(--obs-accent) !important;
  background-image: none !important;
  color: var(--momo-page-inverse, #fff8ef) !important;
}

.momo-observability-mode .btn-outline-primary,
.momo-observability-mode .btn-outline-secondary,
.momo-observability-mode .btn-outline-info,
.momo-observability-mode .btn-outline-warning,
.momo-observability-mode .btn-outline-danger,
.momo-observability-mode .btn-outline-success {
  background-color: var(--momo-bg-surface, #faf6ec) !important;
  background-image: none !important;
  border-color: var(--obs-line) !important;
  color: var(--obs-ink) !important;
}

.momo-observability-mode .table thead th,
.momo-observability-mode table thead th {
  background-color: var(--momo-bg-paper, #f5efe2) !important;
  color: var(--obs-muted) !important;
  font-family: var(--momo-font-mono, "JetBrains Mono", ui-monospace, monospace) !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
}

.momo-observability-mode .table tbody td,
.momo-observability-mode table tbody td {
  background-color: var(--momo-bg-elevated, #fdfaf2) !important;
  color: var(--obs-ink) !important;
}

.momo-observability-mode .table tbody tr:hover td,
.momo-observability-mode table tbody tr:hover td {
  background-color: color-mix(in srgb, var(--obs-accent) 7%, var(--momo-bg-elevated, #fdfaf2)) !important;
}

@media (max-width: 1180px) {
  .momo-observability-mode .obs-command-strip,
  .momo-observability-mode .agent-command,
  .momo-observability-mode .biz-signal-grid,
  .momo-observability-mode .runtime-command,
  .momo-observability-mode .calls-command,
  .momo-observability-mode .gov-command,
  .momo-observability-mode .gate-command,
  .momo-observability-mode .rag-command,
  .momo-observability-mode .qa-command,
  .momo-observability-mode .quality-command,
  .momo-observability-mode .ppt-command,
  .momo-observability-mode [class$="-mini-grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .momo-observability-mode .obs-grid,
  .momo-observability-mode .agent-grid,
  .momo-observability-mode .biz-layout,
  .momo-observability-mode .biz-hero,
  .momo-observability-mode .runtime-grid,
  .momo-observability-mode .runtime-main,
  .momo-observability-mode .calls-grid,
  .momo-observability-mode .gov-grid,
  .momo-observability-mode .gate-grid,
  .momo-observability-mode .rag-grid,
  .momo-observability-mode .qa-grid,
  .momo-observability-mode .quality-grid,
  .momo-observability-mode .ppt-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 560px) {
  .momo-observability-mode {
    --obs-title-size: 1.55rem;
    --obs-value-size: 1.35rem;
  }

  .momo-observability-mode .container-fluid,
  .momo-observability-mode .momo-content {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .momo-observability-mode .container-fluid > h2:first-child,
  .momo-observability-mode .obs-hero,
  .momo-observability-mode .agent-hero,
  .momo-observability-mode .biz-command,
  .momo-observability-mode .runtime-hero,
  .momo-observability-mode .calls-hero,
  .momo-observability-mode .gov-hero,
  .momo-observability-mode .gate-hero,
  .momo-observability-mode .rag-hero,
  .momo-observability-mode .qa-hero,
  .momo-observability-mode .quality-hero,
  .momo-observability-mode .ppt-hero {
    padding: 0.9rem !important;
  }

  .momo-observability-mode .obs-command-strip,
  .momo-observability-mode .agent-command,
  .momo-observability-mode .biz-signal-grid,
  .momo-observability-mode .runtime-command,
  .momo-observability-mode .calls-command,
  .momo-observability-mode .gov-command,
  .momo-observability-mode .gate-command,
  .momo-observability-mode .rag-command,
  .momo-observability-mode .qa-command,
  .momo-observability-mode .quality-command,
  .momo-observability-mode .ppt-command,
  .momo-observability-mode [class$="-mini-grid"] {
    grid-template-columns: 1fr !important;
  }
}

/* v3.7 typography tightening: no legacy tracking, poster-scale numerals, or wrapped action buttons. */
.momo-observability-mode :is(
  .obs-kicker,
  .agent-kicker,
  .biz-kicker,
  .runtime-kicker,
  .calls-kicker,
  .gov-kicker,
  .gate-kicker,
  .rag-kicker,
  .qa-kicker,
  .quality-kicker,
  .ppt-kicker,
  [class$="-label"],
  .obs-signal-label,
  .obs-section-eyebrow,
  .obs-route-code
) {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.momo-observability-mode .biz-signal .value {
  color: var(--obs-ink) !important;
  font-family: var(--momo-font-mono, "JetBrains Mono", ui-monospace, monospace) !important;
  font-size: var(--obs-value-size) !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  line-height: 1.1 !important;
}

.momo-observability-mode :is(.biz-signal .label, .biz-signal .note, .biz-filter-card label) {
  color: var(--obs-muted) !important;
  font-family: var(--momo-font-family, "Inter", "Noto Sans TC", system-ui, sans-serif) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.momo-observability-mode .biz-filter-card .btn {
  min-width: 4.5rem;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .momo-observability-mode {
    --obs-title-size: 1.38rem;
    --obs-value-size: 1.12rem;
  }

  .momo-observability-mode :is(
    .obs-title,
    .agent-title,
    .biz-title,
    .runtime-title,
    .calls-title,
    .gov-title,
    .gate-title,
    .rag-title,
    .qa-title,
    .quality-title,
    .ppt-title
  ) {
    margin-top: 0.55rem !important;
    margin-bottom: 0.25rem !important;
  }

  .momo-observability-mode :is(
    .obs-kicker,
    .agent-kicker,
    .biz-kicker,
    .runtime-kicker,
    .calls-kicker,
    .gov-kicker,
    .gate-kicker,
    .rag-kicker,
    .qa-kicker,
    .quality-kicker,
    .ppt-kicker
  ) {
    font-size: 0.74rem !important;
    line-height: 1.25 !important;
    padding: 0.24rem 0.42rem !important;
  }

  .momo-observability-mode .biz-signal .value {
    font-size: 1.12rem !important;
  }

  .momo-observability-mode .biz-meta-row {
    gap: 0.42rem !important;
    margin-top: 0.7rem !important;
  }

  .momo-observability-mode :is(.biz-meta-pill, .biz-badge, .badge, .obs-pill, [class$="-pill"]) {
    font-size: 0.76rem !important;
    min-height: 1.55rem;
    padding: 0.22rem 0.42rem !important;
  }

  .momo-observability-mode .biz-filter-card .d-flex {
    align-items: stretch;
  }

  .momo-observability-mode .biz-filter-card .btn {
    min-width: 4rem;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
  }
}

/* v3.3 observability hardening: shared visual system, bounded data surfaces, mobile-safe widths. */
.momo-observability-mode {
  --obs-title-size: 1.8rem;
  --obs-value-size: 1.85rem;
  --obs-shadow: var(--momo-shadow-md, 0 0 0 1px rgba(42, 37, 32, 0.1));
  --obs-dot: radial-gradient(color-mix(in srgb, var(--obs-muted) 14%, transparent) 0.8px, transparent 0.8px);
}

.momo-observability-mode,
.momo-observability-mode :where(*) {
  box-sizing: border-box;
  min-width: 0;
}

.momo-observability-mode .momo-content,
.momo-observability-mode .container-fluid {
  max-width: 100%;
  overflow-x: hidden;
}

.momo-observability-mode :is(
  .obs-hero,
  .agent-hero,
  .biz-command,
  .runtime-hero,
  .calls-hero,
  .gov-hero,
  .gate-hero,
  .rag-hero,
  .qa-hero,
  .quality-hero,
  .ppt-hero,
  .obs-panel,
  .agent-panel,
  .biz-panel,
  .runtime-panel,
  .calls-panel,
  .gov-panel,
  .gate-panel,
  .rag-panel,
  .qa-panel,
  .quality-panel,
  .ppt-panel,
  .obs-signal,
  .agent-signal,
  .biz-signal,
  .runtime-signal,
  .calls-signal,
  .gov-signal,
  .gate-signal,
  .rag-signal,
  .qa-signal,
  .quality-signal,
  .ppt-signal,
  .card
) {
  background-color: var(--momo-bg-surface, #faf6ec) !important;
  background-image: none !important;
  border: 1px solid var(--obs-line) !important;
  border-radius: 8px !important;
  box-shadow: var(--obs-shadow) !important;
  color: var(--obs-ink) !important;
}

.momo-observability-mode :is(
  .obs-table-shell,
  .agent-table-shell,
  .biz-table-shell,
  .runtime-table-shell,
  .calls-table-shell,
  .gov-table-shell,
  .gate-table-shell,
  .rag-table-shell,
  .qa-table-shell,
  .quality-table-shell,
  .ppt-table-shell,
  .table-responsive,
  .obs-chart-frame,
  .chart-frame,
  .chart-container
) {
  background-color: var(--momo-bg-surface, #faf6ec) !important;
  background-image: var(--obs-dot) !important;
  background-size: 14px 14px !important;
  border-color: var(--obs-line) !important;
  border-radius: 8px !important;
  box-shadow: var(--obs-shadow) !important;
}

.momo-observability-mode :is(
  .container-fluid > h2:first-child,
  .obs-title,
  .agent-title,
  .biz-title,
  .runtime-title,
  .calls-title,
  .gov-title,
  .gate-title,
  .rag-title,
  .qa-title,
  .quality-title,
  .ppt-title
) {
  color: var(--obs-ink) !important;
  font-family: var(--momo-font-display, "JetBrains Mono", "Noto Sans TC", ui-monospace, monospace) !important;
  font-size: var(--obs-title-size) !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  line-height: 1.25 !important;
}

.momo-observability-mode :is(
  .obs-value,
  .agent-value,
  .biz-value,
  .runtime-value,
  .calls-value,
  .gov-value,
  .gate-value,
  .rag-value,
  .qa-value,
  .quality-value,
  .ppt-value,
  .kpi-value
) {
  color: var(--obs-ink) !important;
  font-family: var(--momo-font-mono, "JetBrains Mono", ui-monospace, monospace) !important;
  font-size: var(--obs-value-size) !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  line-height: 1.1 !important;
}

.momo-observability-mode :is(
  code,
  pre,
  .table td,
  .table th,
  .episode-text,
  .similar-box,
  .fix-card,
  .root-card,
  .rec-card,
  .agent-card,
  .caller-card,
  .biz-decision-card,
  .host-lane,
  .obs-route-card,
  .biz-panel-head,
  .biz-badge
) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.momo-observability-mode .table {
  margin-bottom: 0 !important;
  min-width: 760px;
}

.momo-observability-mode .table-responsive {
  max-width: 100%;
  overflow: auto !important;
  overscroll-behavior: contain;
}

.momo-observability-mode .table-responsive .table {
  min-width: 100%;
  width: max-content;
}

.momo-observability-mode :is(
  .calls-table-shell .table-responsive,
  .gate-table-shell .table-responsive,
  .runtime-table-shell .table-responsive,
  .biz-panel-body.table-responsive,
  .ppt-table-shell .table-responsive,
  .qa-table-shell .table-responsive,
  .rag-table-shell .table-responsive,
  .agent-table-shell .table-responsive,
  .quality-table-shell .table-responsive
) {
  max-height: min(62vh, 640px);
  overflow: auto !important;
}

.momo-observability-mode :is(
  .biz-warroom,
  .biz-hero,
  .biz-layout,
  .biz-panel,
  .biz-panel-head,
  .biz-panel-body,
  .biz-strategy-grid,
  .biz-strategy-card,
  .biz-decision-list,
  .biz-decision-card,
  .biz-table
) {
  max-width: 100% !important;
  min-width: 0 !important;
}

.momo-observability-mode .biz-panel {
  overflow: hidden !important;
}

.momo-observability-mode .biz-panel-head {
  align-items: flex-start !important;
  flex-wrap: wrap !important;
}

.momo-observability-mode .biz-panel-head > div {
  flex: 1 1 220px;
  min-width: 0 !important;
}

.momo-observability-mode .biz-badge {
  max-width: 100%;
  white-space: normal;
}

.momo-observability-mode .biz-strategy-card .metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.momo-observability-mode .calls-signal {
  min-height: 0 !important;
  overflow: hidden !important;
}

.momo-observability-mode .calls-signal canvas[data-spark] {
  display: block !important;
  height: 28px !important;
  margin-top: 0.45rem;
  max-height: 28px !important;
  width: 100% !important;
}

@media (max-width: 768px) {
  .momo-observability-mode {
    --obs-title-size: 1.55rem;
    --obs-value-size: 1.35rem;
  }

  .momo-observability-mode :is(
    .calls-table-shell .table-responsive,
    .gate-table-shell .table-responsive,
    .runtime-table-shell .table-responsive,
    .biz-panel-body.table-responsive,
    .ppt-table-shell .table-responsive,
    .qa-table-shell .table-responsive,
    .rag-table-shell .table-responsive,
    .agent-table-shell .table-responsive,
    .quality-table-shell .table-responsive
  ) {
    max-height: min(58vh, 460px);
  }
}

@media (max-width: 560px) {
  .momo-observability-mode .host-lane,
  .momo-observability-mode .biz-strategy-card .metrics,
  .momo-observability-mode .biz-decision-card {
    grid-template-columns: 1fr !important;
  }

  .momo-observability-mode :is(.obs-hero, .agent-hero, .biz-command, .runtime-hero, .calls-hero, .gov-hero, .gate-hero, .rag-hero, .qa-hero, .quality-hero, .ppt-hero) {
    gap: 0.8rem !important;
  }
}

/* v3.4 chip and nested-surface normalization: remove low-contrast legacy dark-hero residue. */
.momo-observability-mode :is(
  .biz-filter-card,
  .biz-alert-strip,
  .biz-strategy-card,
  .biz-mini-metric,
  .biz-decision-card,
  .episode-card,
  .similar-box,
  .fix-card,
  .root-card,
  .rec-card,
  .agent-card,
  .caller-card,
  .host-lane,
  .strategy-card,
  .obs-route-card
) {
  background-color: var(--momo-bg-elevated, #fdfaf2) !important;
  background-image: none !important;
  border: 1px solid var(--obs-line) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: var(--obs-ink) !important;
}

.momo-observability-mode :is(.obs-pill, [class$="-pill"], .biz-badge, .badge) {
  align-items: center;
  background-color: color-mix(in srgb, var(--obs-accent) 9%, var(--momo-bg-elevated, #fdfaf2)) !important;
  background-image: none !important;
  border: 1px solid color-mix(in srgb, var(--obs-accent) 22%, var(--obs-line)) !important;
  border-radius: 8px !important;
  color: var(--obs-ink) !important;
  display: inline-flex;
  font-family: var(--momo-font-family, "Inter", "Noto Sans TC", system-ui, sans-serif) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  gap: 0.35rem;
  letter-spacing: 0 !important;
  line-height: 1.25 !important;
  max-width: 100%;
  min-height: 1.75rem;
  padding: 0.28rem 0.55rem !important;
  text-transform: none !important;
  white-space: normal !important;
}

.momo-observability-mode :is(.badge.bg-success, .biz-badge.good) {
  background-color: color-mix(in srgb, var(--obs-green) 14%, var(--momo-bg-elevated, #fdfaf2)) !important;
  border-color: color-mix(in srgb, var(--obs-green) 28%, var(--obs-line)) !important;
  color: color-mix(in srgb, var(--obs-green) 76%, var(--obs-ink)) !important;
}

.momo-observability-mode :is(.badge.bg-warning, .biz-badge.warn) {
  background-color: color-mix(in srgb, var(--obs-warn) 16%, var(--momo-bg-elevated, #fdfaf2)) !important;
  border-color: color-mix(in srgb, var(--obs-warn) 32%, var(--obs-line)) !important;
  color: color-mix(in srgb, var(--obs-warn) 72%, var(--obs-ink)) !important;
}

.momo-observability-mode .badge.bg-danger {
  background-color: color-mix(in srgb, var(--obs-red) 14%, var(--momo-bg-elevated, #fdfaf2)) !important;
  border-color: color-mix(in srgb, var(--obs-red) 32%, var(--obs-line)) !important;
  color: color-mix(in srgb, var(--obs-red) 74%, var(--obs-ink)) !important;
}

.momo-observability-mode :is(.badge.bg-info, .badge.bg-primary, .badge.bg-secondary, .badge.bg-light) {
  background-color: color-mix(in srgb, var(--obs-blue) 10%, var(--momo-bg-elevated, #fdfaf2)) !important;
  border-color: color-mix(in srgb, var(--obs-blue) 22%, var(--obs-line)) !important;
  color: var(--obs-ink) !important;
}

.momo-observability-mode .biz-meta-row {
  gap: 0.5rem !important;
  max-width: 100%;
}

/* v3.5 hero density: inline legacy templates must not reserve decorative empty space. */
.momo-observability-mode :is(
  .obs-hero,
  .agent-hero,
  .biz-command,
  .runtime-hero,
  .calls-hero,
  .gov-hero,
  .gate-hero,
  .rag-hero,
  .qa-hero,
  .quality-hero,
  .ppt-hero
) {
  min-height: 0 !important;
}

.momo-observability-mode :is(
  .obs-hero,
  .agent-hero,
  .biz-command,
  .runtime-hero,
  .calls-hero,
  .gov-hero,
  .gate-hero,
  .rag-hero,
  .qa-hero,
  .quality-hero,
  .ppt-hero,
  .obs-panel,
  .agent-panel,
  .biz-panel,
  .runtime-panel,
  .calls-panel,
  .gov-panel,
  .gate-panel,
  .rag-panel,
  .qa-panel,
  .quality-panel,
  .ppt-panel
)::after {
  display: none !important;
}

/* v3.6 mobile density: KPI groups stay readable without consuming the first viewport. */
@media (max-width: 560px) {
  .momo-observability-mode :is(
    .obs-hero,
    .agent-hero,
    .biz-command,
    .runtime-hero,
    .calls-hero,
    .gov-hero,
    .gate-hero,
    .rag-hero,
    .qa-hero,
    .quality-hero,
    .ppt-hero
  ) {
    padding: 0.75rem !important;
  }

  .momo-observability-mode :is(
    .obs-lede,
    .agent-subtitle,
    .biz-command p,
    .runtime-subtitle,
    .calls-subtitle,
    .gov-subtitle,
    .gate-subtitle,
    .rag-subtitle,
    .qa-subtitle,
    .quality-subtitle,
    .ppt-subtitle
  ) {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
  }

  .momo-observability-mode :is(
    .obs-command-strip,
    .agent-command,
    .biz-signal-grid,
    .runtime-command,
    .calls-command,
    .gov-command,
    .gate-command,
    .rag-command,
    .qa-command,
    .quality-command,
    .ppt-command,
    [class$="-mini-grid"]
  ) {
    gap: 0.5rem !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    margin-top: 0.75rem !important;
  }

  .momo-observability-mode :is(
    .obs-signal,
    .agent-signal,
    .biz-signal,
    .runtime-signal,
    .calls-signal,
    .gov-signal,
    .gate-signal,
    .rag-signal,
    .qa-signal,
    .quality-signal,
    .ppt-signal,
    .gov-mini,
    .gate-mini,
    .runtime-mini,
    .calls-mini,
    .quality-mini,
    .ppt-mini
  ) {
    min-height: 0 !important;
    padding: 0.62rem !important;
  }

  .momo-observability-mode :is(
    .obs-signal-value,
    .obs-value,
    .agent-value,
    .biz-value,
    .runtime-value,
    .calls-value,
    .gov-value,
    .gate-value,
    .rag-value,
    .qa-value,
    .quality-value,
    .ppt-value,
    .kpi-value,
    .gov-mini strong,
    .gate-mini strong,
    .runtime-mini strong,
    .calls-mini strong,
    .quality-mini strong,
    .ppt-mini strong
  ) {
    font-size: 1.18rem !important;
    line-height: 1.15 !important;
  }

  .momo-observability-mode :is(
    .agent-filter,
    .calls-filter,
    .gov-filter,
    .quality-filter,
    .qa-filter,
    .biz-filter-card
  ) {
    gap: 0.4rem !important;
    margin-top: 0.65rem !important;
    padding: 0.55rem !important;
  }
}

/* v3.11 V2 workbench normalization: unify legacy observability page skins before the terminal dot layer. */
.momo-observability-mode :is(
  .obs-hero,
  .agent-hero,
  .biz-command,
  .runtime-hero,
  .calls-hero,
  .gov-hero,
  .gate-hero,
  .rag-hero,
  .qa-hero,
  .quality-hero,
  .ppt-hero
) {
  border-color: var(--obs-line) !important;
  border-radius: var(--momo-radius-lg, 8px) !important;
  background-color: var(--momo-bg-surface, #faf7f0) !important;
  background-image: var(--obs-matrix-dot) !important;
  background-size: var(--obs-matrix-size) !important;
  box-shadow: var(--momo-shadow-md, 0 2px 8px rgba(42, 37, 32, 0.06)) !important;
}

.ppt-auto-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--momo-space-3, 12px);
}

.ppt-auto-status.is-working {
  color: var(--obs-accent);
  font-weight: var(--momo-font-weight-bold, 700);
}

@media (max-width: 960px) {
  .ppt-auto-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ppt-auto-grid {
    grid-template-columns: 1fr;
  }
}

.momo-observability-mode :is(
  .obs-panel,
  .agent-panel,
  .biz-panel,
  .runtime-panel,
  .calls-panel,
  .gov-panel,
  .gate-panel,
  .rag-panel,
  .qa-panel,
  .quality-panel,
  .ppt-panel,
  .obs-signal,
  .agent-signal,
  .biz-signal,
  .runtime-signal,
  .calls-signal,
  .gov-signal,
  .gate-signal,
  .rag-signal,
  .qa-signal,
  .quality-signal,
  .ppt-signal,
  .agent-card,
  .rec-card,
  .host-lane,
  .runtime-mini,
  .calls-mini,
  .gov-mini,
  .gate-mini,
  .quality-mini,
  .ppt-mini,
  .strategy-card,
  .episode-card,
  .similar-box,
  .fix-card,
  .root-card,
  .caller-card,
  .biz-filter-card,
  .biz-alert-strip,
  .biz-chart-shell,
  .biz-strategy-card,
  .biz-mini-metric,
  .biz-decision-card,
  .obs-route-card
) {
  border-color: var(--obs-line) !important;
  border-radius: var(--momo-radius-lg, 8px) !important;
  background-color: var(--momo-bg-elevated, #fdfaf3) !important;
  background-image: var(--obs-matrix-dot-soft) !important;
  background-size: var(--obs-matrix-size) !important;
  box-shadow: var(--momo-shadow-md, 0 2px 8px rgba(42, 37, 32, 0.06)) !important;
}

.momo-observability-mode :is(
  .obs-kicker,
  .agent-kicker,
  .biz-kicker,
  .runtime-kicker,
  .calls-kicker,
  .gov-kicker,
  .gate-kicker,
  .rag-kicker,
  .qa-kicker,
  .quality-kicker,
  .ppt-kicker,
  .obs-signal-label,
  .agent-label,
  .biz-signal .label,
  .runtime-label,
  .calls-label,
  .gov-label,
  .gate-label,
  .rag-label,
  .qa-label,
  .quality-label,
  .ppt-label,
  .obs-section-eyebrow
) {
  font-family: var(--momo-font-family-mono, "JetBrains Mono", ui-monospace, monospace) !important;
  font-size: var(--momo-text-label, 0.6875rem) !important;
  letter-spacing: 0.06em !important;
  text-transform: none !important;
  color: color-mix(in srgb, var(--obs-accent) 76%, var(--obs-muted)) !important;
}

.momo-observability-mode :is(
  .btn,
  .badge,
  .obs-pill,
  .biz-badge,
  [class$="-pill"],
  .model-chip
) {
  border-radius: var(--momo-radius-lg, 8px) !important;
}

.momo-observability-mode :is(
  .agent-meter,
  .caller-meter,
  .progress,
  .progress-bar,
  .obs-progress-xs,
  .obs-progress-sm
) {
  border-radius: var(--momo-radius-sm, 3px) !important;
}

/* v3.10 terminal dot-matrix layer: this must stay at EOF to win the cascade. */
.momo-observability-mode {
  --obs-matrix-dot: radial-gradient(color-mix(in srgb, var(--obs-accent) 14%, transparent) 0.85px, transparent 0.95px);
  --obs-matrix-dot-soft: radial-gradient(color-mix(in srgb, var(--obs-muted) 12%, transparent) 0.75px, transparent 0.9px);
  --obs-matrix-size: 13px 13px;
}

.momo-observability-mode :is(
  .obs-hero,
  .agent-hero,
  .biz-command,
  .runtime-hero,
  .calls-hero,
  .gov-hero,
  .gate-hero,
  .rag-hero,
  .qa-hero,
  .quality-hero,
  .ppt-hero,
  .obs-signal,
  .agent-signal,
  .biz-signal,
  .runtime-signal,
  .calls-signal,
  .gov-signal,
  .gate-signal,
  .rag-signal,
  .qa-signal,
  .quality-signal,
  .ppt-signal
) {
  background-image: var(--obs-matrix-dot) !important;
  background-position: 0 0 !important;
  background-size: var(--obs-matrix-size) !important;
}

/* v3.12 responsive data surfaces: observability tables should read like
 * operational records on phones, not desktop sheets squeezed into a viewport.
 */
.momo-observability-mode .table-responsive {
  overflow-x: visible !important;
}

.momo-observability-mode .table-responsive .table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: auto;
}

.momo-observability-mode .table :is(th, td) {
  max-width: min(24rem, 38vw);
  white-space: normal !important;
}

@media (max-width: 768px) {
  .momo-observability-mode .table-responsive {
    max-height: none !important;
    overflow: visible !important;
  }

  .momo-observability-mode .table-responsive .obs-card-ready,
  .momo-observability-mode .table-responsive .obs-card-ready thead,
  .momo-observability-mode .table-responsive .obs-card-ready tbody,
  .momo-observability-mode .table-responsive .obs-card-ready tr,
  .momo-observability-mode .table-responsive .obs-card-ready td {
    display: block;
    width: 100% !important;
  }

  .momo-observability-mode .table-responsive .obs-card-ready thead {
    position: absolute;
    width: 1px !important;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .momo-observability-mode .table-responsive .obs-card-ready tbody {
    display: grid;
    gap: 0.7rem;
  }

  .momo-observability-mode .table-responsive .obs-card-ready tr {
    display: grid;
    gap: 0.44rem;
    padding: 0.72rem;
    border: 1px solid var(--obs-line);
    border-radius: var(--momo-radius-lg, 8px);
    background:
      var(--obs-matrix-dot-soft),
      var(--momo-bg-elevated, #fdfaf3);
    background-size: var(--obs-matrix-size), auto;
    box-shadow: var(--momo-shadow-sm, 0 1px 3px rgba(42, 37, 32, 0.05));
  }

  .momo-observability-mode .table-responsive .obs-card-ready td {
    display: grid;
    grid-template-columns: minmax(5.4rem, 35%) minmax(0, 1fr);
    gap: 0.58rem;
    align-items: start;
    max-width: 100%;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left !important;
  }

  .momo-observability-mode .table-responsive .obs-card-ready td::before {
    content: attr(data-label);
    color: var(--obs-muted);
    font-family: var(--momo-font-mono, "JetBrains Mono", ui-monospace, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .momo-observability-mode .table-responsive .obs-card-ready td:empty {
    display: none;
  }
}

.momo-observability-mode :is(
  .obs-panel,
  .agent-panel,
  .biz-panel,
  .runtime-panel,
  .calls-panel,
  .gov-panel,
  .gate-panel,
  .rag-panel,
  .qa-panel,
  .quality-panel,
  .ppt-panel,
  .biz-filter-card,
  .biz-alert-strip,
  .biz-strategy-card,
  .biz-mini-metric,
  .biz-decision-card,
  .episode-card,
  .similar-box,
  .fix-card,
  .root-card,
  .rec-card,
  .agent-card,
  .caller-card,
  .host-lane,
  .strategy-card,
  .obs-route-card,
  .obs-pill,
  [class$="-pill"],
  .biz-badge,
  .badge
) {
  background-image: var(--obs-matrix-dot-soft) !important;
  background-position: 0 0 !important;
  background-size: var(--obs-matrix-size) !important;
}
