:root {
  --color-background: #ffffff;
  --color-surface: #ffffff;
  --color-surface-muted: #f6f8f7;
  --color-text-primary: #222a2a;
  --color-text-secondary: #697574;
  --color-border: #e5eae8;
  --color-grid: #edf0ee;
  --color-sidebar: #f9fbfa;
  --color-sidebar-muted: #697574;
  --color-sidebar-border: #e5eae8;
  --color-brand-signal: #127a67;
  --color-data-primary: #127a67;
  --color-data-secondary: #638cac;
  --color-data-previous: #919a99;
  --color-positive: #127a67;
  --color-warning: #af6a1e;
  --color-negative: #b94b48;
  --radius-sm: 4px;
  --radius-md: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --font-ui: "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-text-primary);
  background: var(--color-background);
  font-family: var(--font-ui);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.is-hidden {
  display: none !important;
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(220px, 360px) minmax(320px, 440px);
  justify-content: center;
  align-content: center;
  gap: 72px;
  padding: 40px 24px;
  background: #eef1f3;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  align-self: start;
  padding-top: var(--space-5);
}

.auth-brand .brand-mark {
  border-color: #789400;
  color: #506600;
  background: #e4f6b8;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 22px;
}

.auth-brand span {
  margin-top: 3px;
  color: var(--color-text-secondary);
}

.auth-panel {
  display: grid;
  gap: var(--space-4);
  padding: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 18px 50px rgba(16, 20, 23, 0.08);
}

.auth-panel h1,
.auth-panel p {
  margin: 0;
}

.auth-panel h1 {
  margin-top: 4px;
  font-size: 26px;
}

.auth-panel div > p:last-child {
  margin-top: var(--space-2);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.auth-panel label {
  display: grid;
  gap: 6px;
}

.text-button {
  min-height: 28px;
  border: 0;
  padding: 2px;
  color: var(--color-data-primary);
  background: transparent;
}

.form-error,
.form-note {
  min-height: 20px;
  color: var(--color-negative);
  font-size: 12px;
}

.form-note {
  color: var(--color-positive);
}

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

button {
  min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 7px 11px;
  color: var(--color-text-primary);
  background: var(--color-surface);
  cursor: pointer;
}

button:hover {
  border-color: #bfc7cf;
  background: var(--color-surface-muted);
}

button.primary {
  border-color: var(--color-text-primary);
  color: var(--color-surface);
  background: var(--color-text-primary);
}

button.primary:hover {
  border-color: #000;
  background: #000;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  color: var(--color-text-primary);
  background: var(--color-surface);
}

select:focus,
input:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid var(--color-brand-signal);
  outline-offset: 1px;
}

textarea {
  resize: vertical;
}

code {
  font-family: var(--font-mono);
  font-size: 12px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-5);
  border-right: 1px solid var(--color-sidebar-border);
  background: var(--color-sidebar);
  color: var(--color-surface);
}

.brand {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(183, 237, 59, 0.45);
  border-radius: var(--radius-md);
  color: var(--color-brand-signal);
  background: rgba(183, 237, 59, 0.08);
  font-weight: 750;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.section-head h3,
.section-head p {
  margin: 0;
}

.brand h1 {
  font-size: 16px;
}

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

.nav {
  display: grid;
  gap: 3px;
}

.nav-item {
  position: relative;
  justify-content: flex-start;
  border-color: transparent;
  color: var(--color-sidebar-muted);
  background: transparent;
  text-align: left;
}

.nav-item:hover {
  border-color: transparent;
  color: var(--color-surface);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  color: var(--color-surface);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 650;
}

.nav-item.is-active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--color-brand-signal);
  content: "";
}

.sidebar-footer {
  display: grid;
  gap: var(--space-3);
  margin-top: auto;
  color: var(--color-sidebar-muted);
  font-size: 12px;
}

.session-summary {
  display: grid;
  gap: 4px;
}

.session-summary strong {
  overflow: hidden;
  color: var(--color-surface);
  text-overflow: ellipsis;
}

.session-summary button {
  margin-top: var(--space-2);
  border-color: var(--color-sidebar-border);
  color: var(--color-surface);
  background: #171c20;
}

.access-key {
  display: grid;
  gap: 6px;
}

.access-key input {
  border-color: var(--color-sidebar-border);
  color: var(--color-surface);
  background: #171c20;
}

.health-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-warning);
}

.status-dot.ok {
  background: var(--color-brand-signal);
}

.status-dot.bad {
  background: var(--color-negative);
}

.main {
  min-width: 0;
  padding: 0 var(--space-6) var(--space-6);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  align-items: center;
  margin: 0 calc(var(--space-6) * -1) var(--space-5);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: rgba(246, 247, 248, 0.96);
}

.topbar h2 {
  font-size: 24px;
  line-height: 1.2;
}

