:root {
    color-scheme: light;
    --bg: #f6f7f4;
    --surface: #ffffff;
    --surface-soft: #eef5f2;
    --ink: #18211f;
    --muted: #5f6e69;
    --line: #d9e2dd;
    --teal: #0b8f85;
    --teal-dark: #096961;
    --amber: #c78316;
    --red: #bd3d35;
    --blue: #2764c5;
    --shadow: 0 18px 42px rgba(24, 33, 31, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body,
button,
input,
select,
textarea {
    font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--teal-dark);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--teal);
}

button,
input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
}

button,
select {
    cursor: pointer;
}

button {
    min-height: 40px;
    padding: 9px 13px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
}

button:hover {
    border-color: rgba(11, 143, 133, 0.45);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(11, 143, 133, 0.2);
    outline-offset: 2px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    background: #fbfcfa;
    color: var(--ink);
}

select {
    padding-right: 30px;
}

input::placeholder,
textarea::placeholder {
    color: #8b9894;
}

h1,
h2,
h3,
p,
dl,
dd {
    margin-top: 0;
}

h1 {
    max-width: 840px;
    margin-bottom: 16px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 10px;
    font-size: 26px;
    line-height: 1.16;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.25;
}

p {
    color: var(--muted);
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 58px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 72px;
    padding: 14px max(16px, calc((100% - 1180px) / 2));
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--ink);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand > span {
    min-width: 0;
}

.brand strong {
    line-height: 1.15;
}

.brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.site-nav a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--ink);
}

.menu-button {
    display: none;
}

.region-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.region-control select {
    width: auto;
    min-height: 36px;
    padding: 7px 28px 7px 10px;
    background-color: var(--surface);
    font-size: 13px;
}

.hero-calculator {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.78fr);
    grid-template-areas:
        "copy calculator"
        "copy result";
    gap: 18px;
    align-items: start;
    padding: 28px 0 22px;
}

.hero-calculator > * {
    min-width: 0;
    max-width: 100%;
}

.hero-copy {
    grid-area: copy;
    min-width: 0;
    padding: 32px 0;
}

.hero-copy > p:not(.eyebrow) {
    max-width: 660px;
    margin-bottom: 20px;
    font-size: 19px;
}

.calculator-card {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.compact-calculator {
    grid-area: calculator;
}

.result-card {
    display: grid;
    gap: 12px;
    padding: 22px;
}

.hero-calculator .result-card {
    grid-area: result;
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.52fr);
    gap: 20px;
    align-items: start;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1fr);
    gap: 24px;
    align-items: center;
}

.calculator-hero {
    max-width: 860px;
    margin: 10px 0 26px;
}

.calculator-hero > p:not(.eyebrow) {
    font-size: 18px;
}

