:root {
    color-scheme: light;
    --ink: #17211d;
    --muted: #64716b;
    --paper: #f7f5f0;
    --surface: #ffffff;
    --line: #d9ded5;
    --green: #194f3f;
    --teal: #0f766e;
    --gold: #b7791f;
    --rose: #9f3a4a;
    --shadow: 0 16px 50px rgba(23, 33, 29, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--teal);
}

.site-header,
.site-footer,
.hero,
.calculator-hero,
.calculator-shell,
.dashboard-hero,
.dashboard-shell,
.content-grid,
.page-intro,
.article-shell,
.related-posts {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 0.95rem;
}

.brand small {
    font-size: 0.78rem;
}

.brand small,
.eyebrow,
.eyebrow-text,
.byline,
.site-footer {
    color: var(--muted);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.site-nav a,
.pagination a,
.empty-state a,
.search-form button {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--surface);
    font-weight: 700;
}

.site-nav a:last-child,
.search-form button {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 28px;
    align-items: stretch;
    padding: 10px 0 32px;
}

.hero-copy {
    padding: 46px;
    background:
        linear-gradient(135deg, rgba(25, 79, 63, 0.95), rgba(15, 118, 110, 0.88)),
        url("https://images.unsplash.com/photo-1642790106117-e829e14a795f?auto=format&fit=crop&w=1400&q=80");
    background-position: center;
    background-size: cover;
    color: #fff;
    border-radius: 8px;
    min-height: 460px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-copy h1,
.page-intro h1,
.article-header h1 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: 0;
}

.hero-copy h1 {
    max-width: 760px;
    font-size: clamp(1.95rem, 5.25vw, 4.05rem);
}

.hero-copy p {
    max-width: 720px;
    font-size: 1.1rem;
}

.eyebrow-text {
    margin: 0 0 12px;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.search-form {
    width: min(620px, 100%);
    margin-top: 18px;
}

.search-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.search-form div {
    display: flex;
    gap: 8px;
}

.search-form input {
    min-width: 0;
    flex: 1;
    border: 0;
    border-radius: 8px;
    padding: 14px 16px;
    font: inherit;
}

.hero-feature,
.sidebar section,
.post-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-feature {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hero-feature span,
.hero-feature strong {
    color: var(--gold);
    text-transform: uppercase;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.hero-feature h2 {
    font-size: 2rem;
    line-height: 1.15;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 28px;
    padding: 24px 0 52px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-heading h2,
.related-posts h2 {
    margin: 0;
    font-size: 1.6rem;
}

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

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

.post-card {
    overflow: hidden;
}

.post-card-image,
.article-image {
    width: 100%;
    object-fit: cover;
    display: block;
}

.post-card-image {
    height: 220px;
}

.post-card-body {
    padding: 22px;
}

.eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    font-weight: 700;
}

.post-card h2 {
    margin: 10px 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.excerpt-content p {
    margin: 0 0 1rem;
}

.excerpt-content p:last-child {
    margin-bottom: 0;
}

.excerpt-content ul,
.excerpt-content ol {
    margin: 0.5rem 0 1rem;
    padding-left: 1.2rem;
}

.excerpt-content strong {
    color: var(--green);
}

.deck {
    color: var(--green);
    font-weight: 700;
}

.tag-row,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row span,
.tag-cloud span {
    border-radius: 999px;
    background: #edf4f0;
    color: var(--green);
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.sidebar {
    display: grid;
    align-content: start;
    gap: 16px;
}

.sidebar section {
    padding: 20px;
}

.sidebar h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.link-list,
.mini-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li,
.mini-list li {
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.page-intro {
    padding: 48px 0 20px;
}

.page-intro h1,
.article-header h1 {
    font-size: clamp(2.2rem, 6vw, 4.2rem);
}

.article-shell {
    max-width: 860px;
    padding: 46px 0;
}

.article-header {
    margin-bottom: 28px;
}

.article-deck {
    color: var(--green);
    font-size: 1.24rem;
    font-weight: 700;
}

.byline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.byline strong {
    color: var(--rose);
}

.article-image {
    max-height: 480px;
    border-radius: 8px;
    margin-bottom: 28px;
}

.article-body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.14rem;
    color: #25312c;
}

.article-body p {
    margin: 0 0 1.25em;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.2;
    margin: 1.6em 0 0.6em;
}

.article-body h2 {
    font-size: 1.65rem;
}

.article-body h3 {
    font-size: 1.35rem;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
    margin: 0 0 1.25em;
}

.article-body blockquote {
    border-left: 4px solid var(--gold);
    color: var(--green);
    margin: 1.5em 0;
    padding: 0.2rem 0 0.2rem 1rem;
    font-style: italic;
}

.article-body code {
    background: #edf4f0;
    border-radius: 6px;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 0.92em;
    padding: 0.1rem 0.35rem;
}

.article-body pre {
    background: #17211d;
    border-radius: 8px;
    color: #f7f5f0;
    overflow-x: auto;
    padding: 1rem;
}

.article-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.article-body table {
    border-collapse: collapse;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
    margin: 1.5em 0;
    width: 100%;
}

.calculator-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: end;
    padding: 46px 0 26px;
}

.calculator-hero h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(2.2rem, 6vw, 4.35rem);
    line-height: 1.04;
    letter-spacing: 0;
}

.calculator-hero p:last-child {
    max-width: 760px;
    color: var(--green);
    font-size: 1.12rem;
    font-weight: 700;
}

.calculator-summary,
.calculator-panel,
.calculator-results article,
.payment-breakdown,
.refi-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.calculator-summary {
    padding: 24px;
}

.calculator-summary span,
.calculator-results span,
.refi-highlight span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calculator-summary strong {
    display: block;
    color: var(--green);
    font-size: 2.35rem;
    line-height: 1.15;
    margin-top: 8px;
}

.calculator-summary small {
    color: var(--muted);
}

.calculator-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 28px;
    align-items: start;
    padding: 10px 0 58px;
}

.calculator-panel {
    padding: 26px;
}

.calculator-section + .calculator-section {
    border-top: 1px solid var(--line);
    margin-top: 28px;
    padding-top: 24px;
}

.calculator-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.calculator-section-heading h2,
.payment-breakdown h2,
.refi-card h2 {
    margin: 0;
    font-size: 1.2rem;
}

.reset-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #edf4f0;
    color: var(--green);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 9px 13px;
}

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

.field-grid label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.field-grid span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.field-grid input,
.field-grid select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfaf7;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    padding: 10px 12px;
}