.eyebrow,
.account-picker span,
label span,
.section-head p {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.account-picker {
  display: grid;
  gap: 6px;
  min-width: 240px;
}

.tab-panel {
  display: none;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.tab-panel.is-active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.section-head h3 {
  margin-bottom: 5px;
  font-size: 18px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: var(--space-3);
}

.grid-form.compact {
  grid-template-columns: minmax(260px, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
}

.wide {
  grid-column: 1 / -1;
}

.actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.toolbar {
  margin-bottom: var(--space-4);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: var(--space-3);
  align-items: end;
  margin-top: var(--space-5);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 2px solid var(--color-brand-signal);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.output,
.code-output,
.report-view {
  margin-top: var(--space-4);
}

.journal-stack {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.journal-stack h4,
.api-grid h4,
.catalog-section h4 {
  margin: 0 0 var(--space-3);
  font-size: 15px;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: var(--space-4);
}

.filter-hint,
.insight-annotation {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-brand-signal);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.insight-annotation strong {
  color: var(--color-text-primary);
  font-weight: 720;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-5);
}

.empty-state {
  margin-top: var(--space-4);
  padding: var(--space-5);
  border: 1px dashed #bfc7cf;
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.empty-state h4,
.empty-state p {
  margin: 0;
}

.empty-state h4 {
  font-size: 15px;
}

.empty-state p {
  margin: 7px 0 var(--space-4);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.report-catalog {
  display: grid;
  gap: var(--space-5);
}

.catalog-grid,
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

.report-card,
.favorite-card {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.report-card {
  border-top: 2px solid var(--color-grid);
}

.favorite-card {
  border-top: 2px solid var(--color-brand-signal);
}

.report-card-head,
.favorite-card-head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  justify-content: space-between;
}

.report-card h5,
.report-card p,
.favorite-card h5,
.favorite-card p {
  margin: 0;
}

.report-card h5,
.favorite-card h5 {
  font-size: 15px;
  line-height: 1.35;
}

.report-card p,
.favorite-card p {
  margin-top: 7px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.favorite-toggle,
.icon-button {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  color: var(--color-text-primary);
  background: var(--color-brand-signal);
  font-size: 16px;
}

.report-card-meta,
.favorite-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.report-card-meta span,
.favorite-card-meta span {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  background: var(--color-surface-muted);
  font-size: 12px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.executive-kpis {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.kpi-item {
  min-height: 102px;
  padding: var(--space-4);
  border-right: 1px solid var(--color-border);
}

.kpi-drilldown {
  width: 100%;
  border: 0;
  border-right: 1px solid var(--color-border);
  border-radius: 0;
  text-align: left;
  background: transparent;
}

.kpi-drilldown:hover {
  border-color: var(--color-border);
  background: var(--color-surface-muted);
}

.kpi-drilldown:last-child {
  border-right: 0;
}

.kpi-item:last-child {
  border-right: 0;
}

.kpi-item span {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.kpi-item strong {
  display: block;
  margin-top: 9px;
  color: var(--color-text-primary);
  font-size: 30px;
  line-height: 1;
  font-weight: 720;
}

.kpi-item small {
  display: block;
  margin-top: 8px;
  color: var(--color-data-previous);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.report-stack {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.report-section,
.chart-frame {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.report-section {
  min-width: 0;
  padding: var(--space-4);
}

.report-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.report-section-head h4,
.report-section-head span {
  margin: 0;
}

.activity-detail-heading {
  margin-top: var(--space-2);
}

.activity-detail-section a {
  color: var(--color-data-primary);
  font-weight: 700;
}

.report-section-head h4 {
  font-size: 15px;
}

.report-section-head span {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.chart-frame {
  position: relative;
  min-height: 220px;
  margin-top: var(--space-4);
  overflow: hidden;
}

.chart-frame::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
  background-size: 100% 44px, 72px 100%;
  content: "";
}

.chart-tooltip {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-primary);
  background: var(--color-surface);
  font-size: 12px;
}

.code-output {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: #14191d;
  color: #e8eef2;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.compact-code {
  min-height: 160px;
  margin-top: 0;
}

.instruction {
  margin: var(--space-5) 0;
  padding: var(--space-4);
  border: 1px solid #ead7b5;
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-md);
  background: #fffaf0;
}

.instruction ol {
  margin: 0;
  padding-left: var(--space-5);
}

.instruction li + li {
  margin-top: 5px;
}

.report-context {
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 3px solid #2f7d5a;
  padding: var(--space-3) var(--space-4);
  background: #f6faf8;
  font-size: 12px;
}

.report-context.is-warning {
  border-left-color: var(--color-warning);
  background: #fffaf0;
}

.report-context-facts,
.report-context-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.report-context-warnings {
  margin-top: 8px;
  color: var(--color-text-secondary);
}

.script-box,
.mini-script {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.script-box {
  min-height: 420px;
  white-space: pre;
}

.mini-script {
  min-height: 110px;
}

.table-wrap {
  max-height: 520px;
  overflow: auto;
  margin-top: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.compact-table-wrap {
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.data-table,
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--color-text-secondary);
  background: #f0f3f5;
  font-weight: 650;
}

td {
  color: var(--color-text-primary);
}

.compact-table {
  min-width: 620px;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
}

.compact-table strong {
  font-weight: 720;
}

.compact-table small {
  display: block;
  margin-top: 3px;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.matrix-table-wrap {
  max-height: 620px;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-surface);
}

.matrix-table th:first-child {
  z-index: 3;
  background: #f0f3f5;
}

.table-title {
  display: block;
  max-width: 280px;
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td:first-child,
th:first-child {
  border-left: 2px solid transparent;
}

tr:hover td:first-child {
  border-left-color: var(--color-brand-signal);
}

.rule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-3);
}

.rule-list article {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.rule-list h4,
.rule-list p {
  margin: 0;
}

.rule-list h4 {
  margin-bottom: var(--space-2);
}

.rule-list p,
.muted {
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.widget-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.amo-widget-preview {
  min-height: 190px;
  padding: var(--space-4);
  border: 1px solid var(--widget-border);
  border-radius: var(--radius-md);
  color: var(--widget-text);
  background: var(--widget-bg);
}

.amo-widget-preview.light {
  --widget-bg: #ffffff;
  --widget-text: #171a1c;
  --widget-muted: #66717c;
  --widget-border: #dce1e5;
}

.amo-widget-preview.dark {
  --widget-bg: #111820;
  --widget-text: #eef4f7;
  --widget-muted: #a7b1ba;
  --widget-border: #2c3944;
}

.amo-widget-preview h4 {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-2);
  border-left: 3px solid var(--color-brand-signal);
  font-size: 15px;
}

.amo-widget-preview p {
  margin: 0;
  color: var(--widget-muted);
  font-size: 12px;
}

.amo-widget-preview strong {
  display: block;
  margin-top: var(--space-2);
  font-size: 28px;
}

.toast {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  max-width: min(420px, calc(100vw - 40px));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: #fff;
  background: var(--color-text-primary);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

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

@media (max-width: 920px) {
  .auth-gate {
    grid-template-columns: minmax(0, 440px);
    gap: var(--space-5);
    align-content: start;
  }

  .auth-brand {
    padding-top: 0;
  }

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .main {
    padding: 0 var(--space-4) var(--space-4);
  }

  .topbar,
  .inline-form,
  .filter-bar,
  .grid-form,
  .grid-form.compact,
  .api-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    margin-inline: calc(var(--space-4) * -1);
    padding: var(--space-4);
  }

  .filter-bar {
    position: static;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

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

  .kpi-item {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .kpi-item:last-child {
    border-bottom: 0;
  }
}

/* 2026 light cabinet shell */
html {
  overflow-x: hidden;
}

body {
  background: var(--color-surface);
  line-height: 1.45;
}

svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke-width: 1.7;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-brand-signal);
  outline-offset: 2px;
}

.shell {
  grid-template-columns: 228px minmax(0, 1fr);
  background: var(--color-surface);
}

.sidebar {
  width: 228px;
  gap: 0;
  padding: 28px 17px 16px;
  border-color: var(--color-sidebar-border);
  background: var(--color-sidebar);
  color: var(--color-text-primary);
  z-index: 40;
}

.brand {
  gap: 8px;
  padding: 0 9px 26px;
}

.brand h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
  text-transform: lowercase;
}

.brand-period {
  color: var(--color-brand-signal);
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: var(--radius-md);
  color: #fff;
  background: var(--color-brand-signal);
  font-size: 0;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.workspace-summary {
  display: grid;
  width: 100%;
  grid-template-columns: 31px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0 0 28px;
  padding: 10px 9px;
  text-align: left;
  border-color: var(--color-border);
  background: #fff;
}

.workspace-summary:hover {
  border-color: #cbd7d2;
  background: #fff;
}

.workspace-summary > span:nth-child(2) {
  min-width: 0;
}

.workspace-summary strong,
.workspace-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-summary strong {
  font-size: 13px;
  font-weight: 600;
}

.workspace-summary small {
  margin-top: 2px;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.workspace-summary > svg {
  width: 14px;
  color: var(--color-text-secondary);
}

.workspace-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 5px;
  color: var(--color-brand-signal);
  background: #e8efed;
  font-weight: 600;
}

.nav {
  display: flex;
  grid-template-columns: none;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
}

.nav-caption {
  padding: 0 11px;
  margin: 0 0 7px;
  color: var(--color-text-secondary);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.nav-caption.second {
  margin-top: 22px;
}

.nav-item {
  display: flex;
  min-height: 41px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 0;
  color: var(--color-text-primary);
  background: transparent;
  font-size: 13px;
  text-align: left;
}

.nav-item svg {
  width: 17px;
  color: var(--color-text-secondary);
}

.nav-item:hover {
  border: 0;
  color: var(--color-text-primary);
  background: #f0f4f2;
}

.nav-item.is-active {
  border: 0;
  color: #176551;
  background: #e7f0ec;
  font-weight: 600;
}

.nav-item.is-active::before {
  display: none;
}

.nav-item.is-active svg {
  color: var(--color-brand-signal);
}

.sidebar-footer {
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 0;
}

.session-summary {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  padding: 14px 6px 0;
  border-top: 1px solid var(--color-border);
}

.profile-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #e8eaf0;
  color: #596572;
  font-size: 11px;
  font-weight: 600;
}

.session-copy {
  min-width: 0;
}

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

.session-summary strong {
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 600;
}

.session-summary small {
  margin-top: 2px;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.session-summary button,
.icon-button {
  display: inline-flex;
  width: 32px;
  height: 32px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--color-text-secondary);
  background: transparent;
}

.session-summary button:hover,
.icon-button:hover {
  border: 0;
  color: var(--color-text-primary);
  background: #edf3f0;
}

.access-key {
  color: var(--color-text-secondary);
}

.access-key input {
  color: var(--color-text-primary);
  border-color: var(--color-border);
  background: #fff;
}

.health-line {
  padding: 0 7px;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #919a99;
}

.status-dot.ok {
  background: #459b75;
}

.main {
  width: 100%;
  max-width: 1660px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 36px 32px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  min-height: 65px;
  margin: 0 -36px;
  padding: 0 36px;
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.breadcrumb svg {
  width: 12px;
}

.breadcrumb strong {
  overflow: hidden;
  color: var(--color-text-primary);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-picker {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.account-picker span {
  color: var(--color-text-secondary);
  font-size: 10px;
  text-transform: none;
}

.account-picker select {
  width: auto;
  max-width: 260px;
  min-height: 36px;
  padding-block: 6px;
  font-size: 12px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 31px 0 27px;
}

.page-heading h2,
.page-heading p {
  margin: 0;
}

.page-heading h2 {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
}

.page-heading .eyebrow {
  margin-bottom: 6px;
  color: var(--color-brand-signal);
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
}

.page-meta {
  margin-top: 8px !important;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.heading-actions {
  display: flex;
  gap: 6px;
}

.mobile-menu {
  display: none;
}

.section-head {
  margin-bottom: 21px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.section-head h3 {
  font-size: 17px;
  font-weight: 500;
}

.section-head p {
  max-width: 860px;
  margin-top: 7px;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.55;
  text-transform: none;
}

.tab-panel {
  padding-bottom: 32px;
}

.grid-form,
.grid-form.compact,
.filter-bar {
  gap: 14px;
  margin-bottom: 25px;
  padding: 18px 0 21px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.grid-form label > span,
.filter-bar label > span,
.inline-form label > span {
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 500;
}

button {
  border-color: var(--color-border);
  color: var(--color-text-primary);
  background: #fff;
}

button:hover {
  border-color: #cbd7d2;
  background: var(--color-surface-muted);
}

button.primary {
  border-color: var(--color-brand-signal);
  background: var(--color-brand-signal);
}

button.primary:hover {
  border-color: #106854;
  background: #106854;
}

select,
input,
textarea {
  border-color: #dce3df;
  color: var(--color-text-primary);
}

.toolbar {
  gap: 4px;
  margin-bottom: 22px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  flex-wrap: nowrap;
}

.toolbar button {
  min-height: 32px;
  flex: none;
  border-color: transparent;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.toolbar button:hover,
.toolbar button.is-active {
  color: var(--color-brand-signal);
  border-color: transparent;
  background: #edf5f0;
}

.report-view,
.output,
.code-output {
  border-radius: var(--radius-md);
}

.report-view {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.insight-annotation {
  padding: 13px 16px;
  border: 0;
  border-left: 3px solid var(--color-brand-signal);
  border-radius: 0;
  color: var(--color-text-secondary);
  background: #f3f8f5;
  font-size: 12px;
  line-height: 1.6;
}

.insight-annotation strong {
  color: var(--color-text-primary);
}

.report-context {
  padding: 12px 15px;
  border: 0;
  border-left: 3px solid var(--color-brand-signal);
  border-radius: 0;
  background: #f4f8f6;
}

.report-context.is-warning,
.report-context:has(.report-context-warnings) {
  border-left-color: #c98d40;
  background: #fdf9f0;
}

.report-context-facts,
.report-context-warnings {
  font-size: 11px;
  line-height: 1.55;
}

.report-context-warnings span {
  color: #735020;
}

.kpi-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 2px 0 28px;
  padding: 10px 0 27px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
}

.kpi-item,
.kpi-drilldown {
  min-width: 0;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.kpi-item:nth-child(5n + 1) {
  padding-left: 0;
}

.kpi-item:nth-child(5n) {
  padding-right: 0;
  border-right: 0;
}

.executive-kpis .kpi-item:nth-child(n + 6) {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--color-border);
}

.kpi-item span {
  min-height: 31px;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.kpi-item strong {
  margin: 5px 0 8px;
  font-size: 31px;
  font-weight: 400;
  line-height: 1.2;
}

.kpi-item small {
  color: var(--color-text-secondary);
  font-size: 10px;
  line-height: 1.4;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 30px;
}

.report-section,
.chart-frame {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.report-section {
  min-width: 0;
  padding: 0 0 25px;
  border-bottom: 1px solid var(--color-border);
}

.report-section-head {
  margin-bottom: 14px;
}

.report-section-head h4 {
  font-size: 15px;
  font-weight: 500;
}

.report-section-head span {
  color: var(--color-text-secondary);
  font-size: 10px;
}

.compact-table-wrap,
.table-wrap,
.matrix-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
}

table,
.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

th,
td,
.data-table th,
.data-table td {
  height: 45px;
  padding: 11px 12px;
  border-bottom: 1px solid #edf0ee;
  text-align: right;
  white-space: nowrap;
}

th,
.data-table th {
  color: var(--color-text-secondary);
  background: #fafbfa;
  font-size: 10px;
  font-weight: 500;
}

th:first-child,
td:first-child,
.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

tbody tr:hover {
  background: #fafcfb;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  left: 0;
  min-width: 170px;
  background: #fff;
  box-shadow: 1px 0 0 var(--color-border);
}

.matrix-table th:nth-child(2),
.matrix-table td:nth-child(2) {
  min-width: 170px;
}

.table-title {
  font-size: 12px;
  font-weight: 500;
}

.table-title + small {
  display: block;
  margin-top: 3px;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.report-card,
.favorite-card {
  padding: 19px 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.catalog-grid,
.favorites-grid {
  gap: 0 30px;
}

.report-card p,
.favorite-card p {
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.favorite-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--color-text-secondary);
}

.filter-hint {
  border: 0;
  border-left: 3px solid #638cac;
  border-radius: 0;
  background: #f3f6f9;
}

.instruction {
  border: 0;
  border-radius: 0;
  background: #f6f8f7;
}

.rule-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 30px;
}

.rule-list article {
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
}

.journal-stack > section,
.api-grid > div {
  min-width: 0;
}

.empty-state {
  padding: 58px 20px;
  border: 0;
  color: var(--color-text-secondary);
  background: transparent;
  text-align: center;
}

.empty-state > svg {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  color: var(--color-warning);
}

.loading-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--color-text-secondary);
  text-align: center;
}

.loading-state strong {
  color: var(--color-text-primary);
  font-size: 15px;
  font-weight: 500;
}

.loading-state small {
  font-size: 11px;
}

.state-spinner {
  width: 28px;
  height: 28px;
  margin-bottom: 5px;
  border: 2px solid #e4ede7;
  border-top-color: var(--color-brand-signal);
  border-radius: 50%;
  animation: cabinet-spin 0.85s linear infinite;
}

@keyframes cabinet-spin {
  to {
    transform: rotate(360deg);
  }
}

.home-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.home-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-actions svg {
  width: 15px;
  height: 15px;
  color: var(--color-brand-signal);
}

.home-activity {
  margin-top: 29px;
}

.inline-unavailable {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border-left: 3px solid var(--color-warning);
  color: var(--color-text-secondary);
  background: #fdf9f0;
}

.inline-unavailable > svg {
  width: 22px;
  height: 22px;
  color: var(--color-warning);
}

.inline-unavailable strong {
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 600;
}

.inline-unavailable p {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.45;
}

.inline-unavailable button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.inline-unavailable button svg {
  width: 14px;
  height: 14px;
}

.stage-visual {
  display: grid;
  gap: 10px;
  margin: 2px 0 20px;
  padding: 3px 0 18px;
}

.snapshot-head {
  margin-top: 24px;
}

.snapshot-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.snapshot-kpis .kpi-item:nth-child(n) {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.snapshot-kpis .kpi-item:last-child {
  border-right: 0;
}

.manager-stage-wrap {
  max-height: min(62vh, 680px);
  border-bottom: 1px solid var(--color-border);
}

.manager-stage-matrix {
  width: max-content;
  min-width: 100%;
}

.manager-stage-matrix th,
.manager-stage-matrix td {
  min-width: 112px;
}

.manager-stage-matrix th:first-child,
.manager-stage-matrix td:first-child {
  min-width: 220px;
}

.manager-stage-matrix thead th,
.manager-stage-matrix tfoot th {
  position: sticky;
  z-index: 2;
}

.manager-stage-matrix thead th {
  top: 0;
}

.manager-stage-matrix tfoot th {
  bottom: 0;
  color: var(--color-text-primary);
  background: #f4f7f5;
}

.manager-stage-matrix thead th:first-child,
.manager-stage-matrix tbody td:first-child,
.manager-stage-matrix tfoot th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 1px 0 0 var(--color-border);
}

.manager-stage-matrix thead th:first-child {
  z-index: 4;
  background: #fafbfa;
}

.manager-stage-matrix tfoot th:first-child {
  z-index: 4;
  background: #f4f7f5;
}

.manager-stage-matrix thead span,
.manager-stage-matrix thead strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snapshot-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.presentation-switch {
  display: inline-flex;
  flex: none;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #f7f9f8;
}

.presentation-switch button {
  min-height: 30px;
  padding: 5px 12px;
  border: 0;
  border-radius: 4px;
  color: var(--color-text-secondary);
  background: transparent;
  font-size: 11px;
}

.presentation-switch button.is-active {
  color: var(--color-text-primary);
  background: #fff;
  box-shadow: 0 1px 4px rgba(28, 47, 40, 0.1);
}

.manager-stage-flat-table th:last-child,
.manager-stage-flat-table td:last-child {
  text-align: right;
}

@media (max-width: 640px) {
  .snapshot-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* M1 is a focused workspace: one report, compact controls, and personal server presets. */
.m1-workspace {
  margin-bottom: 16px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.m1-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 0 14px;
}

.m1-titlebar h2 {
  margin: 2px 0 0;
  font-size: 26px;
  font-weight: 470;
  line-height: 1.15;
}

.m1-titlebar .icon-button {
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.m1-titlebar .icon-button svg,
.m1-preset-actions button svg,
.m1-advanced summary svg {
  width: 15px;
  height: 15px;
}

.m1-controls {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(145px, 0.72fr) minmax(190px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--color-grid);
}

.m1-controls > label,
.m1-mode-select,
.preset-dialog label {
  display: grid;
  gap: 6px;
}

.m1-controls > label > span,
.m1-mode-select > span,
.preset-dialog label > span {
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 550;
}

.m1-controls select,
.m1-controls input {
  min-height: 38px;
}

.m1-apply {
  min-height: 38px;
  padding-inline: 18px;
}

.m1-advanced {
  grid-column: 1 / -1;
  border-top: 1px solid var(--color-grid);
}

.m1-advanced > summary {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--color-text-primary);
  font-size: 11px;
  list-style: none;
}

.m1-advanced > summary::-webkit-details-marker,
.m1-preset-menu > summary::-webkit-details-marker {
  display: none;
}

.m1-advanced > summary small {
  overflow: hidden;
  margin-left: auto;
  color: var(--color-text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m1-advanced-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  padding: 12px 0 17px;
}

.m1-advanced-panel fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.m1-advanced-panel legend {
  margin-bottom: 9px;
  padding: 0;
  font-size: 12px;
  font-weight: 620;
}

.m1-mode-select {
  grid-template-columns: auto minmax(150px, 220px);
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.m1-check-list {
  display: grid;
  max-height: 210px;
  overflow: auto;
  border-top: 1px solid var(--color-grid);
}

.m1-check-list label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 8px 3px;
  border-bottom: 1px solid var(--color-grid);
  cursor: pointer;
  font-size: 11px;
}

.m1-check-list label > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.m1-check-list label small {
  color: var(--color-text-secondary);
  font-size: 9px;
}

.m1-check-list label.is-missing {
  color: var(--color-negative);
  background: #fff7f5;
}

.m1-check-list input {
  width: 15px;
  height: 15px;
  min-height: 15px;
  flex: none;
  accent-color: var(--color-brand-signal);
}

.m1-all-note {
  margin: 0;
  padding: 12px 3px;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.m1-preset-actions {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--color-grid);
}

.m1-preset-actions > span {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m1-preset-actions > span.is-dirty {
  color: var(--color-warning);
}

.m1-preset-actions > span.is-warning {
  color: var(--color-negative);
}

.m1-preset-actions > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.m1-preset-actions button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  font-size: 10px;
}

.m1-preset-menu {
  position: relative;
}

.m1-preset-menu > summary {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.m1-preset-menu > div {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 218px;
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(28, 47, 40, 0.12);
}

.m1-preset-menu > div button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
}

.danger-text {
  color: var(--color-negative);
}

.is-m1-report #tab-reports {
  padding-top: 12px;
}

body.is-m1-report {
  overflow-x: hidden;
}

.is-m1-report .report-context {
  margin-bottom: 10px;
}

.is-m1-report .snapshot-head {
  align-items: center;
  margin-top: 8px;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.is-m1-report .snapshot-kpis {
  margin-bottom: 20px;
}

.preset-dialog {
  width: min(430px, calc(100vw - 30px));
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-primary);
  background: #fff;
  box-shadow: 0 24px 70px rgba(23, 36, 32, 0.2);
}

.preset-dialog::backdrop {
  background: rgba(21, 34, 31, 0.34);
}

.preset-dialog form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.preset-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.preset-dialog h3 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 520;
}

.preset-dialog .actions {
  justify-content: flex-end;
}

.form-error {
  min-height: 16px;
  margin: -8px 0 0;
  color: var(--color-negative);
  font-size: 11px;
}

@media (max-width: 850px) {
  .m1-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .m1-apply {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .is-m1-report .main {
    padding-inline: 16px;
  }

  .m1-titlebar {
    padding-top: 12px;
  }

  .m1-titlebar h2 {
    font-size: 22px;
  }

  .m1-controls,
  .m1-advanced-panel {
    grid-template-columns: 1fr;
  }

  .m1-controls {
    gap: 9px;
  }

  .m1-advanced > summary {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-block: 11px;
  }

  .m1-advanced > summary small {
    width: 100%;
    margin-left: 23px;
    white-space: normal;
  }

  .m1-preset-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 0;
  }

  .m1-preset-actions > span {
    white-space: normal;
  }

  .m1-preset-actions > div {
    width: 100%;
    flex-wrap: wrap;
  }

  .m1-preset-actions button {
    flex: none;
  }

  .is-m1-report .snapshot-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.compact-analysis-hero {
  padding-top: 24px;
}

.three-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analysis-kpis .textual-kpi {
  overflow: hidden;
  font-size: 19px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row,
.speed-row,
.conversion-row,
.event-line {
  border-bottom: 1px solid var(--color-grid);
}

.rank-row {
  display: grid;
  grid-template-columns: 36px minmax(150px, 1fr) minmax(180px, 2fr) minmax(100px, .7fr);
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.rank-number {
  color: #8b9994;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.rank-name,
.rank-value,
.speed-row > span,
.conversion-count {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.rank-name strong,
.rank-value strong,
.speed-row strong,
.conversion-count strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-name small,
.rank-value small,
.speed-row small,
.conversion-count small {
  color: var(--color-text-secondary);
  font-size: 9px;
}

.rank-bar {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: #edf1ef;
}

.rank-bar > i {
  display: block;
  height: 100%;
  background: #2a8a72;
}

.rank-value {
  text-align: right;
}

.speed-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 2fr) repeat(3, minmax(80px, .65fr));
  align-items: center;
  gap: 18px;
  min-height: 62px;
}

.speed-row > span:nth-child(n + 3) {
  text-align: right;
}

.conversion-groups {
  display: grid;
  gap: 8px;
}

.conversion-section {
  padding-bottom: 16px;
}

.conversion-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(180px, 1.4fr) 100px 72px;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.conversion-route {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 18px minmax(80px, 1fr);
  align-items: center;
  gap: 8px;
}

.conversion-route strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversion-route svg {
  width: 14px;
  color: var(--color-text-secondary);
}

.conversion-percent {
  font-size: 15px;
  font-weight: 580;
  text-align: right;
}

.movement-chart {
  display: grid;
  height: 270px;
  grid-template-columns: repeat(30, minmax(8px, 1fr));
  align-items: end;
  gap: 6px;
  padding: 20px 4px 0;
  border-bottom: 1px solid var(--color-border);
  background-image: linear-gradient(to bottom, transparent 24%, var(--color-grid) 25%, transparent 26%, transparent 49%, var(--color-grid) 50%, transparent 51%, transparent 74%, var(--color-grid) 75%, transparent 76%);
}

.movement-chart > span {
  display: grid;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) 22px;
  align-items: end;
  gap: 5px;
}

.movement-chart i {
  display: block;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: #2a8a72;
}

.movement-chart small {
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 8px;
  text-align: center;
}

.event-timeline {
  padding-top: 20px;
}

.event-line {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1.2fr) minmax(180px, 1fr) 80px;
  align-items: center;
  gap: 14px;
  min-height: 66px;
}

.event-marker {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #15745e;
  background: #e8f2ee;
}

.event-marker svg {
  width: 14px;
  height: 14px;
}

.event-main,
.event-person {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.event-main strong,
.event-person strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-main small,
.event-person small,
.event-source {
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-source {
  justify-self: end;
  padding: 4px 6px;
  border-radius: 3px;
  background: #f2f5f3;
}

@media (max-width: 800px) {
  .rank-row {
    grid-template-columns: 26px minmax(110px, 1fr) minmax(80px, 1fr) 72px;
    gap: 10px;
  }

  .speed-list,
  .conversion-section {
    overflow-x: auto;
  }

  .speed-row {
    min-width: 720px;
  }

  .conversion-row {
    min-width: 760px;
  }

  .movement-chart {
    gap: 3px;
  }

  .movement-chart small:nth-child(even) {
    visibility: hidden;
  }

  .event-line {
    grid-template-columns: 30px minmax(130px, 1fr) minmax(110px, .8fr);
  }

  .event-source {
    display: none;
  }
}

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

  .three-kpis > span,
  .three-kpis > span:first-child,
  .three-kpis > span:last-child {
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--color-grid);
  }

  .rank-row {
    grid-template-columns: 24px minmax(92px, 1fr) 60px;
  }

  .rank-row .rank-bar {
    grid-column: 2 / 4;
    grid-row: 2;
    margin-bottom: 9px;
  }

  .movement-chart {
    height: 220px;
    overflow-x: auto;
    grid-template-columns: repeat(30, 12px);
    justify-content: start;
  }

  .event-line {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    padding: 12px 0;
  }

  .event-person {
    grid-column: 2;
  }
}

.manager-stage-matrix thead span {
  color: var(--color-text-secondary);
  font-size: 9px;
}

.manager-stage-matrix thead strong {
  margin-top: 3px;
  color: var(--color-text-primary);
  font-size: 10px;
  font-weight: 600;
}

.owner-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: normal;
}

.owner-state::before {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--color-data-primary);
  content: "";
}

.owner-state-unknown::before {
  background: var(--color-warning);
}

.owner-state-ambiguous::before {
  background: var(--color-negative);
}

.owner-unknown td,
.owner-ambiguous td {
  background: #fffcf6;
}

.stage-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) minmax(100px, 2fr) 38px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 10px;
}

.stage-bar-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-bar-row > strong {
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.stage-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: #f0f3f1;
}

.stage-track > i {
  display: block;
  height: 100%;
  overflow: hidden;
  background: #d9e9e2;
}

.stage-track b {
  display: block;
  height: 100%;
  background: #c98d40;
}

.stage-legend {
  display: flex;
  gap: 15px;
  color: var(--color-text-secondary);
  font-size: 9px;
}

.stage-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #d9e9e2;
}

.stage-legend i.is-stuck {
  background: #c98d40;
}

.home-activity .report-section-head > div {
  min-width: 0;
}

.m4-coverage {
  margin: 0 0 16px;
  border-top: 1px solid var(--color-grid);
  border-bottom: 1px solid var(--color-grid);
}

.m4-coverage > summary {
  display: grid;
  min-height: 50px;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.m4-coverage > summary::-webkit-details-marker {
  display: none;
}

.m4-coverage > summary > span:first-child {
  display: grid;
  gap: 3px;
}

.m4-coverage > summary strong {
  font-size: 11px;
  font-weight: 620;
}

.m4-coverage > summary small,
.m4-provenance-summary,
.m4-coverage-note,
.m4-intervals small,
.m4-intervals em {
  color: var(--color-text-secondary);
  font-size: 9px;
  font-style: normal;
}

.m4-coverage > summary svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-secondary);
  transition: transform 160ms ease;
}

.m4-coverage[open] > summary svg {
  transform: rotate(180deg);
}

.m4-coverage.is-warning > summary strong,
.m4-evidence-counts .is-warning strong,
.m4-intervals .is-gap strong {
  color: var(--color-warning);
}

.m4-coverage-details {
  padding-bottom: 12px;
}

.m4-evidence-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  border-top: 1px solid var(--color-grid);
}

.m4-evidence-counts > span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-right: 1px solid var(--color-grid);
}

.m4-evidence-counts > span:first-child {
  padding-left: 0;
}

.m4-evidence-counts > span:last-child {
  border-right: 0;
}

.m4-evidence-counts small {
  color: var(--color-text-secondary);
  font-size: 9px;
}

.m4-evidence-counts strong {
  font-size: 16px;
  font-weight: 500;
}

.m4-coverage-note {
  margin: 10px 0 0;
}

.m4-intervals {
  display: grid;
  border-top: 1px solid var(--color-grid);
}

.m4-intervals > span {
  display: grid;
  grid-template-columns: 130px minmax(220px, 1fr) minmax(180px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--color-grid);
}

.m4-intervals strong {
  font-size: 10px;
  font-weight: 570;
}

.activity-summary {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin: 0 0 15px;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.activity-summary strong {
  margin-right: 4px;
  color: var(--color-text-primary);
  font-size: 19px;
  font-weight: 400;
}

.quality-label {
  padding: 4px 7px;
  border-radius: 3px;
  color: var(--color-warning);
  background: #fcf1df;
}

.text-link {
  min-height: 30px;
  padding: 4px 7px;
  border-color: transparent;
  color: var(--color-brand-signal);
  background: transparent;
  font-size: 11px;
}

.text-link:hover {
  border-color: transparent;
  background: #edf5f0;
}

.auth-gate {
  background: #f4f7f5;
}

.auth-panel {
  box-shadow: 0 18px 55px rgba(28, 62, 48, 0.08);
}

.auth-brand strong {
  font-size: 24px;
  font-weight: 500;
  text-transform: lowercase;
}

.auth-brand strong .brand-period {
  display: inline;
}

.auth-brand .brand-mark {
  border: 0;
  color: #fff;
  background: var(--color-brand-signal);
}

.scrim {
  display: none;
}

.toast {
  z-index: 100;
  border-radius: 5px;
  background: #273d34;
}

@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .sidebar {
    width: 200px;
    padding-inline: 12px;
  }

  .main {
    padding-inline: 25px;
  }

  .topbar {
    margin-inline: -25px;
    padding-inline: 25px;
  }

  .kpi-item strong {
    font-size: 27px;
  }
}

@media (max-width: 960px) {
  .kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 22px;
  }

  .kpi-item:nth-child(5n + 1),
  .kpi-item:nth-child(5n),
  .kpi-item {
    padding: 0 16px;
    border-right: 1px solid var(--color-border);
  }

  .kpi-item:nth-child(3n + 1) {
    padding-left: 0;
  }

  .kpi-item:nth-child(3n) {
    padding-right: 0;
    border-right: 0;
  }

  .executive-kpis .kpi-item:nth-child(n + 4) {
    margin-top: 0;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
  }

  .dashboard-grid,
  .api-grid,
  .journal-stack {
    grid-template-columns: 1fr;
  }

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

  .snapshot-kpis .kpi-item:nth-child(n + 3) {
    padding-top: 19px;
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 700px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 228px;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .scrim {
    position: fixed;
    inset: 0;
    display: block;
    z-index: 35;
    background: rgba(20, 48, 38, 0.24);
  }

  .main {
    padding: 0 18px 24px;
  }

  .topbar {
    position: sticky;
    min-height: 56px;
    align-items: center;
    flex-direction: row;
    margin: 0 -18px;
    padding: 0 16px;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .breadcrumb-root,
  .breadcrumb > svg {
    display: none;
  }

  .account-picker span {
    display: none;
  }

  .account-picker select {
    max-width: 145px;
    font-size: 11px;
  }

  .page-heading {
    margin-top: 23px;
  }

  .page-heading h2 {
    font-size: 26px;
  }

  .page-meta {
    font-size: 11px;
  }

  .grid-form,
  .grid-form.compact,
  .filter-bar,
  .inline-form {
    grid-template-columns: 1fr;
  }

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

  .kpi-item:nth-child(3n + 1),
  .kpi-item:nth-child(3n),
  .kpi-item {
    padding: 0 12px;
    border-right: 1px solid var(--color-border);
  }

  .kpi-item:nth-child(odd) {
    padding-left: 0;
  }

  .kpi-item:nth-child(even) {
    padding-right: 0;
    border-right: 0;
  }

  .executive-kpis .kpi-item:nth-child(n + 3) {
    padding-top: 19px;
    border-top: 1px solid var(--color-border);
  }

  .kpi-item strong {
    font-size: 28px;
  }

  .dashboard-grid,
  .catalog-grid,
  .favorites-grid,
  .rule-list {
    grid-template-columns: 1fr;
  }

  .home-actions,
  .actions {
    align-items: stretch;
  }

  .home-actions button,
  .actions button {
    min-height: 40px;
  }

  .inline-unavailable {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .inline-unavailable button {
    grid-column: 2;
    justify-self: start;
  }

  .matrix-table th:first-child,
  .matrix-table td:first-child {
    min-width: 130px;
  }

  .manager-stage-matrix th,
  .manager-stage-matrix td {
    min-width: 92px;
    padding-inline: 9px;
  }

  .manager-stage-matrix th:first-child,
  .manager-stage-matrix td:first-child {
    min-width: 154px;
    max-width: 154px;
  }

  .auth-gate {
    min-height: 100dvh;
    padding: 24px 18px;
  }

  .auth-panel {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Demo-ready executive overview */
.workspace-state {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 4px 0 14px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.workspace-state-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.workspace-state-main > svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--color-brand-signal);
}

.workspace-state-main > span:last-child {
  display: grid;
  gap: 2px;
}

.workspace-state-main strong {
  font-size: 12px;
  font-weight: 620;
}

.workspace-state-main small {
  color: var(--color-text-secondary);
  font-size: 10px;
  line-height: 1.45;
}

.workspace-state-action {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 7px;
}

.workspace-state-action button {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 10px;
}

.workspace-state.is-partial .workspace-state-main > svg,
.workspace-state.is-first_load .workspace-state-main > svg {
  color: var(--color-warning);
}

.workspace-state.is-stale .workspace-state-main > svg,
.workspace-state.is-error .workspace-state-main > svg {
  color: var(--color-negative);
}

.workspace-state.is-no_connection,
.workspace-state.is-first_load,
.workspace-state.is-empty,
.workspace-state.is-error {
  min-height: 78px;
}

.ingestion-progress {
  margin: -12px 0 20px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.ingestion-progress details > summary {
  display: grid;
  min-height: 50px;
  grid-template-columns: 28px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  cursor: pointer;
  list-style: none;
}

.ingestion-progress details > summary::-webkit-details-marker {
  display: none;
}

.ingestion-progress-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--color-text-secondary);
  background: var(--color-surface-muted);
}

.ingestion-progress-icon svg,
.ingestion-progress-chevron {
  width: 15px;
  height: 15px;
}

.ingestion-progress.is-progress .ingestion-progress-icon {
  color: var(--color-data-primary);
  background: #e8f2ee;
}

.ingestion-progress.is-warning .ingestion-progress-icon {
  color: var(--color-warning);
  background: #fff2d8;
}

.ingestion-progress.is-negative .ingestion-progress-icon {
  color: var(--color-negative);
  background: #fde8e6;
}

.ingestion-progress-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ingestion-progress-copy strong {
  font-size: 12px;
  font-weight: 620;
}

.ingestion-progress-copy small,
.ingestion-progress-facts small,
.ingestion-progress-facts em,
.ingestion-checkpoint small,
.ingestion-empty {
  color: var(--color-text-secondary);
  font-size: 10px;
  font-style: normal;
}

.ingestion-progress-count {
  color: var(--color-text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.ingestion-progress-chevron {
  color: var(--color-text-secondary);
  transition: transform 160ms ease;
}

.ingestion-progress details[open] .ingestion-progress-chevron {
  transform: rotate(180deg);
}

.ingestion-progress-details {
  padding: 4px 0 16px 38px;
}

.ingestion-progress-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--color-grid);
  border-bottom: 1px solid var(--color-grid);
}

.ingestion-progress-facts > span {
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  border-right: 1px solid var(--color-grid);
}

.ingestion-progress-facts > span:first-child {
  padding-left: 0;
}

.ingestion-progress-facts > span:last-child {
  padding-right: 0;
  border-right: 0;
}

.ingestion-progress-facts strong {
  font-size: 12px;
  font-weight: 600;
}

.ingestion-event-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 0;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.ingestion-event-counts strong {
  margin-left: 4px;
  color: var(--color-text-primary);
}

.ingestion-event-counts .is-warning strong {
  color: var(--color-warning);
}

.canonical-coverage {
  border-top: 1px solid var(--color-grid);
}

.canonical-coverage-head,
.canonical-coverage-row {
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr) minmax(180px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--color-grid);
}

.canonical-coverage-head {
  grid-template-columns: minmax(0, 1fr) auto;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.canonical-coverage-head strong,
.canonical-coverage-row strong {
  color: var(--color-text-primary);
  font-size: 11px;
  font-weight: 580;
}

.canonical-coverage-row > span,
.canonical-coverage-row > small {
  color: var(--color-text-secondary);
  font-size: 10px;
}

.canonical-coverage-row.is-gap > span,
.canonical-coverage-row.is-gap > strong {
  color: var(--color-warning);
}

.ingestion-checkpoints {
  border-top: 1px solid var(--color-grid);
}

.ingestion-checkpoint {
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr) 150px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-grid);
}

.ingestion-checkpoint > span:not(.ingestion-checkpoint-state) {
  display: grid;
  gap: 3px;
}

.ingestion-checkpoint strong {
  font-size: 11px;
  font-weight: 560;
}

.ingestion-checkpoint-state {
  width: fit-content;
  padding: 4px 6px;
  border-radius: 3px;
  color: var(--color-text-secondary);
  background: var(--color-surface-muted);
  font-size: 9px;
  font-weight: 650;
}

.ingestion-checkpoint-state.is-running,
.ingestion-checkpoint-state.is-yielded {
  color: #17664f;
  background: #e8f2ee;
}

.ingestion-checkpoint-state.is-error,
.ingestion-checkpoint-error {
  color: var(--color-negative);
}

.ingestion-checkpoint-error {
  grid-column: 2 / -1;
  font-size: 10px;
}

.ingestion-empty {
  margin: 10px 0 0;
}

.report-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 8px 0;
  border-left: 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
}

.report-context.is-warning {
  border-left: 0;
  background: transparent;
}

.report-context-facts {
  align-items: center;
  gap: 8px 16px;
  color: var(--color-text-secondary);
}

.freshness-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-positive);
}

.report-context.is-warning .freshness-label {
  color: var(--color-warning);
}

.freshness-label svg {
  width: 14px;
  height: 14px;
}

.report-context-details {
  position: relative;
  flex: none;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.report-context-details summary {
  cursor: pointer;
  list-style: none;
}

.report-context-details summary::-webkit-details-marker {
  display: none;
}

.report-context-details[open] > div {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(420px, 78vw);
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: #735020;
  background: #fffaf0;
  box-shadow: 0 14px 32px rgba(34, 42, 42, 0.1);
  line-height: 1.45;
}

.pulse-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: stretch;
  gap: 30px;
  margin-bottom: 28px;
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--color-border);
}

.pulse-copy {
  min-width: 0;
}

.pulse-period {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-brand-signal);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.pulse-period svg {
  width: 15px;
  height: 15px;
}

.pulse-copy h3 {
  max-width: 830px;
  margin: 13px 0 9px;
  font-size: clamp(28px, 3.1vw, 46px);
  font-weight: 430;
  line-height: 1.08;
  letter-spacing: 0;
}

.pulse-copy h3 em {
  color: var(--color-warning);
  font-style: normal;
}

.pulse-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.pulse-action {
  display: grid;
  min-height: 150px;
  align-content: space-between;
  padding: 17px;
  border: 1px solid #d7e3dd;
  border-radius: var(--radius-md);
  color: #f8fbfa;
  background: #1f4b3d;
  text-align: left;
}

.pulse-action:hover {
  border-color: #1f4b3d;
  color: #fff;
  background: #173c31;
}

.pulse-action span,
.pulse-action small {
  color: #c9dbd4;
  font-size: 10px;
}

.pulse-action strong {
  font-size: 48px;
  font-weight: 430;
  line-height: 1;
}

.pulse-action small {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pulse-action svg {
  width: 15px;
  height: 15px;
}

.showcase-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
  padding: 0 0 25px;
}

.showcase-kpis .kpi-item {
  min-height: 118px;
  padding: 4px 22px;
}

.showcase-kpis .kpi-item:first-child {
  padding-left: 0;
}

.showcase-kpis .kpi-item:last-child {
  padding-right: 0;
  border-right: 0;
}

.showcase-kpis .kpi-label {
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 8px;
}

.showcase-kpis .kpi-label svg {
  width: 16px;
  height: 16px;
  color: var(--color-brand-signal);
}

.showcase-kpis .kpi-item strong {
  margin: 8px 0 7px;
  font-size: 38px;
}

.secondary-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 35px;
  border-bottom: 1px solid var(--color-border);
}

.secondary-kpis > span {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-right: 1px solid var(--color-border);
}

.secondary-kpis > span:first-child {
  padding-left: 0;
}

.secondary-kpis > span:last-child {
  padding-right: 0;
  border-right: 0;
}

.secondary-kpis small {
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-kpis strong {
  flex: none;
  font-size: 17px;
  font-weight: 520;
}

@media (max-width: 900px) {
  .pulse-hero {
    grid-template-columns: minmax(0, 1fr) 160px;
  }

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

  .showcase-kpis .kpi-item:nth-child(2) {
    padding-right: 0;
    border-right: 0;
  }

  .showcase-kpis .kpi-item:nth-child(n + 3) {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
  }

  .showcase-kpis .kpi-item:nth-child(3) {
    padding-left: 0;
  }

  .secondary-kpis > span:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .m4-coverage > summary {
    grid-template-columns: minmax(0, 1fr) 18px;
  }

  .m4-provenance-summary {
    display: none;
  }

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

  .m4-evidence-counts > span,
  .m4-evidence-counts > span:first-child,
  .m4-evidence-counts > span:last-child {
    padding: 9px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--color-grid);
  }

  .m4-intervals > span {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .workspace-state {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .ingestion-progress {
    margin-top: -8px;
  }

  .ingestion-progress details > summary {
    grid-template-columns: 28px minmax(0, 1fr) 18px;
  }

  .ingestion-progress-count {
    display: none;
  }

  .ingestion-progress-details {
    padding-left: 0;
  }

  .ingestion-progress-facts {
    grid-template-columns: 1fr;
  }

  .ingestion-progress-facts > span,
  .ingestion-progress-facts > span:first-child,
  .ingestion-progress-facts > span:last-child {
    padding: 11px 0;
    border-right: 0;
    border-bottom: 1px solid var(--color-grid);
  }

  .ingestion-progress-facts > span:last-child {
    border-bottom: 0;
  }

  .ingestion-checkpoint {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .canonical-coverage-head,
  .canonical-coverage-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .ingestion-checkpoint-error {
    grid-column: auto;
  }

  .workspace-state-action,
  .workspace-state-action button {
    width: 100%;
    flex: 1 1 140px;
  }

  .report-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .pulse-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 16px;
  }

  .pulse-copy h3 {
    font-size: 31px;
  }

  .pulse-action {
    min-height: 116px;
  }

  .showcase-kpis .kpi-item strong {
    font-size: 31px;
  }

  .secondary-kpis {
    grid-template-columns: 1fr;
  }

  .secondary-kpis > span,
  .secondary-kpis > span:first-child,
  .secondary-kpis > span:last-child {
    padding: 11px 0;
    border-right: 0;
    border-bottom: 1px solid var(--color-grid);
  }
}

/* Demo-ready deal focus: a management view instead of a raw API table. */
.deals-focus {
  padding: 30px 0 10px;
}

.deals-focus-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 0 0 24px;
}

.deals-focus-head > div {
  max-width: 680px;
}

.section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--color-brand-signal);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.deals-focus-head h3 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 430;
  line-height: 1.05;
}

.deals-focus-head p {
  margin: 11px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.deals-focus-head > strong {
  color: var(--color-brand-signal);
  font-size: 64px;
  font-weight: 400;
  line-height: .9;
}

.age-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 28px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.age-summary > span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid var(--color-border);
}

.age-summary > span:first-child {
  padding-left: 0;
}

.age-summary > span:last-child {
  padding-right: 0;
  border-right: 0;
}

.age-summary small {
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.age-summary strong {
  font-size: 24px;
  font-weight: 480;
}

.age-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #88a89c;
}

.age-dot.is-week {
  background: #dca54c;
}

.age-dot.is-critical {
  background: #d65d54;
}

.deals-table-wrap {
  border-top-color: #cfd7d3;
}

.deals-table th,
.deals-table td {
  height: 58px;
  padding: 12px 14px;
}

.deals-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.deals-table td {
  text-align: left;
}

.deals-table th:nth-child(5),
.deals-table td:nth-child(5),
.deals-table th:last-child,
.deals-table td:last-child {
  text-align: right;
}

.deal-id {
  color: var(--color-brand-signal);
  font-size: 13px;
  font-weight: 620;
}

.deal-stage strong,
.deal-stage small {
  display: block;
}

.deal-stage strong {
  color: var(--color-text);
  font-size: 12px;
  font-weight: 580;
}

.deal-stage small {
  margin-top: 4px;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.deal-budget {
  font-variant-numeric: tabular-nums;
  font-weight: 540;
}

.age-badge {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 4px;
  color: #426a5d;
  background: #eaf2ee;
  font-size: 11px;
  font-weight: 650;
}

.age-badge.is-week {
  color: #8d5d13;
  background: #fff2d8;
}

.age-badge.is-critical {
  color: #a43e37;
  background: #fde8e6;
}

@media (max-width: 760px) {
  .deals-focus {
    padding-top: 20px;
  }

  .deals-focus-head {
    align-items: flex-start;
  }

  .deals-focus-head h3 {
    font-size: 32px;
  }

  .deals-focus-head > strong {
    font-size: 46px;
  }

  .age-summary {
    grid-template-columns: 1fr;
  }

  .age-summary > span,
  .age-summary > span:first-child,
  .age-summary > span:last-child {
    padding: 11px 0;
    border-right: 0;
    border-bottom: 1px solid var(--color-grid);
  }

  .age-summary > span:last-child {
    border-bottom: 0;
  }

  .deals-table th:nth-child(4),
  .deals-table td:nth-child(4),
  .deals-table th:nth-child(5),
  .deals-table td:nth-child(5) {
    display: none;
  }
}

/* Decision-oriented analytics views. */
.analysis-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: stretch;
  gap: 34px;
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--color-border);
}

.analysis-hero > div:first-child {
  align-self: center;
}

.analysis-hero h3 {
  max-width: 760px;
  margin: 8px 0 10px;
  font-size: clamp(29px, 3.2vw, 45px);
  font-weight: 430;
  line-height: 1.08;
  letter-spacing: 0;
}

.analysis-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.analysis-hero-stat {
  display: grid;
  min-height: 138px;
  align-content: space-between;
  padding: 18px;
  border-radius: 6px;
  color: #fff;
  background: #214c3e;
}

.analysis-hero-stat span,
.analysis-hero-stat small {
  color: #c9ddd5;
  font-size: 10px;
}

.analysis-hero-stat strong {
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 430;
  line-height: 1;
}

.analysis-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--color-border);
}

.analysis-kpis > span {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 21px 22px;
  border-right: 1px solid var(--color-border);
}

.analysis-kpis > span:first-child {
  padding-left: 0;
}

.analysis-kpis > span:last-child {
  padding-right: 0;
  border-right: 0;
}

.analysis-kpis small {
  color: var(--color-text-secondary);
  font-size: 10px;
}

.analysis-kpis strong {
  font-size: 29px;
  font-weight: 450;
}

.analysis-kpis .is-warning strong,
.pipeline-summary .is-warning strong,
.risk-value strong,
.stage-stuck.is-warning strong {
  color: var(--color-warning);
}

.analysis-scope-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--color-border);
  background: #fafbfa;
}

