/* AI Weekly WhatsApp Digest: scoped retention-card styles only. */
.whatsapp-digest-card {
    isolation: isolate;
    overflow: hidden;
    padding: 24px 20px;
    text-align: left;
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.whatsapp-digest-card::before {
    position: absolute;
    z-index: -1;
    top: -65px;
    right: -55px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.12);
    content: '';
    filter: blur(2px);
    pointer-events: none;
}

.digest-card-topline,
.digest-message-meta {
    display: flex;
    align-items: center;
}

.digest-card-topline {
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.digest-retention-pill,
.digest-plan-pill,
.digest-schedule-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.035em;
}

.digest-retention-pill {
    color: #047857;
}

.digest-plan-pill {
    flex: 0 0 auto;
    padding: 5px 9px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    box-shadow: var(--clay-shadow-in);
}

.digest-plan-pill.is-preview {
    background: rgba(217, 119, 6, 0.12);
    color: #B45309;
}

.digest-title {
    margin: 0 0 9px;
    font-size: 1.3rem;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.digest-title span {
    display: block;
    margin-top: 4px;
    color: var(--btn-teal);
    font-size: 0.78rem;
    letter-spacing: 0;
}

.whatsapp-digest-card .digest-subtitle {
    margin-bottom: 12px;
    font-size: 0.78rem;
    line-height: 1.55;
}

.digest-schedule-pill {
    margin-bottom: 20px;
    padding: 8px 12px;
    background: var(--clay-bg);
    color: var(--btn-teal);
    box-shadow: var(--clay-shadow-in);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.digest-field-group {
    margin-bottom: 16px;
}

.digest-field-label {
    display: block;
    margin: 0 0 7px 4px;
    color: var(--text-main);
    font-size: 0.74rem;
    font-weight: 800;
}

.whatsapp-digest-card .digest-input-wrapper {
    padding-left: 15px;
    border-radius: 18px;
}

.whatsapp-digest-card .digest-phone-input {
    padding: 14px 12px;
    direction: ltr;
    font-size: 0.9rem;
    text-align: left;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.digest-field-hint {
    display: block;
    margin: 6px 4px 0;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.4;
}

.digest-input-wrapper.has-error,
.digest-consent-row.has-error {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12), var(--clay-shadow-in);
}

.digest-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 50px;
    border: 2px solid transparent;
    border-radius: 18px;
    background: var(--clay-bg);
    box-shadow: var(--clay-shadow-in);
    transition: 0.2s ease;
}

.digest-select-wrapper:focus-within {
    border-color: var(--neon-cyan);
    box-shadow: var(--input-focus-glow);
}

.digest-select-wrapper > i:first-child {
    margin-left: 15px;
    color: var(--btn-teal);
    font-size: 1.2rem;
}

.digest-language-select {
    width: 100%;
    min-width: 0;
    padding: 13px 36px 13px 10px;
    appearance: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.35;
}

.digest-language-select option,
.digest-language-select optgroup {
    background: var(--clay-bg);
    color: var(--text-main);
}

.digest-select-arrow {
    position: absolute;
    right: 12px;
    color: var(--btn-teal);
    pointer-events: none;
}

.digest-preview {
    overflow: hidden;
    margin: 4px 0 16px;
    border: 1px solid rgba(15, 76, 76, 0.14);
    border-radius: 20px;
    box-shadow: 6px 6px 15px rgba(15, 76, 76, 0.12);
}

.digest-preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #075E54;
    color: #FFF;
}

.digest-preview-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 50%;
    background: #25D366;
    color: #075E54;
    font-size: 1.05rem;
}

.digest-preview-header strong,
.digest-preview-header span {
    display: block;
}

.digest-preview-header strong {
    font-size: 0.76rem;
}

.digest-preview-header span {
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.58rem;
    font-weight: 600;
}

.digest-chat-canvas {
    padding: 14px 11px;
    background-color: #E5DDD5;
    background-image: radial-gradient(rgba(7, 94, 84, 0.07) 1px, transparent 1px);
    background-size: 17px 17px;
}

.digest-message-bubble {
    position: relative;
    max-width: 96%;
    margin-left: auto;
    padding: 11px 11px 7px;
    border-radius: 12px 2px 12px 12px;
    background: #DCF8C6;
    color: #17221D;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    direction: ltr;
    text-align: left;
}

.digest-message-bubble::after {
    position: absolute;
    top: 0;
    right: -7px;
    border-width: 0 0 9px 8px;
    border-style: solid;
    border-color: transparent transparent #DCF8C6 transparent;
    content: '';
}

.digest-preview-copy {
    font-size: 0.67rem;
    font-weight: 550;
    line-height: 1.47;
}

.digest-preview-title {
    margin-bottom: 7px;
    font-size: 0.7rem;
}

.digest-preview-line {
    margin-top: 6px;
    unicode-bidi: plaintext;
}

.digest-preview-line strong {
    font-weight: 850;
}

.digest-preview-token {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    unicode-bidi: isolate;
}

.digest-message-meta {
    justify-content: flex-end;
    gap: 3px;
    min-height: 11px;
    margin-top: 3px;
    color: #66756D;
    direction: ltr;
    font-size: 0.54rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.digest-read-checks {
    color: #34B7F1;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: -0.18em;
}

.digest-message-bubble.is-rtl,
.digest-message-bubble[dir='rtl'] {
    margin-right: auto;
    margin-left: 0;
    border-radius: 2px 12px 12px 12px;
    direction: rtl;
    text-align: right;
}

.digest-message-bubble.is-rtl::after,
.digest-message-bubble[dir='rtl']::after {
    right: auto;
    left: -7px;
    transform: scaleX(-1);
}

.digest-message-bubble.is-rtl .digest-preview-line,
.digest-message-bubble[dir='rtl'] .digest-preview-line {
    direction: rtl;
    text-align: right;
}

.digest-message-bubble.is-rtl .digest-message-meta,
.digest-message-bubble[dir='rtl'] .digest-message-meta {
    justify-content: flex-start;
}

.digest-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 13px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--clay-bg);
    color: var(--text-main);
    box-shadow: var(--clay-shadow-in);
    cursor: pointer;
    font-size: 0.67rem;
    font-weight: 650;
    line-height: 1.45;
}

.digest-consent-row input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin-top: 1px;
    accent-color: #25D366;
}

.whatsapp-digest-card .digest-roi-badge {
    margin-bottom: 10px;
    font-size: 0.68rem;
}

.whatsapp-digest-card .digest-activate-button {
    min-height: 52px;
    margin-bottom: 8px;
    padding: 13px 14px;
    border-radius: 18px;
    font-size: 0.76rem;
    line-height: 1.35;
}

.whatsapp-digest-card .digest-activate-button.is-locked {
    background: var(--gold-gradient);
    color: #5A3506;
    box-shadow: 0 8px 18px rgba(201, 154, 60, 0.28);
}

.whatsapp-digest-card .digest-activate-button.is-active {
    background: #128C7E;
    box-shadow: 0 8px 20px rgba(18, 140, 126, 0.3), 0 0 0 2px rgba(37, 211, 102, 0.16);
}

.digest-action-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 650;
    line-height: 1.4;
    text-align: center;
}

body.dark-mode .digest-retention-pill,
body.dark-mode .digest-plan-pill {
    color: #6EE7B7;
}

body.dark-mode .digest-plan-pill.is-preview {
    color: #FCD34D;
}

body.dark-mode .digest-chat-canvas {
    background-color: #0D2B26;
    background-image: radial-gradient(rgba(110, 231, 183, 0.08) 1px, transparent 1px);
}

body.dark-mode .digest-message-bubble {
    background: #075E54;
    color: #F0FFF9;
}

body.dark-mode .digest-message-bubble::after {
    border-bottom-color: #075E54;
}

body.dark-mode .digest-message-meta {
    color: #B7D7CE;
}

@media (max-width: 380px) {
    .whatsapp-digest-card {
        padding: 20px 14px;
    }

    .digest-retention-pill {
        font-size: 0.55rem;
    }

    .digest-plan-pill {
        padding: 4px 7px;
        font-size: 0.55rem;
    }

    .digest-title {
        font-size: 1.15rem;
    }

    .digest-language-select {
        font-size: 0.67rem;
    }

    .digest-preview-copy {
        font-size: 0.63rem;
    }
}

/* Phase 3: decision-first dashboard composition. Existing clay tokens remain authoritative. */
body.spp-private-route .app-shell-content > #demo-screen {
    width: min(100%, 1400px);
    max-width: 1400px;
}

#demo-screen > :not(.phase3-dashboard) {
    display: none !important;
}

.phase3-dashboard {
    width: 100%;
    min-width: 0;
}

.dashboard-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
    animation: dashboardEnter 0.32s ease both;
}

.dashboard-page-heading {
    min-width: 0;
}

.dashboard-eyebrow,
.dashboard-section-kicker {
    display: block;
    color: var(--btn-teal);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.dashboard-page-heading h1 {
    margin: 3px 0 5px;
    color: var(--text-main);
    font-size: clamp(1.55rem, 2.6vw, 2.2rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.12;
}

.dashboard-page-heading > p {
    max-width: 680px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.55;
}

.dashboard-freshness {
    display: flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    max-width: 100%;
    margin-top: 11px;
    padding: 6px 10px;
    color: var(--text-muted);
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.16);
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
}

.dashboard-freshness i {
    flex: 0 0 auto;
    color: var(--btn-teal);
}

.dashboard-header-actions,
.dashboard-empty-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.dashboard-header-actions button,
.dashboard-empty-actions button {
    width: auto;
    min-height: 44px;
    margin: 0;
    white-space: nowrap;
}

.dashboard-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    font-size: 0.78rem;
}

.dashboard-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 0.75rem;
}

.dashboard-empty-state {
    display: grid;
    grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr);
    align-items: center;
    gap: 34px;
    width: min(100%, 940px);
    margin: 32px auto 0;
    padding: 34px;
    text-align: left;
    border-color: rgba(77, 238, 234, 0.2);
    animation: dashboardEnter 0.34s ease both;
}

.dashboard-empty-state[hidden],
.dashboard-decision-grid[hidden],
.dashboard-partial-state[hidden],
.dashboard-unavailable-state[hidden] {
    display: none !important;
}

.dashboard-empty-icon {
    display: grid;
    width: 132px;
    height: 132px;
    place-items: center;
    justify-self: center;
    color: var(--btn-teal);
    background: var(--clay-bg);
    border: 1px solid rgba(77, 238, 234, 0.2);
    border-radius: 38px;
    box-shadow: var(--clay-shadow-out), 0 0 30px rgba(77, 238, 234, 0.12);
}

.dashboard-empty-icon i {
    font-size: 3.4rem;
    filter: drop-shadow(0 7px 12px rgba(13, 148, 136, 0.2));
}

.dashboard-empty-copy h2 {
    margin: 10px 0 6px;
    color: var(--text-main);
    font-size: 1.45rem;
}

.dashboard-empty-copy > p {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.dashboard-setup-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.dashboard-setup-steps li {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 750;
}

.dashboard-setup-steps li > span {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    place-items: center;
    color: var(--btn-teal);
    background: var(--clay-bg);
    border-radius: 9px;
    box-shadow: var(--clay-shadow-in);
    font-size: 0.65rem;
    font-weight: 900;
}

.dashboard-partial-state {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    margin-bottom: 18px;
    padding: 13px 16px;
    color: var(--text-main);
    background: rgba(217, 119, 6, 0.09);
    border: 1px solid rgba(217, 119, 6, 0.28);
    border-radius: 18px;
}

.dashboard-partial-state > i {
    color: #D97706;
    font-size: 1.3rem;
}

.dashboard-partial-state > div {
    display: grid;
    gap: 2px;
}

.dashboard-partial-state strong {
    font-size: 0.77rem;
}

.dashboard-partial-state span {
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 650;
}

.dashboard-text-action,
.dashboard-card-action {
    min-height: 44px;
    padding: 0;
    color: var(--btn-teal);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.dashboard-text-action:hover,
.dashboard-card-action:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dashboard-decision-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 22px;
    width: 100%;
    min-width: 0;
}

.dashboard-span-12 { grid-column: span 12; }
.dashboard-span-8 { grid-column: span 8; }
.dashboard-span-7 { grid-column: span 7; }
.dashboard-span-5 { grid-column: span 5; }
.dashboard-span-4 { grid-column: span 4; }
.dashboard-span-2 { grid-column: span 2; }

.dashboard-card {
    position: relative;
    min-width: 0;
    min-height: 170px;
    margin: 0;
    padding: 22px;
    overflow: visible;
    text-align: left;
    animation: dashboardEnter 0.34s ease both;
}

.dashboard-card:nth-child(n+8) {
    animation-delay: 0.06s;
}

.dashboard-card:nth-child(n+10) {
    animation-delay: 0.1s;
}

.dashboard-card-content {
    height: 100%;
    min-width: 0;
}

.dashboard-card.is-loading {
    min-height: 210px;
    overflow: hidden;
}

.dashboard-card.is-loading .dashboard-card-content {
    visibility: hidden;
}

.dashboard-card.is-loading::after {
    position: absolute;
    inset: 22px;
    content: "";
    border-radius: 15px;
    background: linear-gradient(100deg, rgba(122, 140, 140, 0.08) 20%, rgba(255, 255, 255, 0.2) 42%, rgba(122, 140, 140, 0.08) 64%);
    background-size: 220% 100%;
    box-shadow: var(--clay-shadow-in);
    animation: dashboardSkeleton 1.25s ease-in-out infinite;
}

.dashboard-card.is-error .dashboard-card-content {
    display: none;
}

.dashboard-component-error {
    display: grid;
    min-height: 140px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 18px;
    text-align: center;
}

.dashboard-component-error i {
    color: #EF4444;
    font-size: 1.6rem;
}

.dashboard-component-error strong {
    font-size: 0.86rem;
}

.dashboard-component-error span {
    max-width: 320px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 650;
}

.dashboard-reconciliation {
    min-height: 0;
    border-color: rgba(13, 148, 136, 0.23);
}

.dashboard-card-heading,
.dashboard-kpi-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-card-heading h2,
.dashboard-kpi-header h2 {
    margin: 3px 0 0;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.25;
}

.dashboard-heading-inline {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dashboard-heading-inline .financial-tooltip-trigger {
    margin: 0;
}

.dashboard-kpi-header h2 {
    margin: 0;
    font-size: 0.72rem;
}

.dashboard-card-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    color: var(--btn-teal);
    background: var(--clay-bg);
    border-radius: 14px;
    box-shadow: var(--clay-shadow-in);
    font-size: 1.18rem;
}

.dashboard-card-icon.is-amber {
    color: #D97706;
}

.dashboard-status-pill,
.dashboard-sku-status,
.dashboard-issue-severity {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 5px 8px;
    color: var(--btn-teal);
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-status-pill.is-warning,
.dashboard-sku-status.is-warning,
.dashboard-issue-severity.is-warning {
    color: #B45309;
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.24);
}

.dashboard-status-pill.is-critical,
.dashboard-sku-status.is-critical,
.dashboard-issue-severity.is-critical {
    color: #DC2626;
    background: rgba(239, 68, 68, 0.09);
    border-color: rgba(239, 68, 68, 0.2);
}

.dashboard-status-pill.is-neutral {
    color: var(--text-muted);
    background: rgba(122, 140, 140, 0.09);
    border-color: rgba(122, 140, 140, 0.18);
}

.dashboard-card-lead {
    margin: 13px 0;
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.5;
}

.dashboard-reconciliation-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.dashboard-reconciliation-facts > div {
    min-width: 0;
    padding: 10px 12px;
    background: var(--clay-bg);
    border-radius: 13px;
    box-shadow: var(--clay-shadow-in);
}

.dashboard-reconciliation-facts dt {
    color: var(--text-muted);
    font-size: 0.55rem;
    font-weight: 850;
    text-transform: uppercase;
}

.dashboard-reconciliation-facts dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-size: 0.73rem;
    font-weight: 850;
}