.field-grid input:focus,
.field-grid select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
    outline: 0;
}

.calculator-results {
    display: grid;
    gap: 16px;
}

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

.calculator-results article {
    min-height: 128px;
    padding: 18px;
}

.calculator-results article strong,
.refi-highlight strong {
    display: block;
    margin-top: 10px;
    color: var(--green);
    font-size: 1.65rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.payment-breakdown,
.refi-card {
    padding: 22px;
}

.bar-stack {
    display: flex;
    height: 16px;
    overflow: hidden;
    border-radius: 8px;
    background: #edf4f0;
    margin: 18px 0;
}

.bar-stack span {
    display: block;
    min-width: 0;
    transition: width 180ms ease;
}

#barPi {
    background: var(--green);
}

#barTax {
    background: var(--teal);
}

#barInsurance {
    background: var(--gold);
}

#barExtras {
    background: var(--rose);
}

#barStake {
    background: var(--green);
}

#barFee {
    background: var(--rose);
}

#barProfit {
    background: var(--gold);
}

.payment-breakdown dl,
.refi-card dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.payment-breakdown dl div,
.refi-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.payment-breakdown dt,
.refi-card dt {
    color: var(--muted);
    font-weight: 700;
}

.payment-breakdown dd,
.refi-card dd {
    margin: 0;
    font-weight: 800;
    text-align: right;
}

.refi-highlight {
    border-left: 4px solid var(--gold);
    margin: 18px 0;
    padding-left: 16px;
}

.refi-card p {
    color: var(--green);
    font-weight: 700;
    margin: 16px 0 0;
}

.retirement-meter {
    height: 18px;
    overflow: hidden;
    border-radius: 8px;
    background: #edf4f0;
    margin: 18px 0;
}

.retirement-meter span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--teal), var(--green));
    transition: width 180ms ease;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: end;
    padding: 46px 0 24px;
}

.dashboard-hero h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(2.2rem, 6vw, 4.35rem);
    line-height: 1.04;
    letter-spacing: 0;
}

.dashboard-hero p:last-child {
    max-width: 760px;
    color: var(--green);
    font-size: 1.12rem;
    font-weight: 700;
}