.analysis-scope-strip > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 18px;
  border-right: 1px solid var(--color-grid);
}

.analysis-scope-strip > span:last-child {
  border-right: 0;
}

.analysis-scope-strip b {
  font-size: 10px;
  font-weight: 620;
}

.analysis-scope-strip small {
  color: var(--color-text-secondary);
  font-size: 9px;
}

.analysis-block {
  padding: 30px 0;
}

.manager-scoreboard {
  min-width: 880px;
  border-top: 1px solid var(--color-border);
}

.analysis-block:has(.manager-scoreboard) {
  overflow-x: auto;
}

.manager-score-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(5, minmax(110px, 1fr));
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid var(--color-grid);
}

.manager-score-row > span {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 11px 13px;
}

.manager-score-row > span:first-child {
  padding-left: 0;
}

.manager-score-row strong,
.manager-score-row b {
  overflow: hidden;
  font-size: 13px;
  font-weight: 570;
  text-overflow: ellipsis;
}

.manager-score-row small {
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-score-head {
  min-height: 40px;
  color: var(--color-text-secondary);
  background: #fafbfa;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.manager-identity {
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
}

.manager-identity i {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #15745e;
  background: #e8f2ee;
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
}

.conversion-cell > i,
.funnel-volume > i {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: #edf1ef;
}

.conversion-cell > i > b,
.funnel-volume > i > b {
  display: block;
  height: 100%;
  background: #2a8a72;
}

.decision-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: stretch;
  margin-top: 4px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: #f7f9f8;
}