.dashboard-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
}

.dashboard-card-footer > span {
    color: var(--text-muted);
    font-size: 0.58rem;
    font-weight: 650;
    text-align: right;
}

.dashboard-kpi {
    display: flex;
    min-height: 192px;
    padding: 18px 16px;
    border-color: rgba(122, 140, 140, 0.14);
}

.dashboard-kpi .dashboard-card-content {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.dashboard-kpi-value {
    width: 100%;
    margin: 16px 0 4px;
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-size: clamp(1.1rem, 1.55vw, 1.46rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.dashboard-kpi-profit {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: var(--clay-shadow-out), var(--card-rim-light), 0 0 25px rgba(16, 185, 129, 0.09);
}

.dashboard-kpi-profit .dashboard-kpi-value {
    color: #10B981;
}

.dashboard-kpi-comparison,
.dashboard-kpi-context,
.dashboard-chart-summary {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.59rem;
    font-weight: 700;
    line-height: 1.4;
}

.dashboard-kpi-context {
    margin-top: 3px;
}

.dashboard-kpi .dashboard-card-action {
    margin-top: auto;
    padding-top: 9px;
}

.financial-tooltip-trigger {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    margin: -6px -6px 0 0;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: help;
}

.financial-tooltip {
    position: absolute;
    z-index: 30;
    top: 34px;
    right: 0;
    width: min(260px, calc(100vw - 36px));
    padding: 10px 12px;
    color: var(--text-main);
    background: var(--clay-bg);
    border: 1px solid rgba(13, 148, 136, 0.25);
    border-radius: 13px;
    box-shadow: var(--clay-shadow-out);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    font-size: 0.65rem;
    font-weight: 650;
    line-height: 1.45;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.financial-tooltip-trigger:hover + .financial-tooltip,
.financial-tooltip-trigger:focus-visible + .financial-tooltip,
.financial-tooltip-trigger[aria-expanded="true"] + .financial-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.dashboard-insight-list,
.dashboard-alert-list {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.dashboard-insight-item,
.dashboard-alert-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 11px 12px;
    background: var(--clay-bg);
    border: 1px solid rgba(122, 140, 140, 0.12);
    border-radius: 15px;
    box-shadow: var(--clay-shadow-in);
}

.dashboard-insight-copy,
.dashboard-alert-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.dashboard-insight-copy strong,
.dashboard-alert-copy strong {
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-size: 0.71rem;
}

.dashboard-insight-copy span,
.dashboard-alert-copy span {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 650;
    line-height: 1.45;
}

.dashboard-insight-copy .dashboard-impact {
    color: #DC2626;
    font-weight: 900;
}

.dashboard-insight-empty,
.dashboard-alert-empty {
    display: grid;
    place-items: center;
    gap: 5px;
    min-height: 130px;
    padding: 20px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.69rem;
    font-weight: 700;
}

.dashboard-insight-empty i,
.dashboard-alert-empty i {
    color: var(--btn-teal);
    font-size: 1.45rem;
}

.dashboard-chart-heading {
    align-items: center;
}

.dashboard-chart-summary {
    margin-top: 7px;
}

.dashboard-waterfall-visual {
    display: grid;
    gap: 8px;
    margin-top: 15px;
}

.dashboard-waterfall-row {
    display: grid;
    grid-template-columns: minmax(112px, 0.72fr) minmax(100px, 1fr) minmax(86px, auto);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dashboard-waterfall-label,
.dashboard-waterfall-value {
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-size: 0.65rem;
    font-weight: 800;
}

.dashboard-waterfall-value {
    text-align: right;
}

.dashboard-waterfall-track {
    height: 10px;
    overflow: hidden;
    background: var(--clay-bg);
    border-radius: 999px;
    box-shadow: var(--clay-shadow-in);
}

.dashboard-waterfall-bar {
    display: block;
    width: var(--bar-width, 0%);
    min-width: 3px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--btn-teal), var(--neon-cyan));
    transform-origin: left;
    animation: dashboardBarDraw 0.32s ease both;
}

.dashboard-waterfall-row.is-cost .dashboard-waterfall-bar {
    background: linear-gradient(90deg, #D97706, #EF4444);
}

.dashboard-waterfall-row.is-profit .dashboard-waterfall-bar {
    background: linear-gradient(90deg, #059669, #22E1A1);
}

.dashboard-chart-alternative {
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 750;
}

.dashboard-chart-alternative summary {
    min-height: 44px;
    padding: 12px 0;
    color: var(--btn-teal);
    cursor: pointer;
}

.dashboard-chart-alternative table,
.dashboard-sku-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
    font-size: 0.65rem;
}

.dashboard-chart-alternative th,
.dashboard-chart-alternative td,
.dashboard-sku-table th,
.dashboard-sku-table td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(122, 140, 140, 0.15);
    text-align: left;
}

.dashboard-chart-alternative th:last-child,
.dashboard-chart-alternative td:last-child,
.dashboard-sku-table th:nth-child(n+2),
.dashboard-sku-table td:nth-child(n+2) {
    text-align: right;
}

.dashboard-inline-control {
    display: grid;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.5rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-inline-control select {
    min-width: 150px;
    min-height: 40px;
    padding: 7px 28px 7px 10px;
    color: var(--text-main);
    background: var(--clay-bg);
    border: 1px solid rgba(122, 140, 140, 0.16);
    border-radius: 12px;
    box-shadow: var(--clay-shadow-in);
    font: inherit;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: none;
}

.dashboard-unavailable-state {
    display: grid;
    min-height: 210px;
    place-items: center;
    align-content: center;
    gap: 7px;
    margin-top: 14px;
    padding: 22px;
    color: var(--text-muted);
    background: var(--clay-bg);
    border-radius: 18px;
    box-shadow: var(--clay-shadow-in);
    text-align: center;
}

.dashboard-unavailable-state i {
    color: var(--btn-teal);
    font-size: 1.7rem;
}

.dashboard-unavailable-state strong {
    color: var(--text-main);
    font-size: 0.8rem;
}

.dashboard-unavailable-state span {
    max-width: 360px;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.5;
}

.dashboard-table-region {
    width: 100%;
    margin-top: 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border-radius: 14px;
}

.dashboard-sku-table {
    min-width: 620px;
}

.dashboard-sku-table th {
    color: var(--text-muted);
    font-size: 0.56rem;
    text-transform: uppercase;
}

.dashboard-sku-table td:first-child {
    max-width: 220px;
    overflow-wrap: anywhere;
    font-weight: 850;
}

.dashboard-mobile-sku-list {
    display: none;
}

.dashboard-alert-item {
    grid-template-columns: 34px minmax(0, 1fr);
}

.dashboard-alert-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--btn-teal);
    background: var(--clay-bg);
    border-radius: 11px;
    box-shadow: var(--clay-shadow-out);
}

.dashboard-alert-copy small {
    color: var(--text-muted);
    font-size: 0.55rem;
    font-weight: 800;
}

.dashboard-alerts-all {
    margin-top: 10px;
}

@keyframes dashboardEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dashboardBarDraw {
    from { transform: scaleX(0.2); opacity: 0.4; }
    to { transform: scaleX(1); opacity: 1; }
}

@keyframes dashboardSkeleton {
    to { background-position: -120% 0; }
}

@media (max-width: 1279px) {
    .dashboard-decision-grid {
        gap: 18px;
    }

    .dashboard-span-2 {
        grid-column: span 4;
    }

    .dashboard-card {
        padding: 20px;
    }

    .dashboard-kpi {
        min-height: 180px;
    }
}

@media (max-width: 1100px) {
    .dashboard-attention,
    .dashboard-waterfall,
    .dashboard-trend,
    .dashboard-drivers,
    .dashboard-sku,
    .dashboard-alerts {
        grid-column: span 12;
    }
}

@media (max-width: 900px) {
    .dashboard-page-header {
        flex-direction: column;
        gap: 16px;
    }

    .dashboard-header-actions {
        width: 100%;
    }

    .dashboard-header-actions button {
        flex: 1 1 0;
    }

    .dashboard-span-2 {
        grid-column: span 6;
    }

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

@media (max-width: 768px) {
    .dashboard-page-header {
        margin-bottom: 16px;
    }

    .dashboard-page-heading h1 {
        font-size: clamp(1.35rem, 7vw, 1.75rem);
    }

    .dashboard-page-heading > p {
        font-size: 0.75rem;
    }

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

    .dashboard-header-actions button {
        width: 100%;
        white-space: normal;
    }

    .dashboard-empty-state {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 18px;
        padding: 22px 16px;
        text-align: center;
    }

    .dashboard-empty-icon {
        width: 92px;
        height: 92px;
        border-radius: 28px;
    }

    .dashboard-empty-icon i {
        font-size: 2.5rem;
    }

    .dashboard-empty-copy h2 {
        font-size: 1.2rem;
    }

    .dashboard-setup-steps {
        grid-template-columns: 1fr;
        text-align: left;
    }

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

    .dashboard-empty-actions button {
        width: 100%;
    }

    .dashboard-partial-state {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 12px;
    }

    .dashboard-partial-state .dashboard-text-action {
        grid-column: 2;
    }

    .dashboard-decision-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .dashboard-card {
        grid-column: span 2;
        padding: 16px;
    }

    .dashboard-reconciliation { order: 1; }
    .dashboard-kpi-profit { order: 2; }
    .dashboard-attention { order: 3; }
    .dashboard-kpi-gross,
    .dashboard-kpi-payout,
    .dashboard-kpi-margin,
    .dashboard-kpi-ads,
    .dashboard-kpi-refunds { order: 4; }
    .dashboard-waterfall { order: 5; }
    .dashboard-trend { order: 6; }
    .dashboard-sku { order: 7; }
    .dashboard-alerts { order: 8; }

    .dashboard-kpi-gross,
    .dashboard-kpi-payout,
    .dashboard-kpi-margin,
    .dashboard-kpi-ads,
    .dashboard-kpi-refunds {
        grid-column: span 1;
        min-height: 184px;
        padding: 15px 13px;
    }

    .dashboard-kpi-profit {
        min-height: 205px;
        padding: 20px 17px;
    }

    .dashboard-kpi-profit .dashboard-kpi-value {
        font-size: clamp(1.65rem, 9vw, 2.3rem);
    }

    .financial-tooltip {
        position: fixed;
        z-index: 1100;
        top: calc(138px + env(safe-area-inset-top));
        right: 12px;
        left: 12px;
        width: auto;
    }

    .dashboard-kpi-value {
        font-size: clamp(1rem, 5.2vw, 1.3rem);
    }

    .dashboard-drivers {
        display: none;
    }

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

    .dashboard-card-footer,
    .dashboard-chart-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-card-footer > span {
        text-align: left;
    }

    .dashboard-inline-control,
    .dashboard-inline-control select {
        width: 100%;
    }

    .dashboard-waterfall-row {
        grid-template-columns: minmax(105px, 0.8fr) minmax(80px, 1fr);
        gap: 7px;
    }

    .dashboard-waterfall-value {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: left;
    }

    .dashboard-table-region {
        display: none;
    }

    .dashboard-mobile-sku-list {
        display: grid;
        gap: 11px;
        margin-top: 14px;
    }

    .dashboard-mobile-sku-card {
        display: grid;
        gap: 10px;
        padding: 14px;
        background: var(--clay-bg);
        border: 1px solid rgba(122, 140, 140, 0.13);
        border-radius: 17px;
        box-shadow: var(--clay-shadow-in);
    }

    .dashboard-mobile-sku-head,
    .dashboard-mobile-sku-metrics {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .dashboard-mobile-sku-head strong {
        min-width: 0;
        overflow-wrap: anywhere;
        font-size: 0.76rem;
    }

    .dashboard-mobile-sku-metrics > div {
        display: grid;
        gap: 2px;
    }

    .dashboard-mobile-sku-metrics span {
        color: var(--text-muted);
        font-size: 0.54rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .dashboard-mobile-sku-metrics strong {
        overflow-wrap: anywhere;
        font-size: 0.78rem;
    }

    .dashboard-mobile-sku-card details {
        color: var(--text-muted);
        font-size: 0.62rem;
        font-weight: 700;
    }

    .dashboard-mobile-sku-card summary {
        min-height: 44px;
        padding: 12px 0;
        color: var(--btn-teal);
        cursor: pointer;
    }
}

@media (min-width: 431px) and (max-width: 768px) {
    .dashboard-reconciliation,
    .dashboard-kpi-profit,
    .dashboard-attention,
    .dashboard-kpi-gross,
    .dashboard-kpi-payout,
    .dashboard-kpi-margin,
    .dashboard-kpi-ads,
    .dashboard-kpi-refunds,
    .dashboard-waterfall,
    .dashboard-trend,
    .dashboard-sku,
    .dashboard-alerts {
        order: initial;
    }

    .dashboard-kpi-profit {
        grid-column: span 1;
        min-height: 184px;
        padding: 15px 13px;
    }

    .dashboard-kpi-profit .dashboard-kpi-value {
        font-size: clamp(1rem, 5.2vw, 1.3rem);
    }

    .dashboard-drivers {
        display: block;
    }

    .dashboard-table-region {
        display: block;
    }

    .dashboard-mobile-sku-list {
        display: none;
    }
}

@media (max-width: 380px) {
    .dashboard-decision-grid {
        gap: 12px;
    }

    .dashboard-card {
        padding: 14px;
    }

    .dashboard-kpi-gross,
    .dashboard-kpi-payout,
    .dashboard-kpi-margin,
    .dashboard-kpi-ads,
    .dashboard-kpi-refunds {
        min-height: 176px;
        padding: 14px 11px;
    }

    .dashboard-kpi-header h2 {
        font-size: 0.66rem;
    }

    .dashboard-kpi-value {
        font-size: clamp(0.94rem, 5vw, 1.15rem);
    }

    .dashboard-freshness {
        width: 100%;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-page-header,
    .dashboard-empty-state,
    .dashboard-card,
    .dashboard-waterfall-bar,
    .dashboard-card.is-loading::after,
    .financial-tooltip {
        animation: none !important;
        transform: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================================================== */
/* Phase 7: WCAG 2.2 AA and release-readiness corrections                    */
/* ========================================================================== */

:root {
    --spp-focus-ring: #0F4C4C;
    --spp-focus-halo: rgba(15, 76, 76, 0.22);
}

body:not(.dark-mode) {
    --text-muted: #536B6B;
}

body.dark-mode {
    --spp-focus-ring: #4DEEEA;
    --spp-focus-halo: rgba(77, 238, 234, 0.24);
}

:where(a, button, input, select, textarea, summary, [role="button"], [role="tab"], [role="radio"], [tabindex]):focus-visible {
    outline: 3px solid var(--spp-focus-ring) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px var(--spp-focus-halo) !important;
}

:where(h1, h2, h3, [role="heading"])[tabindex="-1"] {
    scroll-margin-block-start: 180px;
}

[role="button"],
[role="tab"],
[role="radio"] {
    cursor: pointer;
}

.toast-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: -8px -8px -8px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: inherit;
    background: transparent;
    box-shadow: none;
}

.custom-toast {
    max-height: min(70dvh, 360px);
    overflow: visible;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: #B91C1C !important;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.2) !important;
}

body:not(.dark-mode) [style*="color: #D97706"],
body:not(.dark-mode) [style*="color:#D97706"] {
    color: #994B00 !important;
}

body:not(.dark-mode) [style*="background: #D97706"],
body:not(.dark-mode) [style*="background:#D97706"] {
    background: #914700 !important;
}

body:not(.dark-mode) [style*="background: #3B82F6"],
body:not(.dark-mode) [style*="background:#3B82F6"] {
    background: #1D4ED8 !important;
}

.menu-overlay > .clay-card,
.menu-overlay > .auth-container,
.phase5-filter-sheet,
.notification-panel,
.actions-sheet,
.more-drawer,
.landing-mobile-drawer {
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.screen,
.clay-card,
.result-card,
.dashboard-card,
.phase5-mobile-card,
.phase5-chart-shell,
.phase5-table-region {
    min-width: 0;
}

.screen :where(p, li, dd, dt, h1, h2, h3, h4, button, a, label, strong, span),
.phase4-landing :where(p, li, dd, dt, h1, h2, h3, h4, button, a, label, strong, span) {
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    :where(button, [role="button"], [role="tab"], [role="radio"], summary, select, input:not([type="hidden"]), textarea) {
        min-height: 44px;
    }

    :where(.mobile-bottom-nav a, .drawer-link, .actions-sheet-grid a, .profile-menu a, .notification-item, .landing-mobile-drawer a, .landing-mobile-drawer button, .nav-pill-scroll, .date-pill) {
        min-height: 44px;
    }

    input:not(#otp-input),
    select,
    textarea {
        font-size: 16px !important;
    }

    #otp-input {
        font-size: 1.3rem !important;
        letter-spacing: 0.42em !important;
    }

    .menu-overlay > .clay-card,
    .menu-overlay > .auth-container {
        max-height: calc(100dvh - 24px);
        margin-block: 12px;
        overflow-y: auto;
    }

    .custom-toast {
        width: calc(100% - 24px);
        max-width: none;
        padding-inline: 14px;
    }
}

@media (forced-colors: active) {
    :where(a, button, input, select, textarea, summary, [role="button"], [role="tab"], [role="radio"]):focus-visible {
        outline: 3px solid CanvasText !important;
    }

    .badge,
    .dashboard-status-pill,
    .phase5-status-badge {
        border: 1px solid CanvasText !important;
    }
}

/* Phase 5: shared responsive presentation for authenticated core modules. */
body.spp-phase5-module {
    overflow-x: clip;
}

body.spp-phase5-module .app-shell-content,
body.spp-phase5-module .phase5-core-screen,
.phase5-core-screen :where(*) {
    min-width: 0;
}

body.spp-phase5-module .phase5-core-screen {
    overflow: visible;
}

.phase5-core-screen .header-with-menu,
.phase5-core-screen .demo-header-container {
    gap: 16px;
    min-height: 52px;
}

.phase5-core-screen .header-with-menu h1,
.phase5-core-screen .header-with-menu h2,
.phase5-core-screen .demo-header-container h1,
.phase5-core-screen .demo-header-container h2,
.phase5-core-screen .section-header h2,
.phase5-core-screen .section-header h3 {
    min-width: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.phase5-core-screen button,
.phase5-core-screen [role="button"],
.phase5-core-screen a,
.phase5-core-screen select,
.phase5-core-screen input[type="checkbox"],
.phase5-core-screen input[type="radio"],
.phase5-core-screen .date-pill,
.phase5-core-screen .nav-pill-scroll,
.phase5-core-screen .clay-action-btn {
    touch-action: manipulation;
}

.phase5-core-screen button:focus-visible,
.phase5-core-screen [role="button"]:focus-visible,
.phase5-core-screen a:focus-visible,
.phase5-core-screen input:focus-visible,
.phase5-core-screen select:focus-visible,
.phase5-core-screen textarea:focus-visible,
.phase5-filter-sheet button:focus-visible,
.phase5-filter-sheet input:focus-visible,
.phase5-filter-sheet select:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--neon-cyan) 75%, #fff);
    outline-offset: 3px;
}

.top-nav-menu-scroll[role="tablist"] {
    position: relative;
    scroll-padding-inline: 12px;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.top-nav-menu-scroll[role="tablist"]::after {
    content: "Scroll for more →";
    position: sticky;
    right: 0;
    flex: 0 0 auto;
    align-self: center;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--clay-bg) 94%, transparent);
    box-shadow: var(--clay-shadow-in);
    font-size: 0.62rem;
    font-weight: 800;
    pointer-events: none;
}

.nav-pill-scroll[role="tab"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    cursor: pointer;
    user-select: none;
}

.nav-pill-scroll[role="tab"][aria-selected="true"] {
    border-color: var(--neon-cyan);
}

.phase5-mobile-filter-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
}

.phase5-filter-chips {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 7px;
    overflow-x: auto;
    padding: 3px 1px 7px;
    scrollbar-width: none;
}

.phase5-filter-chips::-webkit-scrollbar {
    display: none;
}

.phase5-filter-chip {
    flex: 0 0 auto;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 8px 11px;
    border-radius: 999px;
    background: var(--clay-bg);
    box-shadow: var(--clay-shadow-in);
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 800;
}

.phase5-filter-open {
    flex: 0 0 auto;
    min-width: 96px;
    min-height: 44px;
    margin: 0;
    padding: 8px 13px;
    border: 1px solid color-mix(in srgb, var(--neon-cyan) 36%, transparent);
    border-radius: 14px;
    background: var(--clay-bg);
    color: var(--btn-teal);
    box-shadow: var(--clay-shadow-out);
    font: inherit;
    font-size: 0.73rem;
    font-weight: 900;
    cursor: pointer;
}

.phase5-filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    margin-inline-start: 4px;
    padding-inline: 5px;
    border-radius: 999px;
    background: var(--btn-teal);
    color: #fff;
    font-size: 0.62rem;
}

.phase5-filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    align-items: end;
    background: rgba(7, 13, 24, 0.68);
    backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.phase5-filter-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.phase5-filter-sheet {
    width: 100%;
    max-height: min(82dvh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-main);
    background: var(--bg-body);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -18px 55px rgba(4, 10, 20, 0.3);
    transform: translateY(105%);
    transition: transform 0.22s ease;
}

.phase5-filter-overlay.is-open .phase5-filter-sheet {
    transform: translateY(0);
}

.phase5-filter-sheet-header,
.phase5-filter-sheet-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: color-mix(in srgb, var(--bg-body) 94%, transparent);
    backdrop-filter: blur(14px);
}

.phase5-filter-sheet-header {
    border-bottom: 1px solid rgba(122, 140, 140, 0.18);
}

.phase5-filter-sheet-header h2 {
    margin: 0;
    font-size: 1.08rem;
}

.phase5-filter-sheet-header button,
.phase5-filter-sheet-footer button {
    min-width: 44px;
    min-height: 44px;
    margin: 0;
}

.phase5-filter-close {
    width: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--text-main);
    background: var(--clay-bg);
    box-shadow: var(--clay-shadow-out);
    font-size: 1.25rem;
}

.phase5-filter-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px;
}

.phase5-filter-field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.phase5-filter-field > span,
.phase5-filter-field legend {
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 900;
}

.phase5-filter-field input,
.phase5-filter-field select {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--text-main);
    background: var(--clay-bg);
    border: 1px solid rgba(122, 140, 140, 0.24);
    border-radius: 14px;
    box-shadow: var(--clay-shadow-in);
    font: inherit;
    font-size: 1rem;
}

