:root {
    --canvas: #f4f7f6;
    --surface: #ffffff;
    --surface-muted: #eef3f1;
    --surface-strong: #e3ebe8;
    --ink: #17201f;
    --ink-soft: #34413f;
    --muted: #687471;
    --line: #d9e1de;
    --line-strong: #bdcbc6;
    --brand: #0f766e;
    --brand-strong: #075e58;
    --blue: #2563eb;
    --amber: #ad5f12;
    --amber-surface: #fff7e8;
    --danger: #b42318;
    --danger-surface: #fff0ee;
    --success: #24754d;
    --success-surface: #eaf7ef;
    --test: #6d45a0;
    --test-surface: #f4edfb;
    --shadow: 0 12px 35px rgba(23, 32, 31, 0.12);
    --header-height: 64px;
    --nav-width: 208px;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--canvas);
    color-scheme: light;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.68;
}

a {
    color: inherit;
}

svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 9px 12px;
    color: #fff;
    background: var(--ink);
    border-radius: 4px;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.32);
    outline-offset: 2px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 750;
}

.brand-mark {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #fff;
    background: var(--ink);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 850;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
    text-transform: uppercase;
}

.icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.icon-button:hover {
    color: var(--ink);
    background: var(--surface-muted);
    border-color: var(--line-strong);
}

.primary-button,
.secondary-button,
.text-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}

.primary-button {
    padding: 8px 14px;
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
}

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