.decision-strip > div {
  display: grid;
  gap: 5px;
  padding: 18px 22px;
  border-right: 1px solid var(--color-border);
}

.decision-strip span,
.decision-strip small {
  color: var(--color-text-secondary);
  font-size: 9px;
}

.decision-strip strong {
  font-size: 15px;
  font-weight: 570;
}

.decision-strip button {
  min-width: 190px;
  justify-content: center;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: #214c3e;
}

.decision-strip button:hover {
  color: #fff;
  background: #173c31;
}

.decision-strip button svg {
  width: 15px;
  height: 15px;
}

.pipeline-list {
  display: grid;
  gap: 34px;
  padding-top: 32px;
}

.pipeline-section {
  min-width: 0;
}

.pipeline-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  padding-bottom: 16px;
}

.pipeline-heading h4 {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 470;
}

.pipeline-heading > div:first-child > span {
  color: var(--color-brand-signal);
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
}

.pipeline-summary {
  display: flex;
  align-items: baseline;
  gap: 28px;
}

.pipeline-summary > span {
  display: grid;
  gap: 3px;
}

.pipeline-summary small {
  color: var(--color-text-secondary);
  font-size: 9px;
}

.pipeline-summary strong {
  font-size: 17px;
  font-weight: 520;
}

.funnel-stage-head {
  display: grid;
  grid-template-columns: 72px minmax(180px, 1.2fr) minmax(180px, 2fr) 76px;
  gap: 16px;
  padding: 9px 0;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-grid);
  background: #fafbfa;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.funnel-stage-head span:nth-child(3),