.phase5-filter-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 0;
    margin: 0;
    padding: 0;
}

.phase5-filter-presets label {
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 13px;
    color: var(--text-main);
    background: var(--clay-bg);
    box-shadow: var(--clay-shadow-out);
    font-size: 0.7rem;
    font-weight: 800;
}

.phase5-filter-sheet-footer {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(122, 140, 140, 0.18);
}

.phase5-filter-reset {
    flex: 0 0 auto;
    color: var(--btn-teal);
    background: transparent;
    border: 0;
    box-shadow: none;
}

.phase5-filter-apply {
    flex: 1;
    color: #fff;
    background: var(--btn-teal);
    border: 0;
    border-radius: 15px;
    box-shadow: var(--btn-glow);
}

body.phase5-overlay-open {
    overflow: hidden !important;
    touch-action: none;
}

.phase5-table-region,
.acos-bulk-table-wrap {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.phase5-table-region::after,
.acos-bulk-table-wrap::after {
    content: "Swipe to compare →";
    position: sticky;
    left: 12px;
    bottom: 8px;
    display: none;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--clay-bg) 92%, transparent);
    box-shadow: var(--clay-shadow-out);
    font-size: 0.62rem;
    font-weight: 800;
    pointer-events: none;
}

.acos-bulk-table th,
.acos-bulk-table td {
    min-width: 126px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.acos-bulk-table th:first-child,
.acos-bulk-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 150px;
    background: var(--clay-bg);
}

.acos-bulk-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.acos-bulk-table thead th:first-child {
    z-index: 4;
}

.phase5-chart-tools {
    display: flex;
    justify-content: flex-end;
    margin: 2px 0 6px;
}

.phase5-chart-expand {
    min-height: 44px;
    width: auto;
    margin: 0;
    padding: 8px 12px;
    color: var(--btn-teal);
    background: var(--clay-bg);
    border: 1px solid rgba(122, 140, 140, 0.18);
    border-radius: 13px;
    box-shadow: var(--clay-shadow-out);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 900;
}

.phase5-chart-alternative {
    margin-top: 12px;
    color: var(--text-main);
    font-size: 0.72rem;
}

.phase5-chart-alternative summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--btn-teal);
    cursor: pointer;
    font-weight: 900;
}

.phase5-chart-alternative > div {
    max-width: 100%;
    overflow-x: auto;
}

.phase5-chart-alternative table {
    width: 100%;
    min-width: 390px;
    border-collapse: collapse;
}

.phase5-chart-alternative th,
.phase5-chart-alternative td {
    padding: 9px;
    text-align: start;
    border-bottom: 1px solid rgba(122, 140, 140, 0.18);
}

.phase5-chart-shell {
    min-width: 0;
}

.phase5-chart-shell.is-phase5-expanded {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10060;
    width: 100vw !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)) !important;
    overflow: auto;
    background: var(--bg-body);
}

.phase5-chart-shell.is-phase5-expanded .chart-container {
    width: 100% !important;
    min-height: min(65dvh, 620px) !important;
    height: min(65dvh, 620px) !important;
}

.phase5-chart-shell.is-phase5-expanded canvas {
    min-height: 0;
}

.phase5-state,
.phase5-core-screen .dashboard-empty-state,
.phase5-core-screen .dashboard-component-error,
.phase5-core-screen .dashboard-skeleton,
.phase5-core-screen .shell-module-empty,
.phase5-core-screen .ads-empty-state {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.phase5-core-screen .unlock-overlay button,
.phase5-core-screen .unlock-btn-shiny,
.phase5-core-screen .reimb-lock-cta {
    min-height: 44px;
    white-space: normal;
    text-wrap: balance;
}

.phase5-settings-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.phase5-settings-index {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    background: var(--clay-bg);
    box-shadow: var(--clay-shadow-in);
}

.phase5-settings-index h3 {
    margin: 4px 7px 7px;
    color: var(--text-main);
    font-size: 0.78rem;
}

.phase5-settings-index button,
.phase5-settings-index a {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 13px;
    color: var(--text-main);
    background: transparent;
    box-shadow: none;
    text-align: start;
    text-decoration: none;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.phase5-settings-index button:hover,
.phase5-settings-index button[aria-current="true"],
.phase5-settings-index a:hover {
    color: var(--btn-teal);
    background: color-mix(in srgb, var(--btn-teal) 10%, transparent);
}

.phase5-settings-content {
    display: grid;
    gap: 18px;
}

.phase5-settings-section {
    scroll-margin-top: 96px;
    padding: 18px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--clay-bg) 94%, transparent);
    box-shadow: var(--clay-shadow-in);
}

.phase5-settings-section > h3:first-of-type {
    margin-top: 0 !important;
}

.phase5-settings-mobile-back {
    display: none;
}

.phase5-settings-section p,
.phase5-settings-section a,
.phase5-settings-section span {
    overflow-wrap: anywhere;
}

.phase5-settings-section [onclick] {
    min-height: 44px;
}

.phase5-settings-section[data-settings-section="danger"] {
    border: 1px solid rgba(239, 68, 68, 0.42);
    background: color-mix(in srgb, #ef4444 7%, var(--clay-bg));
}

.phase5-settings-danger-copy {
    margin: -6px 0 16px;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.55;
}

.phase5-settings-privacy-actions {
    display: grid;
    gap: 9px;
    margin-top: 14px;
}

.phase5-settings-privacy-actions a,
.phase5-settings-privacy-actions button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 11px 13px;
    color: var(--text-main);
    background: var(--clay-bg);
    border: 0;
    border-radius: 13px;
    box-shadow: var(--clay-shadow-out);
    text-align: start;
    text-decoration: none;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
}

.phase5-modal-managed [data-phase5-dialog-panel] {
    min-width: 0;
}