.content-section {
    margin-top: 28px;
    padding: 28px 0 0;
    border-top: 1px solid var(--line);
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading p {
    margin-bottom: 0;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.trust-strip {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    max-width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.trust-strip span,
.trust-strip a {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.trust-strip a {
    font-weight: 800;
}

.calculator-card,
.result-card,
.tool-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.calculator-card,
.result-card {
    width: 100%;
    max-width: 100%;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

label span {
    line-height: 1.25;
}

.checkbox-field {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
}

.checkbox-field input {
    width: 17px;
    min-height: 17px;
    margin: 0;
    accent-color: var(--teal);
}

.result-primary {
    max-width: 100%;
    color: var(--ink);
    font-size: 44px;
    line-height: 1;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.result-card > span {
    color: var(--muted);
    font-weight: 800;
}

.metric-list {
    display: grid;
    gap: 10px;
    margin-bottom: 2px;
}

.metric-list div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.metric-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.metric-list dd {
    margin-bottom: 0;
    color: var(--ink);
    font-weight: 800;
    text-align: right;
}

.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--teal);
    border-radius: 8px;
    background: var(--teal);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.primary-link:hover {
    border-color: var(--teal-dark);
    background: var(--teal-dark);
    color: #ffffff;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tool-card {
    display: grid;
    gap: 8px;
    min-height: 154px;
    padding: 18px;
    color: var(--ink);
    text-decoration: none;
}

.tool-card:hover {
    border-color: rgba(11, 143, 133, 0.45);
    transform: translateY(-1px);
}

.tool-card strong {
    font-size: 17px;
    line-height: 1.25;
}

.tool-card span {
    color: var(--muted);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.breakdown-table caption {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

.breakdown-table th,
.breakdown-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.breakdown-table tr:last-child th,
.breakdown-table tr:last-child td {
    border-bottom: 0;
}

.breakdown-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.breakdown-table td {
    color: var(--ink);
    font-weight: 800;
    text-align: right;
}

.warning,
.warning-text {
    margin: 0;
    padding: 11px 12px;
    border: 1px solid rgba(189, 61, 53, 0.25);
    border-radius: 8px;
    background: #fff1ef;
    color: var(--red);
    font-weight: 800;
}

details {
    border-top: 1px solid var(--line);
}

details:first-child {
    border-top: 0;
}

summary {
    cursor: pointer;
    padding: 14px 0;
    color: var(--ink);
    font-weight: 800;
}

details p {
    margin-bottom: 14px;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-links h2 {
    flex: 0 0 100%;
}

.related-links a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.related-links a:hover {
    border-color: rgba(11, 143, 133, 0.45);
    color: var(--teal-dark);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 42px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.site-footer strong {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
}

.site-footer p {
    margin-bottom: 0;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 16px;
}

.site-footer a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--teal-dark);
}

.modal[hidden],
.toast[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: auto 20px 20px auto;
    z-index: 40;
    width: min(440px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(24, 33, 31, 0.18);
}

.modal h2 {
    font-size: 22px;
}

#modalKicker {
    display: block;
    margin-bottom: 6px;
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    width: min(360px, calc(100vw - 40px));
    padding: 12px 14px;
    border: 1px solid rgba(11, 143, 133, 0.25);
    border-radius: 8px;
    background: var(--ink);
    color: #ffffff;
    box-shadow: var(--shadow);
}

@media (max-width: 980px) {
    .site-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .site-nav {
        display: none;
        flex: 0 0 100%;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        padding-top: 8px;
    }

    .site-nav.open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-nav a,
    .region-control {
        min-height: 40px;
        padding: 9px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
    }

    .region-control {
        grid-column: 1 / -1;
        justify-content: space-between;
        margin-left: 0;
    }

    .region-control select {
        width: min(260px, 100%);
    }

    .hero-calculator,
    .calculator-layout,
    .split-section {
        grid-template-columns: 1fr;
        grid-template-areas:
            "copy"
            "calculator"
            "result";
    }

    .hero-copy {
        padding-bottom: 10px;
    }

    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    main {
        width: min(1180px, calc(100% - 80px));
        padding: 22px 0 42px;
    }

    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        max-width: 100%;
        padding-right: 12px;
        padding-left: 12px;
    }

    .menu-button {
        position: relative;
        width: 44px;
        min-width: 44px;
        padding: 0;
        overflow: hidden;
        font-size: 0;
    }

    .menu-button::before {
        content: "";
        position: absolute;
        left: 12px;
        top: 19px;
        width: 18px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
    }

    .brand small {
        display: none;
    }

    .site-nav.open,
    .field-grid,
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .site-nav.open {
        grid-column: 1 / -1;
    }

    .calculator-card,
    .result-card {
        padding: 18px;
    }

    .hero-copy {
        max-width: calc(100vw - 24px);
        padding-top: 14px;
    }

    .hero-copy > p:not(.eyebrow),
    .calculator-hero > p:not(.eyebrow) {
        max-width: calc(100vw - 24px);
        font-size: 16px;
    }

    .trust-strip {
        display: flex;
        width: 100%;
        max-width: calc(100vw - 24px);
    }

    h1 {
        max-width: 100%;
        font-size: clamp(28px, 8.2vw, 34px);
        overflow-wrap: break-word;
    }

    h2 {
        font-size: 22px;
    }

    .result-primary {
        font-size: 36px;
    }

    .tool-card {
        min-height: 0;
    }

    .breakdown-table th,
    .breakdown-table td {
        padding: 10px 11px;
    }

    .site-footer {
        flex-direction: column;
        width: min(1180px, calc(100% - 80px));
    }

    .site-footer nav {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    main {
        width: calc(100% - 24px);
        margin-right: auto;
        margin-left: auto;
    }

    .site-header {
        width: 100%;
    }

    .hero-copy,
    .hero-copy > p:not(.eyebrow),
    .calculator-hero > p:not(.eyebrow),
    .trust-strip,
    h1 {
        max-width: 100%;
    }

    .calculator-card,
    .result-card {
        max-width: 100%;
    }
}

body[data-page="home"] main {
    width: min(1440px, calc(100% - 32px));
}

.brand-mark {
    position: relative;
    border-radius: 11px;
    background: #123a2b;
    color: transparent;
}

.brand-mark::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 20px;
    width: 21px;
    height: 10px;
    border-left: 3px solid #78f0b3;
    border-bottom: 3px solid #78f0b3;
    transform: skewX(-14deg) rotate(-18deg);
}

.brand-mark::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
}

.language-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.language-control select {
    width: auto;
    min-height: 36px;
    padding: 7px 28px 7px 10px;
    background-color: var(--surface);
    font-size: 13px;
}

.marginpath-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
    align-items: end;
    padding: 28px 0 14px;
}

.marginpath-hero > *,
.marginpath-workbench > * {
    min-width: 0;
}

.marginpath-hero h1 {
    max-width: 780px;
    margin-bottom: 10px;
    font-size: clamp(34px, 4vw, 52px);
}

.hero-lede {
    max-width: 760px;
    margin-bottom: 0;
    font-size: 17px;
}

.trust-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.trust-card a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.marginpath-workbench {
    display: grid;
    grid-template-columns: minmax(286px, 330px) minmax(0, 1fr);
    grid-template-areas:
        "calculator chart"
        "result chart";
    gap: 16px;
    align-items: start;
    margin-top: 12px;
}

.sankey-input-card {
    grid-area: calculator;
}

.sankey-card {
    grid-area: chart;
}

.sankey-result-card {
    grid-area: result;
}

.sankey-input-card,
.sankey-result-card,
.sankey-card {
    border-radius: 14px;
}

.card-head,
.sankey-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfa;
}

.card-head h2,
.sankey-head h2 {
    margin-bottom: 0;
    font-size: 16px;
}

.card-head p,
.sankey-head p {
    margin: 4px 0 0;
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.form-groups {
    display: grid;
    gap: 0;
    padding: 0 16px 16px;
}

.form-group {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.form-group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.group-title {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.form-group label {
    grid-template-columns: minmax(0, 1fr) 106px;
    align-items: center;
    margin-top: 8px;
}

.form-group label:first-of-type {
    margin-top: 0;
}

.form-group input {
    min-height: 40px;
    text-align: right;
    font-weight: 800;
}

.primary-input {
    border-color: #72c798;
    box-shadow: 0 0 0 3px rgba(75, 208, 131, 0.14);
}

.sankey-card {
    min-height: 722px;
    overflow: hidden;
    border: 1px solid #101827;
    background:
        radial-gradient(circle at 18% 46%, rgba(45, 199, 123, 0.18), transparent 26%),
        linear-gradient(180deg, #172033 0%, #141c2b 100%);
    color: #ffffff;
    box-shadow: 0 24px 70px rgba(9, 16, 28, 0.28);
}

.sankey-head {
    border-bottom: 0;
    background: transparent;
    color: #ffffff;
    padding: 18px 20px 8px;
}

.sankey-head p {
    color: rgba(255, 255, 255, 0.62);
}

.sankey-stage {
    position: relative;
    height: 656px;
    margin: 0;
    overflow: hidden;
    border-radius: 0 0 14px 14px;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 74px 74px;
    background-position: -22px -26px;
}

.sankey-svg {
    position: absolute;
    inset: 4px 0 0;
    width: 100%;
    height: 100%;
}

.sankey-canvas {
    position: absolute;
    inset: 0;
}

.sankey-rendered-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.sankey-link {
    transition: opacity 180ms ease, filter 180ms ease;
}

.sankey-link-profit {
    fill: url("#sankeyProfitGradient");
}

.sankey-link-cost,
.sankey-link-costs {
    fill: url("#sankeyCostGradient");
}

.sankey-link-shipping {
    fill: url("#sankeyShippingGradient");
}

.sankey-node {
    shape-rendering: crispEdges;
}

.sankey-node-source,
.sankey-node-profit {
    fill: #22ad69;
}

.sankey-node-costs,
.sankey-node-cost {
    fill: #d44449;
}

.sankey-node-shipping {
    fill: #d88a23;
}

.sankey-svg-label {
    fill: #ffffff;
    font-size: 20px;
    font-weight: 900;
    paint-order: stroke;
    stroke: rgba(20, 28, 43, 0.72);
    stroke-width: 4px;
    stroke-linejoin: round;
}

.sankey-svg-value {
    font-style: italic;
    font-weight: 760;
}

.flow-ribbon {
    fill: none;
    stroke-linecap: butt;
    stroke-linejoin: round;
    transition: stroke-width 180ms ease;
}

.flow-profit {
    stroke: url("#profitRibbon");
    stroke-width: var(--flow-profit-width, 176);
}

.flow-costs {
    stroke: url("#costRibbon");
    stroke-width: var(--flow-costs-width, 130);
}

.flow-cogs {
    stroke: url("#costRibbon");
    stroke-width: var(--flow-cogs-width, 64);
}

.flow-affiliate {
    stroke: url("#costRibbon");
    stroke-width: var(--flow-affiliate-width, 36);
}

.flow-platform {
    stroke: url("#costRibbon");
    stroke-width: var(--flow-platform-width, 26);
}

.flow-shipping {
    stroke: url("#shippingRibbon");
    stroke-width: var(--flow-shipping-width, 54);
}

.flow-node {
    position: absolute;
    width: 16px;
    border-radius: 0;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
}

.node-source,
.node-profit {
    background: #22ad69;
}

.node-source {
    left: 20.6%;
    top: 13%;
    height: 64%;
}

.node-profit {
    right: 2.3%;
    top: 15%;
    height: 34%;
}

.node-split,
.node-cogs,
.node-affiliate,
.node-platform,
.node-shipping {
    background: #cf3f45;
}

.node-split {
    left: 55.8%;
    top: 51.5%;
    height: 23%;
}

.node-cogs {
    right: 2.3%;
    top: 58.5%;
    height: 11%;
}

.node-affiliate {
    right: 2.3%;
    top: 72.5%;
    height: 6.5%;
}

.node-platform {
    right: 2.3%;
    top: 81.5%;
    height: 5.4%;
}

.node-shipping {
    right: 2.3%;
    top: 90.5%;
    height: 5.8%;
    background: #d88a23;
}

.sankey-source-bubble {
    position: absolute;
    left: 18px;
    top: 36%;
    display: grid;
    place-items: center;
    width: 136px;
    height: 136px;
    border-radius: 50%;
    background: #0e3c2f;
    color: #ffffff;
    box-shadow: 0 24px 48px rgba(5, 24, 18, 0.34);
}

.sankey-source-bubble span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 800;
}

.sankey-source-bubble strong {
    margin-top: -24px;
    font-size: 36px;
    line-height: 1;
}

.flow-tag {
    position: absolute;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
    white-space: nowrap;
}

.flow-tag b {
    font-style: italic;
    font-weight: 780;
}

.tag-profit {
    left: 24%;
    top: 35%;
}

.tag-net {
    right: 6%;
    top: 27%;
}

.tag-costs {
    left: 57%;
    top: 58%;
}

.tag-cogs {
    right: 6%;
    top: 60.5%;
}

.tag-affiliate {
    right: 6%;
    top: 74.5%;
}

.tag-platform {
    right: 6%;
    top: 83%;
}

.tag-shipping {
    right: 6%;
    top: 91%;
    opacity: 0.9;
}

.sankey-mobile-summary {
    display: none;
}

.sankey-result-card .label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sankey-result-card .result-primary {
    color: #0f8058;
    font-size: 56px;
}

.sankey-result-card > p {
    margin-bottom: 14px;
}

.seller-receipt {
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.seller-receipt h3 {
    margin: 0;
    padding: 13px 14px 8px;
    font-size: 15px;
}

.seller-receipt div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    color: #3d4d45;
    font-size: 13px;
    font-weight: 700;
}

.seller-receipt .negative {
    color: #9e3d4f;
}

.seller-receipt .positive {
    background: #f1faf5;
    color: #0f8058;
    font-weight: 850;
}

.independence-note {
    margin: 14px 0 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fbfcfa;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

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

@media (max-width: 1120px) {
    .marginpath-hero,
    .marginpath-workbench {
        grid-template-columns: 1fr;
        grid-template-areas:
            "chart"
            "calculator"
            "result";
    }

    .sankey-card {
        min-height: 620px;
    }
}

@media (max-width: 980px) {
    .language-control {
        grid-column: 1 / -1;
        justify-content: space-between;
        min-height: 40px;
        padding: 9px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
    }

    .language-control select {
        width: min(260px, 100%);
    }
}

@media (max-width: 760px) {
    body[data-page="home"] main {
        width: min(1180px, calc(100% - 80px));
        max-width: calc(100vw - 80px);
    }

    .marginpath-hero {
        width: 100%;
        max-width: 100%;
        padding-top: 18px;
    }

    .marginpath-hero > *,
    .trust-card,
    .sankey-input-card,
    .sankey-result-card {
        max-width: 100%;
    }

    .marginpath-hero h1 {
        max-width: 100%;
        font-size: clamp(28px, 8.2vw, 34px);
    }

    .hero-lede {
        max-width: 100%;
        font-size: 15px;
    }

    .sankey-card {
        min-height: auto;
    }

    .sankey-stage {
        display: none;
    }

    .sankey-mobile-summary {
        display: grid;
        gap: 8px;
        padding: 14px 16px 16px;
    }

    .mobile-flow-row {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 11px 12px;
        background: rgba(255, 255, 255, 0.055);
        color: rgba(255, 255, 255, 0.82);
        font-weight: 800;
    }

    .mobile-flow-row b {
        color: #ffffff;
        font-style: italic;
    }

    .mobile-flow-row.positive {
        border-color: rgba(64, 214, 135, 0.28);
        background: rgba(42, 187, 113, 0.16);
    }

    .form-group label {
        grid-template-columns: minmax(0, 1fr) 104px;
    }

    .sankey-result-card .result-primary {
        font-size: 42px;
    }
}