.funnel-stage-head span:nth-child(4) {
  text-align: right;
}

.funnel-stage-list {
  border-top: 1px solid var(--color-border);
}

.funnel-stage-row {
  display: grid;
  grid-template-columns: 72px minmax(180px, 1.2fr) minmax(180px, 2fr) 76px;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  border-bottom: 1px solid var(--color-grid);
}

.stage-role {
  display: inline-flex;
  width: fit-content;
  padding: 4px 6px;
  border-radius: 3px;
  color: #426a5d;
  background: #eaf2ee;
  font-size: 9px;
  font-weight: 650;
}

.stage-role.is-success {
  color: #17664f;
  background: #dcf1e8;
}

.stage-role.is-failure,
.stage-role.is-archive {
  color: #8a5550;
  background: #f5e9e7;
}

.stage-name,
.stage-stuck {
  display: grid;
  gap: 4px;
}

.stage-name b,
.stage-stuck strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-name small,
.stage-stuck small {
  color: var(--color-text-secondary);
  font-size: 9px;
}

.funnel-volume {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 36px;
  align-items: center;
  gap: 12px;
}

.funnel-volume strong {
  font-size: 13px;
  font-weight: 570;
  text-align: right;
}

.stage-stuck {
  text-align: right;
}

@media (max-width: 900px) {
  .analysis-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

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

  .analysis-kpis > span:nth-child(2) {
    border-right: 0;
  }

  .analysis-kpis > span:nth-child(n + 3) {
    border-top: 1px solid var(--color-grid);
  }

  .pipeline-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .analysis-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 18px;
  }

  .analysis-hero-stat {
    min-height: 112px;
  }

  .analysis-kpis > span,
  .analysis-kpis > span:first-child,
  .analysis-kpis > span:last-child {
    padding: 16px 12px;
  }

  .analysis-kpis > span:nth-child(odd) {
    padding-left: 0;
  }

  .analysis-kpis > span:nth-child(even) {
    padding-right: 0;
  }

  .decision-strip {
    grid-template-columns: 1fr;
  }

  .decision-strip > div {
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .decision-strip button {
    min-height: 48px;
  }

  .pipeline-summary {
    width: 100%;
    justify-content: space-between;
    gap: 14px;
  }

  .analysis-scope-strip {
    grid-template-columns: 1fr;
  }

  .analysis-scope-strip > span {
    padding: 11px 0;
    border-right: 0;
    border-bottom: 1px solid var(--color-grid);
  }

  .analysis-scope-strip > span:last-child {
    border-bottom: 0;
  }

  .analysis-block:has(.manager-scoreboard) {
    overflow: visible;
  }

  .manager-scoreboard {
    min-width: 0;
  }

  .manager-score-head {
    display: none;
  }

  .manager-score-row:not(.manager-score-head) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 14px 0;
  }

  .manager-score-row:not(.manager-score-head) > span {
    gap: 3px;
    padding: 10px 0;
    border-top: 1px solid var(--color-grid);
  }

  .manager-score-row:not(.manager-score-head) > .manager-identity {
    grid-column: 1 / -1;
    padding: 0 0 10px;
    border-top: 0;
  }

  .manager-score-row:not(.manager-score-head) > span[data-label]::before {
    content: attr(data-label);
    color: var(--color-text-secondary);
    font-size: 9px;
  }

  .manager-score-row:not(.manager-score-head) > span:last-child {
    grid-column: 1 / -1;
  }

  .funnel-stage-list {
    overflow: visible;
  }

  .funnel-stage-head {
    display: none;
  }

  .funnel-stage-row {
    grid-template-columns: 58px minmax(108px, 1fr) 72px;
    gap: 8px;
    min-width: 0;
    padding: 10px 0;
  }

  .funnel-volume {
    grid-template-columns: minmax(32px, 1fr) 24px;
    gap: 6px;
  }

  .stage-stuck {
    grid-column: 2 / 4;
    grid-template-columns: auto auto;
    justify-content: end;
    gap: 6px;
  }

  .stage-role {
    padding-inline: 4px;
  }
}