.manual-cogs-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.manual-cogs-field > span {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.manual-cogs-remove[role="button"] {
    min-width: 44px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    color: #ef4444;
    cursor: pointer;
}

.phase5-core-screen .sku-item,
.phase5-core-screen .breakdown-row,
.phase5-core-screen .dl-history-item,
.phase5-core-screen .reimb-anomaly-row {
    min-width: 0;
}

.phase5-core-screen .sku-item > *,
.phase5-core-screen .breakdown-row > *,
.phase5-core-screen .dl-history-item > *,
.phase5-core-screen .reimb-anomaly-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

.phase5-core-screen .highlight-val,
.phase5-core-screen .text-green,
.phase5-core-screen .text-red,
.phase5-core-screen [id^="res-"],
.phase5-core-screen [id^="ads-res-"] {
    font-variant-numeric: tabular-nums;
    overflow-wrap: normal;
    word-break: normal;
}

@media (max-width: 1100px) {
    body.spp-private-route .app-shell-content > #results-screen.phase5-core-screen {
        width: 100%;
        max-width: 100%;
    }

    .phase5-core-screen .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .phase5-core-screen .chart-container {
        min-height: 260px;
        height: clamp(260px, 38vw, 370px);
    }

    .phase5-core-screen .result-card,
    .phase5-core-screen .clay-card {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body.spp-phase5-module .app-shell-content {
        padding-inline: 12px;
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
        overflow-x: clip;
    }

    .phase5-core-screen .header-with-menu,
    .phase5-core-screen .demo-header-container {
        align-items: flex-start;
        margin-bottom: 14px;
        padding-inline: 0;
    }

    .phase5-core-screen .header-with-menu > div:nth-child(2),
    .phase5-core-screen .demo-header-container > h2 {
        flex: 1;
        text-align: start !important;
    }

    .phase5-core-screen .header-with-menu h2,
    .phase5-core-screen .demo-header-container h2 {
        font-size: clamp(1.05rem, 5vw, 1.32rem) !important;
        line-height: 1.25;
    }

    .phase5-core-screen .menu-btn-round,
    .phase5-core-screen .back-btn-round,
    .phase5-core-screen .clay-action-btn,
    .phase5-core-screen .dl-del-btn,
    .phase5-core-screen button {
        min-width: 44px;
        min-height: 44px;
    }

    .phase5-core-screen input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
    .phase5-core-screen select,
    .phase5-core-screen textarea,
    .phase5-filter-sheet input,
    .phase5-filter-sheet select {
        font-size: 16px !important;
    }

    .phase5-core-screen .top-nav-menu-scroll {
        position: sticky;
        top: calc(60px + env(safe-area-inset-top));
        z-index: 80;
        margin-inline: -12px;
        margin-bottom: 14px;
        padding: 10px 12px 13px;
        background: color-mix(in srgb, var(--bg-body) 92%, transparent);
        backdrop-filter: blur(14px);
        border-block: 1px solid rgba(122, 140, 140, 0.12);
    }

    .phase5-core-screen .nav-pill-scroll {
        min-height: 44px;
        padding: 8px 14px;
        font-size: 0.72rem;
    }

    .phase5-mobile-filter-bar {
        display: flex;
    }

    .phase5-filter-source {
        display: none !important;
    }

    body[data-spp-module="alerts"] .phase5-mobile-filter-bar {
        display: none;
    }

    .phase5-core-screen .upload-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    .phase5-core-screen .upload-col,
    .phase5-core-screen .upload-card {
        width: 100% !important;
        min-width: 0 !important;
    }

    .phase5-core-screen .upload-row > :not(.upload-col) {
        min-height: 44px;
        padding: 0 !important;
        flex-direction: row !important;
        gap: 8px;
    }

    .phase5-core-screen .upload-row > :not(.upload-col) br {
        display: none;
    }

    .phase5-core-screen .date-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .phase5-core-screen .date-row .input-wrapper {
        width: 100%;
    }

    .phase5-core-screen .pill-row.phase5-filter-source,
    .phase5-core-screen .report-toolbar-row.phase5-filter-source {
        display: none !important;
    }

    .phase5-core-screen .privacy-banner {
        align-items: flex-start;
        text-align: start;
    }

    .phase5-core-screen .summary-grid,
    .phase5-core-screen #summary-boxes-grid,
    .phase5-core-screen .reimb-stat-pills,
    .phase5-core-screen .acos-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .phase5-core-screen .highlight-box,
    .phase5-core-screen .reimb-stat-pill,
    .phase5-core-screen .acos-result-box {
        min-width: 0;
        padding: 13px 10px;
    }

    .phase5-core-screen .highlight-val,
    .phase5-core-screen .acos-result-val {
        font-size: clamp(1.05rem, 6vw, 1.5rem) !important;
    }

    .phase5-core-screen .breakdown-row {
        min-height: 54px;
        align-items: flex-start;
        gap: 8px;
        padding-block: 12px;
    }

    .phase5-core-screen .breakdown-row > span:first-child,
    .phase5-core-screen .breakdown-row > .blur-target > span:first-child {
        flex: 1 1 52%;
        line-height: 1.4;
    }

    .phase5-core-screen .breakdown-row > span:last-child,
    .phase5-core-screen .breakdown-row > .blur-target > span:last-child {
        flex: 0 1 auto;
        max-width: 48%;
        text-align: end;
    }

    .phase5-core-screen .sku-item {
        align-items: stretch !important;
        flex-wrap: wrap;
        gap: 10px !important;
        padding: 14px;
    }

    .phase5-core-screen .sku-item > div:first-child {
        flex: 1 1 58% !important;
    }

    .phase5-core-screen .sku-item > div:last-child {
        flex: 0 1 auto;
        max-width: 42%;
        min-width: 0 !important;
        margin-inline-start: auto;
        text-align: end !important;
    }

    .phase5-core-screen .sku-item[role="button"] {
        min-height: 56px;
        cursor: pointer;
    }

    .phase5-core-screen .chart-container {
        width: 100%;
        min-height: 280px;
        height: clamp(280px, 82vw, 410px);
        overflow: visible;
    }

    .phase5-core-screen .chart-container canvas {
        max-width: 100% !important;
        touch-action: pan-y;
    }

    .phase5-table-region::after,
    .acos-bulk-table-wrap::after {
        display: block;
    }

    #acos-simulator-screen .acos-input-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    #acos-simulator-screen .acos-number-input,
    #acos-simulator-screen .acos-range {
        width: 100%;
        max-width: none;
    }

    #acos-simulator-screen .acos-input-group {
        padding: 14px;
    }

    #acos-bulk-modal .acos-bulk-modal-card,
    #manual-cogs-modal > .clay-card,
    #action-plan-modal > .clay-card,
    #tally-modal > .auth-container {
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: none !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: calc(64px + env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    #acos-lock-modal .acos-lock-card {
        width: min(calc(100% - 24px), 430px);
        max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    #manual-cogs-rows {
        max-height: none !important;
        overflow: visible !important;
    }

    .manual-cogs-row {
        position: relative;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 44px !important;
        gap: 10px !important;
        padding: 13px !important;
    }

    .manual-cogs-field {
        grid-column: 1 / -1;
    }

    .manual-cogs-row .manual-cogs-remove {
        grid-column: 2;
        justify-self: end;
    }

    .manual-cogs-row input {
        width: 100% !important;
        min-height: 46px;
        padding: 10px !important;
        border-radius: 10px !important;
        background: color-mix(in srgb, var(--bg-body) 72%, transparent) !important;
    }

    .phase5-tally-date-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
    }

    #tally-modal #btn-confirm-tally,
    #manual-cogs-modal #manual-cogs-save,
    #acos-bulk-modal #acos-bulk-download-btn {
        position: sticky;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 5;
        width: 100%;
        min-height: 52px;
    }

    .phase5-core-screen .digest-card-topline,
    .phase5-core-screen .digest-preview-header,
    .phase5-core-screen .digest-consent-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .phase5-core-screen .digest-title {
        font-size: clamp(1.15rem, 6vw, 1.55rem);
        overflow-wrap: anywhere;
    }

    .phase5-core-screen .digest-phone-input,
    .phase5-core-screen .digest-language-select,
    .phase5-core-screen .digest-activate-button {
        width: 100%;
        min-height: 50px;
    }

    .phase5-core-screen .digest-message-bubble,
    .phase5-core-screen .digest-preview-copy {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .phase5-core-screen .dl-history-item,
    .phase5-core-screen .reimb-anomaly-row {
        align-items: flex-start;
        gap: 10px;
        padding: 13px;
    }

    .phase5-core-screen .dl-info,
    .phase5-core-screen .reimb-anomaly-row > div:first-child {
        flex: 1;
    }

    #settings-screen > .clay-card {
        padding: 14px !important;
    }

    .phase5-settings-layout {
        display: block;
    }

    .phase5-settings-index {
        position: static;
        gap: 7px;
        padding: 8px;
    }

    .phase5-settings-index button,
    .phase5-settings-index a {
        min-height: 52px;
        padding: 12px;
        font-size: 0.8rem;
    }

    .phase5-settings-content {
        margin-top: 0;
    }

    .phase5-settings-layout.is-index .phase5-settings-content,
    .phase5-settings-layout:not(.is-index) .phase5-settings-index {
        display: none;
    }

    .phase5-settings-section {
        display: none;
        padding: 14px;
        box-shadow: none;
        background: transparent;
    }

    .phase5-settings-section.is-active {
        display: block;
    }

    .phase5-settings-mobile-back {
        width: auto;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        margin: 0 0 14px;
        padding: 8px 12px;
        color: var(--btn-teal);
        background: var(--clay-bg);
        border: 0;
        border-radius: 13px;
        box-shadow: var(--clay-shadow-out);
        font: inherit;
        font-size: 0.72rem;
        font-weight: 900;
    }

    .phase5-settings-section > div[style*="justify-content: space-between"] {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 10px;
    }

    .phase5-settings-section .lang-select,
    .phase5-settings-section .theme-toggle-btn-settings,
    .phase5-settings-section > button {
        width: 100%;
    }

    .phase5-core-screen .blur-trap-wrapper {
        max-width: 100%;
    }

    .phase5-core-screen .unlock-overlay {
        padding: 12px;
    }

    .phase5-core-screen .unlock-overlay button,
    .phase5-core-screen .reimb-lock-cta {
        width: 100%;
        max-width: 360px;
    }
}

@media (max-width: 430px) {
    .phase5-core-screen .summary-grid,
    .phase5-core-screen #summary-boxes-grid,
    .phase5-core-screen .reimb-stat-pills,
    .phase5-core-screen .acos-result-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .phase5-core-screen .sku-item {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
    }

    .phase5-core-screen .sku-item > div:first-child,
    .phase5-core-screen .sku-item > div:last-child {
        width: 100%;
        max-width: none;
        margin: 0;
        text-align: start !important;
    }

    .phase5-core-screen .breakdown-row > span:last-child,
    .phase5-core-screen .breakdown-row > .blur-target > span:last-child {
        max-width: 54%;
    }

    .phase5-filter-presets {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 380px) {
    body.spp-phase5-module .app-shell-content {
        padding-inline: 8px;
    }

    .phase5-core-screen .result-card,
    .phase5-core-screen .clay-card,
    .phase5-core-screen .whatsapp-digest-card,
    .phase5-core-screen .acos-sim-card {
        padding-inline: 12px !important;
    }

    .phase5-core-screen .section-header {
        align-items: flex-start;
    }

    .phase5-core-screen .section-header h2,
    .phase5-core-screen .section-header h3 {
        font-size: 1rem;
    }

    .phase5-core-screen .digest-retention-pill,
    .phase5-core-screen .digest-plan-pill,
    .phase5-core-screen .digest-schedule-pill {
        font-size: 0.62rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .phase5-core-screen .sku-item,
    .phase5-core-screen .nav-pill-scroll,
    .phase5-core-screen button,
    .phase5-core-screen [role="button"] {
        transition-duration: 0.1s !important;
    }

    .phase5-core-screen .sku-item:hover,
    .phase5-core-screen .result-card:hover,
    .phase5-core-screen .clay-card:hover {
        transform: none;
    }

    .phase5-core-screen .sku-item:active,
    .phase5-core-screen button:active,
    .phase5-core-screen [role="button"]:active {
        transform: scale(0.985);
    }
}

@media (prefers-reduced-motion: reduce) {
    .phase5-core-screen *,
    .phase5-filter-overlay,
    .phase5-filter-sheet,
    .phase5-core-screen .tab-content,
    .phase5-core-screen .sku-item,
    .phase5-core-screen #breakdown-ledger-card,
    .phase5-core-screen .dl-history-item {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .phase5-core-screen .sku-item,
    .phase5-core-screen #breakdown-ledger-card,
    .phase5-core-screen .tab-content .result-card,
    .phase5-core-screen .tab-content .section-header {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Phase 2 responsive application shell. Feature cards and report modules remain unchanged. */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    clip-path: inset(50%) !important;
}

.app-shell-topbar,
.mobile-app-header,
.app-global-filters,
.profile-menu,
.notification-panel,
.shell-popover-overlay,
.actions-sheet,
.actions-sheet-overlay,
.app-route-loader {
    display: none;
}

.app-route-loader {
    position: fixed;
    z-index: 10020;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
}

.app-route-loader span {
    display: block;
    width: 38%;
    height: 100%;
    transform: translateX(-110%);
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), #10B981, transparent);
    box-shadow: 0 0 12px rgba(77, 238, 234, 0.65);
}

body.spp-route-loading .app-route-loader {
    display: block;
}

body.spp-route-loading .app-route-loader span {
    animation: shellRouteLoading 0.72s ease-in-out infinite;
}

@keyframes shellRouteLoading {
    to { transform: translateX(360%); }
}

body.spp-private-route {
    display: block;
    padding: 0;
}

body.spp-private-route #top-bar {
    display: none !important;
}

body.spp-private-route .app-shell-topbar,
body.spp-private-route .app-global-filters {
    display: flex;
}

.app-shell-topbar {
    position: fixed;
    z-index: 820;
    top: 0;
    right: 0;
    left: 250px;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 30px;
    background: color-mix(in srgb, var(--bg-body) 88%, transparent);
    border-bottom: 1px solid rgba(122, 140, 140, 0.18);
    backdrop-filter: blur(18px);
}

.app-shell-heading {
    min-width: 0;
}

.app-shell-eyebrow {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 0.61rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.app-shell-heading h1,
.shell-panel-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.26rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.app-shell-topbar-actions,
.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shell-icon-button,
.profile-trigger,
.profile-menu a,
.profile-menu button {
    border: 0;
    color: var(--text-main);
    background: var(--clay-bg);
    font: inherit;
    cursor: pointer;
}

.shell-icon-button {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    padding: 0;
    border-radius: 16px;
    box-shadow: var(--clay-shadow-out), var(--card-rim-light);
}

.shell-icon-button > i {
    color: var(--btn-teal);
    font-size: 1.2rem;
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    display: grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 4px;
    border: 2px solid var(--bg-body);
    border-radius: 999px;
    background: #EF4444;
    color: #FFF;
    font-size: 0.55rem;
    font-weight: 900;
}

.notification-badge[hidden] {
    display: none;
}

.profile-trigger {
    display: flex;
    min-width: 184px;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 18px;
    box-shadow: var(--clay-shadow-out), var(--card-rim-light);
}

.profile-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--neon-cyan), var(--btn-teal));
    color: #FFF;
    font-size: 0.68rem;
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(15, 76, 76, 0.24);
}