.dashboard-aside,
.indicator-card,
.market-tile,
.dashboard-note {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dashboard-aside {
    padding: 24px;
}

.dashboard-aside span,
.indicator-card span,
.market-tile span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-aside strong {
    display: block;
    color: var(--green);
    font-size: 1.75rem;
    line-height: 1.15;
    margin-top: 8px;
}

.dashboard-aside small {
    color: var(--muted);
}

.dashboard-shell {
    display: grid;
    gap: 22px;
    padding: 10px 0 58px;
}

.dashboard-hero.etf-dashboard-hero,
.dashboard-shell.etf-dashboard-shell {
    width: min(1400px, calc(100% - 32px));
}

.dashboard-section {
    display: grid;
    gap: 14px;
}

.dashboard-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-section-heading h2,
.dashboard-note h2 {
    margin: 0;
    font-size: 1.35rem;
}

.dashboard-section-heading a {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--green);
    font-size: 0.88rem;
    font-weight: 800;
    padding: 8px 12px;
}

.indicator-grid {
    display: grid;
    grid-template-columns: 1.1fr repeat(2, minmax(0, 0.95fr));
    gap: 16px;
}

.indicator-card,
.market-tile {
    min-width: 0;
    min-height: 168px;
    padding: 20px;
}

.indicator-card.featured {
    border-top: 5px solid var(--green);
}

.indicator-card strong,
.market-tile strong {
    display: block;
    color: var(--green);
    font-size: 2rem;
    line-height: 1.12;
    margin-top: 10px;
    overflow-wrap: anywhere;
}

.indicator-card strong a,
.market-tile strong a,
.trend a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.12em;
}

.indicator-card strong a:hover,
.market-tile strong a:hover,
.trend a:hover {
    color: var(--teal);
}

.indicator-card p {
    color: #25312c;
    margin: 12px 0;
}

.trend {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-weight: 800;
    padding: 5px 9px;
}

.trend.up {
    background: #eaf4ee;
    color: var(--green);
}

.trend.down {
    background: #f7ecef;
    color: var(--rose);
}

.trend.neutral {
    background: #f7f1df;
    color: #7c5518;
}

.market-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.market-tile {
    min-height: 150px;
}

.market-tile strong {
    font-size: 1.7rem;
}

.dashboard-note {
    border-left: 5px solid var(--gold);
    padding: 24px;
}

.dashboard-note p {
    color: var(--green);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 10px 0 0;
}

.forecast-table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.forecast-table {
    border-collapse: collapse;
    min-width: 1120px;
    width: 100%;
}

.forecast-table th,
.forecast-table td {
    border-bottom: 1px solid var(--line);
    padding: 13px 15px;
    text-align: left;
    vertical-align: top;
}

.forecast-table th {
    background: #edf4f0;
    color: var(--green);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.forecast-sort-button {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
    padding: 0;
    text-align: left;
    text-transform: inherit;
    width: 100%;
}

.forecast-sort-button:focus-visible {
    border-radius: 3px;
    outline: 2px solid var(--green);
    outline-offset: 3px;
}

.forecast-table th[aria-sort="ascending"] .forecast-sort-button::after {
    content: " ▲";
}

.forecast-table th[aria-sort="descending"] .forecast-sort-button::after {
    content: " ▼";
}

.forecast-table th small {
    color: var(--muted);
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0;
    margin-top: 2px;
    text-transform: none;
}

.forecast-table td {
    font-weight: 700;
}

.forecast-table td small {
    color: var(--muted);
    display: block;
    font-weight: 700;
    margin-top: 3px;
}

.article-body th,
.article-body td {
    border: 1px solid var(--line);
    padding: 0.65rem;
    text-align: left;
}

.article-body th {
    background: #edf4f0;
    color: var(--green);
}

.article-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.related-posts {
    padding-bottom: 58px;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 24px 0 36px;
}

@media (max-width: 920px) {
    .hero,
    .calculator-hero,
    .calculator-shell,
    .dashboard-hero,
    .content-grid,
    .post-grid.three {
        grid-template-columns: 1fr;
    }

    .post-grid,
    .indicator-grid,
    .market-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header,
    .search-form div,
    .section-heading,
    .calculator-section-heading,
    .dashboard-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-copy {
        min-height: 520px;
        padding: 28px;
    }

    .site-nav {
        width: 100%;
    }

    .site-nav a,
    .search-form button {
        text-align: center;
        width: 100%;
    }

    .calculator-hero {
        padding-top: 28px;
    }

    .dashboard-hero {
        padding-top: 28px;
    }

    .calculator-panel,
    .calculator-summary,
    .payment-breakdown,
    .refi-card,
    .dashboard-aside,
    .indicator-card,
    .market-tile,
    .dashboard-note {
        padding: 18px;
    }

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

    .calculator-results article {
        min-height: 108px;
    }
}