/* First vertical scenario: shared analytics context, topics, and reusable blocks. */
.analytics-context {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) repeat(3, minmax(145px, 0.7fr)) auto auto;
  align-items: end;
  gap: 10px;
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
}

.context-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.context-field.is-hidden,
.context-preset-editor.is-hidden {
  display: none;
}

.context-label {
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.analytics-context input,
.analytics-context select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
}

.date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.date-range > span {
  color: var(--color-text-secondary);
}

.context-apply {
  height: 38px;
}

.context-more {
  position: relative;
}

.context-more > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  list-style: none;
}

.context-more > summary::-webkit-details-marker {
  display: none;
}

.context-more > summary svg {
  width: 15px;
}

.context-more-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 270px;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 45px rgb(22 47 40 / 14%);
}

.context-more-panel label {
  display: grid;
  gap: 5px;
}

.context-more-panel label > span {
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.context-preset-editor {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--color-grid);
}

.context-preset-editor > span {
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.pipeline-choice-list {
  display: grid;
  max-height: 150px;
  gap: 5px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--color-grid);
}

.pipeline-choice-list label,
.context-default-check {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 7px !important;
  color: var(--color-text) !important;
  font-size: 11px !important;
  text-transform: none !important;
}

.pipeline-choice-list input,
.context-default-check input {
  width: 15px;
  height: 15px;
}