.profile-trigger-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.profile-trigger-copy strong {
    overflow: hidden;
    max-width: 100px;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-trigger-copy small {
    color: var(--text-muted);
    font-size: 0.58rem;
    font-weight: 700;
}

.app-global-filters {
    position: fixed;
    z-index: 810;
    top: 82px;
    right: 0;
    left: 250px;
    min-height: 66px;
    align-items: center;
    gap: 10px;
    padding: 9px 30px 11px;
    background: color-mix(in srgb, var(--bg-body) 90%, transparent);
    border-bottom: 1px solid rgba(122, 140, 140, 0.14);
    backdrop-filter: blur(16px);
}

.global-filter-control {
    position: relative;
    display: grid;
    min-width: 0;
    flex: 0 1 210px;
    grid-template-columns: 20px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 7px;
    padding: 7px 12px;
    border: 1px solid rgba(122, 140, 140, 0.12);
    border-radius: 16px;
    background: var(--clay-bg);
    box-shadow: var(--clay-shadow-in);
}

.global-filter-control > span {
    grid-column: 2;
    color: var(--text-muted);
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.global-filter-control > i {
    grid-row: 1 / 3;
    color: var(--btn-teal);
    font-size: 1rem;
}

.global-filter-control select {
    width: 100%;
    min-width: 0;
    grid-column: 2;
    padding: 0;
    overflow: hidden;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.67rem;
    font-weight: 800;
    text-overflow: ellipsis;
}

body.spp-private-route .app-shell-content {
    width: auto;
    max-width: none;
    min-height: 100vh;
    margin-left: 250px;
    padding: 172px 34px 70px;
    align-items: center;
}

body.spp-private-route .app-shell-content > .screen {
    width: min(100%, 760px);
    max-width: 760px;
}

body.spp-private-route .app-shell-content > #results-screen {
    width: min(100%, 1040px);
    max-width: 1040px;
}

body.spp-private-route .screen.exit {
    top: 172px;
}

body.spp-private-route .side-menu {
    z-index: 840;
}

.sidebar-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 5px 8px rgba(15, 76, 76, 0.18));
}

.sidebar-brand > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1;
}

.sidebar-brand strong {
    font-size: 0.96rem;
}

.sidebar-brand small {
    margin-top: 4px;
    color: #D97706;
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.shell-popover-overlay,
.actions-sheet-overlay {
    position: fixed;
    z-index: 1090;
    inset: 0;
    background: rgba(10, 20, 24, 0.34);
    opacity: 0;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(3px);
}

.shell-popover-overlay.active,
.actions-sheet-overlay.active {
    display: block;
    opacity: 1;
}

.profile-menu {
    position: fixed;
    z-index: 1110;
    top: 72px;
    right: 28px;
    width: min(290px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 22px;
    background: var(--clay-bg);
    box-shadow: 16px 18px 40px rgba(15, 42, 42, 0.25), var(--card-rim-light);
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.profile-menu.active {
    display: block;
    transform: translateY(0) scale(1);
    opacity: 1;
}

.profile-menu-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 8px;
    padding: 8px 7px 13px;
    border-bottom: 1px dashed rgba(122, 140, 140, 0.3);
}

.profile-avatar-large {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 14px;
}

.profile-menu-summary > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.profile-menu-summary strong {
    font-size: 0.82rem;
}

.profile-menu-summary small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu a,
.profile-menu button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    margin: 3px 0;
    padding: 11px 12px;
    border-radius: 14px;
    box-shadow: none;
    text-align: left;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 800;
}

.profile-menu a:hover,
.profile-menu button:hover,
.profile-menu a:focus-visible,
.profile-menu button:focus-visible {
    color: var(--btn-teal);
    background: rgba(15, 76, 76, 0.08);
}

.notification-panel {
    position: fixed;
    z-index: 1110;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(390px, calc(100vw - 24px));
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 28px;
    background: var(--clay-bg);
    box-shadow: -18px 20px 48px rgba(15, 42, 42, 0.26), var(--card-rim-light);
    transform: translateX(calc(100% + 30px));
    transition: transform 0.3s cubic-bezier(0.2, 0.82, 0.25, 1);
}

.notification-panel.active {
    display: block;
    transform: translateX(0);
}

.shell-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

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

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid transparent;
    border-radius: 19px;
    background: var(--clay-bg);
    color: var(--text-main);
    box-shadow: var(--clay-shadow-out);
    text-decoration: none;
}

.notification-item.is-unread {
    border-color: rgba(77, 238, 234, 0.42);
}

.notification-item > i {
    color: var(--btn-teal);
    font-size: 1.25rem;
}

.notification-item span,
.notification-empty {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.notification-item strong,
.notification-empty strong {
    font-size: 0.75rem;
}

.notification-item small,
.notification-empty small {
    color: var(--text-muted);
    font-size: 0.64rem;
    line-height: 1.45;
}

.notification-empty {
    align-items: center;
    padding: 36px 18px;
    text-align: center;
}

.notification-empty[hidden] {
    display: none;
}

.notification-empty > i {
    margin-bottom: 7px;
    color: var(--btn-teal);
    font-size: 1.8rem;
}

.shell-text-button {
    width: 100%;
    margin: 16px 0 0;
    padding: 11px;
    border: 0;
    border-radius: 15px;
    background: var(--clay-bg);
    color: var(--btn-teal);
    box-shadow: var(--clay-shadow-in);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 900;
}

.actions-sheet {
    position: fixed;
    z-index: 1200;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(76vh, 560px);
    overflow: auto;
    padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
    border-radius: 30px 30px 0 0;
    background: var(--clay-bg);
    box-shadow: 0 -20px 48px rgba(15, 42, 42, 0.28), var(--card-rim-light);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.2, 0.82, 0.25, 1);
}

.actions-sheet.active {
    display: block;
    transform: translateY(0);
}

.actions-sheet-handle {
    width: 44px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: rgba(122, 140, 140, 0.34);
}

.actions-sheet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.actions-sheet-grid a {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 11px;
    padding: 15px 13px;
    border-radius: 19px;
    background: var(--clay-bg);
    color: var(--text-main);
    box-shadow: var(--clay-shadow-out);
    text-decoration: none;
}

.actions-sheet-grid a > i {
    color: var(--btn-teal);
    font-size: 1.25rem;
}

.actions-sheet-grid a span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.actions-sheet-grid strong {
    font-size: 0.72rem;
}

.actions-sheet-grid small {
    color: var(--text-muted);
    font-size: 0.6rem;
    line-height: 1.35;
}

.shell-module-card {
    text-align: left;
}

.shell-module-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 20px;
    color: var(--btn-teal);
    box-shadow: var(--clay-shadow-in);
    font-size: 1.7rem;
}

.integration-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 10px;
    padding: 13px 15px;
    border-radius: 17px;
    box-shadow: var(--clay-shadow-in);
    font-size: 0.72rem;
    font-weight: 800;
}

.integration-status-row span {
    display: flex;
    align-items: center;
    gap: 9px;
}

.integration-status-row i,
.integration-status-row strong {
    color: #10B981;
}

.integration-status-row.is-planned strong {
    color: #D97706;
}

.shell-icon-button:focus-visible,
.profile-trigger:focus-visible,
.global-filter-control:focus-within,
.notification-item:focus-visible,
.actions-sheet-grid a:focus-visible {
    outline: 3px solid var(--neon-cyan);
    outline-offset: 3px;
}

body.shell-modal-open {
    overflow: hidden;
}

@media (min-width: 1101px) {
    body.spp-private-route .side-menu {
        left: 0;
        width: 250px;
        padding: 22px 18px;
        gap: 10px;
        border-right: 1px solid rgba(122, 140, 140, 0.18);
        box-shadow: 10px 0 30px rgba(15, 42, 42, 0.1);
    }

    body.spp-private-route .side-menu .menu-header {
        min-height: 55px;
        margin-bottom: 5px;
    }

    body.spp-private-route .side-menu [data-close-side-menu] {
        display: none;
    }

    body.spp-private-route .menu-overlay {
        display: none !important;
    }

    body.spp-private-route .menu-item {
        min-height: 46px;
        padding: 11px 13px;
        border-radius: 16px;
        font-size: 0.82rem;
    }

    body.spp-private-route .menu-item i {
        font-size: 1.15rem;
    }

    body.spp-private-route .header-with-menu .menu-btn-round,
    body.spp-private-route .demo-header-container .menu-btn-round {
        visibility: hidden;
        pointer-events: none;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    body.spp-private-route .side-menu {
        left: 0;
        width: 88px;
        padding: 18px 12px;
        gap: 9px;
        border-right: 1px solid rgba(122, 140, 140, 0.18);
        box-shadow: 8px 0 24px rgba(15, 42, 42, 0.1);
    }

    body.spp-private-route .side-menu .menu-header {
        justify-content: center;
        min-height: 48px;
        margin-bottom: 4px;
        padding-bottom: 10px;
    }

    body.spp-private-route .sidebar-brand > span,
    body.spp-private-route .side-menu .menu-section-label,
    body.spp-private-route .side-menu .menu-item span,
    body.spp-private-route .side-menu [data-close-side-menu] {
        display: none;
    }

    body.spp-private-route .side-menu .menu-item {
        justify-content: center;
        min-height: 50px;
        padding: 10px;
        border-radius: 16px;
    }

    body.spp-private-route .side-menu .menu-item i {
        margin: 0;
        font-size: 1.23rem;
    }

    body.spp-private-route .menu-overlay {
        display: none !important;
    }

    .app-shell-topbar,
    .app-global-filters {
        left: 88px;
    }

    body.spp-private-route .app-shell-content {
        margin-left: 88px;
        padding-right: 24px;
        padding-left: 24px;
    }

    body.spp-private-route .header-with-menu .menu-btn-round,
    body.spp-private-route .demo-header-container .menu-btn-round {
        visibility: hidden;
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    body.spp-private-route .app-shell-topbar {
        display: none;
    }

    body.spp-private-route .mobile-app-header {
        position: fixed;
        z-index: 830;
        top: 0;
        right: 0;
        left: 0;
        display: flex;
        min-height: calc(64px + env(safe-area-inset-top));
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: calc(9px + env(safe-area-inset-top)) 14px 9px;
        background: color-mix(in srgb, var(--bg-body) 90%, transparent);
        border-bottom: 1px solid rgba(122, 140, 140, 0.17);
        backdrop-filter: blur(18px);
    }

    .mobile-brand-lockup {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 9px;
    }

    .mobile-brand-lockup img {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        object-fit: contain;
        filter: drop-shadow(0 5px 8px rgba(15, 76, 76, 0.16));
    }

    .mobile-brand-lockup > span {
        display: flex;
        min-width: 0;
        flex-direction: column;
        line-height: 1.2;
    }

    .mobile-brand-lockup strong {
        overflow: hidden;
        font-size: 0.78rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-brand-lockup small {
        color: var(--text-muted);
        font-size: 0.57rem;
        font-weight: 800;
    }

    .mobile-header-actions {
        gap: 7px;
    }

    .mobile-header-actions .shell-icon-button {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 14px;
    }

    .mobile-profile-trigger .profile-avatar {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        border-radius: 11px;
        font-size: 0.58rem;
    }

    .app-global-filters {
        top: calc(64px + env(safe-area-inset-top));
        right: 0;
        left: 0;
        min-height: 68px;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 8px 8px 10px;
    }

    .global-filter-control {
        width: 100%;
        min-width: 0;
        grid-template-columns: 17px minmax(0, 1fr);
        padding: 7px 7px;
        column-gap: 4px;
        border-radius: 14px;
    }

    .global-filter-control select {
        font-size: 0.58rem;
    }

    .global-filter-control > span {
        font-size: 0.46rem;
    }

    .global-filter-control > i {
        font-size: 0.88rem;
    }

    body.spp-private-route .app-shell-content {
        width: 100%;
        max-width: none;
        min-height: 100vh;
        margin-left: 0;
        padding: calc(150px + env(safe-area-inset-top)) 12px calc(104px + env(safe-area-inset-bottom));
    }

    body.spp-private-route .app-shell-content > .screen,
    body.spp-private-route .app-shell-content > #results-screen {
        width: min(100%, 560px);
        max-width: 560px;
    }

    body.spp-private-route .screen.exit {
        top: calc(150px + env(safe-area-inset-top));
    }

    body.spp-private-route .side-menu {
        padding-top: calc(22px + env(safe-area-inset-top));
    }

    .profile-menu {
        top: calc(58px + env(safe-area-inset-top));
        right: 10px;
    }

    .notification-panel {
        top: calc(8px + env(safe-area-inset-top));
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        width: calc(100vw - 16px);
        border-radius: 25px;
    }

    .actions-sheet {
        display: block;
    }

    body.actions-sheet-open .mobile-bottom-nav {
        transform: translateY(calc(100% + env(safe-area-inset-bottom)));
    }

    .mobile-bottom-nav {
        transition: transform 0.25s ease;
    }
}

@media (max-width: 430px) {
    .app-global-filters {
        gap: 4px;
        padding-inline: 5px;
    }

    .global-filter-control {
        grid-template-columns: 15px minmax(0, 1fr);
        padding-inline: 5px;
    }

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

@media (max-width: 380px) {
    .mobile-brand-lockup strong {
        font-size: 0.7rem;
    }

    .mobile-header-actions {
        gap: 5px;
    }

    .global-filter-control > span {
        display: none;
    }

    .global-filter-control > i {
        grid-row: 1;
    }

    .global-filter-control select {
        grid-row: 1;
        font-size: 0.54rem;
    }

    body.spp-private-route .app-shell-content {
        padding-right: 8px;
        padding-left: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-route-loader span,
    .profile-menu,
    .notification-panel,
    .actions-sheet,
    .mobile-bottom-nav {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* Phase 1 information architecture: preserves the existing clay navigation language. */
.side-menu {
    gap: 0;
    overflow: hidden;
}

.side-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 5px 10px;
    scrollbar-width: thin;
}

.side-menu-spacer {
    flex: 1 1 auto;
    min-height: 12px;
}

.menu-section-label {
    margin: 6px 8px 2px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    line-height: 1.25;
    text-transform: uppercase;
}

a.menu-item,
button.menu-item {
    width: 100%;
    margin: 0;
    text-align: left;
    text-decoration: none;
}

button.menu-item,
.nav-icon-button,
.mobile-bottom-nav button,
.drawer-link {
    font: inherit;
}

button.menu-item {
    justify-content: flex-start;
}

.menu-item[aria-current="page"] {
    color: var(--btn-teal);
    border-color: rgba(13, 148, 136, 0.35);
    box-shadow: var(--clay-shadow-in);
}

.menu-item[aria-current="page"] i {
    color: var(--btn-teal);
}

.nav-icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    color: var(--text-muted);
    background: var(--clay-bg);
    border: 1px solid transparent;
    border-radius: 50%;
    box-shadow: var(--clay-shadow-out);
    cursor: pointer;
}

.nav-icon-button:focus-visible,
.menu-item:focus-visible,
.drawer-link:focus-visible,
.mobile-bottom-nav a:focus-visible,
.mobile-bottom-nav button:focus-visible {
    outline: 3px solid rgba(13, 148, 136, 0.45);
    outline-offset: 2px;
}

.nav-screen-trigger {
    width: 45px;
    height: 45px;
    min-width: 45px;
    padding: 0;
    border: 0;
}

.more-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1190;
    display: none;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.more-drawer-overlay.active {
    display: block;
    opacity: 1;
}

.more-drawer {
    position: fixed;
    top: 0;
    right: -410px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    width: min(390px, 100vw);
    height: 100dvh;
    padding: 24px 18px max(24px, env(safe-area-inset-bottom));
    color: var(--text-main);
    background: var(--clay-bg);
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.24);
    visibility: hidden;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0s linear 0.4s;
}

.more-drawer.active {
    right: 0;
    visibility: visible;
    transition-delay: 0s;
}

.more-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 4px 17px;
    border-bottom: 2px dashed rgba(122, 140, 140, 0.3);
}

.more-drawer-header .menu-section-label {
    margin: 0 0 3px;
}

.more-drawer-header h2 {
    margin: 0;
    color: var(--btn-teal);
    font-size: 1.5rem;
}

.more-drawer-content {
    min-height: 0;
    overflow-y: auto;
    padding: 12px 5px 8px;
}

.more-drawer-section {
    display: grid;
    gap: 9px;
    margin-bottom: 18px;
}

.more-drawer-section .menu-section-label {
    margin-top: 2px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    margin: 0;
    padding: 13px 14px;
    color: var(--text-main);
    text-align: left;
    text-decoration: none;
    background: var(--clay-bg);
    border: 1px solid transparent;
    border-radius: 18px;
    box-shadow: var(--clay-shadow-out);
    cursor: pointer;
}

.drawer-link:hover,
.drawer-link[aria-current="page"] {
    color: var(--btn-teal);
    border-color: rgba(13, 148, 136, 0.32);
    box-shadow: var(--clay-shadow-in);
}

.drawer-link > i {
    flex: 0 0 auto;
    width: 24px;
    color: var(--btn-teal);
    font-size: 1.25rem;
    text-align: center;
}

.drawer-link > span {
    display: grid;
    min-width: 0;
}

.drawer-link strong {
    font-size: 0.91rem;
    line-height: 1.25;
}

.drawer-link small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.69rem;
    font-weight: 650;
}

.drawer-link-danger,
.drawer-link-danger > i {
    color: #dc2626;
}

.mobile-bottom-nav {
    display: none;
}

body.more-drawer-open,
body.side-menu-open {
    overflow: hidden;
}

body:not(.spp-private-route) #mobile-bottom-nav,
body:not(.spp-private-route) #side-menu,
body:not(.spp-private-route) #menu-overlay {
    visibility: hidden;
}

