:root {
  --paper: #f3f6fb;
  --surface: #ffffff;
  --ink: #17233b;
  --muted: #657089;
  --line: #dfe5ef;
  --line-strong: #c7d1e0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #e8f0ff;
  --coral: #dc6b52;
  --amber: #c28a28;
  --shadow: 0 10px 32px rgba(31, 55, 94, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html.dashboard-auth-locked > body > *:not(.dashboard-login-gate) { display: none !important; }
.dashboard-login-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.dashboard-login-card { width: min(390px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.dashboard-login-card h1 { margin: 10px 0 8px; font-size: 28px; }
.dashboard-login-card p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.dashboard-login-card label { display: block; margin-top: 14px; color: var(--muted); font-size: 12px; }
.dashboard-login-card input { display: block; width: 100%; height: 42px; margin-top: 6px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: #fff; }
.dashboard-login-card form button { width: 100%; height: 42px; margin-top: 20px; border: 0; border-radius: 6px; color: #fff; background: var(--blue); font-weight: 700; }
.dashboard-login-card form button:disabled { opacity: .6; }
.dashboard-login-error { margin-top: 12px; padding: 9px; border-radius: 5px; color: #9b4f46; background: #fff0ed; font-size: 12px; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}
html.dialog-scroll-locked { overscroll-behavior: none; }
html.dialog-scroll-locked body {
  position: fixed; inset: var(--dialog-page-offset, 0) 0 auto; width: 100%; overflow: hidden;
  padding-right: var(--dialog-scrollbar-width, 0);
}
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.app-header {
  height: 68px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.brand-block, .header-actions, .filter-topline, .report-controls, .date-range, .panel-heading,
.section-heading, .table-tools, .chart-legend { display: flex; align-items: center; }
.brand-block { gap: 12px; }
.brand-mark { width: 27px; height: 27px; display: flex; gap: 3px; align-items: flex-end; }
.brand-mark span { width: 7px; display: block; background: var(--blue); }
.brand-mark span:nth-child(1) { height: 11px; }
.brand-mark span:nth-child(2) { height: 19px; }
.brand-mark span:nth-child(3) { height: 26px; }
.brand-name { font: 700 13px/1 "DIN Alternate", "Avenir Next", sans-serif; letter-spacing: 2px; }
.brand-context { margin-top: 5px; color: var(--muted); font-size: 13px; }
.header-actions { gap: 10px; }
.header-actions { justify-content: flex-end; }
.view-tabs {
  height: 38px; padding: 3px; display: flex; align-items: center; border: 1px solid var(--line);
  border-radius: 6px; background: #f4f7fb;
}
.view-tabs button {
  min-width: 86px; height: 30px; padding: 0 12px; border: 0; border-radius: 4px;
  color: var(--muted); background: transparent; font-size: 13px; font-weight: 650;
}
.view-tabs button.active { color: #fff; background: var(--blue-dark); box-shadow: 0 2px 7px rgba(29,78,216,.2); }
.mode-badge { padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); background: #f7f9fc; font-size: 13px; }
.mode-badge i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--amber); border-radius: 50%; }
.mode-badge.live i { background: var(--blue); }
.icon-button, .export-button, .density-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 5px;
  height: 36px;
}
.icon-button { width: 36px; font-size: 22px; line-height: 1; }
.export-button { padding: 0 14px; }
.export-button span { margin-right: 6px; }
.icon-button:hover, .export-button:hover { border-color: #8b99af; background: #f7f9fc; }

.filter-band {
  padding: 30px 32px 24px;
  color: var(--ink);
  background-color: #eef4ff;
  border-bottom: 1px solid var(--line-strong);
}
.filter-topline { justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font: 700 12px/1 "DIN Alternate", sans-serif; letter-spacing: 1.7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; line-height: 1.2; font-weight: 650; }
.report-controls { align-items: flex-end; gap: 18px; }
.date-range { position: relative; width: 290px; display: grid; gap: 6px; color: var(--muted); }
.date-range-label { font-size: 12px; }
.date-range-trigger {
  width: 100%; height: 38px; padding: 0 11px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 5px; text-align: left;
}
.date-range-trigger:hover { border-color: #8b99af; }
.date-range-trigger:focus-visible, .date-range:has(.date-range-popover:not([hidden])) .date-range-trigger {
  border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.14); outline: 0;
}
.date-range-chevron { flex: 0 0 auto; color: var(--muted); transition: transform .16s ease; }
.date-range-trigger[aria-expanded="true"] .date-range-chevron { transform: rotate(180deg); }
.date-range-popover {
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 70; width: 680px;
  padding: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong);
  border-radius: 6px; box-shadow: 0 18px 38px rgba(31,55,94,.2);
}
.date-range-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.date-range-presets button {
  min-height: 34px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted); background: #f7f9fc; font-size: 12px; white-space: nowrap;
}
.date-range-presets button:hover { color: var(--blue-dark); border-color: #aebddd; background: #f1f5ff; }
.date-range-presets button.active { color: #fff; border-color: var(--blue); background: var(--blue); font-weight: 650; }
.date-range-selection {
  min-height: 48px; margin-top: 12px; padding: 8px 11px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; background: #f5f8fd; border: 1px solid var(--line);
  border-radius: 5px;
}
.date-range-selection span { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.date-range-selection strong { min-width: 0; color: #203c61; font-size: 14px; text-align: right; }
.date-range-calendar-toolbar {
  height: 44px; display: grid; grid-template-columns: 34px 1fr 34px; align-items: center;
  gap: 8px; color: var(--muted); font-size: 12px; text-align: center;
}
.date-range-calendar-toolbar button {
  width: 34px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 4px;
  color: var(--ink); background: #fff; font-size: 22px; line-height: 1;
}
.date-range-calendar-toolbar button:hover { color: var(--blue-dark); border-color: #9fb0ce; background: #f4f7fc; }
.date-range-calendars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.range-calendar { min-width: 0; }
.range-calendar-title { margin: 0 0 9px; color: var(--ink); font-size: 14px; font-weight: 700; text-align: center; }
.range-calendar-weekdays, .range-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.range-calendar-weekdays span {
  height: 25px; color: #7a8599; font-size: 11px; font-weight: 650; text-align: center;
}
.range-calendar-grid { row-gap: 2px; }
.range-calendar-empty, .range-calendar-day { height: 34px; }
.range-calendar-day {
  position: relative; min-width: 0; padding: 0; border: 0; color: var(--ink); background: transparent;
  font-size: 12px; text-align: center;
}
.range-calendar-day::before {
  content: ""; position: absolute; top: 2px; right: 0; bottom: 2px; left: 0;
  z-index: 0; background: transparent;
}
.range-calendar-day > span {
  position: relative; z-index: 1; width: 30px; height: 30px; margin: 2px auto;
  display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%;
}
.range-calendar-day:hover > span { color: var(--blue-dark); border-color: #9fb6e5; background: #f3f7ff; }
.range-calendar-day.in-range::before { background: #e6efff; }
.range-calendar-day.range-start::before { left: 50%; }
.range-calendar-day.range-end::before { right: 50%; }
.range-calendar-day.range-start.range-end::before { display: none; }
.range-calendar-day.range-start > span, .range-calendar-day.range-end > span {
  color: #fff; border-color: var(--blue); background: var(--blue); font-weight: 700;
}
.range-calendar-day.is-today:not(.range-start):not(.range-end) > span { color: var(--blue-dark); border-color: var(--blue); font-weight: 700; }
.range-calendar-day:focus-visible { z-index: 2; outline: 2px solid var(--blue); outline-offset: -2px; }
.date-range-feedback { min-height: 31px; padding-top: 9px; color: var(--muted); font-size: 12px; }
.date-range-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.date-range-actions button { height: 34px; padding: 0 14px; border-radius: 4px; font-weight: 650; }
.date-range-cancel { color: var(--muted); background: #fff; border: 1px solid var(--line-strong); }
.date-range-apply { color: #fff; background: var(--blue); border: 1px solid var(--blue); }
.date-range-apply:disabled { cursor: not-allowed; background: #9ca9bd; border-color: #9ca9bd; }
.granularity-selector, .retention-rate-selector, .revenue-selector, .cancel-window-selector, .primary-cancel-selector { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.granularity-tabs, .retention-rate-tabs, .revenue-tabs { height: 38px; display: flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; }
.granularity-tabs button, .retention-rate-tabs button, .revenue-tabs button { min-width: 42px; padding: 0 10px; border: 0; border-radius: 3px; color: var(--muted); background: transparent; font-weight: 650; white-space: nowrap; }
.granularity-tabs button.active, .retention-rate-tabs button.active, .revenue-tabs button.active { color: #fff; background: var(--blue); }
.cancel-window-selector .multi-select { width: 170px; }
.primary-cancel-selector select {
  width: 126px; height: 38px; padding: 0 10px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 5px; outline: 0;
}
.primary-cancel-selector select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.14); }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.field { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; }
.field > input, .field > select {
  width: 100%; height: 39px; padding: 0 11px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 5px; outline: 0;
}
.field > input::placeholder { color: #8b9591; }
.field > input:focus, .field > select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.14); outline: 0; }
.multi-select { position: relative; min-width: 0; }
.multi-trigger {
  width: 100%; height: 39px; padding: 0 10px 0 11px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; overflow: hidden; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; text-align: left;
}
.multi-trigger:hover { border-color: #8b99af; }
.multi-trigger:disabled { cursor: not-allowed; color: #8792a6; background: #edf1f7; border-color: #d6deea; opacity: .78; }
.multi-trigger:focus-visible, .multi-select.open .multi-trigger { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.14); outline: 0; }
.multi-trigger-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-trigger.placeholder .multi-trigger-value { color: #8b9591; }
.multi-count { flex: 0 0 auto; padding: 2px 6px; color: var(--blue-dark); background: var(--blue-soft); border-radius: 3px; font-size: 11px; font-weight: 700; }
.multi-chevron { flex: 0 0 auto; color: var(--muted); font-size: 13px; transition: transform .16s ease; }
.multi-select.open .multi-chevron { transform: rotate(180deg); }
.multi-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: max(260px, 100%);
  overflow: hidden; color: var(--ink); background: #fff; border: 1px solid var(--line-strong);
  border-radius: 6px; box-shadow: 0 16px 34px rgba(31, 55, 94, .18);
}
.filter-grid .field:nth-child(n+5) .multi-popover { right: 0; left: auto; }
.multi-popover[hidden] { display: none; }
.multi-search { height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.multi-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.multi-actions { height: 34px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; background: #f7f9fc; border-bottom: 1px solid var(--line); }
.multi-actions button { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 650; }
.multi-options { max-height: 218px; padding: 5px; overflow-y: auto; }
.multi-option { min-height: 34px; padding: 7px 8px; display: flex; align-items: center; gap: 9px; border-radius: 4px; color: var(--ink); font-size: 12px; cursor: pointer; }
.multi-option:hover { background: #f3f7ff; }
.multi-option.selected { color: var(--blue-dark); background: #eaf1ff; font-weight: 600; }
.multi-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.multi-option span { min-width: 0; overflow-wrap: anywhere; }
.multi-empty { padding: 22px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.multi-footer { padding: 7px 8px; display: flex; justify-content: flex-end; border-top: 1px solid var(--line); background: #fafbfe; }
.multi-done { height: 28px; padding: 0 14px; border: 0; border-radius: 4px; color: #fff; background: var(--blue); font-size: 12px; font-weight: 650; }
.query-button {
  height: 39px; padding: 0 15px; color: #fff; background: var(--blue); border: 0;
  border-radius: 5px; font-weight: 650; white-space: nowrap;
}
.query-button:hover { background: var(--blue-dark); }
.query-button:disabled { cursor: wait; opacity: .62; }
.query-button span { margin-left: 9px; }
.active-filters { min-height: 25px; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { padding: 5px 8px; color: var(--muted); background: #fff; border: 1px solid #d5deec; border-radius: 3px; font-size: 12px; }
.filter-chip strong { color: var(--ink); font-weight: 600; }

.workspace { max-width: 1600px; margin: 0 auto; padding: 30px 32px 48px; }
.section-heading { justify-content: space-between; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 0; font-size: 22px; }
.as-of { color: var(--muted); font-size: 13px; }
.as-of strong { color: var(--ink); font-weight: 600; }
.workspace .eyebrow { color: var(--blue); }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi-card { min-width: 0; padding: 17px 18px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 3px 12px rgba(31,55,94,.04); }
.kpi-card[data-tooltip] { cursor: help; }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { margin: 7px 0 4px; font: 700 29px/1 "DIN Alternate", "Avenir Next", sans-serif; }
.kpi-meta { min-height: 17px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.delta { padding: 2px 5px; border-radius: 3px; color: var(--blue-dark); background: var(--blue-soft); font-weight: 650; }
.delta.down { color: #a94a38; background: #f6e1dc; }

.performance-selector {
  margin-bottom: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: var(--shadow);
}
.performance-selector-heading {
  min-height: 78px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; border-bottom: 1px solid var(--line);
}
.performance-selector-heading h3 { margin-bottom: 4px; font-size: 17px; }
.performance-selector-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.performance-selector-heading > strong {
  flex: 0 0 auto; padding: 6px 9px; color: #244d7b; background: #eef4fb;
  border: 1px solid #d7e2ef; border-radius: 4px; font-size: 12px;
}
.performance-selector-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.performance-selector-actions > strong {
  padding: 6px 9px; color: #244d7b; background: #eef4fb;
  border: 1px solid #d7e2ef; border-radius: 4px; font-size: 12px;
}
.performance-baseline-none {
  min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 7px;
  color: #40536c; background: #fff; border: 1px solid #c9d4e3; border-radius: 4px;
  font-size: 12px; font-weight: 650; cursor: pointer;
}
.performance-baseline-none:has(input:checked) { color: #173f72; background: #edf4ff; border-color: #8da9ce; }
.performance-baseline-none input { width: 15px; height: 15px; margin: 0; accent-color: #244d7b; }
.performance-selection-notice {
  min-height: 38px; padding: 9px 18px; display: flex; align-items: center; color: #6c7890;
  background: #f8fafc; border-top: 1px solid var(--line); font-size: 12px;
}
.performance-selection-notice.ready { color: #12675f; background: #f1f8f6; }
.performance-selection-notice.error { color: #a14936; background: #fff4f1; }
.performance-report-tabs {
  min-height: 48px; margin-bottom: 16px; padding: 4px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px; background: #e8edf5; border: 1px solid #d7dfeb; border-radius: 6px;
}
.performance-report-tabs button {
  min-width: 0; height: 38px; padding: 0 12px; overflow: hidden; color: #55657c; background: transparent;
  border: 0; border-radius: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650;
}
.performance-report-tabs button:hover { color: var(--ink); background: rgba(255,255,255,.68); }
.performance-report-tabs button.active { color: #fff; background: #244d7b; box-shadow: 0 2px 7px rgba(31,55,94,.18); }
.performance-scope-toolbar {
  min-height: 52px; margin: -8px 0 18px; padding: 9px 12px; display: flex; align-items: center;
  gap: 10px 18px; overflow-x: auto; background: #f8faff; border: 1px solid var(--line); border-radius: 5px;
}
.performance-scope-control, .performance-theme-controls { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.performance-scope-control > span, .performance-theme-control > span { color: var(--muted); font-size: 11px; }
.performance-theme-controls { min-width: 0; }
.performance-theme-control { display: flex; align-items: center; gap: 8px; }
.performance-theme-control + .performance-theme-control { padding-left: 14px; border-left: 1px solid var(--line); }
.performance-scope-toolbar .compact-segmented { height: 30px; }
.performance-scope-toolbar .compact-segmented button { min-width: 56px; }
.performance-theme-toggle { height: 30px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 11px; }
.performance-theme-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue-dark); }
.performance-builder {
  margin-bottom: 18px; overflow: visible; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: var(--shadow);
}
.performance-builder-heading {
  min-height: 67px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; border-bottom: 1px solid var(--line);
}
details.performance-builder .performance-builder-heading { cursor: pointer; list-style: none; }
details.performance-builder .performance-builder-heading::-webkit-details-marker { display: none; }
details.performance-builder .performance-builder-heading::after { content: "+"; color: #50627a; font-size: 21px; line-height: 1; }
details.performance-builder[open] .performance-builder-heading::after { content: "−"; }
.performance-builder-heading .eyebrow { margin-bottom: 4px; font-size: 10px; }
.performance-builder-heading > span:first-child { min-width: 0; display: grid; }
.performance-builder-heading > span:first-child strong { font-size: 15px; }
.performance-builder-count {
  margin-left: auto; flex: 0 0 auto; padding: 5px 7px; color: #35506f; background: #f3f6fa;
  border: 1px solid #d7e0eb; border-radius: 3px; font-size: 11px; font-weight: 650;
}
.performance-compose-grid {
  padding: 16px 18px 12px; display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(210px, 1.2fr) minmax(260px, 1.55fr) 142px;
  align-items: end; gap: 10px;
}
.performance-compose-grid .field > select {
  width: 100%; height: 39px; padding: 0 31px 0 10px; overflow: hidden; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; outline: 0; text-overflow: ellipsis;
}
.performance-compose-grid .field > select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.14); }
.performance-add-button, .performance-save-button, .performance-cancel-button, .performance-clear-button {
  height: 39px; padding: 0 14px; border-radius: 5px; font-size: 12px; font-weight: 650; white-space: nowrap;
}
.performance-add-button { color: #fff; background: #244d7b; border: 1px solid #244d7b; }
.performance-add-button span { margin-right: 7px; font-size: 17px; line-height: 0; }
.performance-add-button:disabled, .performance-save-button:disabled, .performance-clear-button:disabled { cursor: not-allowed; opacity: .48; }
.performance-save-button { color: #fff; background: var(--blue); border: 1px solid var(--blue); }
.performance-cancel-button { color: #40536c; background: #fff; border: 1px solid var(--line-strong); }
.performance-clear-button { color: #9f4939; background: #fff; border: 1px solid #e4bdb5; }
.performance-clear-button:not(:disabled):hover { background: #fbece8; }
.performance-clear-button span { margin-right: 6px; font-size: 15px; line-height: 0; }
.performance-draft {
  min-height: 51px; margin: 0 18px; padding: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: #f7f9fc; border: 1px dashed #c5d0df; border-radius: 5px;
}
.performance-inline-empty { width: 100%; color: #8290a2; text-align: center; font-size: 12px; }
.performance-member-chip {
  max-width: 100%; min-height: 31px; padding: 4px 5px 4px 8px; display: inline-flex; align-items: center; gap: 7px;
  color: #30445f; background: #fff; border: 1px solid #d5deea; border-radius: 4px; font-size: 11px;
}
.performance-member-account {
  max-width: 150px; overflow: hidden; color: #12675f; text-overflow: ellipsis; white-space: nowrap; font-weight: 500;
}
.performance-member-campaign { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-member-remove, .performance-group-action {
  width: 25px; height: 25px; flex: 0 0 25px; padding: 0; color: #627189; background: transparent;
  border: 0; border-radius: 3px; font-size: 16px; line-height: 1;
}
.performance-member-remove:hover, .performance-group-action:hover { color: #9f4939; background: #fbece8; }
.performance-compose-actions {
  min-height: 54px; padding: 8px 18px; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  color: var(--muted); font-size: 11px;
}
.performance-compose-actions > span { margin-right: auto; }
.performance-group-list { min-height: 58px; }
.performance-group-row {
  min-height: 62px; padding: 10px 18px; display: grid;
  grid-template-columns: 28px 62px minmax(160px, .65fr) minmax(0, 2.4fr) 128px;
  align-items: center; gap: 10px; border-bottom: 1px solid #edf1f6;
}
.performance-group-row:last-child { border-bottom: 0; }
.performance-group-row.selected {
  background: #f6f9ff; background: color-mix(in srgb, var(--group-color, var(--blue)) 8%, #fff);
  box-shadow: inset 6px 0 0 var(--group-color, var(--blue));
}
.performance-group-row.editing { background: #f5f8ff; box-shadow: inset 3px 0 0 var(--blue); }
.performance-group-row.manager { min-height: 58px; grid-template-columns: minmax(150px, .65fr) minmax(0, 2.4fr) 66px; gap: 12px; }
.performance-group-select { width: 28px; height: 32px; position: relative; display: grid; place-items: center; cursor: pointer; }
.performance-group-select input { position: absolute; opacity: 0; pointer-events: none; }
.performance-group-select i {
  width: 18px; height: 18px; display: block; background: #fff; border: 3px solid var(--group-color); border-radius: 4px;
}
.performance-group-select input:checked + i { background: var(--group-color); box-shadow: inset 0 0 0 2px #fff; }
.performance-group-select input:focus-visible + i { outline: 2px solid rgba(37,99,235,.38); outline-offset: 2px; }
.performance-group-select:has(input:disabled) { cursor: not-allowed; opacity: .45; }
.performance-group-baseline { display: inline-flex; align-items: center; gap: 5px; color: #64738a; font-size: 11px; cursor: pointer; }
.performance-group-baseline input { width: 14px; height: 14px; margin: 0; accent-color: #244d7b; }
.performance-group-baseline:has(input:disabled) { cursor: not-allowed; opacity: .44; }
.performance-group-name { min-width: 0; }
.performance-group-name strong {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif; font-size: 13px; font-weight: 400;
}
.performance-group-name small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.performance-group-members { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.performance-group-member {
  max-width: 260px; padding: 4px 6px; overflow: hidden; color: #40536c; background: #f5f7fa;
  border: 1px solid #dfe5ed; border-radius: 3px; text-overflow: ellipsis; white-space: nowrap; font-size: 10px;
}
.performance-group-member.more { color: #315b8a; background: #eaf1f8; border-color: #ccdae8; font-weight: 700; }
.performance-group-actions { display: flex; justify-content: flex-end; gap: 4px; }
.performance-group-action { width: 29px; height: 29px; flex-basis: 29px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.performance-group-action:disabled { cursor: not-allowed; opacity: .35; }
.performance-group-order { color: #315b8a; font-size: 16px; }
.performance-group-order:not(:disabled):hover { color: #174f91; background: #eaf1f8; }
.performance-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.efficiency-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.performance-kpis .kpi-value { font-size: 25px; }
.performance-kpis .kpi-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-comparison-workspace .performance-analysis-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.performance-chart-heading { align-items: flex-start; }
.performance-metric-tabs { max-width: 58%; }
.performance-chart-wrap { height: 330px; }
.performance-matrix-panel { padding-bottom: 0; }
.performance-matrix-wrap {
  margin: 16px -20px 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
}
.performance-matrix-table {
  width: 100%; min-width: max(100%, calc(190px + var(--performance-metric-count, 1) * 118px)); table-layout: fixed;
}
.performance-matrix-table th, .performance-matrix-table td { height: 62px; padding: 9px 16px; }
.performance-matrix-table thead th { height: 46px; background: #f7f9fc; font-size: 12px; }
.performance-matrix-table thead th:not(:first-child) { min-width: 118px; text-align: right; }
.performance-matrix-table thead th:first-child,
.performance-matrix-table tbody th { width: 190px; }
.performance-matrix-table thead th:first-child { position: sticky; left: 0; z-index: 3; }
.performance-matrix-table tbody th {
  position: sticky; left: 0; z-index: 2; color: var(--ink); background: #fbfcfe;
  border-right: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--group-color);
}
.performance-matrix-table td { text-align: right; }
.performance-matrix-table tbody th strong, .performance-matrix-table tbody th small { display: block; }
.performance-matrix-table tbody th strong { font-size: 13px; font-weight: 500; }
.performance-matrix-table tbody th small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.performance-matrix-group { max-width: 100%; display: flex; align-items: center; gap: 7px; }
.performance-matrix-group > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-matrix-group i { width: 12px; height: 12px; flex: 0 0 12px; background: var(--group-color); border-radius: 3px; }
.performance-group-cell > i { width: 6px; height: 26px; flex: 0 0 6px; background: var(--group-color); border-radius: 2px; }
.performance-matrix-group b { padding: 2px 4px; color: #244d7b; background: #eaf1fb; border-radius: 3px; font-size: 9px; }
.performance-value { min-width: 78px; display: inline-grid; justify-items: end; gap: 2px; }
.performance-value strong { color: var(--ink); font: 700 14px/1.1 "DIN Alternate", "Avenir Next", sans-serif; }
.performance-value small { color: var(--muted); font-size: 10px; }
.performance-matrix-table .performance-value { width: 100%; min-width: 0; gap: 3px; }
.performance-matrix-table .performance-value strong { font-size: 16px; }
.performance-matrix-table .performance-value strong,
.performance-matrix-table .performance-value small {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.performance-matrix-table .performance-value small { font-size: 11px; }
.performance-value.missing { color: #9aa5b4; }
.performance-data-status {
  display: inline-block; padding: 1px 4px; color: #925d11; background: #fff0cf;
  border: 1px solid #e8c984; border-radius: 3px; font-size: 9px; font-style: normal; font-weight: 600;
  line-height: 1.3; white-space: nowrap;
}
.performance-delta { padding: 1px 4px; border-radius: 3px; }
.performance-delta.better { color: #12675f; background: #e7f4f1; }
.performance-delta.worse { color: #a14936; background: #fbece8; }
.performance-delta.neutral { color: #665c45; background: #f4f0e7; }
.performance-delta.baseline { color: #46617e; background: #edf2f8; }
.performance-result-section { margin-top: 0; }
.efficiency-daily-section { margin-top: 18px; }
.efficiency-daily-table-wrap table { min-width: 1040px; }
.efficiency-period-tabs { flex: 0 0 auto; }
.efficiency-period-tabs button { min-width: 42px; }
.section-heading-actions { display: flex; align-items: center; gap: 14px; }
.efficiency-maturity-tabs button { min-width: 58px; }
.efficiency-date-cell { display: grid; gap: 3px; }
.efficiency-date-cell strong { color: var(--ink); font-size: 12px; font-weight: 500; }
.efficiency-date-cell > span { display: flex; align-items: center; gap: 6px; }
.efficiency-date-cell small { color: var(--muted); font-size: 10px; }
.efficiency-date-cell em {
  padding: 1px 5px; color: #9b432e; background: #fcece7; border: 1px solid #f3c9bd;
  border-radius: 3px; font-size: 9px; font-style: normal; font-weight: 600; line-height: 1.4;
}
.performance-group-cell small .performance-data-status,
.performance-matrix-table tbody th > small .performance-data-status { margin-left: 5px; vertical-align: 1px; }
.performance-group-cell { display: inline-flex; align-items: center; gap: 9px; }
.performance-group-cell > span { min-width: 0; }
.performance-table-wrap .baseline-row { background: #f6f9ff; }
.campaign-comparison-workspace .performance-table-wrap tbody tr { box-shadow: inset 5px 0 0 var(--group-color); }
.campaign-comparison-workspace .performance-chart-panel .chart-legend i {
  width: 26px; border-top-width: 4px; border-radius: 3px;
}
.performance-metric-cell { min-width: 118px; }
.performance-detail-trigger {
  width: 100%; padding: 2px 3px; border: 0; border-radius: 3px; color: inherit; background: transparent;
  text-align: inherit; cursor: pointer;
}
.performance-detail-trigger:hover { background: #edf3fb; }
.performance-detail-trigger:focus-visible { outline: 2px solid rgba(37,99,235,.38); outline-offset: 2px; }
.performance-matrix-table .performance-detail-trigger { display: flex; justify-content: center; }
.performance-detail-formula {
  margin-top: 20px; padding: 12px 14px; color: #40536c; background: #f6f8fb;
  border-left: 3px solid #7594bc; font-size: 12px; line-height: 1.55;
}
.performance-detail-section { margin-top: 24px; border-top: 1px solid var(--line-strong); }
.performance-detail-section[hidden] { display: none; }
.performance-detail-section h4 { margin: 18px 0 5px; font-size: 13px; }
.performance-detail-section > p { margin: 0 0 8px; color: var(--muted); font-size: 10px; }
.performance-detail-list { display: grid; }
.performance-detail-row {
  min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
  gap: 10px; border-bottom: 1px solid #edf1f6; font-size: 12px;
}
.performance-detail-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-detail-row > strong { font: 700 13px "DIN Alternate", sans-serif; }
.performance-detail-row > small { width: 58px; color: var(--muted); font-size: 11px; text-align: right; }
.performance-detail-bar { grid-column: 1 / -1; height: 5px; margin: -7px 0 9px; overflow: hidden; background: #edf1f6; border-radius: 2px; }
.performance-detail-bar i { display: block; height: 100%; background: var(--group-color, var(--blue)); }
.performance-detail-footer {
  margin-top: auto; padding-top: 22px; display: flex; align-items: flex-end; justify-content: space-between;
  gap: 15px; color: var(--muted); font-size: 11px; line-height: 1.5;
}
.performance-detail-link { flex: 0 0 auto; color: #24579a; font-weight: 650; text-decoration: none; }
.performance-detail-link:hover { text-decoration: underline; }

.campaign-comparison-workspace .section-heading h2 { font-size: 22px; }
.campaign-comparison-workspace .as-of { font-size: 13px; }
.campaign-comparison-workspace .performance-selector-heading { min-height: 78px; padding: 16px 18px; }
.campaign-comparison-workspace .performance-selector-heading h3 { font-size: 17px; }
.campaign-comparison-workspace .performance-selector-heading p:not(.eyebrow),
.campaign-comparison-workspace .performance-selection-notice { font-size: 12px; }
.campaign-comparison-workspace .performance-report-tabs button { height: 38px; font-size: 13px; }
.campaign-comparison-workspace .performance-group-row { min-height: 62px; padding-top: 10px; padding-bottom: 10px; }
.campaign-comparison-workspace .performance-group-name strong {
  font-family: "Helvetica Neue", "PingFang SC", sans-serif; font-size: 13px; font-weight: 400;
}
.campaign-comparison-workspace .performance-group-name strong:focus-visible {
  outline: 2px solid rgba(37,99,235,.38); outline-offset: 2px; border-radius: 2px;
}
.campaign-comparison-workspace .performance-group-name small { font-size: 10px; }
.campaign-comparison-workspace .performance-group-baseline { font-size: 11px; }
.campaign-comparison-workspace .performance-group-member { font-size: 10px; }
.campaign-comparison-workspace .performance-kpis .kpi-card { padding: 17px 18px 15px; }
.campaign-comparison-workspace .performance-kpis .kpi-label,
.campaign-comparison-workspace .performance-kpis .kpi-meta { font-size: 12px; }
.campaign-comparison-workspace .performance-kpis .kpi-value {
  min-width: 0; overflow: hidden; font-size: 25px; text-overflow: ellipsis; white-space: nowrap;
}
.campaign-comparison-workspace .performance-kpis .performance-kpi-group-name {
  font-family: "Helvetica Neue", "PingFang SC", sans-serif; font-weight: 400;
}
.campaign-comparison-workspace .panel-heading h3 { font-size: 15px; }
.campaign-comparison-workspace .panel-heading p { font-size: 12px; }
.matrix-copy-button {
  flex: 0 0 auto; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: #fff;
  font-size: 11px; cursor: pointer;
}
.matrix-copy-button span { font-size: 16px; line-height: 1; }
.matrix-copy-button:hover { border-color: #8b99af; background: #f7f9fc; }
.matrix-copy-button:disabled { color: #a3adbb; background: #f6f8fb; cursor: not-allowed; }
.campaign-comparison-workspace .performance-result-section .table-heading { padding-top: 18px; padding-bottom: 18px; }
.campaign-comparison-workspace .performance-table-wrap th { font-size: 11px; }
.campaign-comparison-workspace .performance-table-wrap td { height: 46px; font-size: 13px; }
.campaign-comparison-workspace .performance-table-wrap .dense td { height: 36px; }
.campaign-comparison-workspace .performance-matrix-group > span,
.campaign-comparison-workspace .performance-group-cell strong,
.campaign-comparison-workspace .performance-chart-panel .chart-legend {
  font-family: "Helvetica Neue", "PingFang SC", sans-serif; font-weight: 400;
}
.campaign-comparison-workspace .performance-group-cell strong { font-size: 13px; }
.campaign-comparison-workspace .performance-group-cell small,
.campaign-comparison-workspace .performance-table-wrap .performance-value small { font-size: 10px; }
.campaign-comparison-workspace .performance-table-wrap .performance-value strong { font-size: 14px; }
.campaign-comparison-workspace .performance-metric-cell { min-width: 118px; }
.campaign-comparison-workspace .table-footer { min-height: 43px; font-size: 11px; }
.campaign-comparison-workspace .performance-matrix-table th,
.campaign-comparison-workspace .performance-matrix-table td { height: 54px; padding: 8px 12px; }
.campaign-comparison-workspace .performance-matrix-table thead th { height: 42px; font-size: 11px; }
.campaign-comparison-workspace .performance-matrix-table thead th:first-child,
.campaign-comparison-workspace .performance-matrix-table tbody th { width: 170px; }
.campaign-comparison-workspace .performance-matrix-table tbody th strong { font-size: 12px; }
.campaign-comparison-workspace .performance-matrix-table tbody th small { margin-top: 3px; font-size: 10px; }
.campaign-comparison-workspace .performance-matrix-group { gap: 6px; }
.campaign-comparison-workspace .performance-matrix-group i { width: 10px; height: 10px; flex-basis: 10px; }
.campaign-comparison-workspace .performance-matrix-table .performance-value { gap: 2px; }
.campaign-comparison-workspace .performance-matrix-table .performance-value strong { font-size: 14px; }
.campaign-comparison-workspace .performance-matrix-table .performance-value small { font-size: 10px; }

.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(310px, .8fr); gap: 14px; margin-bottom: 20px; }
.chart-panel, .breakdown-panel, .cohort-section { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.chart-panel, .breakdown-panel { padding: 19px 20px 16px; min-width: 0; }
.panel-heading { justify-content: space-between; gap: 12px; }
.panel-heading h3 { margin-bottom: 4px; font-size: 15px; }
.panel-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.metric-tabs { max-width: 60%; display: flex; overflow-x: auto; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9fc; }
.metric-tabs button { min-width: 43px; height: 29px; padding: 0 10px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font: 650 12px "DIN Alternate", sans-serif; }
.metric-tabs button.active { background: var(--blue-dark); color: #fff; }
.metric-tabs button { flex: 0 0 auto; }
.cohort-mode-tabs { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9fc; }
.cohort-mode-tabs button { height: 29px; padding: 0 11px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font: 650 12px "Avenir Next", sans-serif; white-space: nowrap; }
.cohort-mode-tabs button.active { color: #fff; background: var(--blue-dark); }
.cohort-mode-tabs button span { margin-left: 4px; opacity: .72; font-family: "DIN Alternate", sans-serif; }
.chart-wrap { position: relative; height: 270px; margin-top: 15px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-legend { min-height: 18px; gap: 8px 18px; margin-top: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.chart-legend > span, .chart-legend-toggle { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend i { width: 18px; margin-right: 6px; display: inline-block; vertical-align: middle; border-top: 2px solid var(--legend-color, var(--blue)); }
.chart-legend-toggle { min-width: 0; padding: 3px 2px; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: color .16s ease, opacity .16s ease, background .16s ease; }
.chart-legend-toggle span { overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.chart-legend-toggle:hover { color: var(--ink); background: var(--blue-soft); }
.chart-legend-toggle:focus-visible { outline: 2px solid rgba(37, 99, 235, .34); outline-offset: 2px; }
.chart-legend-toggle[aria-pressed="false"] { color: #8f99aa; opacity: .58; }
.chart-legend-toggle[aria-pressed="false"] i { border-top-color: #aeb7c6; }
.chart-legend .legend-baseline { border-color: #aab5c7; border-top-style: dashed; }
.chart-legend .legend-actual { border-color: #5d6b82; }
.chart-legend .legend-forecast { border-color: #5d6b82; border-top-style: dashed; }
.chart-legend .legend-cost { border-color: #aab5c7; border-top-style: dotted; }
.cohort-ltv-panel .chart-legend > span { display: inline-flex; align-items: center; max-width: none; }
.cohort-ltv-panel .chart-legend .legend-actual,
.cohort-ltv-panel .chart-legend .legend-forecast,
.cohort-ltv-panel .chart-legend .legend-underforecast {
  width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; border-top: 0;
}
.cohort-ltv-panel .chart-legend .legend-actual { background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.cohort-ltv-panel .chart-legend .legend-forecast { background: #fff; border: 1.5px solid var(--blue); }
.cohort-ltv-panel .chart-legend .legend-underforecast { background: var(--coral); box-shadow: 0 0 0 1px var(--coral); }
.cohort-model-status {
  flex: 0 0 auto; padding: 5px 7px; color: var(--muted); background: #f6f8fb;
  border: 1px solid var(--line); border-radius: 3px; font-size: 11px; white-space: nowrap;
}
.cohort-model-status.has-underforecast { color: #a44935; background: #fff1ed; border-color: #efc8bf; }
.breakdown-panel select { height: 34px; max-width: 105px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); }
.breakdown-list { margin-top: 22px; display: grid; gap: 17px; }
.breakdown-row { display: grid; grid-template-columns: minmax(74px, 1fr) 2.2fr 44px; align-items: center; gap: 10px; }
.breakdown-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.bar-track { height: 7px; overflow: hidden; background: #edf1f7; border-radius: 2px; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width .4s ease; }
.breakdown-row:nth-child(n+4) .bar-fill { background: #7e9bc7; }
.breakdown-value { text-align: right; font: 650 13px "DIN Alternate", sans-serif; }

.cohort-section { overflow: hidden; }
.table-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table-tools { gap: 8px; }
.search-box { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); }
.search-box input { width: 140px; border: 0; outline: 0; color: var(--ink); }
.density-button { width: 34px; height: 34px; border-color: var(--line-strong); color: var(--ink); }
.density-button.active { color: #fff; background: #274f7f; border-color: #274f7f; }
.table-wrap { overflow-x: auto; }
.performance-table-wrap { max-height: min(68vh, 680px); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.performance-table-wrap table { min-width: 1160px; }
.performance-table-wrap .comparison-period-table { min-width: 1040px; }
.comparison-period-table .comparison-period-cell { min-width: 112px; }
.comparison-cohort-group {
  min-width: 150px; max-width: 220px; display: flex; align-items: center; gap: 8px;
}
.comparison-cohort-group > i {
  width: 10px; height: 28px; flex: 0 0 10px; background: var(--group-color); border-radius: 2px;
}
.comparison-cohort-group > span { min-width: 0; }
.comparison-cohort-group strong {
  display: block; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif; font-size: 13px; font-weight: 400;
}
.comparison-cohort-status {
  display: inline-block; margin-top: 3px; color: #64748b; font-size: 9px; font-style: normal; font-weight: 600;
}
.comparison-cohort-status.running { color: #9a620d; }
.comparison-cohort-metric { min-width: 76px; display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.comparison-cohort-metric strong { color: var(--ink); font: 600 13px "DIN Alternate", "Avenir Next", sans-serif; }
.comparison-cohort-metric small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.comparison-cohort-metric.running strong { color: #9a620d; }
.comparison-monetization-table .comparison-monetization-progress { min-width: 148px; }
.comparison-monetization-table .comparison-signal { min-width: 170px; }
.comparison-cancellation-table .comparison-cancellation-result { min-width: 126px; }
.comparison-cancellation-table .comparison-signal { min-width: 170px; }
.comparison-cohort-path { min-width: 160px; max-width: 240px; display: block; }
.comparison-cohort-path strong,
.comparison-cohort-path small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comparison-cohort-path strong { color: var(--ink); font-size: 11px; font-weight: 500; }
.comparison-cohort-path small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.comparison-signal { min-width: 150px; max-width: 210px; display: block; white-space: normal; line-height: 1.25; }
.comparison-signal strong, .comparison-signal small { display: block; }
.comparison-signal strong { color: #53647a; font-size: 11px; font-weight: 600; }
.comparison-signal small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.comparison-signal.good strong { color: #08796f; }
.comparison-signal.warning strong, .comparison-signal.running strong { color: #9a620d; }
.comparison-cohort-running { background: #fffdf8; }
.comparison-cohort-running:hover { background: #fff9ed; }
.performance-table-wrap thead th { position: sticky; top: 0; z-index: 4; box-shadow: inset 0 -1px 0 var(--line); }
.performance-table-wrap .performance-members-column,
.performance-table-wrap .performance-members-cell { width: 210px; min-width: 210px; max-width: 210px; overflow: hidden; }
.performance-table-members { width: 100%; display: flex; align-items: center; gap: 7px; overflow: hidden; }
.performance-table-member { min-width: 0; display: flex; flex: 1 1 auto; align-items: baseline; gap: 6px; color: #4b5d74; line-height: 1.3; }
.performance-table-member strong {
  width: 78px; flex: 0 0 78px; overflow: hidden; color: #12675f;
  text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 500;
}
.performance-table-member span { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-table-more { flex: 0 0 auto; padding: 2px 5px; color: #315f91; background: #eaf1fb; border-radius: 3px; font-size: 10px; font-weight: 700; }
.performance-group-cell strong {
  display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif; font-weight: 400;
}
.performance-group-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.retention-table-wrap {
  max-height: min(70vh, 720px); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
}
.retention-table-wrap thead th {
  position: sticky; top: 0; z-index: 4; box-shadow: inset 0 -1px 0 var(--line), 0 3px 8px rgba(31,55,94,.08);
}
table { width: 100%; min-width: 850px; border-collapse: collapse; }
th { height: 38px; padding: 0 14px; color: var(--muted); background: #f7f9fc; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 650; white-space: nowrap; }
.table-sort-button {
  width: 100%; min-height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: space-between;
  gap: 7px; border: 0; color: inherit; background: transparent; font: inherit; text-align: inherit; white-space: nowrap;
  cursor: pointer;
}
.table-sort-button > span { min-width: 0; }
.table-sort-button i {
  width: 12px; flex: 0 0 12px; color: #98a5b6; font: 700 12px/1 "DIN Alternate", "Avenir Next", sans-serif;
  text-align: center;
}
th.numeric .table-sort-button { justify-content: flex-end; }
.table-sort-button:hover, .table-sort-button.active { color: #244d7b; }
.table-sort-button:hover i, .table-sort-button.active i { color: var(--blue); }
.table-sort-button:focus-visible { outline: 2px solid rgba(37,99,235,.38); outline-offset: 2px; border-radius: 2px; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: #244d7b; background: #edf3fb; }
td { height: 46px; padding: 0 14px; border-bottom: 1px solid #edf1f6; font-size: 13px; white-space: nowrap; }
tbody tr:hover { background: #f6f9ff; }
tbody tr:last-child td { border-bottom: 0; }
.cohort-group-start:not(:first-child) td { border-top: 1px solid var(--line-strong); }
.period-group-cell { min-width: 105px; padding-top: 15px; vertical-align: top; color: var(--ink); background: #f8faff; border-right: 1px solid #e8edf5; }
.period-group-cell strong { display: block; font-size: 12px; font-weight: 500; }
.period-range-line { min-height: 18px; margin-top: 4px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.period-group-cell small { color: var(--muted); font: 500 10px/1.3 "Avenir Next", "PingFang SC", sans-serif; }
.period-group-cell em { flex: 0 0 auto; width: fit-content; padding: 2px 5px; color: #965d13; background: #fff0cf; border-radius: 3px; font-size: 10px; line-height: 1.2; font-style: normal; }
tfoot td { height: 46px; background: #f5f8fd; border-top: 0; border-bottom: 1px solid #e2e8f2; font-size: 12px; }
tfoot tr:first-child td { border-top: 1px solid #c7d4e8; }
tfoot tr + tr td { border-top: 1px solid #e2e8f2; }
tfoot tr:last-child td { border-bottom: 0; }
tfoot strong { font-weight: 700; }
.summary-label-cell { padding-top: 15px; vertical-align: top; color: var(--blue-dark); background: #eaf1ff; border-right: 1px solid #c7d4e8; }
.summary-label-cell small, .summary-context { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.summary-app-name { color: var(--ink); font-weight: 500; }
.summary-heat { color: var(--blue-dark); background: rgba(37, 99, 235, .09); font-weight: 700; }
.summary-total td { background: #e4edff; border-top-color: #b9cbea; }
.summary-total .summary-app-name { color: var(--blue-dark); font-weight: 600; }
.numeric { text-align: right; font-family: "DIN Alternate", "Avenir Next", sans-serif; }
.heat { display: inline-block; min-width: 53px; padding: 5px 7px; border-radius: 3px; text-align: right; }
td.empty-value { vertical-align: middle; }
.empty-value, .heat.empty { text-align: center !important; }
td.numeric.empty-value { text-align: right !important; }
.heat small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 600; }
.heat.incomplete { color: #805719; background: #fff1cf; box-shadow: inset 0 0 0 1px #ead49f; }
.heat.incomplete small { color: #936b2d; }
.retention-outcome-trigger {
  min-width: 53px; padding: 0; border: 0; border-radius: 3px; color: inherit;
  background: transparent; text-align: inherit; cursor: pointer;
}
.retention-outcome-trigger:hover .heat { box-shadow: inset 0 0 0 1px #8da7d0; }
.retention-outcome-trigger:focus-visible { outline: 2px solid rgba(37,99,235,.38); outline-offset: 2px; }
.incomplete-mark { color: #9a681d; }
.retention-attention-cell { min-width: 118px; }
.retention-attention { display: inline-grid; grid-template-columns: auto auto; align-items: baseline; justify-content: end; gap: 2px 7px; min-width: 105px; font-family: "Avenir Next", "PingFang SC", sans-serif; }
.retention-attention strong { color: var(--ink); font-size: 11px; font-weight: 500; white-space: nowrap; }
.retention-attention em { font-family: "DIN Alternate", "Avenir Next", sans-serif; font-size: 13px; font-style: normal; font-weight: 600; white-space: nowrap; }
.retention-attention small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; font-weight: 500; white-space: nowrap; }
.retention-attention.loss em { color: #c94f3d; }
.retention-attention.running em { color: #9a681d; }
.retention-attention.stable em { color: #168274; }
.retention-attention.empty { display: inline-block; min-width: 105px; color: var(--muted); text-align: center; }
.dense td { height: 36px; }
.dense .period-group-cell, .dense .summary-label-cell { padding-top: 10px; }
.table-footer { min-height: 43px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); background: #fafbfe; border-top: 1px solid var(--line); font-size: 11px; }

.empty-state { grid-column: 1 / -1; padding: 54px 20px; color: var(--muted); text-align: center; }
.skeleton { animation: pulse 1.2s ease-in-out infinite; color: transparent; background: #e8edf5; border-radius: 3px; }
.retention-outcome-dialog {
  position: fixed; inset: 0 0 0 auto; width: min(460px, 100vw); max-width: none; height: 100dvh;
  max-height: none; margin: 0; padding: 0; overflow: hidden; color: var(--ink); background: #fff;
  border: 0; border-left: 1px solid var(--line-strong); box-shadow: -18px 0 46px rgba(31,55,94,.18);
}
.retention-outcome-dialog::backdrop { background: rgba(23,35,59,.3); }
.retention-outcome-shell { height: 100%; padding: 23px 24px; display: flex; flex-direction: column; overflow-y: auto; }
.retention-outcome-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.retention-outcome-header .table-kicker { color: var(--blue); }
.retention-outcome-header h3 { margin: 6px 0 5px; font-size: 20px; }
.retention-outcome-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.retention-outcome-close {
  width: 34px; height: 34px; flex: 0 0 34px; padding: 0; color: #506078; background: #fff;
  border: 1px solid var(--line-strong); border-radius: 5px; font-size: 22px; line-height: 1;
}
.retention-outcome-close:hover { color: var(--ink); background: #f5f7fb; }
.retention-outcome-kpis {
  margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.retention-outcome-kpi { min-width: 0; padding: 14px 12px; border-left: 1px solid var(--line); }
.retention-outcome-kpi:first-child { padding-left: 0; border-left: 0; }
.retention-outcome-kpi:last-child { padding-right: 0; }
.retention-outcome-kpi span { display: block; color: var(--muted); font-size: 10px; }
.retention-outcome-kpi strong { display: block; margin-top: 5px; font: 700 22px/1.1 "DIN Alternate", sans-serif; }
.retention-outcome-stack { min-height: 12px; margin-top: 24px; display: flex; overflow: hidden; background: #edf1f6; border-radius: 3px; }
.retention-outcome-stack span { min-width: 2px; height: 12px; background: var(--outcome-color); }
.retention-outcome-list { margin-top: 15px; display: grid; }
.retention-outcome-row {
  min-height: 47px; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center; gap: 10px; border-bottom: 1px solid #edf1f6;
}
.retention-outcome-row i { width: 9px; height: 9px; background: var(--outcome-color); border-radius: 2px; }
.retention-outcome-row span { min-width: 0; font-size: 12px; }
.retention-outcome-row strong { font: 700 14px "DIN Alternate", sans-serif; }
.retention-outcome-row small { width: 48px; color: var(--muted); font-size: 11px; text-align: right; }
.retention-outcome-breakdown { margin-top: 25px; border-top: 1px solid var(--line-strong); }
.retention-outcome-breakdown[hidden] { display: none; }
.retention-outcome-breakdown h4 { margin: 18px 0 5px; font-size: 13px; }
.retention-outcome-breakdown > p { margin: 0 0 8px; color: var(--muted); font-size: 10px; }
.retention-outcome-app { padding: 13px 0; border-bottom: 1px solid #edf1f6; }
.retention-outcome-app header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.retention-outcome-app header strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }
.retention-outcome-app header span { flex: 0 0 auto; color: var(--muted); font: 700 12px "DIN Alternate", sans-serif; }
.retention-outcome-app-stack { height: 7px; margin-top: 9px; display: flex; overflow: hidden; background: #edf1f6; border-radius: 2px; }
.retention-outcome-app-stack i { min-width: 2px; height: 7px; background: var(--outcome-color); }
.retention-outcome-app p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.retention-outcome-note { margin-top: auto; padding-top: 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.data-tooltip {
  position: fixed; z-index: 100; max-width: min(320px, calc(100vw - 16px)); padding: 8px 10px;
  color: #fff; background: #17233b; border-radius: 4px; box-shadow: 0 10px 26px rgba(23,35,59,.22);
  font-size: 12px; line-height: 1.45; white-space: pre-line; pointer-events: none;
}
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(380px, calc(100vw - 44px)); padding: 12px 15px; color: #fff; background: #17233b; border-left: 4px solid var(--blue); border-radius: 5px; box-shadow: 0 12px 30px rgba(0,0,0,.18); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-left-color: var(--coral); }

.forecast-badge { padding: 5px 7px; color: #85611d; background: #fff0cf; border: 1px solid #eed9a8; border-radius: 3px; font-size: 11px; white-space: nowrap; }
.forecast-badge.ready { color: var(--blue-dark); background: var(--blue-soft); border-color: #c8d8f5; }
.subscription-table-wrap table { min-width: 1420px; }
.subscription-table-wrap th, .subscription-table-wrap td { padding-right: 12px; padding-left: 12px; }
.subscription-mode-badge { display: inline-block; padding: 3px 6px; border-radius: 3px; color: #0f6f66; background: #e2f4f1; font-size: 11px; font-weight: 650; }
.subscription-mode-badge.direct { color: #28527f; background: #eaf1f8; }
.subscription-mode-badge.intro { color: #8a5717; background: #fff0d8; }
.subscription-mode-badge.trial { color: #0f6f66; background: #e2f4f1; }
.subscription-mode-badge.no-trial { color: #9a5714; background: #fff0d8; }
.subscription-mode-badge.unknown { color: var(--muted); background: #edf1f7; }
.sku-value { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.forecast-value { color: var(--blue-dark); font-weight: 650; }
.monetization-kpis .kpi-card { border-top: 2px solid #b9cbea; }
.monetization-kpis .kpi-card:last-child .kpi-value { font-size: 22px; line-height: 1.15; }
.model-summary-strip {
  min-height: 48px; margin: -7px 0 18px; padding: 0 18px; display: flex; align-items: center;
  gap: 0; overflow-x: auto; color: var(--muted); background: #f8faff;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.model-summary-strip > span { min-width: 116px; padding: 0 18px; display: flex; align-items: baseline; gap: 8px; border-right: 1px solid var(--line); white-space: nowrap; }
.model-summary-strip > span:first-child { padding-left: 0; }
.model-summary-strip > span:last-child { border-right: 0; }
.model-summary-strip small { font-size: 11px; }
.model-summary-strip strong { color: var(--ink); font: 700 15px "DIN Alternate", "Avenir Next", sans-serif; }
.monetization-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.decay-panel-actions { display: flex; align-items: center; gap: 12px; }
.decay-control-group { display: flex; align-items: center; gap: 7px; }
.compact-segmented {
  height: 32px; padding: 3px; display: flex; border: 1px solid #d6deea;
  border-radius: 5px; background: #eef2f7;
}
.compact-segmented button {
  min-width: 58px; padding: 0 9px; border: 0; border-radius: 3px;
  color: #68768b; background: transparent; font-size: 11px; font-weight: 650; white-space: nowrap;
}
.compact-segmented button:hover { color: #244d7b; }
.compact-segmented button.active { color: #fff; background: #274f7f; box-shadow: 0 2px 5px rgba(39,79,127,.17); }
.compact-segmented button:focus-visible { outline: 2px solid rgba(37,99,235,.34); outline-offset: 1px; }
.monetization-chart-wrap { height: 300px; }
.chart-legend.decay-sku-selector {
  min-height: 0; margin-top: 10px; display: grid; gap: 9px; color: var(--muted);
}
.decay-legend-group { min-width: 0; display: grid; grid-template-columns: minmax(130px, 180px) minmax(0, 1fr); align-items: start; gap: 8px 16px; }
.decay-legend-group + .decay-legend-group { padding-top: 9px; border-top: 1px solid var(--line); }
.decay-legend-group-head { min-width: 0; display: grid; gap: 2px; }
.decay-legend-group-head strong { overflow-wrap: anywhere; color: #354860; font-size: 11px; font-weight: 600; line-height: 1.35; }
.decay-legend-group-head span { color: #8490a1; font-size: 9px; }
.decay-legend-items { min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 14px; }
.decay-legend-items .chart-legend-toggle { max-width: none; display: inline-flex; align-items: baseline; white-space: normal; }
.decay-legend-items .chart-legend-toggle i { flex: 0 0 auto; }
.decay-legend-items .chart-legend-toggle span { overflow: visible; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
.decay-summary-section { margin-bottom: 18px; border-top: 2px solid #315f91; }
.decay-summary-wrap { overflow-x: auto; }
.decay-summary-wrap table { width: 100%; min-width: 860px; table-layout: fixed; }
.decay-summary-wrap th:first-child { width: 142px; }
.decay-summary-wrap th:nth-child(2) { width: 190px; }
.decay-summary-wrap th:nth-child(n + 3) { width: 82px; }
.decay-summary-wrap td { height: 50px; }
.decay-summary-wrap td:nth-child(2) { color: #53647a; font-size: 11px; line-height: 1.4; }
.decay-path { min-width: 0; display: grid; gap: 3px; }
.decay-path strong {
  overflow: hidden; color: #253a55; font-size: 12px; font-weight: 500;
  text-overflow: ellipsis; white-space: nowrap;
}
.decay-path small { color: #7a8798; font-size: 10px; font-weight: 550; }
.decay-summary-total td { background: #edf3fb; border-top-color: #c8d5e6; font-weight: 700; }
.decay-summary-total .decay-path strong { color: #203c61; font-weight: 650; }
.monetization-segment-section { margin-bottom: 18px; }
.monetization-segment-table-wrap table { min-width: 1680px; }
.monetization-payback-section { margin-bottom: 18px; border-top: 2px solid #315f91; }
.monetization-table-wrap, .monetization-payback-table-wrap {
  max-height: min(70vh, 720px); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
}
.monetization-table-wrap thead th, .monetization-payback-table-wrap thead th {
  position: sticky; top: 0; z-index: 4; box-shadow: inset 0 -1px 0 var(--line), 0 3px 8px rgba(31,55,94,.08);
}
.monetization-table-wrap table { min-width: 1400px; }
.monetization-payback-table-wrap table { min-width: 2020px; }
.monetization-table-wrap .period-group-cell, .monetization-payback-table-wrap .period-group-cell { min-width: 125px; }
.monetization-table-wrap .period-group-cell em.complete, .monetization-payback-table-wrap .period-group-cell em.complete { color: #0f6f66; background: #e2f4f1; }
.monetization-payback-table-wrap td:nth-child(12),
.monetization-payback-table-wrap td:nth-child(13),
.monetization-payback-table-wrap td:nth-child(14) { min-width: 132px; }
.annual-credit-value { color: #0f6f66; font-weight: 650; }
.target-ltv-value { color: #244d7b; font-weight: 700; }
.cohort-recovery-cell { min-width: 184px; }
.cohort-recovery { width: 166px; display: inline-grid; justify-items: end; gap: 3px; line-height: 1.2; }
.cohort-recovery strong { color: var(--ink); font: 700 14px "DIN Alternate", "Avenir Next", sans-serif; }
.cohort-recovery small { color: var(--muted); font-size: 9px; font-weight: 500; white-space: nowrap; }
.cohort-recovery-track { width: 100%; height: 4px; overflow: hidden; border-radius: 2px; background: #e5eaf1; }
.cohort-recovery-track i { display: block; height: 100%; border-radius: inherit; background: #3772b2; }
.cohort-recovery em { color: #9a620d; font-size: 9px; font-style: normal; font-weight: 650; white-space: nowrap; }
.cohort-recovery.covered .cohort-recovery-track i { background: #168579; }
.cohort-recovery.covered em { color: #0f766e; }
.annual-scope-toggle {
  min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 9px;
  border: 1px solid #d6deea; border-radius: 4px; color: #46566d; background: #fff;
  font-size: 11px; font-weight: 650; white-space: nowrap; cursor: pointer;
}
.annual-scope-toggle:hover { border-color: #9fb3ca; color: #244d7b; }
.annual-scope-toggle:focus-within { outline: 2px solid rgba(37,99,235,.22); outline-offset: 1px; }
.annual-scope-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.annual-scope-switch {
  position: relative; width: 28px; height: 16px; flex: 0 0 auto; border-radius: 999px;
  background: #b8c2cf; transition: background .16s ease;
}
.annual-scope-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(25,40,64,.24);
  transition: transform .16s ease;
}
.annual-scope-toggle input:checked + .annual-scope-switch { background: #2b659d; }
.annual-scope-toggle input:checked + .annual-scope-switch::after { transform: translateX(12px); }
.annual-scope-toggle input:disabled ~ span { opacity: .58; cursor: wait; }
.cohort-payback-cell { min-width: 250px; }
.cohort-payback-summary { display: grid; gap: 3px; }
.cohort-payback-summary strong { color: var(--ink); font-size: 13px; line-height: 1.25; font-weight: 600; }
.cohort-payback-summary small { color: var(--muted); font-size: 11px; line-height: 1.35; white-space: normal; }
.cohort-payback-summary.observed-payback strong { color: #0f6f66; }
.cohort-payback-summary.forecast-never strong { color: #a33f2d; }
.renewal-gap { color: #a33f2d; font-weight: 700; }
.payback-result {
  display: inline-block; padding: 4px 7px; border: 1px solid #d8e0eb; border-radius: 3px;
  color: #536176; background: #f5f7fa; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.payback-result.observed-payback, .payback-result.forecast-payback {
  color: #0f6f66; background: #e5f4f1; border-color: #c2e3dc;
}
.payback-result.forecast-never { color: #a33f2d; background: #f9e9e5; border-color: #efc9c0; }
.payback-result.population-mismatch { color: #a33f2d; background: #f9e9e5; border-color: #efc9c0; }
.cancellation-analysis-grid { grid-template-columns: minmax(0, 1.8fr) minmax(300px, .8fr); }
.cancellation-curve-panel { margin-bottom: 14px; }
.cancellation-curve-wrap { height: 270px; }
.cancellation-curve-scope {
  margin: 14px -20px 0; padding: 0 20px; display: grid; grid-template-columns: .7fr 1.15fr .9fr 1.15fr;
  background: #f7f9fc; border-top: 1px solid #e2e8f1; border-bottom: 1px solid #e2e8f1;
}
.curve-scope-item { min-width: 0; padding: 10px 16px; border-left: 1px solid #e2e8f1; }
.curve-scope-item:first-child { padding-left: 0; border-left: 0; }
.curve-scope-item > span, .curve-scope-item > strong, .curve-scope-item > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.curve-scope-item > span { color: #718096; font-size: 9px; font-weight: 650; }
.curve-scope-item > strong { margin-top: 3px; color: #203c61; font-size: 12px; font-weight: 600; }
.curve-scope-item > small { margin-top: 2px; color: #738196; font-size: 9px; }
.curve-scope-insight { background: #eef5ff; }
.curve-scope-insight > strong { color: #1f5f9f; }
.curve-scope-empty { grid-column: 1 / -1; padding: 11px 0; display: flex; align-items: baseline; gap: 9px; color: var(--muted); font-size: 10px; }
.curve-scope-empty strong { color: #8c5b12; font-size: 11px; }
.panel-heading-actions { display: flex; align-items: center; gap: 10px; }
.compact-tabs button { min-width: 0; }
.curve-window-count { color: var(--muted); font: 650 11px "DIN Alternate", "Avenir Next", sans-serif; white-space: nowrap; }
.cancellation-chart-wrap { height: 290px; }
.cancellation-status.live { color: #a33f2d; background: #f8e4df; border-color: #edc5bc; }
.cancellation-detail-section { border-top: 2px solid #2e5b92; }
.cancellation-detail-heading { min-height: 78px; padding-top: 14px; padding-bottom: 14px; background: #fbfcfe; }
.cancellation-detail-title { min-width: 0; display: flex; align-items: center; gap: 14px; }
.cancellation-detail-title > div { min-width: 0; }
.table-kicker {
  flex: 0 0 auto; padding: 5px 7px; color: #315b8a; background: #eaf1f8;
  border: 1px solid #ccdae8; border-radius: 3px; font: 700 10px/1 "DIN Alternate", "Avenir Next", sans-serif;
}
.cancellation-status-legend { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.cancellation-status-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cancellation-status-legend i { width: 7px; height: 7px; border-radius: 50%; }
.cancellation-status-legend i.complete { background: #158477; }
.cancellation-status-legend i.running { background: #c18a2d; box-shadow: 0 0 0 2px #fff0cf; }
.cancellation-detail-section .table-tools { flex: 0 0 auto; }
.cancellation-detail-section .search-box { background: #fff; }
.cancellation-detail-section .search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.11); }
.cancellation-detail-section .cohort-mode-tabs { background: #eef2f7; border-color: #d6deea; }
.cancellation-detail-section .cohort-mode-tabs button.active { background: #274f7f; box-shadow: 0 2px 6px rgba(39,79,127,.18); }
.cancellation-table-wrap {
  max-height: min(72vh, 720px); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
  background: #fff;
}
.cancellation-table-wrap table { min-width: 760px; }
.cancellation-table-wrap th, .cancellation-table-wrap td { padding-right: 12px; padding-left: 12px; }
.cancellation-table-wrap thead th { position: sticky; top: 0; z-index: 5; box-shadow: inset 0 -1px 0 var(--line); }
.cancellation-group-button {
  width: 100%; min-height: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: space-between;
  gap: 7px; border: 0; color: var(--muted); background: transparent; font: inherit; text-align: left;
}
.cancellation-group-button i { color: #8b98aa; font-style: normal; }
.cancellation-group-button:hover { color: #244d7b; }
.cancellation-group-button.active { color: #244d7b; font-weight: 750; }
.cancellation-group-button.active i { color: var(--blue); }
.cancellation-group-button:focus-visible { outline: 2px solid rgba(37,99,235,.38); outline-offset: 2px; border-radius: 2px; }
.cancellation-app-group { display: grid; gap: 5px; }
.cancellation-app-group strong { max-width: 196px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cancellation-app-group small { color: var(--muted); font-size: 10px; font-weight: 500; }
.cancellation-app-group-cell, .matrix-app-group-cell {
  padding-top: 14px; vertical-align: top; color: #244d7b; background: #f2f6fb; border-right: 1px solid #dfe7f1;
}
.cancellation-flat-date, .matrix-flat-date { padding-top: 10px; vertical-align: top; }
.cancellation-date-line { min-height: 18px; display: flex; align-items: center; gap: 7px; }
.cancellation-date-line strong { display: inline; font-weight: 500; }
.cancellation-date-line em { flex: 0 0 auto; width: fit-content; padding: 2px 5px; color: #965d13; background: #fff0cf; border-radius: 3px; font-size: 10px; line-height: 1.2; font-style: normal; }
.cancellation-date-line em.complete { color: #0f6f66; background: #e2f4f1; }
.cancellation-running { color: #965d13; font-weight: 650; }
.cancellation-matrix-table { min-width: 1424px !important; table-layout: fixed; }
.cancellation-matrix-table .matrix-group-row th { top: 0; height: 32px; }
.cancellation-matrix-table .matrix-window-row th { top: 32px; z-index: 6; height: 42px; }
.cancellation-matrix-table .matrix-stage-head {
  color: #38516f; background: #eaf0f7; border-right: 1px solid #d4dfeb; text-align: center;
  font-size: 11px; font-weight: 600;
}
.cancellation-matrix-table .matrix-stage-head span { margin-right: 6px; }
.cancellation-matrix-table .matrix-stage-head small { color: #77879b; font-size: 9px; font-weight: 550; }
.cancellation-matrix-table .matrix-window-row th { color: #53647a; background: #f7f9fc; text-align: center; }
.cancellation-matrix-table .matrix-window-row .table-sort-button { justify-content: center; gap: 4px; }
.cancellation-matrix-table .matrix-window-row .table-sort-button > span { display: inline-flex; align-items: baseline; }
.cancellation-matrix-table .matrix-window-row th strong { color: #243952; font: 600 13px/1 "DIN Alternate", "Avenir Next", sans-serif; }
.cancellation-matrix-table .matrix-window-row th small { margin-left: 3px; color: #8290a2; font: 550 9px/1 "Avenir Next", sans-serif; }
.cancellation-matrix-table th.numeric, .cancellation-matrix-table td.numeric { min-width: 88px; }
.cancellation-matrix-table td { height: 56px; }
.cancellation-matrix-table .sticky-col-date { left: 0; width: 142px; min-width: 142px; max-width: 142px; }
.cancellation-matrix-table .sticky-col-app { left: 142px; width: 220px; min-width: 220px; max-width: 220px; }
.cancellation-matrix-table .sticky-col-start { left: 362px; width: 94px; min-width: 94px; max-width: 94px; }
.cancellation-matrix-table thead .sticky-col-date,
.cancellation-matrix-table thead .sticky-col-app,
.cancellation-matrix-table thead .sticky-col-start { z-index: 9; background: #edf2f8; }
.cancellation-matrix-table tbody .sticky-col-date,
.cancellation-matrix-table tbody .sticky-col-app,
.cancellation-matrix-table tbody .sticky-col-start { position: sticky; z-index: 3; background: #fff; box-shadow: inset -1px 0 0 #e4eaf2; }
.cancellation-matrix-table tbody .matrix-date-cell { z-index: 4; background: #f6f9fd; }
.cancellation-matrix-table tbody tr:hover .matrix-app-cell,
.cancellation-matrix-table tbody tr:hover .matrix-start-cell { background: #f6f9ff; }
.cancellation-matrix-table .matrix-app-cell { overflow: hidden; color: #30445f; text-overflow: ellipsis; }
.cancellation-matrix-table .matrix-start-cell { color: #253a55; background: #fbfcfe; font-weight: 700; }
.matrix-window-cell { padding-top: 6px !important; padding-bottom: 6px !important; text-align: center; }
.matrix-window-cell.is-running { background: #fffaf0; }
.matrix-metric {
  --metric-fill: 0%; position: relative; min-width: 58px; min-height: 39px; padding: 5px 5px 7px;
  display: inline-grid; align-content: center; justify-items: center; overflow: hidden;
}
.matrix-metric::before, .matrix-metric::after {
  content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px;
  border-radius: 2px;
}
.matrix-metric::before { width: 100%; background: #e4e9f0; }
.matrix-metric::after { width: var(--metric-fill); background: #d6725d; }
.matrix-metric strong { color: #a94a38; font: 700 13px/1 "DIN Alternate", "Avenir Next", sans-serif; }
.matrix-metric small { display: block; margin-top: 5px; color: #7a8798; font: 550 9px/1 "DIN Alternate", "Avenir Next", sans-serif; }
.matrix-metric.running::before { background: #eee4cf; }
.matrix-metric.running::after { background: #c18a2d; }
.matrix-metric.running strong { color: #8c5b12; }
.cancellation-matrix-table tfoot { position: sticky; bottom: 0; z-index: 6; }
.cancellation-matrix-table tfoot td { height: 56px; background: #e7eef9; border-top: 2px solid #9db2ce; }
.cancellation-matrix-table tfoot .sticky-col-date,
.cancellation-matrix-table tfoot .sticky-col-app,
.cancellation-matrix-table tfoot .sticky-col-start {
  position: sticky; z-index: 7; background: #e7eef9; box-shadow: inset -1px 0 0 #c8d5e6;
}
.cancellation-matrix-table tfoot .matrix-summary-app-row td { background: #f4f7fb; border-top: 1px solid #d8e1ec; }
.cancellation-matrix-table tfoot .matrix-summary-app-row .sticky-col-app,
.cancellation-matrix-table tfoot .matrix-summary-app-row .sticky-col-start { background: #f4f7fb; }
.cancellation-matrix-table tfoot .matrix-summary-period { vertical-align: top; background: #e7eef9; }
.matrix-summary-app-row .matrix-summary-app strong { color: #315f91; font-weight: 500; }
.matrix-summary-period span { display: grid; gap: 3px; }
.matrix-summary-app strong, .matrix-summary-app small,
.matrix-summary-row .matrix-start-cell strong, .matrix-summary-row .matrix-start-cell small,
.matrix-summary-app-row .matrix-start-cell strong, .matrix-summary-app-row .matrix-start-cell small { display: block; }
.matrix-summary-app small, .matrix-summary-row .matrix-start-cell small { margin-top: 3px; }
.matrix-summary-period strong, .matrix-summary-app strong { color: #203c61; font-size: 12px; }
.matrix-summary-period small, .matrix-summary-app small, .matrix-summary-row .matrix-start-cell small { color: #60738d; font-size: 9px; font-weight: 550; }
.matrix-summary-row .matrix-metric::after { background: #315f91; }
.matrix-summary-row .matrix-metric strong { color: #244d7b; }
.matrix-summary-row .matrix-window-cell.is-running { background: #f7eedc; }
.matrix-summary-row .matrix-metric.running::before { background: #eadfc8; }
.matrix-summary-row .matrix-metric.running::after { background: #b57c21; }
.matrix-summary-row .matrix-metric.running strong { color: #80500d; }
.cancellation-matrix-table.dense td { height: 40px; }
.cancellation-matrix-table.dense .matrix-window-cell { padding-top: 2px !important; padding-bottom: 2px !important; }
.cancellation-matrix-table.dense .matrix-metric { min-height: 28px; padding: 2px 4px 5px; }
.cancellation-matrix-table.dense .matrix-metric strong { font-size: 12px; }
.cancellation-matrix-table.dense .matrix-metric small { margin-top: 2px; font-size: 9px; }
.cancellation-matrix-table.dense .period-group-cell,
.cancellation-matrix-table.dense .matrix-app-group-cell { padding-top: 6px; }
.cancel-rate { color: #a94a38; font-weight: 650; }

th[data-tooltip], td[data-tooltip], [data-tooltip] { cursor: help; }
th[data-tooltip]:focus-visible, td[data-tooltip]:focus-visible, canvas:focus-visible {
  position: relative; z-index: 2; outline: 2px solid var(--blue); outline-offset: -2px;
}

@keyframes pulse { 50% { opacity: .55; } }

@media (max-width: 1180px) {
  .app-header { grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr); padding: 0 22px; }
  .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .analysis-grid { grid-template-columns: minmax(0, 1.45fr) minmax(290px, .75fr); }
  .performance-compose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-add-button { width: 142px; justify-self: end; }
  .performance-analysis-grid { grid-template-columns: 1fr; }
  .performance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .efficiency-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-header { height: auto; min-height: 68px; padding: 10px 18px; grid-template-columns: 1fr auto; gap: 8px 14px; }
  .view-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .brand-context, .export-button { display: none; }
  .filter-band { padding: 23px 18px 20px; }
  .filter-topline { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 25px; }
  .report-controls, .date-range { width: 100%; }
  .report-controls { justify-content: space-between; }
  .date-range-popover { right: 0; width: min(680px, calc(100vw - 36px)); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { padding: 24px 18px 36px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card:last-child { grid-column: 1 / -1; }
  .analysis-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 240px; }
  .monetization-chart-wrap { height: 270px; }
  .decay-panel-actions { align-items: flex-end; flex-direction: column; }
  .decay-control-group { width: 100%; justify-content: flex-end; }
  .cancellation-chart-wrap { height: 260px; }
  .cancellation-detail-heading { align-items: flex-start; flex-direction: column; }
  .cancellation-detail-section .table-tools { width: 100%; justify-content: flex-end; }
  .cancellation-detail-title { width: 100%; flex-wrap: wrap; }
  .performance-group-row { grid-template-columns: 28px 62px minmax(130px, .7fr) minmax(0, 2fr) 128px; }
  .performance-group-row.manager { grid-template-columns: minmax(130px, .7fr) minmax(0, 2fr) 66px; }
}

@media (max-width: 700px) {
  html, body { min-width: 320px; overflow-x: hidden; }
  .app-header { position: sticky; top: 0; z-index: 100; padding: 9px 12px; background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
  .brand-block { gap: 8px; }
  .brand-mark { transform: scale(.84); transform-origin: left center; margin-right: -4px; }
  .brand-name { font-size: 12px; }
  .view-tabs { justify-self: stretch; justify-content: flex-start; width: calc(100vw - 24px); margin: 0; padding: 3px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .view-tabs button { flex: 0 0 auto; min-width: 78px; }
  .view-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; width: 100vw; height: 58px; padding: 7px 8px; justify-content: flex-start; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: rgba(255,255,255,.98); box-shadow: 0 -8px 24px rgba(31,55,94,.12); }
  .view-tabs button { min-width: 96px; height: 42px; }
  main { padding-bottom: 58px; }
  .header-actions { min-width: 0; }
  .mode-badge { display: none; }
  .filter-band { padding: 14px 12px 12px; }
  .filter-topline { gap: 10px; margin-bottom: 11px; }
  h1 { font-size: 21px; }
  .report-controls { gap: 8px; }
  .date-range { width: 100%; }
  .date-range-trigger { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .filter-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .filter-grid .field-wide { grid-column: 1 / -1; }
  .filter-grid .query-button { grid-column: 1 / -1; width: 100%; }
  .workspace { padding: 16px 12px 30px; }
  .section-heading h2 { font-size: 18px; }
  .as-of { margin-left: 0; width: 100%; text-align: left; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .kpi-card { min-width: 0; padding: 12px 10px; }
  .kpi-value { overflow: hidden; text-overflow: ellipsis; font-size: 21px; }
  .analysis-grid, .cancellation-analysis-grid, .monetization-analysis-grid, .performance-analysis-grid { grid-template-columns: 1fr; gap: 9px; }
  .chart-wrap, .cancellation-chart-wrap, .performance-chart-wrap { height: 220px; }
  .table-wrap, .performance-table-wrap, .cancellation-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 760px; }
  .performance-group-row { min-width: 760px; }
  .performance-compose-grid { grid-template-columns: 1fr; }
  .performance-add-button { width: 100%; justify-self: stretch; }
  .meta-controls, .meta-detail-grid { grid-template-columns: 1fr; }
  .retention-outcome-dialog { width: calc(100vw - 24px); max-width: none; }
  .retention-outcome-shell { padding: 14px; }
}

@media (max-width: 520px) {
  .mode-badge { padding: 6px 8px; }
  .filter-grid { grid-template-columns: 1fr; }
  .query-button { grid-column: 1; }
  .report-controls { align-items: stretch; flex-direction: column; gap: 12px; }
  .granularity-tabs button, .retention-rate-tabs button { flex: 1; }
  .cancel-window-selector .multi-select { width: 100%; }
  .primary-cancel-selector select { width: 100%; }
  .multi-popover { width: 100%; }
  .date-range-popover { right: auto; left: 0; width: 100%; }
  .date-range-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-range-presets button:last-child { grid-column: 1 / -1; }
  .date-range-selection { align-items: flex-start; flex-direction: column; gap: 3px; }
  .date-range-selection strong { text-align: left; }
  .date-range-calendars { grid-template-columns: 1fr; }
  .range-calendar.secondary { display: none; }
  .section-heading { align-items: flex-start; gap: 10px; }
  .as-of { text-align: right; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 25px; }
  .chart-panel, .breakdown-panel { padding: 16px 13px; }
  .panel-heading { align-items: flex-start; }
  .monetization-decay-heading { width: 100%; flex-direction: column; }
  .decay-panel-actions, .decay-control-group { width: 100%; align-items: stretch; }
  .decay-control-group { display: grid; grid-template-columns: 1fr 1fr; }
  .compact-segmented { width: 100%; }
  .compact-segmented button { min-width: 0; flex: 1; padding: 0 6px; }
  .decay-legend-group { grid-template-columns: 1fr; gap: 5px; }
  .decay-summary-wrap { margin-right: -13px; margin-left: -13px; }
  .cancellation-curve-panel .panel-heading { flex-direction: column; }
  .cancellation-curve-scope { margin-right: -13px; margin-left: -13px; padding: 0 13px; grid-template-columns: 1fr; }
  .curve-scope-item, .curve-scope-item:first-child { padding: 8px 0; border-top: 1px solid #e2e8f1; border-left: 0; }
  .curve-scope-item:first-child { border-top: 0; }
  .panel-heading-actions { width: 100%; justify-content: space-between; }
  .metric-tabs button { min-width: 35px; padding: 0 7px; }
  .table-heading { align-items: flex-start; flex-direction: column; }
  .retention-table-wrap { max-height: 68vh; }
  .table-tools, .search-box { width: 100%; }
  .table-tools { flex-wrap: wrap; }
  .annual-scope-toggle { flex: 1 1 auto; justify-content: center; }
  .cancellation-detail-title { gap: 9px; }
  .cancellation-detail-title .table-kicker { display: none; }
  .cancellation-status-legend { width: 100%; padding-top: 3px; }
  .cancellation-matrix-table .sticky-col-date { width: 126px; min-width: 126px; max-width: 126px; }
  .cancellation-matrix-table .sticky-col-app { left: auto; width: 190px; min-width: 190px; max-width: 190px; }
  .cancellation-matrix-table .sticky-col-start { left: auto; width: 84px; min-width: 84px; max-width: 84px; }
  .cancellation-matrix-table tbody .sticky-col-app,
  .cancellation-matrix-table tbody .sticky-col-start { position: static; }
  .cohort-mode-tabs { width: 100%; }
  .cohort-mode-tabs button { flex: 1; }
  .search-box input { width: 100%; }
  .view-tabs { width: 100%; }
  .view-tabs button { min-width: 0; padding: 0 6px; flex: 1; font-size: 11px; }
  .retention-outcome-dialog {
    inset: auto 0 0; width: 100vw; height: min(86dvh, 720px); border-top: 1px solid var(--line-strong);
    border-left: 0; box-shadow: 0 -18px 46px rgba(31,55,94,.18);
  }
  .retention-outcome-shell { padding: 19px 17px; }
  .performance-selector-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .performance-selector-heading > strong { align-self: flex-start; }
  .performance-report-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-report-tabs button { height: 36px; }
  .performance-scope-toolbar { align-items: flex-start; flex-direction: column; overflow: visible; }
  .performance-scope-control, .performance-theme-controls { width: 100%; }
  .performance-theme-controls { align-items: flex-start; flex-direction: column; }
  .performance-theme-control + .performance-theme-control { padding-top: 8px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .performance-detail-footer { align-items: flex-start; flex-direction: column; }
  .performance-chart-heading { flex-direction: column; }
  .performance-metric-tabs { width: 100%; max-width: 100%; }
  .performance-chart-wrap { height: 270px; }
  .performance-compose-grid { grid-template-columns: 1fr; }
  .performance-add-button { width: 100%; justify-self: stretch; }
  .performance-draft { margin-right: 12px; margin-left: 12px; }
  .performance-compose-grid, .performance-builder-heading, .performance-compose-actions { padding-right: 12px; padding-left: 12px; }
  .performance-compose-actions { flex-wrap: wrap; }
  .performance-compose-actions > span { flex: 1 0 100%; margin-right: 0; }
  .performance-compose-actions > button { min-width: 0; padding-right: 9px; padding-left: 9px; flex: 1; }
  .performance-group-row { padding: 11px 12px; grid-template-columns: 28px 56px minmax(0, 1fr); gap: 8px; }
  .performance-group-name { grid-column: 3; grid-row: 1; }
  .performance-group-actions { grid-column: 1 / -1; grid-row: 2; }
  .performance-group-members { grid-column: 1 / -1; grid-row: 3; }
  .performance-group-row.manager { grid-template-columns: minmax(0, 1fr); }
  .performance-group-row.manager .performance-group-name { grid-column: 1; }
  .performance-group-row.manager .performance-group-actions { grid-column: 1; grid-row: 2; }
  .performance-selector-heading { align-items: flex-start; flex-direction: column; }
  .performance-selector-actions { width: 100%; justify-content: space-between; }
  .campaign-comparison-workspace .performance-matrix-wrap { margin-right: -13px; margin-left: -13px; }
  .campaign-comparison-workspace .performance-matrix-table thead th:first-child,
  .campaign-comparison-workspace .performance-matrix-table tbody th { width: 120px; }
}
.meta-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.meta-controls select { width: 100%; min-height: 40px; }
.meta-controls select[multiple] { min-height: 40px; }
.meta-controls select:disabled { cursor: not-allowed; color: #8792a6; background: #edf1f7; border-color: #d6deea; opacity: .78; }
.meta-row { transition: background .16s ease; }
.meta-row:hover, .meta-row.selected { background: color-mix(in srgb, var(--blue) 9%, transparent); }
.meta-campaign-select { display: block; width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.meta-campaign-select strong, .meta-campaign-select small { pointer-events: none; }
.meta-campaign-select:focus-visible { outline: 2px solid rgba(37,99,235,.34); outline-offset: 2px; border-radius: 3px; }
.meta-row small { display: block; color: var(--muted); margin-top: 3px; }
.meta-mapping { display: inline-flex; padding: 3px 7px; border-radius: 999px; font-size: 12px; }
.meta-mapping.matched { color: #166534; background: #dcfce7; }
.meta-mapping.ambiguous { color: #92400e; background: #fef3c7; }
.meta-mapping.unmatched { color: #64748b; background: #f1f5f9; }
.meta-detail-panel { margin-top: 20px; padding: 22px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.meta-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.meta-detail-grid div { padding: 12px; background: var(--paper); border-radius: 6px; }
.meta-detail-grid span, .meta-detail-grid strong { display: block; }
.meta-detail-grid span { color: var(--muted); font-size: 12px; }
.meta-detail-grid strong { margin-top: 4px; font-size: 18px; }
.meta-detail-note { color: var(--muted); }
.meta-horizon-section { border-top: 1px solid var(--line); padding-top: 18px; }
.meta-horizon-section h4 { margin: 0; font-size: 16px; }
.meta-horizon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.meta-horizon-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 6px; }
.meta-horizon-grid span, .meta-horizon-grid strong, .meta-horizon-grid small { display: block; }
.meta-horizon-grid span, .meta-horizon-grid small { color: var(--muted); }
.meta-horizon-grid strong { margin: 5px 0; font-size: 18px; }
.meta-horizon-scope { flex: 0 0 auto; }
.meta-horizon-scope { height: 32px; padding: 3px; min-width: 136px; }
.meta-horizon-scope button { flex: 1 1 0; min-width: 0; height: 24px; padding: 0 8px; }
.meta-horizon-daily-heading { margin-bottom: 8px; }
.meta-horizon-daily-heading h4 { margin: 0; font-size: 14px; }
.meta-horizon-daily-heading > span { color: var(--muted); font-size: 12px; }
.meta-clear-selection { margin-top: 16px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--blue-dark); background: #fff; font-size: 12px; font-weight: 650; }
.meta-clear-selection:hover { border-color: var(--blue); background: var(--blue-soft); }
.meta-loading-state { grid-column: 1 / -1; min-height: 104px; padding: 20px; display: flex; align-items: center; gap: 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.meta-loading-state strong { color: var(--ink); font-size: 13px; }
.meta-loading-state small { margin-left: auto; font-size: 12px; }
.meta-table-loading, .meta-horizon-loading { min-height: 128px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 13px; }
.loading-spinner { width: 16px; height: 16px; flex: 0 0 auto; display: inline-block; border: 2px solid #d7e0eb; border-top-color: var(--blue); border-radius: 50%; animation: meta-spin .7s linear infinite; }
@keyframes meta-spin { to { transform: rotate(360deg); } }
.meta-horizon-daily { margin-top: 18px; }
.meta-horizon-daily h5 { margin: 0 0 8px; font-size: 14px; }
.meta-horizon-daily .table-wrap { max-height: min(78vh, 820px); overflow: auto; }
.meta-horizon-daily table { min-width: 900px; width: 100%; }
.meta-horizon-daily .table-wrap thead th { position: sticky; top: 0; z-index: 5; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); }
.meta-horizon-campaign-row td { border-bottom-color: rgba(148, 163, 184, .25); }
.meta-horizon-campaign-row:hover td { background: #f5f8fc; }
.meta-horizon-campaign-row strong { font-weight: 600; }
.button-link { display: inline-flex; padding: 8px 12px; border-radius: 6px; background: var(--blue); color: #fff; text-decoration: none; }
@media (max-width: 900px) { .meta-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); } .meta-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .meta-controls, .meta-detail-grid { grid-template-columns: 1fr; } }

/* Landscape phones have enough width for side-by-side controls, but very little
   vertical space. Keep the primary workflow visible without making the page
   depend on a long stack of full-height panels. */
@media (orientation: landscape) and (max-width: 1024px) and (max-height: 600px) {
  html, body { min-width: 0; }

  .app-header {
    min-height: 56px;
    height: auto;
    padding: 8px 14px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 12px;
  }
  .brand-block { gap: 8px; }
  .brand-mark { width: 23px; height: 23px; gap: 2px; }
  .brand-mark span { width: 6px; }
  .brand-mark span:nth-child(1) { height: 9px; }
  .brand-mark span:nth-child(2) { height: 16px; }
  .brand-mark span:nth-child(3) { height: 22px; }
  .brand-context, .export-button { display: none; }
  .view-tabs {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    height: 34px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .view-tabs::-webkit-scrollbar { display: none; }
  .view-tabs button { min-width: 72px; height: 26px; padding: 0 8px; font-size: 11px; }
  .header-actions { gap: 6px; }
  .mode-badge { max-width: 92px; padding: 6px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .icon-button { width: 32px; height: 32px; font-size: 19px; }

  .filter-band { padding: 14px 14px 12px; }
  .filter-topline {
    align-items: flex-start;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 12px;
  }
  .filter-topline > :first-child { min-width: 0; flex: 1 1 auto; }
  .eyebrow { margin-bottom: 5px; font-size: 10px; }
  h1 { font-size: 22px; line-height: 1.15; }
  .report-controls {
    width: auto;
    flex: 0 1 auto;
    align-items: flex-end;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
  .granularity-selector, .retention-rate-selector { gap: 4px; }
  .granularity-tabs, .retention-rate-tabs { height: 34px; }
  .granularity-tabs button, .retention-rate-tabs button { min-width: 38px; height: 26px; padding: 0 7px; font-size: 11px; }
  .date-range { width: clamp(190px, 30vw, 260px); gap: 4px; }
  .date-range-trigger { height: 34px; padding: 0 9px; font-size: 12px; }
  .date-range-popover {
    right: 0;
    width: min(620px, calc(100vw - 28px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .field { gap: 4px; font-size: 11px; }
  .field > input, .field > select, .multi-trigger, .query-button { height: 35px; font-size: 12px; }
  .query-button { padding: 0 10px; }
  .query-button span { margin-left: 5px; }
  .active-filters { min-height: 20px; margin-top: 9px; gap: 4px; }
  .filter-chip { padding: 3px 6px; font-size: 10px; }

  .workspace { padding: 16px 14px 28px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
  .section-heading h2 { font-size: 19px; }
  .as-of { margin-left: auto; font-size: 11px; text-align: right; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .kpi-card, .performance-kpis .kpi-card { padding: 12px 13px 11px; }
  .kpi-card:last-child { grid-column: auto; }
  .kpi-value { margin: 5px 0 3px; font-size: 23px; }
  .kpi-label, .kpi-meta { font-size: 10px; }

  .analysis-grid, .cancellation-analysis-grid, .monetization-analysis-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(220px, .8fr);
    gap: 10px;
    margin-bottom: 12px;
  }
  .chart-panel, .breakdown-panel { padding: 13px 14px 11px; }
  .panel-heading { gap: 8px; }
  .panel-heading h3 { margin-bottom: 2px; font-size: 13px; }
  .panel-heading p { font-size: 10px; }
  .metric-tabs { max-width: 54%; }
  .metric-tabs button, .cohort-mode-tabs button { height: 26px; padding: 0 7px; font-size: 10px; }
  .chart-wrap, .cancellation-chart-wrap { height: 205px; margin-top: 9px; }
  .monetization-chart-wrap { height: 220px; }
  .chart-legend { gap: 4px 10px; margin-top: 5px; font-size: 9px; }
  .chart-legend > span, .chart-legend-toggle { max-width: 150px; }
  .breakdown-list { margin-top: 13px; gap: 10px; }
  .breakdown-row { grid-template-columns: minmax(54px, 1fr) 2fr 38px; gap: 6px; }
  .breakdown-label, .breakdown-value { font-size: 10px; }

  .table-heading { padding: 12px 14px; }
  .table-heading h3 { font-size: 13px; }
  .table-tools { gap: 6px; }
  .search-box { height: 30px; }
  .search-box input { width: 100px; font-size: 11px; }
  .density-button { width: 30px; height: 30px; }
  .retention-table-wrap, .performance-table-wrap, .cancellation-table-wrap { max-height: 52vh; }
  th { height: 33px; padding: 0 10px; font-size: 10px; }
  td { height: 39px; padding: 0 10px; font-size: 11px; }
  .table-footer { min-height: 35px; padding: 0 14px; font-size: 10px; }

  .performance-selector-heading, .performance-builder-heading { min-height: 58px; padding: 11px 14px; }
  .performance-selector-heading h3 { font-size: 14px; }
  .performance-selector-heading p:not(.eyebrow), .performance-selection-notice { font-size: 10px; }
  .performance-report-tabs { min-height: 40px; margin-bottom: 10px; }
  .performance-report-tabs button { height: 31px; padding: 0 8px; font-size: 11px; }
  .performance-scope-toolbar { min-height: 42px; margin: -4px 0 12px; padding: 6px 9px; gap: 8px 12px; }
  .performance-chart-wrap { height: 220px; }

  .retention-outcome-dialog { width: min(420px, 64vw); }
  .retention-outcome-shell { padding: 16px 18px; }
}

@media (orientation: landscape) and (max-width: 1024px) and (max-height: 430px) {
  .date-range-popover { top: calc(100% + 4px); }
  .date-range-calendars { grid-template-columns: 1fr; }
  .date-range-calendars .range-calendar.secondary { display: none; }
  .range-calendar-day, .range-calendar-empty { height: 30px; }
  .range-calendar-day > span { width: 26px; height: 26px; }
  .date-range-feedback { min-height: 25px; padding-top: 6px; }
  .date-range-actions { padding-top: 7px; }
}