.secondary-button {
    padding: 8px 12px;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.secondary-button:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.text-button {
    min-height: 34px;
    padding: 5px 2px;
    color: var(--brand-strong);
    background: transparent;
    border: 0;
}

.text-button:hover {
    color: var(--ink);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    min-height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.app-brand > span:last-child {
    display: grid;
    line-height: 1.15;
}

.app-brand strong {
    font-size: 14px;
}

.app-brand small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.header-context {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.pipeline-triage {
    position: relative;
}

.pipeline-indicator {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 7px;
    padding: 4px 9px;
    color: var(--muted);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pipeline-indicator > span:first-child {
    width: 8px;
    height: 8px;
    background: var(--amber);
    border-radius: 50%;
}

.pipeline-indicator.is-healthy {
    color: var(--success);
    background: var(--success-surface);
    border-color: #b8dec8;
}

.pipeline-indicator.is-healthy > span:first-child {
    background: var(--success);
}

.pipeline-indicator.is-warning {
    color: var(--danger);
    background: var(--danger-surface);
    border-color: #efc0ba;
}

.pipeline-indicator.is-warning > span:first-child {
    background: var(--danger);
}

.pipeline-indicator.is-info {
    color: var(--brand-strong);
    background: #edf8f6;
    border-color: #b8ded8;
}

.pipeline-indicator.is-info > span:first-child {
    background: var(--brand);
}

.pipeline-triage-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    width: min(430px, calc(100vw - 32px));
    padding: 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(21, 43, 39, 0.18);
}

.pipeline-triage-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.pipeline-triage-heading .eyebrow {
    margin: 0 0 3px;
}

.pipeline-triage-heading h2 {
    margin: 0;
    font-size: 17px;
}

.pipeline-triage-summary {
    margin: 10px 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

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

.pipeline-triage-action {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    grid-template-columns: 30px minmax(0, 1fr);
}

.pipeline-triage-action.is-healthy {
    background: var(--success-surface);
    border-color: #b8dec8;
}

.pipeline-triage-action.is-info {
    background: #edf8f6;
    border-color: #b8ded8;
}

.pipeline-triage-action-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--danger);
    background: var(--danger-surface);
    border-radius: 50%;
}

.pipeline-triage-action.is-healthy .pipeline-triage-action-icon {
    color: var(--success);
    background: #fff;
}

.pipeline-triage-action.is-info .pipeline-triage-action-icon {
    color: var(--brand-strong);
    background: #e1f4f1;
}

.pipeline-triage-action-icon svg {
    width: 15px;
    height: 15px;
}

.pipeline-triage-action-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.pipeline-triage-action-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.pipeline-triage-action-title span:last-child {
    color: var(--danger);
    font-variant-numeric: tabular-nums;
}

.pipeline-triage-action.is-info .pipeline-triage-action-title span:last-child {
    color: var(--brand-strong);
}

.pipeline-triage-action-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.pipeline-triage-action-copy button,
.pipeline-triage-footer {
    justify-self: start;
    min-height: auto;
    padding: 3px 0;
    font-size: 11px;
}

.pipeline-triage-action-copy button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pipeline-triage-action-copy button svg,
.pipeline-triage-footer svg {
    width: 13px;
    height: 13px;
}

.pipeline-triage-footer {
    display: inline-flex;
    margin-top: 11px;
    align-items: center;
    gap: 5px;
}

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

.admin-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    background: var(--blue);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.admin-copy {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.admin-copy strong,
.admin-copy small {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-copy strong {
    font-size: 13px;
}

.admin-copy small {
    color: var(--muted);
    font-size: 11px;
}

.app-layout {
    display: grid;
    min-height: calc(100vh - var(--header-height));
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
}

.section-nav {
    position: sticky;
    top: var(--header-height);
    display: flex;
    height: calc(100vh - var(--header-height));
    align-self: start;
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px;
    background: #fafcfb;
    border-right: 1px solid var(--line);
}

.nav-item {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 680;
    text-align: left;
    text-decoration: none;
}

.nav-item:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.nav-item.is-active {
    color: var(--brand-strong);
    background: #e8f4f1;
    border-color: #c4ded8;
}

.dashboard-content {
    width: 100%;
    min-width: 0;
    max-width: 1680px;
    margin: 0 auto;
    padding: 20px 24px 56px;
}

.filter-bar {
    display: grid;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    container-name: revenue-filters;
    container-type: inline-size;
}

.filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.period-control,
.driver-tabs {
    display: inline-flex;
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.period-control button,
.driver-tabs button {
    min-height: 32px;
    padding: 5px 10px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-right: 1px solid var(--line);
    font-size: 12px;
    font-weight: 750;
}

.period-control button:last-child,
.driver-tabs button:last-child {
    border-right: 0;
}

.period-control button.is-active,
.driver-tabs button[aria-pressed="true"] {
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(23, 32, 31, 0.08);
}

.filters {
    display: grid;
    align-items: end;
    gap: 9px;
    grid-template-columns:
        minmax(128px, 0.8fr) minmax(128px, 0.8fr)
        minmax(180px, 1.1fr) minmax(135px, 0.8fr)
        minmax(145px, 0.85fr) minmax(220px, 1.6fr)
        minmax(180px, 1.2fr) 78px 74px auto auto;
}

.filter-actions {
    display: grid;
    min-width: 0;
    grid-column: span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.filter-actions > .primary-button,
.filter-actions > .secondary-button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
}

.apply-button {
    transition: background-color 160ms ease-out, border-color 160ms ease-out,
        opacity 160ms ease-out;
}

.apply-button.is-loading {
    cursor: progress;
}

.apply-button.is-loading svg {
    animation: spin 720ms linear infinite;
}

.compact-field,
.field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.compact-field > span,
.field > span:first-child {
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
}

.compact-field input,
.compact-field select,
.currency-fixed output,
.field input,
.field select,
.table-search input {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
}

.currency-fixed output {
    display: flex;
    align-items: center;
    font-weight: 720;
}

.compact-field select {
    padding-right: 27px;
}

.compact-field input:hover,
.compact-field select:hover,
.field input:hover,
.field select:hover,
.table-search input:hover {
    border-color: #9baca7;
}

.compact-field input:focus-visible,
.compact-field select:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.table-search input:focus-visible {
    border-color: var(--blue);
    outline: 3px solid rgba(37, 99, 235, 0.14);
}

.environment-notice,
.global-error,
.form-alert,
.catalog-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 13px;
}

.environment-notice {
    color: var(--test);
    background: var(--test-surface);
    border: 1px solid #d9c3ee;
}

.global-error,
.form-alert,
.catalog-alert {
    color: var(--danger);
    background: var(--danger-surface);
    border: 1px solid #efc0ba;
}

.global-error .text-button {
    margin-left: auto;
    color: var(--danger);
}

.dashboard-panel {
    display: none;
    padding-top: 25px;
    scroll-margin-top: calc(var(--header-height) + 16px);
}

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

[data-graph-panel][hidden] {
    display: none !important;
}

.graph-explorer {
    margin-top: 28px;
}

.graph-tabs {
    display: flex;
    gap: 2px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 3px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    scrollbar-width: thin;
}

.graph-tabs button {
    min-height: 42px;
    flex: 0 0 auto;
    padding: 8px 13px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 740;
    white-space: nowrap;
    transition: color 160ms ease-out, background-color 160ms ease-out,
        border-color 160ms ease-out, transform 120ms ease-out;
}

.graph-tabs button:hover {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
}

.graph-tabs button[aria-selected="true"] {
    color: var(--brand-strong);
    background: var(--surface);
    border-color: var(--line-strong);
    box-shadow: 0 2px 5px rgba(23, 32, 31, 0.07);
}

.graph-tabs button:active {
    transform: scale(0.98);
}

.panel-heading,
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.panel-heading {
    min-height: 54px;
    margin-bottom: 19px;
}

.panel-heading h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    text-wrap: balance;
}

.panel-subtitle {
    max-width: 720px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.section-heading h2,
.drawer-header h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
    text-wrap: balance;
}

.section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.data-freshness {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.metric-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(6, minmax(148px, 1fr));
}

.metric-card {
    display: grid;
    min-height: 132px;
    align-content: space-between;
    gap: 8px;
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.metric-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metric-label svg {
    width: 17px;
    height: 17px;
}

.metric-value {
    overflow-wrap: anywhere;
    font-size: 23px;
    font-variant-numeric: tabular-nums;
    font-weight: 780;
    line-height: 1.1;
}

.metric-note {
    display: flex;
    min-height: 20px;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
}

.currency-summary {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.currency-summary-label {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
}

.currency-options {
    display: flex;
    min-width: 0;
    gap: 1px;
    overflow-x: auto;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.currency-options button {
    display: inline-flex;
    min-height: 34px;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 6px;
    padding: 5px 9px;
    color: var(--muted);
    background: var(--surface);
    border: 0;
}

.currency-options button[aria-pressed="true"] {
    color: var(--brand-strong);
    background: #e8f4f1;
}

.currency-options strong {
    color: var(--ink);
    font-size: 11px;
}

.currency-options span,
.currency-options small,
.currency-empty {
    font-size: 10px;
}

.currency-options small,
.currency-empty {
    color: var(--muted);
}

.metric-change {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 760;
}

.metric-change.is-positive {
    color: var(--success);
}

.metric-change.is-negative {
    color: var(--danger);
}

.metric-change svg {
    width: 14px;
    height: 14px;
}

.skeleton {
    display: block;
    background: var(--surface-strong);
    border-radius: 4px;
    animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-label {
    width: 58%;
    height: 12px;
}

.skeleton-value {
    width: 78%;
    height: 27px;
}

.skeleton-note {
    width: 66%;
    height: 10px;
}

@keyframes pulse {
    50% {
        opacity: 0.42;
    }
}

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

.spin {
    animation: spin 0.8s linear infinite;
}

.chart-section,
.table-section {
    margin-top: 28px;
    padding-top: 21px;
    border-top: 1px solid var(--line);
}

.reporting-source-section {
    margin-top: 24px;
    padding-top: 21px;
    border-top: 1px solid var(--line);
}

.reporting-source-grid {
    display: grid;
    margin-top: 13px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reporting-source-item {
    display: grid;
    min-width: 0;
    min-height: 102px;
    align-items: start;
    gap: 10px;
    padding: 14px;
    border-right: 1px solid var(--line);
    grid-template-columns: 30px minmax(0, 1fr);
}

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

.reporting-source-item.is-loading {
    grid-template-columns: 1fr;
}

.reporting-source-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--brand-strong);
    background: #e8f4f1;
    border-radius: 5px;
}

.reporting-source-icon svg {
    width: 16px;
    height: 16px;
}

.reporting-source-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.reporting-source-copy small {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 10px;
}

.reporting-source-title {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.reporting-source-title strong {
    min-width: 0;
    color: var(--ink);
    font-size: 12px;
}

.source-status,
.chart-source-status {
    display: inline-flex;
    min-height: 24px;
    flex: 0 0 auto;
    align-items: center;
    padding: 3px 7px;
    color: var(--muted);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 760;
    white-space: nowrap;
}

.source-status.is-available,
.chart-source-status.is-available {
    color: var(--success);
    background: var(--success-surface);
    border-color: #b8dec8;
}

.source-status.is-warning,
.chart-source-status.is-warning {
    color: var(--amber);
    background: var(--amber-surface);
    border-color: #ecd19c;
}

.source-status.is-error,
.chart-source-status.is-error {
    color: var(--danger);
    background: var(--danger-surface);
    border-color: #efc0ba;
}

.chart-sequence {
    margin-bottom: 5px !important;
    color: var(--brand-strong) !important;
    font-size: 10px !important;
    font-weight: 780;
    text-transform: uppercase;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 11px;
}

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

.chart-legend i {
    width: 18px;
    height: 3px;
    border-radius: 2px;
}

.legend-gross {
    background: var(--brand);
}

.legend-refunds {
    background: var(--danger);
}

.chart-frame {
    position: relative;
    width: 100%;
    height: 340px;
    margin-top: 12px;
}

.chart-frame canvas.is-hidden {
    display: none;
}

.chart-empty {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 220px;
    place-content: center;
    justify-items: center;
    gap: 10px;
    padding: 24px;
    color: var(--muted);
    background: var(--surface-muted);
    border: 1px dashed var(--line-strong);
    border-radius: 6px;
    text-align: center;
}

.chart-empty svg {
    width: 24px;
    height: 24px;
}

.chart-empty span {
    max-width: 560px;
    font-size: 12px;
    line-height: 1.55;
}

.chart-data-details {
    margin-top: 10px;
    border-top: 1px solid var(--line);
}

.chart-data-details summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    width: fit-content;
    color: var(--brand-strong);
    cursor: pointer;
    font-size: 11px;
    font-weight: 740;
}

.chart-data-details summary:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.chart-data-table {
    padding: 2px 0 10px;
}

.chart-data-table .table-scroll {
    max-height: 340px;
}

.chart-data-table table {
    font-size: 11px;
}

.chart-heading-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.chart-detail-button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 11px;
    transition: transform 120ms ease-out;
}

.chart-detail-button:active:not(:disabled) {
    transform: scale(0.98);
}

.chart-table-empty {
    margin: 8px 0 0;
    padding: 14px;
    color: var(--muted);
    background: var(--surface-muted);
    font-size: 11px;
}

.subscriber-audit-overview-status {
    min-height: 20px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.subscriber-audit-flow-metrics {
    display: grid;
    margin-top: 12px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subscriber-audit-flow-metrics article {
    display: grid;
    min-height: 82px;
    align-content: center;
    gap: 5px;
    padding: 13px 14px;
    border-right: 1px solid var(--line);
}

.subscriber-audit-flow-metrics article:last-child {
    border-right: 0;
}

.subscriber-audit-flow-metrics span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 680;
}

.subscriber-audit-flow-metrics strong {
    color: var(--brand-strong);
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.subscriber-audit-periods {
    margin-top: 18px;
}

.subscriber-audit-detail-dialog {
    width: min(820px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(23, 32, 31, 0.24);
}

.subscriber-audit-detail-dialog::backdrop {
    background: rgba(17, 31, 29, 0.52);
    backdrop-filter: blur(2px);
}

.subscriber-audit-detail-shell {
    display: flex;
    max-height: calc(100vh - 34px);
    flex-direction: column;
}

.subscriber-audit-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--line);
}

.subscriber-audit-detail-header h2 {
    margin: 0;
    font-size: 19px;
    line-height: 1.25;
}

.subscriber-audit-detail-header p:last-child {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.subscriber-audit-detail-body {
    min-height: 120px;
    padding: 18px 22px 22px;
    overflow: auto;
}

.subscriber-audit-detail-facts,
.subscriber-audit-detail-observations {
    display: grid;
    gap: 10px;
}

.subscriber-audit-detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subscriber-audit-detail-fact {
    display: grid;
    gap: 3px;
    padding: 10px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.subscriber-audit-detail-fact span,
.subscriber-audit-detail-observations h3,
.subscriber-audit-detail-observations p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.subscriber-audit-detail-fact strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.subscriber-audit-detail-observations {
    margin-top: 18px;
}

.subscriber-audit-detail-observations h3 {
    color: var(--ink);
    font-size: 13px;
}

.mobile-transactions-dialog {
    width: min(1500px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(23, 32, 31, 0.24);
}

.mobile-transactions-dialog::backdrop {
    background: rgba(17, 31, 29, 0.52);
    backdrop-filter: blur(2px);
}

.mobile-transactions-shell {
    display: flex;
    width: 100%;
    min-width: 0;
    max-height: calc(100vh - 34px);
    flex-direction: column;
}

.mobile-transactions-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--line);
}

.mobile-transactions-header > div {
    min-width: 0;
}

.mobile-transactions-header .icon-button {
    flex: 0 0 auto;
}

.mobile-transactions-header h2 {
    margin: 0;
    font-size: 19px;
    line-height: 1.25;
    text-wrap: balance;
}

.mobile-transactions-header p:last-child {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.audit-basis-notes {
    display: grid;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--line);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.audit-basis-note {
    display: grid;
    align-items: start;
    gap: 10px;
    padding: 12px 22px;
    color: var(--ink-soft);
    grid-template-columns: 20px minmax(0, 1fr);
}

.amount-basis-note {
    background: #f1f8f6;
}

.client-attribution-note {
    background: #f4f7fb;
    border-left: 1px solid var(--line);
}

.audit-basis-note svg {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--brand-strong);
}

.audit-basis-note p {
    margin: 0;
    font-size: 11px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.mobile-transactions-summary {
    flex: 0 0 auto;
    min-height: 36px;
    margin: 0;
    padding: 10px 22px 8px;
    color: var(--muted);
    font-size: 11px;
}

.table-scroll.mobile-transactions-table-scroll {
    width: calc(100% - 44px);
    min-height: 220px;
    min-width: 0;
    flex: 1 1 auto;
    margin: 0 22px;
    overflow: auto;
    border-radius: 6px;
}

.mobile-transactions-table {
    min-width: 2290px;
}

.mobile-transactions-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.mobile-transactions-table th {
    background: #f4f7f6;
}

.mobile-transactions-table td {
    height: 70px;
    vertical-align: top;
}

.mobile-transactions-table .cell-primary,
.mobile-transactions-table .cell-secondary {
    max-width: 245px;
}

.mobile-transactions-table .store-cell {
    align-items: flex-start;
}

.cohort-entry-badge {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    padding: 3px 7px;
    color: var(--success);
    background: var(--success-surface);
    border: 1px solid #b8dec8;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 760;
}

.cohort-entry-badge.is-recurring {
    color: var(--brand-strong);
    background: #e7f5f2;
    border-color: #b7dbd4;
}

.amount-cell strong,
.amount-cell span {
    display: block;
}

.amount-cell strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.amount-cell span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.correlation-value {
    max-width: 190px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.mobile-transactions-footer {
    display: flex;
    min-height: 54px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 22px;
    border-top: 1px solid var(--line);
}

.mobile-transactions-footer > p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    overflow-wrap: anywhere;
}

.mobile-transactions-footer .pagination {
    min-height: 40px;
}

.insight-grid {
    display: grid;
    margin-top: 25px;
    padding-top: 21px;
    border-top: 1px solid var(--line);
    grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.8fr);
}

.insight-section {
    min-width: 0;
    padding-right: 25px;
}

.pipeline-section {
    padding-right: 0;
    padding-left: 25px;
    border-left: 1px solid var(--line);
}

.driver-tabs {
    margin: 15px 0 8px;
}

.driver-row {
    display: grid;
    min-height: 42px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    grid-template-columns: minmax(120px, 1fr) minmax(100px, 2fr) 96px;
}

.driver-row:last-child {
    border-bottom: 0;
}

.driver-name {
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-bar {
    position: relative;
    height: 7px;
    overflow: hidden;
    background: var(--surface-strong);
    border-radius: 3px;
}

.driver-bar > span {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 2px;
    background: var(--brand);
}

.driver-row.is-negative .driver-bar > span {
    background: var(--danger);
}

.driver-delta {
    color: var(--success);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 740;
    text-align: right;
}

.driver-row.is-negative .driver-delta {
    color: var(--danger);
}

.pipeline-grid {
    display: grid;
    margin-top: 11px;
}

.pipeline-item {
    display: grid;
    min-height: 48px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    grid-template-columns: 32px minmax(0, 1fr) auto;
}

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

.pipeline-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--success);
    background: var(--success-surface);
    border-radius: 5px;
}

.pipeline-icon.is-warning {
    color: var(--danger);
    background: var(--danger-surface);
}

.pipeline-icon svg {
    width: 16px;
    height: 16px;
}

.pipeline-copy {
    display: grid;
    min-width: 0;
}

.pipeline-copy strong {
    font-size: 12px;
}

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

.pipeline-value {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 780;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th,
td {
    height: 44px;
    padding: 8px 11px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: var(--muted);
    background: #f8faf9;
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:has(.row-action:hover) td {
    background: #f7faf9;
}

td.numeric,
th.numeric {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.cell-primary {
    display: block;
    max-width: 270px;
    overflow: hidden;
    color: var(--ink);
    font-weight: 680;
    text-overflow: ellipsis;
}

.cell-secondary {
    display: block;
    max-width: 240px;
    overflow: hidden;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
}

.store-cell {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.store-icon {
    display: inline-grid;
    width: 25px;
    height: 25px;
    place-items: center;
    color: var(--ink-soft);
    background: var(--surface-muted);
    border-radius: 5px;
}

.store-icon svg {
    width: 14px;
    height: 14px;
}

.status-badge,
.environment-badge,
.tier-badge {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    background: var(--surface-muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: capitalize;
}

.status-badge.is-success {
    color: var(--success);
    background: var(--success-surface);
    border-color: #b8dec8;
}

.status-badge.is-warning {
    color: var(--amber);
    background: var(--amber-surface);
    border-color: #ecd19c;
}

.status-badge.is-danger {
    color: var(--danger);
    background: var(--danger-surface);
    border-color: #efc0ba;
}

.environment-badge.is-test {
    color: var(--test);
    background: var(--test-surface);
    border-color: #d9c3ee;
}

.tier-badge.is-pro-plus {
    color: #1056a3;
    background: #edf5ff;
    border-color: #c7dcf7;
}

.row-action {
    width: 30px;
    height: 30px;
    border: 0;
}

.row-action svg {
    width: 16px;
    height: 16px;
}

.empty-row td {
    height: 112px;
    color: var(--muted);
    text-align: center;
}

.table-summary {
    min-height: 28px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.table-search {
    position: relative;
    display: block;
    width: min(320px, 45vw);
}

.table-search svg {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 17px;
    height: 17px;
    color: var(--muted);
    pointer-events: none;
}

.table-search input {
    padding-left: 34px;
}

.pagination {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.pagination button {
    display: inline-grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.pagination span {
    margin: 0 5px;
    color: var(--muted);
    font-size: 11px;
}

.subscription-layout {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.5fr);
}

.state-list {
    margin-top: 12px;
    border-top: 1px solid var(--line);
}

.state-row {
    display: grid;
    min-height: 46px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    grid-template-columns: minmax(0, 1fr) auto;
}

.state-row strong {
    text-transform: capitalize;
}

.state-row span {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    font-weight: 780;
}

.health-strip {
    display: grid;
    gap: 1px;
    margin-bottom: 16px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 6px;
    grid-template-columns: repeat(4, 1fr);
}

.health-stat {
    min-height: 76px;
    padding: 12px;
    background: var(--surface);
}

.health-stat span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 680;
}

.health-stat strong {
    display: block;
    margin-top: 7px;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.health-stat.is-warning strong {
    color: var(--danger);
}

.dashboard-content.is-management-mode .filter-bar,
.dashboard-content.is-management-mode .environment-notice,
.dashboard-content.is-all-time-mode .filter-bar,
.dashboard-content.is-all-time-mode .environment-notice {
    display: none;
}

.dashboard-content.is-management-mode .dashboard-panel,
.dashboard-content.is-all-time-mode .dashboard-panel {
    padding-top: 0;
}

.ai-credit-metrics {
    margin-bottom: 26px;
}

.ai-credit-table-section + .ai-credit-table-section {
    margin-top: 26px;
}

.ai-credits-panel .insight.is-danger {
    background: var(--danger-surface);
    border-color: #efc0ba;
    border-left-color: var(--danger);
}

.ai-credits-panel .insight.is-danger svg,
.ai-credits-panel .insight.is-danger p {
    color: var(--danger);
}

.safety-lock {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    color: var(--success);
    background: var(--success-surface);
    border: 1px solid #b8dec8;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 760;
}

.safety-lock svg {
    width: 15px;
    height: 15px;
}

.console-readiness {
    padding: 18px 0 22px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.readiness-grid {
    display: grid;
    gap: 1px;
    margin-top: 13px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.readiness-item {
    display: grid;
    min-height: 88px;
    align-items: center;
    gap: 10px;
    padding: 13px;
    background: var(--surface);
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.readiness-item.is-loading {
    grid-template-columns: 1fr;
}

.readiness-icon {
    display: inline-grid;
    width: 31px;
    height: 31px;
    color: var(--muted);
    background: var(--surface-muted);
    border-radius: 5px;
    place-items: center;
}

.readiness-item.is-ready .readiness-icon {
    color: var(--success);
    background: var(--success-surface);
}

.readiness-item.is-blocked .readiness-icon {
    color: var(--amber);
    background: var(--amber-surface);
}

.readiness-icon svg {
    width: 16px;
    height: 16px;
}

.readiness-item strong,
.readiness-item small {
    display: block;
    min-width: 0;
}

.readiness-item strong {
    font-size: 12px;
}

.readiness-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.owner-evidence {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.sku-launch-layout {
    display: grid;
    gap: 32px;
    padding: 26px 0;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.65fr);
}

.sku-draft-tool,
.sku-workflow-guide {
    min-width: 0;
}

.sku-workflow-guide {
    padding-left: 28px;
    border-left: 1px solid var(--line);
}

.sku-draft-form {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.field small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.field-error {
    color: var(--danger);
    font-size: 10px;
    font-weight: 680;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
    border-color: var(--danger);
}

.field.is-disabled {
    opacity: 0.5;
}

.field.is-disabled input {
    background: var(--surface-muted);
}

.segmented-field {
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

.segmented-field legend {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
}

.segmented-control {
    display: inline-grid;
    min-width: min(100%, 330px);
    overflow: hidden;
    background: var(--surface-muted);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    grid-template-columns: repeat(3, 1fr);
}

.segmented-control label {
    min-width: 0;
}

.segmented-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-control span {
    display: grid;
    min-height: 38px;
    padding: 7px 12px;
    border-right: 1px solid var(--line);
    cursor: pointer;
    font-size: 12px;
    font-weight: 720;
    place-items: center;
}

.segmented-control label:last-child span {
    border-right: 0;
}

.segmented-control input:checked + span {
    color: var(--brand-strong);
    background: var(--surface);
    box-shadow: inset 0 -2px 0 var(--brand);
}

.segmented-control input:focus-visible + span {
    position: relative;
    z-index: 1;
    outline: 3px solid rgba(37, 99, 235, 0.16);
    outline-offset: -3px;
}

.sku-id-grid,
.sku-mapping-grid {
    display: grid;
    gap: 12px;
}

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

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

.checkbox-field {
    display: flex;
    min-height: 42px;
    align-items: flex-start;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 12px;
}

.checkbox-field input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 2px 0 0;
    accent-color: var(--brand);
}

.checkbox-field strong,
.checkbox-field small {
    display: block;
}

.checkbox-field small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.checkbox-field.is-disabled {
    opacity: 0.5;
}

.draft-safety-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    color: #195d3e;
    background: var(--success-surface);
    border: 1px solid #b8dec8;
    border-radius: 5px;
}

.draft-safety-note svg {
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.draft-safety-note p {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
}

.safety-acknowledgement {
    min-height: 44px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.sku-save-button {
    width: fit-content;
    min-height: 42px;
}

.sku-save-button.is-loading {
    cursor: wait;
}

.form-error-summary {
    padding: 10px 12px;
    color: var(--danger);
    background: var(--danger-surface);
    border: 1px solid #efc0ba;
    border-radius: 5px;
    font-size: 12px;
}

.form-error-summary:focus {
    outline: 3px solid rgba(180, 35, 24, 0.15);
}

.sku-save-result {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    color: var(--success);
    background: var(--success-surface);
    border: 1px solid #b8dec8;
    border-radius: 5px;
    font-size: 11px;
}

.sku-save-result svg {
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.sku-save-result code,
.draft-meta code,
.draft-store-line code,
.draft-instructions code {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px;
}

.workflow-steps {
    display: grid;
    gap: 0;
    padding: 0;
    margin: 16px 0 0;
    list-style: none;
}

.workflow-steps li {
    display: grid;
    min-height: 69px;
    gap: 10px;
    padding: 0 0 13px;
    grid-template-columns: 28px minmax(0, 1fr);
}

.workflow-steps li > span {
    display: grid;
    width: 26px;
    height: 26px;
    color: var(--brand-strong);
    background: #e6f4f1;
    border: 1px solid #b9dad4;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    place-items: center;
}

.workflow-steps strong {
    display: block;
    font-size: 12px;
}

.workflow-steps p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.console-help {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.console-help summary {
    min-height: 44px;
    padding: 12px 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 730;
}

.console-help p {
    padding: 0 0 12px;
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.sku-drafts-section {
    padding: 24px 0 0;
    border-top: 1px solid var(--line);
}

.sku-draft-list {
    margin-top: 14px;
    border-top: 1px solid var(--line);
}

.sku-draft-row {
    display: grid;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    grid-template-columns: minmax(280px, 1.1fr) minmax(160px, 0.55fr) minmax(280px, 1fr);
    content-visibility: auto;
    contain-intrinsic-size: auto 260px;
}

.draft-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.draft-title > span:first-child,
.draft-store-line > * {
    min-width: 0;
}

.draft-title strong,
.draft-title small {
    display: block;
}

.draft-title strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.draft-title small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.draft-stores {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.draft-store-line {
    display: grid;
    align-items: center;
    gap: 9px;
    grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr) auto;
}

.draft-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-top: 11px;
    color: var(--muted);
    font-size: 9px;
}

.draft-progress {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 7px;
    padding-left: 16px;
    border-left: 1px solid var(--line);
}

.draft-progress > div {
    display: grid;
    gap: 3px;
}

.draft-progress small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 680;
}

.draft-guidance {
    min-width: 0;
}

.draft-instructions {
    border-bottom: 1px solid var(--line);
}

.draft-instructions:first-child {
    border-top: 1px solid var(--line);
}

.draft-instructions summary {
    display: grid;
    min-height: 42px;
    align-items: center;
    gap: 6px;
    padding: 8px 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 720;
    grid-template-columns: minmax(0, 1fr) minmax(80px, auto);
}

.draft-instructions summary code {
    color: var(--muted);
    text-align: right;
}

.draft-instructions ol {
    padding: 0 0 10px 19px;
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.store-check-action {
    display: flex;
    min-height: 52px;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px 3px 10px;
}

.store-check-action .secondary-button {
    min-height: 36px;
}

.store-check-action > span {
    color: var(--muted);
    font-size: 10px;
}

.store-check-action > span.is-success {
    color: var(--success);
}

.store-check-action > span.is-warning {
    color: var(--amber);
}

.store-check-action > span.is-danger {
    color: var(--danger);
}

.manual-store-note {
    padding: 0 3px 10px;
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.sku-empty,
.sku-loading {
    display: grid;
    min-height: 110px;
    margin-top: 12px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    place-items: center;
    text-align: center;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(23, 32, 31, 0.34);
}

.transaction-drawer {
    position: fixed;
    z-index: 80;
    top: 0;
    right: 0;
    width: min(560px, 94vw);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: contain;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateX(105%);
    transition: transform 180ms ease;
}

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

.drawer-header {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding:
        max(14px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        14px
        18px;
    border-bottom: 1px solid var(--line);
}

.drawer-content {
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding:
        18px
        max(18px, env(safe-area-inset-right))
        max(18px, env(safe-area-inset-bottom))
        18px;
}

.detail-section {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.detail-section:first-child {
    padding-top: 0;
}

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

.detail-section h3 {
    margin: 0 0 12px;
    font-size: 13px;
}

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

.detail-field {
    min-width: 0;
}

.detail-field dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 730;
    text-transform: uppercase;
}

.detail-field dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 650;
}

.timeline {
    display: grid;
    gap: 0;
}

.timeline-item {
    position: relative;
    display: grid;
    min-height: 56px;
    gap: 4px;
    padding: 0 0 14px 24px;
}

.timeline-item::before {
    position: absolute;
    top: 6px;
    bottom: -6px;
    left: 6px;
    width: 1px;
    content: "";
    background: var(--line-strong);
}

.timeline-item::after {
    position: absolute;
    top: 4px;
    left: 2px;
    width: 9px;
    height: 9px;
    content: "";
    background: var(--brand);
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--brand);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-item strong {
    font-size: 12px;
}

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

.drawer-loading {
    display: grid;
    gap: 12px;
}

.drawer-loading .skeleton {
    height: 18px;
}

.login-page {
    min-height: 100vh;
    background: #edf2f0;
}

.login-shell {
    display: grid;
    width: min(960px, calc(100% - 40px));
    min-height: 580px;
    margin: max(5vh, 36px) auto;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.login-brand {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    color: #fff;
    background: #153c3a;
}

.login-brand .brand-mark {
    color: var(--ink);
    background: #fff;
}

.login-kicker {
    margin: 0 0 10px;
    color: #acd0ca;
    font-size: 12px;
    font-weight: 720;
    text-transform: uppercase;
}

.login-brand h1 {
    max-width: 420px;
    margin: 0;
    font-size: 38px;
    line-height: 1.08;
}

.login-intro {
    max-width: 410px;
    margin: 16px 0 0;
    color: #d4e4e1;
    font-size: 15px;
    line-height: 1.55;
}

.login-security {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #d4e4e1;
    font-size: 12px;
    font-weight: 650;
}

.login-form-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 46px;
}

.login-form-heading {
    margin-bottom: 24px;
}

.login-form-heading h2 {
    margin: 0;
    font-size: 27px;
}

.login-form {
    display: grid;
    gap: 18px;
}

.field {
    gap: 7px;
}

.field > span:first-child {
    color: var(--ink-soft);
    font-size: 12px;
}

.input-with-icon {
    position: relative;
    display: block;
}

.input-with-icon > svg {
    position: absolute;
    z-index: 1;
    top: 12px;
    left: 12px;
    width: 17px;
    height: 17px;
    color: var(--muted);
    pointer-events: none;
}

.input-with-icon input {
    min-height: 43px;
    padding-left: 39px;
}

.input-with-icon .password-toggle {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 37px;
    height: 37px;
    border: 0;
}

.input-with-icon input[type="password"],
.input-with-icon input[type="text"] {
    padding-right: 43px;
}

.login-submit {
    min-height: 43px;
    margin-top: 2px;
}

.login-submit:disabled {
    cursor: wait;
}

.form-alert {
    margin: 0 0 18px;
}

.cf-turnstile {
    width: 100%;
}

.status-shell {
    display: grid;
    width: min(100% - 32px, 560px);
    min-height: 280px;
    align-content: center;
    gap: 28px;
    margin: max(24px, 12vh) auto;
    padding: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.status-shell h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
    text-wrap: balance;
}

.status-shell p:not(.eyebrow) {
    max-width: 58ch;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.status-shell .primary-button {
    width: fit-content;
}

@media (max-width: 1280px) {
    .filters {
        grid-template-columns: repeat(4, minmax(125px, 1fr));
    }

    .product-filter {
        grid-column: span 2;
    }

    .currency-field {
        grid-column: span 1;
    }

    .apply-button,
    .export-button {
        align-self: end;
    }

    .metric-grid {
        grid-template-columns: repeat(3, minmax(170px, 1fr));
    }

    .sku-draft-row {
        grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    }

    .draft-progress {
        grid-column: 1;
        grid-row: 2;
        padding: 12px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .draft-guidance {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 980px) {
    :root {
        --header-height: 62px;
    }

    .app-layout {
        display: block;
    }

    .section-nav {
        position: sticky;
        z-index: 30;
        top: var(--header-height);
        height: auto;
        overflow-x: auto;
        flex-direction: row;
        gap: 5px;
        padding: 8px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .nav-item {
        width: auto;
        min-width: max-content;
        min-height: 38px;
    }

    .dashboard-content {
        padding: 18px 18px 48px;
    }

    .insight-grid {
        gap: 24px;
        grid-template-columns: 1fr;
    }

    .insight-section,
    .pipeline-section {
        padding: 0;
        border-left: 0;
    }

    .pipeline-section {
        padding-top: 22px;
        border-top: 1px solid var(--line);
    }

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

    .sku-launch-layout {
        grid-template-columns: 1fr;
    }

    .sku-workflow-guide {
        padding: 24px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

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

    .login-brand {
        min-height: 290px;
        padding: 30px;
    }

    .login-form-panel {
        padding: 36px 30px;
    }
}

@media (max-width: 720px) {
    .app-header {
        gap: 10px;
        padding: 9px 12px;
    }

    .app-brand strong {
        font-size: 13px;
    }

    .admin-copy {
        display: none;
    }

    .pipeline-indicator {
        width: 38px;
        min-height: 38px;
        justify-content: center;
        padding: 0;
    }

    .pipeline-indicator > span:last-child {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .header-context {
        gap: 8px;
    }

    .dashboard-content {
        padding: 15px 12px 42px;
    }

    .currency-summary {
        display: grid;
        gap: 6px;
    }

    .filter-title,
    .panel-heading,
    .section-heading {
        align-items: flex-start;
    }

    .source-chart-section .section-heading {
        flex-direction: column;
    }

    .chart-heading-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .chart-detail-button {
        min-height: 44px;
    }

    .filter-title {
        flex-direction: column;
    }

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

    .compact-field input,
    .compact-field select,
    .field input,
    .table-search input {
        font-size: 16px;
    }

    .product-filter {
        grid-column: span 2;
    }

    .apply-button,
    .export-button {
        width: 100%;
    }

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

    .metric-card {
        min-height: 126px;
        padding: 13px;
    }

    .metric-value {
        font-size: 20px;
    }

    .chart-frame {
        height: 280px;
    }

    .reporting-source-grid {
        grid-template-columns: 1fr;
    }

    .reporting-source-item,
    .reporting-source-item:last-child {
        min-height: 92px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

    .reporting-source-title {
        align-items: flex-start;
    }

    .chart-source-status {
        align-self: flex-start;
    }

    .subscription-layout {
        grid-template-columns: 1fr;
    }

    .sku-id-grid,
    .sku-mapping-grid {
        grid-template-columns: 1fr;
    }

    .sku-save-button {
        width: 100%;
    }

    .sku-draft-row {
        grid-template-columns: 1fr;
    }

    .draft-progress,
    .draft-guidance {
        grid-column: auto;
        grid-row: auto;
    }

    .draft-guidance {
        padding-top: 4px;
    }

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

    .table-search {
        width: min(100%, 260px);
    }

    .panel-heading {
        flex-wrap: wrap;
    }

    .driver-row {
        grid-template-columns: minmax(90px, 1fr) minmax(70px, 1.4fr) 78px;
    }

    .login-shell {
        width: min(100% - 20px, 560px);
        margin: 10px auto;
    }

    .login-brand {
        min-height: 250px;
        padding: 25px;
    }

    .login-brand h1 {
        font-size: 31px;
    }

    .login-form-panel {
        padding: 30px 24px;
    }

    .mobile-transactions-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 7px;
    }

    .mobile-transactions-shell {
        max-height: calc(100vh - 18px);
    }

    .mobile-transactions-header {
        padding: 16px 14px 13px;
    }

    .mobile-transactions-header h2 {
        font-size: 17px;
    }

    .audit-basis-notes {
        grid-template-columns: 1fr;
    }

    .audit-basis-note {
        padding: 11px 14px;
    }

    .client-attribution-note {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .mobile-transactions-summary {
        padding-right: 14px;
        padding-left: 14px;
    }

    .table-scroll.mobile-transactions-table-scroll {
        width: calc(100% - 28px);
        margin: 0 14px;
    }

    .mobile-transactions-footer {
        align-items: flex-start;
        padding: 8px 14px;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-transactions-footer .pagination {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 430px) {
    .filters {
        grid-template-columns: 1fr;
    }

    .product-filter {
        grid-column: auto;
    }

    .readiness-item {
        align-items: start;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .readiness-item .status-badge {
        grid-column: 2;
        justify-self: start;
    }

    .segmented-control {
        width: 100%;
    }

    .draft-store-line {
        align-items: start;
        grid-template-columns: 1fr;
    }

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

    .draft-instructions summary code {
        text-align: left;
    }

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

    .metric-card {
        min-height: 112px;
    }

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

@media (pointer: coarse) {
    .icon-button,
    .primary-button,
    .secondary-button,
    .nav-item,
    .period-control button,
    .driver-tabs button,
    .graph-tabs button,
    .pagination button {
        min-width: 44px;
        min-height: 44px;
    }

    .segmented-control span,
    .console-help summary,
    .draft-instructions summary {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (max-width: 640px) {
    .subscriber-audit-flow-metrics {
        grid-template-columns: 1fr;
    }

    .subscriber-audit-flow-metrics article,
    .subscriber-audit-flow-metrics article:last-child {
        min-height: 64px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .subscriber-audit-flow-metrics article:last-child {
        border-bottom: 0;
    }

    .subscriber-audit-detail-dialog {
        width: calc(100vw - 16px);
    }

    .subscriber-audit-detail-header,
    .subscriber-audit-detail-body {
        padding-right: 14px;
        padding-left: 14px;
    }

    .subscriber-audit-detail-facts {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ */
/* CEO-first overview: hero, insight, hero chart, money flow, audit.  */
/* ------------------------------------------------------------------ */

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.hero-card,
.hero-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 158px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.hero-card {
    border: 1.5px solid var(--brand);
    box-shadow: 0 10px 26px rgba(15, 118, 110, 0.1);
}

.hero-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
    justify-content: space-between;
}

.hero-label {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-approx {
    padding: 3px 10px;
    color: var(--brand-strong);
    background: var(--success-surface);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 750;
    white-space: nowrap;
}

.hero-value {
    font-size: clamp(34px, 5vw, 46px);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.05;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
}

.hero-exact {
    color: var(--muted);
    font-size: 12.5px;
}

.hero-spark {
    margin-top: auto;
    color: var(--brand);
}

.hero-spark .sparkline {
    display: block;
    width: 100%;
    height: 44px;
}

.hero-warning {
    padding: 5px 9px;
    color: var(--amber);
    background: var(--amber-surface);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.hero-side-value {
    font-size: 27px;
    font-weight: 800;
    line-height: 1.1;
}

.insight {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 12px 15px;
    background: var(--success-surface);
    border: 1px solid #cbe6d6;
    border-left: 4px solid var(--brand);
    border-radius: 8px;
}

.insight svg {
    margin-top: 1px;
    color: var(--brand-strong);
}

.insight p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.55;
}

.metric-card .sparkline {
    display: block;
    width: 100%;
    height: 30px;
    margin-top: 8px;
    color: var(--brand);
    opacity: 0.85;
}

.granularity-control {
    display: inline-flex;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.granularity-control button {
    min-height: 36px;
    padding: 6px 13px;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-right: 1px solid var(--line);
    font-size: 12.5px;
    font-weight: 750;
}

.granularity-control button:last-child {
    border-right: 0;
}

.granularity-control button:hover {
    background: var(--surface-muted);
}

.granularity-control button.is-active {
    color: #fff;
    background: var(--brand);
}

.hero-chart-frame {
    height: 330px;
}

.hero-chart-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chart-badge {
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.chart-badge.is-low {
    color: var(--amber);
    background: var(--amber-surface);
}

.chart-badge.is-high {
    color: var(--success);
    background: var(--success-surface);
}

.chart-badge.is-neutral {
    color: var(--muted);
    background: var(--surface-muted);
}

.money-flow-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}

.money-flow-row span:first-child {
    color: var(--ink-soft);
}

.money-flow-row strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.money-flow-row.is-strong strong {
    color: var(--brand-strong);
    font-size: 15px;
}

.money-flow-empty {
    display: grid;
    place-items: center;
    height: 140px;
}

.flow-bar {
    display: flex;
    height: 14px;
    margin: 14px 0 6px;
    overflow: hidden;
    background: var(--surface-muted);
    border-radius: 7px;
}

.flow-ours {
    background: var(--brand);
    border-right: 2px solid var(--surface);
}

.flow-cut {
    background: var(--amber);
}

.flow-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.flow-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 3px;
    vertical-align: -1px;
}

.flow-swatch.is-ours {
    background: var(--brand);
}

.flow-swatch.is-cut {
    background: var(--amber);
}

.money-flow-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.confidence-section {
    margin-top: 18px;
}

.confidence-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    font-size: 12.5px;
}

.confidence-item {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--muted);
}

.confidence-item strong {
    color: var(--ink-soft);
}

.confidence-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    background: var(--muted);
    border-radius: 999px;
}

.confidence-item.is-available .confidence-dot {
    background: var(--success);
}

.confidence-item.is-warning .confidence-dot {
    background: var(--amber);
}

.confidence-item.is-error .confidence-dot {
    background: var(--danger);
}

.audit-details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0 0 10px 10px;
}

.audit-details > summary {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 11px 16px;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    list-style: none;
}

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

.audit-details > summary:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.audit-details .audit-chevron {
    margin-left: auto;
    transition: transform 0.2s ease-out;
}

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

.audit-details .audit-body {
    padding: 6px 16px 18px;
    border-top: 1px solid var(--line);
}

.audit-details .audit-body .currency-summary {
    margin-top: 12px;
}

@media (max-width: 860px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-chart-section .section-heading {
        flex-wrap: wrap;
    }

    .hero-chart-frame {
        height: 260px;
    }
}

button.pipeline-indicator {
    cursor: pointer;
}

button.pipeline-indicator:hover {
    border-color: var(--line-strong);
    filter: brightness(0.97);
}

.source-graphs-intro {
    margin-top: 26px;
}

.confidence-cta {
    margin-left: auto;
    font-size: 12.5px;
}

.hero-basis {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.drivers-source-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

/* The sidebar changes this usable width independently from the viewport. */
@container revenue-filters (max-width: 1500px) {
    .filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .application-field,
    .basis-field,
    .product-filter,
    .filter-actions {
        grid-column: span 2;
    }
}

@container revenue-filters (max-width: 980px) {
    .filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .application-field,
    .basis-field,
    .product-filter,
    .filter-actions {
        grid-column: span 3;
    }
}

@container revenue-filters (max-width: 660px) {
    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .application-field,
    .basis-field,
    .product-filter,
    .filter-actions {
        grid-column: span 2;
    }
}

@container revenue-filters (max-width: 430px) {
    .filters {
        grid-template-columns: 1fr;
    }

    .application-field,
    .basis-field,
    .product-filter,
    .filter-actions {
        grid-column: auto;
    }

    .filter-actions {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ */
/* Clear async feedback, chart context, and final responsive guards.  */
/* ------------------------------------------------------------------ */

html,
body,
.dashboard-page {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.app-header,
.app-layout,
.section-nav,
.dashboard-content,
.filter-bar,
.filters,
.chart-section,
.chart-heading-copy {
    min-width: 0;
    max-width: 100%;
}

.app-brand {
    min-width: 0;
    flex: 1 1 auto;
}

.header-context {
    flex: 0 0 auto;
}

.button-spinner,
.status-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
    animation: spin 720ms linear infinite;
}

.button-spinner {
    display: none;
}

.apply-button.is-loading [data-apply-icon] {
    display: none;
}

.apply-button.is-loading .button-spinner {
    display: inline-block;
}

.apply-button.is-loading svg {
    animation: none;
}

.filter-apply-status {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    color: var(--brand-strong);
    background: #e8f4f1;
    border: 1px solid #c4ded8;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    grid-column: 1 / -1;
}

.filter-apply-status .status-spinner {
    width: 15px;
    height: 15px;
}

.chart-title-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.chart-title-row h2 {
    min-width: 0;
}

.info-popover {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.chart-info-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    color: var(--brand-strong);
    background: transparent;
    border: 0;
    border-radius: 999px;
}

.chart-info-button:hover,
.chart-info-button[aria-expanded="true"] {
    background: #e8f4f1;
}

.chart-info-button svg {
    width: 17px;
    height: 17px;
}

.info-popover-panel {
    position: absolute;
    z-index: 70;
    top: calc(100% + 7px);
    right: auto;
    left: -6px;
    width: min(600px, calc(100vw - 32px));
    max-height: min(420px, 75vh);
    padding: 16px;
    overflow-y: auto;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 13px;
    line-height: 1.65;
    text-align: left;
    transform-origin: top left;
    animation: info-popover-in 140ms ease-out;
}

@keyframes info-popover-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-loading {
    position: absolute;
    inset: 0;
    display: grid;
    min-height: 220px;
    align-content: center;
    gap: 24px;
    padding: 24px clamp(18px, 4vw, 42px);
    color: var(--muted);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.chart-loading::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.66) 48%,
        transparent 66%
    );
    content: "";
    pointer-events: none;
    transform: translateX(-100%);
    animation: chart-shimmer 1.4s ease-in-out infinite;
}

@keyframes chart-shimmer {
    to {
        transform: translateX(100%);
    }
}

.chart-loading-copy {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: left;
}

.chart-loading-copy > span:last-child {
    display: grid;
    gap: 2px;
}

.chart-loading-copy strong {
    color: var(--ink-soft);
    font-size: 13px;
}

.chart-loading-copy small {
    color: var(--muted);
    font-size: 11px;
}

.chart-loading-copy .status-spinner {
    color: var(--brand);
}

.chart-loading-plot {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100px;
    align-items: end;
    justify-content: space-around;
    gap: clamp(8px, 3vw, 26px);
    padding: 0 clamp(4px, 2vw, 18px);
    border-bottom: 1px solid var(--line-strong);
}

.chart-loading-plot span {
    display: block;
    width: min(46px, 9%);
    background: var(--surface-strong);
    border-radius: 4px 4px 0 0;
}

.chart-loading-plot span:nth-child(1),
.chart-loading-plot span:nth-child(5) {
    height: 38%;
}

.chart-loading-plot span:nth-child(2),
.chart-loading-plot span:nth-child(7) {
    height: 62%;
}

.chart-loading-plot span:nth-child(3) {
    height: 48%;
}

.chart-loading-plot span:nth-child(4) {
    height: 82%;
}

.chart-loading-plot span:nth-child(6) {
    height: 72%;
}

.chart-source-status.is-loading {
    color: var(--brand-strong);
    background: #e8f4f1;
    border-color: #c4ded8;
}

.granularity-control {
    display: grid;
    width: max-content;
    max-width: 100%;
    flex: 0 0 auto;
    grid-template-columns: repeat(3, minmax(76px, 1fr));
}

.granularity-control button {
    min-width: 0;
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .info-popover-panel {
        position: fixed;
        z-index: 90;
        top: calc(var(--header-height) + 12px);
        right: 16px;
        left: 16px;
        width: auto;
        max-width: 600px;
        max-height: calc(100vh - var(--header-height) - 24px);
        margin: 0 auto;
        transform-origin: top center;
    }
}

@media (max-width: 720px) {
    .app-header {
        width: 100%;
    }

    .app-brand > span:last-child {
        min-width: 0;
    }

    .section-nav {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        padding: 8px 12px;
        overflow: visible;
    }

    .nav-item {
        width: 100%;
        min-width: 0;
        min-height: 52px;
        justify-content: center;
        gap: 6px;
        padding: 7px 5px;
        font-size: 11px;
        line-height: 1.15;
        text-align: center;
    }

    .nav-item span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .filter-title,
    .period-control {
        width: 100%;
    }

    .period-control {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .period-control button {
        min-width: 0;
        padding-right: 4px;
        padding-left: 4px;
        white-space: nowrap;
    }

    .hero-chart-section .section-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .granularity-control {
        width: 100%;
    }

    .chart-info-button {
        width: 44px;
        height: 44px;
        margin: -6px;
    }

    .info-popover-panel {
        right: 12px;
        left: 12px;
    }

    .chart-loading {
        gap: 18px;
        padding: 20px 14px;
    }

    .chart-loading-plot {
        gap: 9px;
    }
}

@media (max-width: 430px) {
    .app-header {
        padding-right: 10px;
        padding-left: 10px;
    }

    .app-brand {
        gap: 7px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .app-brand small {
        display: none;
    }

    .header-context {
        gap: 6px;
    }

    .admin-avatar {
        width: 32px;
        height: 32px;
    }

    .section-nav {
        padding-right: 10px;
        padding-left: 10px;
    }

    .dashboard-content {
        width: 100%;
        padding-right: 10px;
        padding-left: 10px;
    }

    .chart-title-row {
        align-items: flex-start;
    }

    .chart-loading-copy {
        align-items: flex-start;
    }

    .chart-loading-copy small {
        line-height: 1.4;
    }
}

@media (pointer: coarse), (max-width: 720px) {
    .compact-field input,
    .compact-field select,
    .currency-fixed output,
    .granularity-control button,
    .period-control button,
    .graph-tabs button,
    .filter-actions > .primary-button,
    .filter-actions > .secondary-button {
        min-height: 44px;
    }

    .chart-info-button {
        min-width: 44px;
        min-height: 44px;
    }
}