body.dark-mode .more-drawer,
body.dark-mode .drawer-link,
body.dark-mode .nav-icon-button,
body.dark-mode .mobile-bottom-nav {
    background: var(--clay-bg);
}

@media (max-width: 768px) {
    body.spp-private-route .screen-container {
        padding-bottom: calc(94px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 950;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
        width: 100%;
        max-width: 100vw;
        padding: 8px max(6px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
        background: color-mix(in srgb, var(--clay-bg) 94%, transparent);
        border-top: 1px solid rgba(122, 140, 140, 0.24);
        box-shadow: 0 -9px 24px rgba(0, 0, 0, 0.14);
        backdrop-filter: blur(16px);
    }

    body.spp-private-route .mobile-bottom-nav {
        display: grid;
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        display: grid;
        min-width: 0;
        min-height: 52px;
        margin: 0;
        padding: 6px 2px;
        place-items: center;
        align-content: center;
        gap: 3px;
        color: var(--text-muted);
        text-decoration: none;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 15px;
        box-shadow: none;
        cursor: pointer;
    }

    .mobile-bottom-nav i {
        font-size: 1.18rem;
        line-height: 1;
    }

    .mobile-bottom-nav span {
        display: block;
        width: 100%;
        overflow: hidden;
        font-size: clamp(0.56rem, 2.6vw, 0.68rem);
        font-weight: 800;
        line-height: 1.1;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-bottom-nav [aria-current="page"] {
        color: var(--btn-teal);
        background: rgba(13, 148, 136, 0.1);
        border-color: rgba(13, 148, 136, 0.2);
        box-shadow: var(--clay-shadow-in);
    }

    .more-drawer {
        width: min(92vw, 390px);
        padding-top: max(18px, env(safe-area-inset-top));
    }
}

@media (max-width: 380px) {
    .side-menu {
        width: min(280px, 86vw);
        padding-inline: 14px;
    }

    .more-drawer {
        width: 100vw;
        padding-inline: 13px;
    }

    .mobile-bottom-nav {
        gap: 0;
        padding-inline: 3px;
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        padding-inline: 1px;
    }
}

/* Phase 4: public landing-page structure. Reuses the approved clay visual system. */
body.spp-marketing-route {
    display: block;
    padding: 0;
    scroll-behavior: smooth;
}

body.spp-marketing-route #top-bar {
    display: none !important;
}

body.spp-marketing-route .app-shell-content {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    padding: 0;
}

body.spp-marketing-route .app-shell-content > #welcome-screen {
    width: 100%;
    max-width: none;
    animation: landingPageIn 0.28s ease both;
}

#welcome-screen > :not(.phase4-landing) {
    display: none !important;
}

.phase4-landing {
    width: 100%;
    min-width: 0;
    overflow: clip;
}

.landing-skip-link {
    position: fixed;
    z-index: 2000;
    top: 8px;
    left: 12px;
    padding: 10px 14px;
    color: #fff;
    background: var(--btn-teal);
    border-radius: 12px;
    box-shadow: var(--btn-glow);
    transform: translateY(-160%);
    font-size: 0.75rem;
    font-weight: 900;
}

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

.landing-header {
    position: sticky;
    z-index: 900;
    top: 0;
    width: 100%;
    min-height: 72px;
    background: color-mix(in srgb, var(--bg-body) 90%, transparent);
    border-bottom: 1px solid rgba(122, 140, 140, 0.16);
    backdrop-filter: blur(18px);
}

.landing-header-inner {
    display: flex;
    width: min(calc(100% - 40px), 1240px);
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
}

.landing-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    text-decoration: none;
}

.landing-brand img {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(15, 76, 76, 0.18));
}

