/* Stacked Excel-tab preview for the pink workbook. */

.workbook-preview-page.home-editorial {
    background: #f7eef2;
}

.workbook-preview-page .preview-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

.preview-intro {
    margin-bottom: 1.25rem;
}

.preview-kicker {
    display: inline-block;
    margin-bottom: 0.55rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.preview-intro h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    line-height: 1.15;
    color: #3d2a38;
}

.preview-intro p {
    margin: 0 0 0.9rem;
    max-width: 46rem;
    color: #5c4a56;
    line-height: 1.55;
}

.preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.preview-actions a {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}

.preview-actions .preview-get {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    max-width: 28rem;
    line-height: 1.35;
    text-align: left;
}

.preview-actions .preview-home {
    background: #fff;
    color: #db2777;
    border: 1.5px solid #ec4899;
}

.sheet-tile {
    scroll-margin-top: 8.5rem;
}

.preview-jump {
    position: sticky;
    top: 68px;
    z-index: 30;
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    margin: 0 -1rem 1.25rem;
    padding: 0.55rem 1rem;
    background: rgba(247, 238, 242, 0.94);
    border-bottom: 1px solid #e7d0dc;
}

.preview-jump a {
    flex: 0 0 auto;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #fff;
    color: #5c3a54;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e0c4d2;
}

.preview-jump a:hover {
    background: #f8e8ef;
}

.sheet-stack {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.sheet-tile {
    background: #fff;
    border: 1px solid #e0c4d2;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(92, 58, 84, 0.08);
    overflow: hidden;
}

.excel-tabs {
    display: flex;
    gap: 0.2rem;
    overflow-x: auto;
    padding: 0.55rem 0.7rem 0;
    background: #efe4ea;
}

.excel-tabs a {
    flex: 0 0 auto;
    padding: 0.38rem 0.7rem;
    border-radius: 8px 8px 0 0;
    color: #6b5a66;
    font-size: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
}

.excel-tabs a.active {
    background: #fff;
    color: #5c3a54;
    font-weight: 700;
}

.formula-bar {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-bottom: 1px solid #ead6e0;
    background: #fffafc;
    color: #6b5a66;
    font-size: 0.75rem;
}

.formula-bar span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 4px;
    background: #f3c6d6;
    color: #5c3a54;
    font-weight: 700;
    font-style: italic;
}

.sheet-shot {
    margin: 0;
    background: #f6f1ea;
}

.sheet-shot img {
    display: block;
    width: 100%;
    height: auto;
}

.sheet-shot figcaption {
    margin: 0;
    padding: 0.55rem 0.85rem 0.75rem;
    color: #6b5a66;
    font-size: 0.8rem;
    line-height: 1.4;
}

.sheet-body {
    padding: 1rem 1rem 1.15rem;
}

.sheet-body h2 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    color: #5c3a54;
}

.sheet-lead {
    margin: 0 0 0.9rem;
    color: #6b5a66;
    font-size: 0.9rem;
    line-height: 1.45;
}

.sheet-note {
    margin: 0.75rem 0 0;
    color: #6b5a66;
    font-size: 0.8rem;
    line-height: 1.4;
}

.step-grid,
.know-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.step-grid li,
.know-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
    color: #2a2430;
    line-height: 1.45;
}

.step-num,
.know-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #f3c6d6;
    color: #5c3a54;
    font-size: 0.75rem;
    font-weight: 700;
}

.sheet-section-label {
    margin: 1rem 0 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7a4f6e;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.9rem;
}

.kpi-row.six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi-row.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi {
    background: #faf4f7;
    border: 1px solid #ead6e0;
    border-radius: 10px;
    padding: 0.65rem 0.7rem;
}

.kpi strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.05rem;
    color: #3d2a38;
}

.kpi span,
.kpi em {
    display: block;
    color: #6b5a66;
    font-size: 0.72rem;
    font-style: normal;
}

.sheet-split {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0.75rem;
}

.table-scroll {
    overflow-x: auto;
}

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.sheet-table th,
.sheet-table td {
    padding: 0.38rem 0.5rem;
    border: 1px solid #ead6e0;
    text-align: left;
    white-space: nowrap;
}

.sheet-table th {
    background: #f8e8ef;
    color: #5c3a54;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sheet-table td.num,
.sheet-table th.num {
    text-align: right;
}

.sheet-table .in {
    background: #f3c6d6;
}

.mini-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.mini-bars div {
    display: grid;
    grid-template-columns: 7.5rem 1fr auto;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.78rem;
    color: #5c4a56;
}

.mini-bars i {
    display: block;
    height: 0.55rem;
    border-radius: 999px;
    background: #e7d0dc;
    overflow: hidden;
}

.mini-bars i b {
    display: block;
    height: 100%;
    background: #c45b86;
}

.pace {
    font-weight: 700;
    color: #1f5c36;
}

.pace.watch {
    color: #9a5416;
}

.crop {
    position: relative;
}

.crop-fade {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4.5rem;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 78%);
    pointer-events: none;
}

.smart-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10rem;
    gap: 0.75rem 1rem;
    align-items: end;
}