.dashboard-intro,
.topic-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.dashboard-intro h3,
.topic-heading h3 {
  margin: 4px 0 3px;
  font-size: 22px;
  font-weight: 560;
}

.dashboard-intro p,
.topic-heading p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.section-kicker {
  color: var(--color-accent);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-intro > button,
.related-report > button,
.topic-report-actions > button:not(.icon-button) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.dashboard-intro svg,
.related-report svg,
.topic-report-actions svg {
  width: 15px;
  height: 15px;
}

.topic-layout {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  gap: 28px;
}

.topic-nav {
  position: sticky;
  top: 76px;
  align-self: start;
  padding-top: 6px;
}

.topic-nav > .section-kicker {
  display: block;
  margin: 0 10px 8px;
}

.topic-nav-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--color-text-secondary);
  background: transparent;
  text-align: left;
}

.topic-nav-item:hover,
.topic-nav-item.is-active {
  border-left-color: var(--color-accent);
  color: var(--color-text);
  background: #eef5f2;
}

.topic-nav-item svg {
  width: 14px;
}

.topic-content {
  min-width: 0;
}

.analytics-block-grid {
  display: grid;
  gap: 18px;
}

.analytics-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
}

.analytics-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--color-grid);
}

.analytics-block-head > div:first-child {
  min-width: 0;
}