.landing-brand > span {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.landing-brand strong {
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.landing-brand small {
    color: var(--btn-teal);
    font-size: 0.63rem;
    font-weight: 900;
}

.landing-desktop-nav,
.landing-header-actions,
.landing-cta-group,
.landing-trust-links {
    display: flex;
    align-items: center;
}

.landing-desktop-nav {
    gap: clamp(16px, 2.2vw, 30px);
}

.landing-desktop-nav a,
.landing-signin,
.landing-start-free,
.landing-mobile-menu-button {
    min-height: 44px;
    color: var(--text-main);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.landing-desktop-nav a {
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}

.landing-desktop-nav a:hover,
.landing-desktop-nav a.is-current {
    color: var(--btn-teal);
    border-bottom-color: var(--neon-cyan);
}

.landing-header-actions {
    flex: 0 0 auto;
    gap: 8px;
}

.landing-signin,
.landing-start-free,
.landing-mobile-menu-button {
    padding: 0 15px;
    border-radius: 15px;
}

.landing-signin {
    box-shadow: var(--clay-shadow-in);
}

.landing-start-free {
    color: #fff;
    background: var(--btn-teal);
    box-shadow: var(--btn-glow);
}

.landing-mobile-menu-button {
    display: none;
    width: 44px;
    padding: 0;
    place-items: center;
    box-shadow: var(--clay-shadow-out);
}

.landing-mobile-menu-button i {
    color: var(--btn-teal);
    font-size: 1.25rem;
}

.landing-drawer-backdrop {
    position: fixed;
    z-index: 1180;
    inset: 0;
    visibility: hidden;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    backdrop-filter: blur(4px);
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.landing-drawer-backdrop.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.landing-mobile-drawer {
    position: fixed;
    z-index: 1190;
    top: 0;
    right: 0;
    width: min(390px, 94vw);
    height: 100dvh;
    padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
    color: var(--text-main);
    background: var(--clay-bg);
    box-shadow: -18px 0 38px rgba(0, 0, 0, 0.28);
    visibility: hidden;
    transform: translateX(105%);
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

.landing-mobile-drawer.is-open {
    visibility: visible;
    transform: translateX(0);
    transition-delay: 0s;
}

.landing-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 2px 18px;
    border-bottom: 1px solid rgba(122, 140, 140, 0.2);
}

.landing-drawer-header span {
    color: var(--btn-teal);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.landing-drawer-header h2 {
    margin: 2px 0 0;
    font-size: 1.35rem;
}

.landing-drawer-header button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--btn-teal);
    background: var(--clay-bg);
    border: 0;
    border-radius: 15px;
    box-shadow: var(--clay-shadow-out);
    cursor: pointer;
}

.landing-mobile-drawer nav {
    display: grid;
    gap: 9px;
    margin-top: 18px;
}

.landing-mobile-drawer nav a,
.landing-mobile-drawer nav button {
    display: flex;
    min-height: 50px;
    align-items: center;
    width: 100%;
    padding: 0 16px;
    color: var(--text-main);
    background: var(--clay-bg);
    border: 1px solid transparent;
    border-radius: 16px;
    box-shadow: var(--clay-shadow-out);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.landing-mobile-drawer nav .is-primary {
    justify-content: center;
    color: #fff;
    background: var(--btn-teal);
    box-shadow: var(--btn-glow);
}

body.landing-menu-open {
    overflow: hidden;
}

.landing-main {
    width: 100%;
    min-width: 0;
}

.landing-hero,
.landing-section,
.landing-trust-strip,
.landing-final-cta,
.landing-footer-grid,
.landing-footer-bottom {
    width: min(calc(100% - 40px), 1200px);
    margin-inline: auto;
}

.landing-hero {
    position: relative;
    display: grid;
    min-height: min(760px, calc(100vh - 72px));
    grid-template-columns: minmax(0, 0.46fr) minmax(0, 0.54fr);
    align-items: center;
    gap: clamp(34px, 5vw, 76px);
    padding: 72px 0 64px;
}

.landing-hero-glow,
.landing-final-glow {
    position: absolute;
    z-index: -1;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(77, 238, 234, 0.18), transparent 70%);
    filter: blur(12px);
    pointer-events: none;
    animation: landingGlowFloat 7s ease-in-out infinite;
}

.landing-hero-glow-one {
    top: 5%;
    left: -12%;
}

.landing-hero-glow-two {
    right: -8%;
    bottom: 2%;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.13), transparent 70%);
    animation-delay: -3s;
}

.landing-eyebrow,
.landing-illustrative-badge,
.landing-capability-number,
.landing-price-fit {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    color: var(--btn-teal);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.landing-hero h1 {
    max-width: 650px;
    margin: 14px 0 20px;
    color: var(--text-main);
    font-size: clamp(2.6rem, 4.4vw, 4.65rem);
    font-weight: 900;
    letter-spacing: -0.055em;
    line-height: 0.99;
}

.landing-hero h1 span {
    color: var(--btn-teal);
}

.landing-hero-copy > p,
.landing-section-copy > p,
.landing-section-heading > p,
.landing-security-section > .landing-section-heading p {
    max-width: 660px;
    color: var(--text-muted);
    font-size: 0.91rem;
    font-weight: 600;
    line-height: 1.7;
}

.landing-cta-group {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.landing-primary-cta,
.landing-secondary-cta,
.landing-context-cta,
.landing-capability-copy button,
.landing-price-card button {
    min-height: 50px;
    padding: 0 20px;
    border-radius: 17px;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.landing-primary-cta,
.landing-price-card.is-recommended button {
    color: #fff;
    background: var(--btn-teal);
    border: 2px solid var(--neon-cyan);
    box-shadow: var(--btn-glow);
}

.landing-secondary-cta,
.landing-context-cta,
.landing-capability-copy button,
.landing-price-card button {
    color: var(--text-main);
    background: var(--clay-bg);
    border: 1px solid rgba(122, 140, 140, 0.16);
    box-shadow: var(--clay-shadow-out), var(--card-rim-light);
}

.landing-primary-cta:hover,
.landing-secondary-cta:hover,
.landing-context-cta:hover,
.landing-capability-copy button:hover,
.landing-price-card button:hover {
    transform: translateY(-3px);
}

.landing-microcopy {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 13px;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 750;
}

.landing-microcopy i {
    color: #10B981;
}

.landing-product-preview,
.landing-waterfall-card,
.landing-capability-visual,
.landing-action-card,
.landing-price-card,
.landing-final-cta {
    color: var(--text-main);
    background: var(--clay-bg);
    border: 1px solid rgba(77, 238, 234, 0.16);
    box-shadow: var(--clay-shadow-out), var(--card-rim-light);
}

.landing-product-preview {
    position: relative;
    min-width: 0;
    padding: 22px;
    border-radius: 32px;
    transform: perspective(1200px) rotateY(-2deg) rotateX(1deg);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.landing-product-preview:hover,
.landing-product-preview.is-sample-active {
    transform: perspective(1200px) rotateY(0) rotateX(0) translateY(-3px);
    box-shadow: var(--clay-shadow-out), var(--card-rim-light), 0 0 38px rgba(77, 238, 234, 0.16);
}

.landing-preview-topbar,
.landing-preview-confidence,
.landing-preview-kpis,
.landing-preview-insight,
.landing-card-heading,
.landing-action-top,
.landing-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.landing-preview-topbar > span:first-child {
    font-size: 0.74rem;
    font-weight: 900;
}

.landing-preview-topbar i {
    color: var(--btn-teal);
    margin-right: 5px;
}

.landing-illustrative-badge {
    padding: 5px 8px;
    background: rgba(13, 148, 136, 0.09);
    border: 1px solid rgba(13, 148, 136, 0.18);
    border-radius: 999px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.landing-preview-confidence {
    margin: 17px 0 12px;
    padding: 13px 14px;
    background: var(--clay-bg);
    border-radius: 16px;
    box-shadow: var(--clay-shadow-in);
}

.landing-preview-confidence > div {
    display: grid;
    gap: 3px;
}

.landing-preview-confidence span,
.landing-preview-confidence small,
.landing-preview-kpis span,
.landing-preview-insight small {
    color: var(--text-muted);
    font-size: 0.56rem;
    font-weight: 800;
}

.landing-preview-confidence strong {
    color: #10B981;
    font-size: 0.69rem;
}

.landing-preview-kpis {
    gap: 10px;
}

.landing-preview-kpis > div {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 5px;
    padding: 15px;
    background: var(--clay-bg);
    border-radius: 17px;
    box-shadow: var(--clay-shadow-in);
}

.landing-preview-kpis strong {
    overflow-wrap: anywhere;
    color: #10B981;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
}

.landing-preview-waterfall {
    display: grid;
    gap: 9px;
    margin: 16px 0;
}

.landing-preview-waterfall > div {
    display: grid;
    grid-template-columns: 105px minmax(40px, 1fr) minmax(84px, auto);
    align-items: center;
    gap: 9px;
}

.landing-preview-waterfall span,
.landing-preview-waterfall strong {
    font-size: 0.58rem;
    font-weight: 850;
}

.landing-preview-waterfall strong {
    text-align: right;
}

.landing-preview-waterfall b {
    display: block;
    width: var(--preview-width);
    height: 8px;
    background: linear-gradient(90deg, var(--btn-teal), var(--neon-cyan));
    border-radius: 99px;
    transform-origin: left;
    animation: landingBarDraw 0.45s ease both;
}

.landing-preview-waterfall .is-cost b {
    background: linear-gradient(90deg, #D97706, #EF4444);
}

.landing-preview-waterfall .is-profit b {
    background: linear-gradient(90deg, #059669, #22E1A1);
}

.landing-preview-insight {
    justify-content: flex-start;
    padding: 12px 13px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: 15px;
}

.landing-preview-insight > i {
    flex: 0 0 auto;
    color: #D97706;
    font-size: 1.25rem;
}

.landing-preview-insight > span {
    display: grid;
    gap: 2px;
}

.landing-preview-insight strong {
    font-size: 0.64rem;
}

.landing-trust-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    background: color-mix(in srgb, var(--clay-bg) 70%, transparent);
    border: 1px solid rgba(122, 140, 140, 0.14);
    border-radius: 24px;
    box-shadow: var(--clay-shadow-in);
}

.landing-trust-strip > div {
    display: flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-main);
    font-size: 0.67rem;
    font-weight: 850;
    text-align: center;
}

.landing-trust-strip i {
    flex: 0 0 auto;
    color: var(--btn-teal);
    font-size: 1.05rem;
}

.landing-section {
    padding-block: clamp(76px, 9vw, 120px);
}

.landing-problem-section,
.landing-insight-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: clamp(34px, 6vw, 80px);
}

.landing-section-copy h2,
.landing-section-heading h2,
.landing-final-cta h2 {
    margin: 10px 0 15px;
    color: var(--text-main);
    font-size: clamp(2rem, 3.5vw, 3.4rem);
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.landing-check-list,
.landing-capability-copy ul,
.landing-price-card ul {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.landing-check-list li,
.landing-capability-copy li,
.landing-price-card li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
}

.landing-check-list i {
    color: #10B981;
    font-size: 1rem;
}

.landing-waterfall-card {
    min-width: 0;
    padding: 24px;
    border-radius: 28px;
}

.landing-card-heading {
    align-items: flex-start;
}

.landing-card-heading > div {
    display: grid;
    gap: 8px;
}

.landing-card-heading h3 {
    margin: 0;
    font-size: 1.08rem;
}

.landing-card-heading > i {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    color: var(--btn-teal);
    background: var(--clay-bg);
    border-radius: 14px;
    box-shadow: var(--clay-shadow-in);
    font-size: 1.2rem;
}

.landing-waterfall-rows {
    display: grid;
    gap: 0;
    margin: 18px 0 10px;
}

.landing-waterfall-rows > div {
    display: flex;
    min-height: 49px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(122, 140, 140, 0.14);
    font-size: 0.72rem;
    font-weight: 800;
    opacity: 0;
    transform: translateY(8px);
}

.landing-waterfall-card.is-visible .landing-waterfall-rows > div {
    animation: landingRowReveal 0.24s ease forwards;
}

.landing-waterfall-card.is-visible .landing-waterfall-rows > div:nth-child(2) { animation-delay: 0.04s; }
.landing-waterfall-card.is-visible .landing-waterfall-rows > div:nth-child(3) { animation-delay: 0.08s; }
.landing-waterfall-card.is-visible .landing-waterfall-rows > div:nth-child(4) { animation-delay: 0.12s; }
.landing-waterfall-card.is-visible .landing-waterfall-rows > div:nth-child(5) { animation-delay: 0.16s; }
.landing-waterfall-card.is-visible .landing-waterfall-rows > div:nth-child(6) { animation-delay: 0.2s; }

.landing-waterfall-rows .is-cost strong {
    color: #EF4444;
}

.landing-waterfall-rows .is-profit {
    margin-top: 5px;
    padding: 14px 12px;
    color: #10B981;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 15px;
}

.landing-waterfall-card > p {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.58rem;
    font-weight: 700;
    text-align: center;
}

.landing-centered-section .landing-section-heading,
.landing-capabilities > .landing-section-heading,
.landing-faq-section > .landing-section-heading,
.landing-security-section > .landing-section-heading {
    width: min(100%, 760px);
    margin: 0 auto 38px;
    text-align: center;
}

.landing-centered-section .landing-eyebrow,
.landing-capabilities > .landing-section-heading .landing-eyebrow,
.landing-faq-section > .landing-section-heading .landing-eyebrow,
.landing-security-section > .landing-section-heading .landing-eyebrow {
    margin-inline: auto;
}

.landing-centered-section .landing-section-heading > p,
.landing-capabilities > .landing-section-heading > p,
.landing-security-section > .landing-section-heading > p {
    margin-inline: auto;
}

.landing-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.landing-step-card,
.landing-audience-card,
.landing-security-card {
    position: relative;
    min-width: 0;
    padding: 22px;
    background: var(--clay-bg);
    border: 1px solid rgba(122, 140, 140, 0.14);
    border-radius: 24px;
    box-shadow: var(--clay-shadow-out), var(--card-rim-light);
}

.landing-step-card > span {
    position: absolute;
    top: 16px;
    right: 18px;
    color: rgba(122, 140, 140, 0.28);
    font-size: 1.7rem;
    font-weight: 900;
}

.landing-step-card > i,
.landing-audience-card > i,
.landing-security-card > i {
    display: grid;
    width: 45px;
    height: 45px;
    place-items: center;
    color: var(--btn-teal);
    background: var(--clay-bg);
    border-radius: 15px;
    box-shadow: var(--clay-shadow-in);
    font-size: 1.2rem;
}

.landing-step-card h3,
.landing-audience-card h3,
.landing-security-card h3 {
    margin: 16px 0 7px;
    color: var(--text-main);
    font-size: 0.86rem;
}

.landing-step-card p,
.landing-audience-card p,
.landing-security-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.55;
}

.landing-capabilities {
    padding-top: 78px;
}

.landing-capability {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: clamp(34px, 7vw, 92px);
    padding: 58px 0;
    border-bottom: 1px solid rgba(122, 140, 140, 0.14);
}

.landing-capability.is-reverse .landing-capability-copy {
    order: 2;
}

.landing-capability.is-reverse .landing-capability-visual {
    order: 1;
}

.landing-capability-copy h3 {
    margin: 9px 0 5px;
    color: var(--btn-teal);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.landing-capability-copy h4 {
    max-width: 560px;
    margin: 0;
    color: var(--text-main);
    font-size: clamp(1.7rem, 3vw, 2.65rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.12;
}

.landing-capability-copy button,
.landing-context-cta {
    margin-top: 22px;
}

.landing-capability-visual {
    min-width: 0;
    min-height: 280px;
    padding: 24px;
    border-radius: 28px;
}

.landing-capability-visual > .landing-illustrative-badge {
    margin-bottom: 18px;
}

.landing-status-visual {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 13px;
    padding: 15px;
    color: #10B981;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 17px;
}

.landing-status-visual.is-warning {
    color: #D97706;
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.18);
}

.landing-status-visual > i {
    font-size: 1.5rem;
}

.landing-status-visual > span {
    display: grid;
}

.landing-status-visual small,
.landing-visual-row span,
.landing-report-files small {
    color: var(--text-muted);
    font-size: 0.58rem;
    font-weight: 750;
}

.landing-status-visual strong,
.landing-visual-row strong {
    font-size: 0.72rem;
}

.landing-visual-row {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(122, 140, 140, 0.14);
}

.landing-sku-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(90px, auto) minmax(90px, auto);
    gap: 0;
    overflow: hidden;
    border-radius: 17px;
    box-shadow: var(--clay-shadow-in);
}

.landing-sku-preview > * {
    min-width: 0;
    padding: 11px 10px;
    overflow-wrap: anywhere;
    border-bottom: 1px solid rgba(122, 140, 140, 0.13);
    font-size: 0.62rem;
}

.landing-sku-preview > span {
    color: var(--text-muted);
    font-size: 0.53rem;
    font-weight: 850;
    text-transform: uppercase;
}

.landing-sku-preview .is-negative {
    color: #EF4444;
}

.landing-sku-preview .is-positive {
    color: #10B981;
}

.landing-ad-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 13px;
}

.landing-ad-preview > div {
    display: grid;
    gap: 5px;
    padding: 18px;
    background: var(--clay-bg);
    border-radius: 17px;
    box-shadow: var(--clay-shadow-in);
}

.landing-ad-preview span {
    color: var(--text-muted);
    font-size: 0.56rem;
    font-weight: 800;
}

.landing-ad-preview strong {
    font-size: 1.3rem;
}

.landing-report-files {
    display: grid;
    gap: 10px;
}

.landing-report-files > div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    background: var(--clay-bg);
    border-radius: 16px;
    box-shadow: var(--clay-shadow-in);
}

.landing-report-files i {
    color: var(--btn-teal);
    font-size: 1.3rem;
}

.landing-report-files span {
    display: grid;
}

.landing-report-files strong {
    font-size: 0.7rem;
}

.landing-action-card {
    min-width: 0;
    padding: 26px;
    border-color: rgba(217, 119, 6, 0.24);
    border-radius: 28px;
    box-shadow: var(--clay-shadow-out), var(--card-rim-light), 0 0 30px rgba(217, 119, 6, 0.08);
}

.landing-action-top > span,
.landing-action-top > b {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 0.57rem;
    font-weight: 900;
    text-transform: uppercase;
}

.landing-action-top > span {
    color: var(--text-muted);
    background: rgba(122, 140, 140, 0.09);
}

.landing-action-top > b {
    color: #B45309;
    background: rgba(217, 119, 6, 0.1);
}

.landing-action-card h3 {
    margin: 18px 0;
    color: var(--text-main);
    font-size: 1.25rem;
    line-height: 1.35;
}

.landing-action-card dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.landing-action-card dl > div {
    display: grid;
    gap: 4px;
    padding: 12px 13px;
    background: var(--clay-bg);
    border-radius: 15px;
    box-shadow: var(--clay-shadow-in);
}

.landing-action-card dt {
    color: var(--text-muted);
    font-size: 0.56rem;
    font-weight: 850;
    text-transform: uppercase;
}

.landing-action-card dd {
    margin: 0;
    color: var(--text-main);
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1.5;
}

.landing-action-card dl > div:first-child dd {
    color: #EF4444;
    font-size: 1.15rem;
    font-weight: 900;
}

.landing-action-card > p {
    margin: 13px 0 0;
    color: var(--text-muted);
    font-size: 0.57rem;
    font-weight: 650;
}

.landing-audience-grid,
.landing-security-grid,
.landing-pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.landing-audience-card > span {
    display: inline-flex;
    margin-top: 12px;
    padding: 4px 7px;
    color: #D97706;
    background: rgba(217, 119, 6, 0.08);
    border-radius: 999px;
    font-size: 0.54rem;
    font-weight: 900;
    text-transform: uppercase;
}

.landing-security-section {
    width: 100%;
    max-width: none;
    padding-inline: max(20px, calc((100% - 1200px) / 2));
    background: color-mix(in srgb, var(--clay-bg) 38%, transparent);
    border-block: 1px solid rgba(122, 140, 140, 0.12);
}

.landing-security-grid {
    width: min(100%, 1200px);
    margin-inline: auto;
}

.landing-trust-links {
    width: min(100%, 900px);
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    margin: 28px auto 0;
}

.landing-trust-links a,
.landing-compare-plans {
    min-height: 44px;
    padding: 12px 2px;
    color: var(--btn-teal);
    font-size: 0.67rem;
    font-weight: 900;
    text-underline-offset: 3px;
}

.landing-pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.landing-price-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 25px;
    border-radius: 28px;
    text-align: left;
}

.landing-price-card.is-recommended {
    border: 2px solid var(--neon-cyan);
    box-shadow: var(--clay-shadow-out), var(--card-rim-light), 0 0 32px rgba(77, 238, 234, 0.13);
}

.landing-price-recommended {
    position: absolute;
    top: -12px;
    right: 18px;
    padding: 5px 10px;
    color: #fff;
    background: var(--btn-teal);
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 900;
    text-transform: uppercase;
}

.landing-price-card h3 {
    margin: 10px 0 5px;
    color: var(--text-main);
    font-size: 1.3rem;
}

.landing-price-card > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.landing-price-value {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    font-weight: 900;
}

.landing-price-card small {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 700;
}

.landing-price-card button {
    width: 100%;
    margin-top: auto;
}

.landing-price-card ul {
    margin-bottom: 24px;
}

.landing-price-card li::before {
    color: #10B981;
    content: "✓";
    font-weight: 900;
}

.landing-compare-plans {
    display: block;
    width: fit-content;
    margin: 18px auto 0;
}

.landing-faq-section {
    width: min(calc(100% - 40px), 900px);
}

.landing-faq-list {
    display: grid;
    gap: 10px;
}

.landing-faq-list article {
    background: var(--clay-bg);
    border: 1px solid rgba(122, 140, 140, 0.14);
    border-radius: 19px;
    box-shadow: var(--clay-shadow-out), var(--card-rim-light);
}

.landing-faq-list h3 {
    margin: 0;
}

.landing-faq-list button {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 17px;
    color: var(--text-main);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 850;
    text-align: left;
    cursor: pointer;
}

.landing-faq-list button i {
    flex: 0 0 auto;
    color: var(--btn-teal);
    font-size: 1.1rem;
    transition: transform 0.18s ease;
}

.landing-faq-list button[aria-expanded="true"] i {
    transform: rotate(45deg);
}

.landing-faq-list article > div {
    padding: 0 17px 16px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 650;
    line-height: 1.65;
}

.landing-final-cta {
    position: relative;
    margin-bottom: 90px;
    padding: clamp(38px, 6vw, 70px);
    overflow: hidden;
    border-radius: 34px;
    text-align: center;
}

.landing-final-cta .landing-eyebrow {
    margin-inline: auto;
}

.landing-final-cta h2 {
    margin-inline: auto;
}

.landing-final-cta p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 650;
}

.landing-final-cta .landing-cta-group {
    justify-content: center;
}

.landing-final-glow {
    z-index: 0;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
}

.landing-final-cta > *:not(.landing-final-glow) {
    position: relative;
    z-index: 1;
}

.landing-footer {
    padding: 58px 0 max(24px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--clay-bg) 68%, transparent);
    border-top: 1px solid rgba(122, 140, 140, 0.15);
}

.landing-footer-grid {
    display: grid;
    grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr));
    gap: 28px;
}

.landing-footer-brand p {
    max-width: 230px;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 650;
    line-height: 1.55;
}

.landing-footer nav {
    display: grid;
    align-content: start;
    gap: 9px;
}

.landing-footer nav h2 {
    margin: 0 0 5px;
    color: var(--text-main);
    font-size: 0.7rem;
    font-weight: 900;
}

.landing-footer nav a,
.landing-footer nav button {
    width: fit-content;
    min-height: 30px;
    padding: 4px 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 0.63rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.landing-footer nav a:hover,
.landing-footer nav button:hover {
    color: var(--btn-teal);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.landing-footer-bottom {
    margin-top: 38px;
    padding-top: 18px;
    color: var(--text-muted);
    border-top: 1px solid rgba(122, 140, 140, 0.15);
    font-size: 0.58rem;
    font-weight: 650;
}

.landing-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.landing-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.phase4-landing :focus-visible {
    outline: 3px solid rgba(13, 148, 136, 0.5);
    outline-offset: 3px;
}

@keyframes landingPageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes landingGlowFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -12px, 0); }
}