.colour-key {
    list-style: none;
    margin: 0 0 0.9rem;
    padding: 0;
}

.colour-key li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.28rem;
    color: #5c4a56;
    font-size: 0.78rem;
}

.swatch {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
}

.swatch.income { background: #8fceab; }
.swatch.expense { background: #e7a3bf; }
.swatch.savings { background: #9ebfee; }
.swatch.debt { background: #f0c48a; }

.cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.cal-head {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a4f6e;
}

.cal-day {
    min-height: 3.3rem;
    padding: 0.25rem 0.3rem;
    border: 1px solid #ead6e0;
    border-radius: 8px;
    background: #fff;
}

.cal-day.mute {
    background: #faf4f7;
    border-color: transparent;
}

.cal-day b {
    display: block;
    font-size: 0.72rem;
    color: #5c3a54;
}

.cal-day em {
    display: inline-block;
    margin-top: 0.15rem;
    padding: 0.02rem 0.28rem;
    border-radius: 4px;
    font-style: normal;
    font-size: 0.66rem;
    font-weight: 700;
}

.cal-day em.income { background: #d9f2e3; color: #1f5c36; }
.cal-day em.expense { background: #f8d5e3; color: #8a3158; }
.cal-day em.savings { background: #d9e8fb; color: #1e4b8a; }
.cal-day em.debt { background: #fde7c7; color: #8a4b12; }

.preview-more {
    margin: 1.15rem 0 0;
    color: #5c4a56;
    line-height: 1.5;
}

.workbook-contents {
    scroll-margin-top: 8.5rem;
    margin-top: 1.5rem;
    background: #fff;
    border: 1px solid #e0c4d2;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(92, 58, 84, 0.08);
    padding: 1.15rem 1.15rem 0.55rem;
}

.workbook-contents h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    color: #5c3a54;
}

.workbook-contents > p {
    margin: 0 0 0.75rem;
    color: #6b5a66;
    font-size: 0.9rem;
}

.workbook-contents ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.workbook-contents li {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-top: 1px solid #ead6e0;
    color: #2a2430;
    line-height: 1.4;
}

.workbook-contents strong {
    color: #5c3a54;
}

.kpi.neg strong {
    color: #8a3158;
}

.dash-graphs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.graph-card {
    margin: 0;
    padding: 0.7rem 0.75rem 0.55rem;
    border: 1px solid #ead6e0;
    border-radius: 10px;
    background: #fffafc;
}

.graph-card figcaption {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7a4f6e;
}

.graph-frame {
    position: relative;
    height: 220px;
}

.year-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.35rem;
    align-items: end;
    height: 9rem;
    margin: 0 0 0.45rem;
}

.year-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}

.year-pair {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 6.5rem;
}

.year-pair i {
    display: block;
    width: 38%;
    max-width: 0.7rem;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
}

.year-pair i.income { background: #8fceab; }
.year-pair i.expense { background: #e7a3bf; }

.year-col span {
    margin-top: 0.25rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #7a4f6e;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.35rem;
    color: #6b5a66;
    font-size: 0.78rem;
}

.chart-legend .swatch {
    margin-left: 0.45rem;
}

.chart-legend .swatch:first-child {
    margin-left: 0;
}

.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.cal-nav strong {
    color: #5c3a54;
    font-size: 1.05rem;
}

.cal-switch {
    padding: 0.4rem 0.7rem;
    border: 1px solid #e0c4d2;
    border-radius: 999px;
    background: #fff;
    color: #5c3a54;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.cal-switch:disabled {
    opacity: 0.45;
    cursor: default;
}

.cal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16rem;
    gap: 1rem;
    align-items: start;
}

.cal-day.day-income { background: #f3faf6; }
.cal-day.day-expense { background: #fff5f8; }
.cal-day.day-savings { background: #f4f8fd; }
.cal-day.day-debt { background: #fff8ef; }

.cal-day em.more {
    background: transparent;
    color: #7a4f6e;
    font-weight: 600;
}

.cal-side h3 {
    margin: 0 0 0.45rem;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7a4f6e;
}

.repeat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.repeat-list li {
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1fr) auto;
    gap: 0.35rem;
    padding: 0.35rem 0;
    border-top: 1px solid #ead6e0;
    color: #2a2430;
    font-size: 0.78rem;
}

.repeat-list li span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repeat-list strong.income { color: #1f5c36; }
.repeat-list strong.expense { color: #8a3158; }
.repeat-list strong.savings { color: #1e4b8a; }
.repeat-list strong.debt { color: #8a4b12; }

@media (max-width: 640px) {
    .workbook-contents li {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}

@media (max-width: 900px) {
    .kpi-row,
    .kpi-row.six,
    .kpi-row.four,
    .sheet-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .smart-top,
    .cal-layout,
    .dash-graphs {
        grid-template-columns: 1fr;
    }

    .year-chart {
        height: 7rem;
    }

    .colour-key {
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem 0.8rem;
        margin-top: 0;
    }
}

@media (max-width: 560px) {
    .kpi-row,
    .kpi-row.six,
    .kpi-row.four {
        grid-template-columns: 1fr;
    }
}