.analytics-block-head span,
.report-kind {
  color: var(--color-accent);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.analytics-block-head h4 {
  margin: 4px 0 5px;
  font-size: 19px;
  font-weight: 560;
}

.analytics-block-head p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.analytics-block-head p svg {
  width: 13px;
  height: 13px;
}

.analytics-block-actions,
.block-order {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.analytics-block-actions .icon-button {
  width: 34px;
  height: 34px;
}

.icon-button.is-pinned {
  color: var(--color-accent);
  background: #e4f1ec;
}

.icon-button.is-pinned svg {
  fill: currentColor;
}

.analytics-block-body {
  min-width: 0;
  padding: 0 20px 20px;
}

.analytics-block-body > .report-context {
  margin-inline: -20px;
  padding-inline: 20px;
}

.analytics-block .report-section,
.analytics-block .snapshot-report {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.analytics-block .report-section {
  padding-inline: 0;
}

.embedded-report-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 10px;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.block-state {
  display: flex;
  min-height: 145px;
  align-items: center;
  gap: 14px;
  padding: 24px 20px;
}

.block-state > svg {
  width: 24px;
  height: 24px;
  color: #b17626;
}

.block-state p {
  margin: 5px 0 0;
  color: var(--color-text-secondary);
}

.block-footnote {
  margin-top: 14px;
  padding: 11px 0 0;
  border-top: 1px solid var(--color-grid);
  color: var(--color-text-secondary);
  font-size: 10px;
}

.analytics-block.is-error > button {
  margin: 0 20px 20px;
}

.related-report,
.topic-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #f8faf9;
}

.related-report h4,
.topic-report-row h4 {
  margin: 4px 0;
  font-size: 16px;
  font-weight: 560;
}

.related-report p,
.topic-report-row p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 11px;
}

.topic-report-list {
  display: grid;
  gap: 10px;
}

.topic-report-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.back-link svg {
  width: 14px;
}

body.has-expanded-report {
  overflow: hidden;
}

.analytics-block.is-expanded {
  position: fixed;
  z-index: 120;
  inset: 18px;
  overflow: auto;
  border-color: #b8cbc4;
  box-shadow: 0 28px 80px rgb(20 45 37 / 22%);
}

.analytics-block.is-expanded .analytics-block-head {
  position: sticky;
  z-index: 4;
  top: 0;
  background: #fff;
}

@media (max-width: 1050px) {
  .analytics-context {
    grid-template-columns: minmax(240px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr) auto;
  }

  .context-more {
    grid-column: 4;
  }
}

@media (max-width: 760px) {
  .analytics-context {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .context-period {
    grid-column: 1 / -1;
  }

  .context-apply {
    width: 100%;
  }

  .context-more {
    grid-column: auto;
  }

  .context-more > summary {
    width: 100%;
  }

  .context-more-panel {
    right: 0;
    width: min(270px, calc(100vw - 36px));
  }

  .topic-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .topic-nav {
    position: static;
    overflow-x: auto;
    padding: 0 0 4px;
  }

  .topic-nav > .section-kicker {
    display: none;
  }

  .topic-nav > div {
    display: flex;
    gap: 6px;
    width: max-content;
  }

  .topic-nav-item {
    width: auto;
    min-height: 34px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
  }

  .topic-nav-item.is-active {
    border-color: #a9c9bd;
  }

  .topic-nav-item svg {
    display: none;
  }

  .analytics-block-head,
  .dashboard-intro,
  .topic-heading,
  .related-report,
  .topic-report-row {
    align-items: flex-start;
  }

  .analytics-block-head {
    padding: 15px;
  }

  .analytics-block-body {
    padding-inline: 15px;
  }

  .analytics-block-body > .report-context {
    margin-inline: -15px;
    padding-inline: 15px;
  }

  .analytics-block.is-expanded {
    inset: 0;
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 520px) {
  .analytics-context {
    grid-template-columns: 1fr;
  }

  .context-period,
  .context-more {
    grid-column: auto;
  }

  .date-range {
    grid-template-columns: 1fr;
  }

  .date-range > span {
    display: none;
  }

  .dashboard-intro,
  .related-report,
  .topic-report-row {
    flex-direction: column;
  }

  .analytics-block-head {
    flex-direction: column;
  }

  .analytics-block-actions {
    align-self: flex-end;
  }
}
.is-unsupported-source #tab-reports > .toolbar,
.is-unsupported-source .nav-item[data-tab="sheets"],
.is-unsupported-source .admin-nav {
  display: none;
}

.source-pickers {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

@media (max-width: 700px) {
  .has-multiple-workspaces .topbar {
    flex-wrap: wrap;
    padding-bottom: 9px;
  }

  .has-multiple-workspaces .source-pickers {
    flex: 1 1 100%;
    order: 2;
  }

  .has-multiple-workspaces .source-pickers .account-picker {
    flex: 1 1 0;
  }

  .has-multiple-workspaces .source-pickers select {
    width: 100%;
    max-width: none;
  }
}

.is-unsupported-source .nav-item[data-tab="connect"]:not(.is-hidden) {
  display: flex;
}

.owner-connect-form {
  max-width: 820px;
}

.owner-connect-status {
  max-width: 820px;
  min-height: 48px;
  padding: 14px 16px;
  border-left: 3px solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.owner-connect-status:empty {
  display: none;
}

.owner-connect-status.is-success {
  border-left-color: var(--color-positive);
}

.owner-connect-status.is-error {
  border-left-color: var(--color-negative);
}

.owner-connect-status.is-progress {
  border-left-color: var(--color-data-secondary);
}

.owner-connect-status strong,
.owner-connect-status span {
  display: block;
}

.owner-connect-status strong {
  margin-bottom: 3px;
  color: var(--color-text-primary);
  font-size: 15px;
}

.owner-connect-actions {
  max-width: 820px;
  margin-top: 16px;
}

@media (max-width: 700px) {
  .owner-connect-form,
  .owner-connect-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .owner-connect-actions button {
    width: 100%;
  }

  .owner-connect-form .actions button {
    width: 100%;
  }
}