@keyframes landingBarDraw {
    from { transform: scaleX(0.15); opacity: 0.4; }
    to { transform: scaleX(1); opacity: 1; }
}

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

@media (max-width: 1100px) {
    .landing-desktop-nav {
        display: none;
    }

    .landing-mobile-menu-button {
        display: grid;
    }

    .landing-hero {
        grid-template-columns: minmax(0, 0.48fr) minmax(0, 0.52fr);
        gap: 34px;
    }

    .landing-trust-strip,
    .landing-steps,
    .landing-audience-grid,
    .landing-security-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .landing-footer-brand {
        grid-column: span 3;
    }
}

@media (max-width: 820px) {
    .landing-hero {
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 60px 0 58px;
    }

    .landing-hero-copy {
        max-width: 700px;
    }

    .landing-product-preview {
        width: min(100%, 680px);
        margin-inline: auto;
        transform: none;
    }

    .landing-problem-section,
    .landing-insight-section,
    .landing-capability {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .landing-capability.is-reverse .landing-capability-copy,
    .landing-capability.is-reverse .landing-capability-visual {
        order: initial;
    }

    .landing-capability-visual {
        min-height: 0;
    }

    .landing-pricing-grid {
        grid-template-columns: 1fr;
        width: min(100%, 620px);
        margin-inline: auto;
    }
}

@media (max-width: 600px) {
    .landing-header-inner,
    .landing-hero,
    .landing-section,
    .landing-trust-strip,
    .landing-final-cta,
    .landing-footer-grid,
    .landing-footer-bottom,
    .landing-faq-section {
        width: min(calc(100% - 24px), 1200px);
    }

    .landing-header-inner {
        gap: 8px;
    }

    .landing-header-actions {
        gap: 6px;
    }

    .landing-signin {
        display: none;
    }

    .landing-start-free {
        padding-inline: 11px;
        font-size: 0.63rem;
    }

    .landing-brand strong {
        font-size: 0.72rem;
    }

    .landing-brand img {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .landing-hero {
        padding: 44px 0 52px;
    }

    .landing-hero h1 {
        margin-top: 11px;
        font-size: clamp(2.25rem, 10.7vw, 2.75rem);
        line-height: 1.02;
    }

    .landing-hero-copy > p {
        font-size: 0.8rem;
        line-height: 1.6;
    }

    .landing-cta-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        margin-top: 23px;
    }

    .landing-primary-cta,
    .landing-secondary-cta {
        width: 100%;
        white-space: normal;
    }

    .landing-product-preview {
        padding: 16px;
        border-radius: 25px;
    }

    .landing-preview-confidence {
        align-items: flex-start;
    }

    .landing-preview-confidence > small {
        text-align: right;
    }

    .landing-preview-kpis > div {
        padding: 13px;
    }

    .landing-preview-kpis strong {
        font-size: clamp(1.05rem, 6vw, 1.35rem);
    }

    .landing-preview-waterfall > div {
        grid-template-columns: 92px minmax(30px, 1fr);
    }

    .landing-preview-waterfall strong {
        grid-column: 1 / -1;
        text-align: left;
    }

    .landing-trust-strip,
    .landing-steps,
    .landing-audience-grid,
    .landing-security-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .landing-trust-strip {
        padding: 10px;
    }

    .landing-trust-strip > div {
        justify-content: flex-start;
        padding: 6px;
        font-size: 0.6rem;
        text-align: left;
    }

    .landing-section {
        padding-block: 66px;
    }

    .landing-section-copy h2,
    .landing-section-heading h2,
    .landing-final-cta h2 {
        font-size: clamp(1.75rem, 8.6vw, 2.25rem);
    }

    .landing-waterfall-card,
    .landing-capability-visual,
    .landing-action-card,
    .landing-price-card {
        padding: 18px;
        border-radius: 23px;
    }

    .landing-waterfall-rows > div {
        min-height: 52px;
        padding-inline: 9px;
    }

    .landing-step-card,
    .landing-audience-card,
    .landing-security-card {
        padding: 17px;
        border-radius: 20px;
    }

    .landing-step-card {
        grid-column: span 2;
    }

    .landing-capabilities {
        padding-top: 60px;
    }

    .landing-capability {
        padding: 46px 0;
    }

    .landing-capability-copy h4 {
        font-size: 1.75rem;
    }

    .landing-capability-copy button,
    .landing-context-cta {
        width: 100%;
    }

    .landing-sku-preview {
        grid-template-columns: minmax(0, 1fr) minmax(82px, auto);
    }

    .landing-sku-preview > *:nth-child(3n) {
        display: none;
    }

    .landing-security-section {
        padding-inline: 12px;
    }

    .landing-trust-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        text-align: center;
    }

    .landing-faq-list button {
        min-height: 62px;
        font-size: 0.69rem;
    }

    .landing-final-cta {
        margin-bottom: 58px;
        padding: 34px 18px;
        border-radius: 28px;
    }

    .landing-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 18px;
    }

    .landing-footer-brand {
        grid-column: span 2;
    }

    .landing-footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-reveal {
        transform: translateY(12px);
    }

    .landing-hero-glow {
        width: 220px;
        height: 220px;
        filter: blur(8px);
        opacity: 0.65;
    }
}

@media (max-width: 380px) {
    .landing-header-inner,
    .landing-hero,
    .landing-section,
    .landing-trust-strip,
    .landing-final-cta,
    .landing-footer-grid,
    .landing-footer-bottom,
    .landing-faq-section {
        width: min(calc(100% - 16px), 1200px);
    }

    .landing-start-free {
        display: none;
    }

    .landing-hero h1 {
        font-size: 2.18rem;
    }

    .landing-product-preview,
    .landing-waterfall-card,
    .landing-capability-visual,
    .landing-action-card,
    .landing-price-card {
        padding: 15px;
    }

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

    .landing-audience-grid,
    .landing-security-grid {
        grid-template-columns: 1fr;
    }

    .landing-audience-card,
    .landing-security-card {
        grid-column: auto;
    }

    .landing-footer-grid {
        grid-template-columns: 1fr;
    }

    .landing-footer-brand {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.spp-marketing-route {
        scroll-behavior: auto;
    }

    .landing-hero-glow,
    .landing-final-glow,
    .landing-preview-waterfall b,
    .landing-waterfall-card.is-visible .landing-waterfall-rows > div,
    .landing-reveal,
    .landing-product-preview,
    .landing-mobile-drawer,
    .landing-drawer-backdrop,
    .landing-faq-list button i {
        animation: none !important;
        transform: none !important;
        transition-duration: 0.01ms !important;
    }

    .landing-reveal,
    .landing-waterfall-rows > div {
        opacity: 1 !important;
    }
}

/* ========================================================================== */
/* Phase 6: centralized motion system                                         */
/* ========================================================================== */

:root {
    --motion-duration-instant: 0ms;
    --motion-duration-fast: 120ms;
    --motion-duration-base: 180ms;
    --motion-duration-slow: 240ms;
    --motion-duration-emphasized: 320ms;
    --motion-ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --motion-ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-ease-exit: cubic-bezier(0.4, 0, 1, 1);
    --motion-distance-subtle: 4px;
    --motion-distance-base: 12px;
    --motion-distance-emphasized: 24px;
    --motion-distance-emphasized-negative: -24px;
    --motion-stagger-step: 40ms;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translate3d(var(--motion-distance-emphasized), 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideOutLeft {
    from { opacity: 1; transform: translate3d(0, 0, 0); }
    to { opacity: 0; transform: translate3d(var(--motion-distance-emphasized-negative), 0, 0); }
}

.screen.active {
    animation: slideInRight var(--motion-duration-slow) var(--motion-ease-enter) both;
}

.screen.exit {
    animation: slideOutLeft var(--motion-duration-slow) var(--motion-ease-exit) both;
}

.custom-toast {
    top: 25px;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-50%, calc(-100% - 50px), 0);
    transition: transform var(--motion-duration-slow) var(--motion-ease-enter),
        opacity var(--motion-duration-base) var(--motion-ease-standard);
}

.custom-toast.show {
    top: 25px;
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(-50%, 0, 0);
}

body,
.digest-select-wrapper,
.landing-cta,
.landing-product-preview,
.landing-faq-list button i,
.financial-tooltip,
.phase5-filter-overlay,
.phase5-filter-sheet,
.profile-menu,
.notification-panel,
.actions-sheet,
.mobile-bottom-nav,
.landing-mobile-drawer,
.landing-drawer-backdrop {
    transition-duration: var(--motion-duration-base);
    transition-timing-function: var(--motion-ease-standard);
}

.dashboard-page-header,
.dashboard-card,
.dashboard-empty-state {
    animation-duration: var(--motion-duration-slow);
    animation-timing-function: var(--motion-ease-enter);
}

.dashboard-waterfall-bar,
.landing-preview-waterfall b {
    animation-duration: var(--motion-duration-emphasized);
    animation-timing-function: var(--motion-ease-enter);
}

.tab-content .result-card,
.tab-content .section-header,
#money-leak-card .breakdown-row,
#summary-boxes-grid,
#breakdown-ledger-card,
#res-sku-list .sku-item,
.landing-reveal {
    transition-duration: var(--motion-duration-slow);
    transition-timing-function: var(--motion-ease-enter);
}

html:not(.motion-enhanced) .landing-reveal,
html:not(.motion-enhanced) .landing-waterfall-card {
    opacity: 1;
    transform: none;
}

.dl-history-item.motion-list-enter {
    animation: slideInRight var(--motion-duration-slow) var(--motion-ease-enter) both;
}

.more-drawer {
    right: 0;
    visibility: hidden;
    transform: translate3d(105%, 0, 0);
    transition: transform var(--motion-duration-emphasized) var(--motion-ease-enter),
        visibility 0s linear var(--motion-duration-emphasized);
}

.more-drawer.active {
    right: 0;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    transition-delay: 0s;
}

.more-drawer-overlay {
    transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
}

.notification-panel,
.actions-sheet {
    transition-duration: var(--motion-duration-emphasized);
    transition-timing-function: var(--motion-ease-enter);
}

.profile-menu {
    transition-duration: var(--motion-duration-slow);
    transition-timing-function: var(--motion-ease-enter);
}

.chart-container {
    min-height: 220px;
    overflow-anchor: none;
}

.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.dashboard-card.is-loading {
    min-height: var(--dashboard-loading-min-height, 180px);
}

.landing-product-preview {
    min-height: 410px;
    overflow-anchor: none;
}

.motion-offscreen,
.motion-offscreen::before,
.motion-offscreen::after,
body.motion-document-hidden *,
body.motion-document-hidden *::before,
body.motion-document-hidden *::after {
    animation-play-state: paused !important;
}

.dashboard-card.is-loading.motion-offscreen::after {
    animation-play-state: paused !important;
}

.ai-action-btn {
    animation-duration: 2.4s !important;
    transition: transform var(--motion-duration-base) var(--motion-ease-standard),
        box-shadow var(--motion-duration-base) var(--motion-ease-standard) !important;
}

.ai-action-btn.motion-offscreen {
    animation-play-state: paused !important;
}

body.motion-touch .landing-product-preview:hover {
    transform: perspective(1200px) rotateY(-2deg) rotateX(1deg);
}

body.motion-touch .ai-action-btn:hover,
body.motion-touch .loss-aversion-banner:hover {
    transform: none;
}

@media (max-width: 768px) {
    :root {
        --motion-duration-base: 135ms;
        --motion-duration-slow: 180ms;
        --motion-duration-emphasized: 240ms;
        --motion-distance-base: 8px;
        --motion-distance-emphasized: 14px;
        --motion-distance-emphasized-negative: -14px;
        --motion-stagger-step: 20ms;
    }

    .landing-hero-glow,
    .landing-final-glow {
        animation-duration: 10s;
    }

    .main-icon,
    .splash-icon {
        animation-duration: 6s;
    }

    .status-light,
    .unlock-btn-shiny,
    .loss-aversion-banner,
    .reimb-hero-banner {
        animation-duration: 3s;
    }

    .ai-action-btn {
        animation-duration: 3s !important;
    }

    .landing-product-preview {
        min-height: 380px;
    }

    .dashboard-page-header,
    .dashboard-card,
    .dashboard-empty-state,
    .landing-reveal {
        animation-duration: var(--motion-duration-base);
        transition-duration: var(--motion-duration-base);
    }

    .more-drawer,
    .notification-panel,
    .actions-sheet {
        transition-duration: var(--motion-duration-slow);
    }
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-delay: 0ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }

    .landing-reveal,
    .landing-waterfall-rows > div,
    .tab-content .result-card,
    .tab-content .section-header,
    #money-leak-card .breakdown-row,
    #summary-boxes-grid,
    #breakdown-ledger-card,
    #res-sku-list .sku-item,
    .leak-row,
    .leak-net-box {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Phase 7 cascade guard: accessibility rules must follow all legacy phases. */
body:not(.dark-mode) {
    --text-muted: #536B6B;
    --spp-focus-ring: #0F4C4C;
    --spp-focus-halo: rgba(15, 76, 76, 0.22);
}

body.dark-mode {
    --spp-focus-ring: #4DEEEA;
    --spp-focus-halo: rgba(77, 238, 234, 0.24);
}

:where(a, button, input, select, textarea, summary, [role="button"], [role="tab"], [role="radio"], [tabindex]):focus-visible {
    outline: 3px solid var(--spp-focus-ring) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px var(--spp-focus-halo) !important;
}

.toast-close {
    min-width: 44px !important;
    min-height: 44px !important;
    border: 0 !important;
    color: inherit !important;
    background: transparent !important;
    box-shadow: none !important;
}

body:not(.dark-mode) [style*="color: #D97706"],
body:not(.dark-mode) [style*="color:#D97706"] {
    color: #994B00 !important;
}

body:not(.dark-mode) [style*="background: #D97706"],
body:not(.dark-mode) [style*="background:#D97706"] {
    background: #914700 !important;
}

body:not(.dark-mode) [style*="background: #3B82F6"],
body:not(.dark-mode) [style*="background:#3B82F6"] {
    background: #1D4ED8 !important;
}

@media (max-width: 768px) {
    :where(button, [role="button"], [role="tab"], [role="radio"], summary, select, input:not([type="hidden"]), textarea, .mobile-bottom-nav a, .drawer-link, .actions-sheet-grid a, .notification-item, .nav-pill-scroll, .date-pill) {
        min-height: 44px !important;
    }

    input:not(#otp-input),
    select,
    textarea {
        font-size: 16px !important;
    }

    :where(button, [role="button"], [role="tab"], [role="radio"], summary) {
        min-width: 44px !important;
    }

    #forgot-password-link,
    #link-to-signup,
    #link-to-login,
    #signup-screen a[onclick*="openLegal"] {
        display: inline-flex !important;
        min-height: 44px !important;
        align-items: center;
        justify-content: center;
    }
}
