:root {
    --bg: #0e1420;
    --panel: #151e2c;
    --raised: #1a2738;
    --line: #2e4154;
    --text: #edf3f8;
    --muted: #a6b6c7;
    --teal: #7ccbc6;
    --blue: #addfff;
    --input: #263e52;
    --green: #91e5bd;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.65 Inter, Arial, sans-serif;
}

.page {
    max-width: 1080px;
    margin: auto;
    padding: 48px 22px 70px;
}

/* HEADER */

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: var(--teal);
}

h1 {
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin: 12px 0;
    font-weight: 700;
}

h2 {
    font-size: 21px;
    line-height: 1.25;
    margin: 7px 0 13px;
}

.subtitle {
    font-size: 16px;
    color: var(--muted);
    max-width: 800px;
}

.notice {
    max-width: 900px;
    font-size: 12px;
    color: var(--muted);
    border-left: 3px solid var(--teal);
    padding: 7px 14px;
    margin: 22px 0 30px;
    background: #172332;
}

.notice strong {
    color: var(--text);
}

/* KPI CARDS */

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 28px 0 36px;
}

.kpi {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 17px;
}

.kpi span,
.kpi small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.kpi strong {
    display: block;
    font-size: 29px;
    line-height: 1.5;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

/* SECTIONS */

.section {
    margin-top: 36px;
}

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

.muted {
    color: var(--muted);
    font-size: 13px;
    max-width: 830px;
    margin: 0 0 17px;
}

/* SPREADSHEET */

.worksheet {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel);
}

.sheet-toolbar {
    background: var(--raised);
    padding: 11px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--line);
}

.xls {
    background: #215943;
    color: #dbffeb;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 10px;
    margin-right: 7px;
}

.sheet-label {
    color: var(--teal);
}

.scroll-table {
    overflow: auto;
}

table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    table-layout: fixed;
}

td,
th {
    border: 1px solid var(--line);
    padding: 10px 13px;
    text-align: left;
}

tbody th,
.letters th {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    text-align: center;
    background: #172434;
    padding: 8px 4px;
}

.letters th {
    padding: 5px;
}

.group td {
    background: #1a2a3a;
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* EDITABLE INPUTS */

.input-cell {
    background: var(--input);
    padding: 5px 8px;
}

.input-cell:focus-within {
    outline: 2px solid var(--teal);
    outline-offset: -2px;
}

.input-cell input,
.input-cell select {
    appearance: auto;
    border: 0;
    outline: none;
    background: transparent;
    color: white;
    width: 100%;
    padding: 5px;
    font: 600 16px Inter, Arial, sans-serif;
}

.input-cell select option {
    color: #112033;
    background: #e7edf5;
}

.input-cell input:invalid {
    color: #ffb3ae;
}

.money {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--blue);
}

.hint {
    font-size: 12px;
    color: var(--muted);
}

/* RESULTS */

.output {
    background: #1b3531;
    color: var(--green);
    font-weight: 750;
    font-size: 23px;
    font-variant-numeric: tabular-nums;
}

.output-secondary {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.formula {
    font-family: Consolas, Monaco, monospace;
    color: var(--blue);
    font-size: 12px;
    overflow-wrap: anywhere;
}

/* PROBABILITY CHART */

.result-chart {
    padding: 22px;
    background: var(--raised);
}

.chart-title {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 12px;
}

.chart-title span {
    color: var(--teal);
}

.track {
    height: 18px;
    background: #344759;
    overflow: hidden;
    border-radius: 4px;
}

.track div {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3e8589, var(--teal));
    transition: width 0.2s;
}

.axis {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
    margin-top: 6px;
}

.chart-subtitle {
    color: var(--muted);
    font-size: 11px;
    margin-top: 14px;
}

/* BUTTONS */

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

button {
    border: 1px solid var(--line);
    background: var(--raised);
    color: var(--text);
    border-radius: 5px;
    padding: 10px 14px;
    font: 600 12px Inter, Arial, sans-serif;
    cursor: pointer;
}

button:hover {
    border-color: var(--teal);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

/* SENSITIVITY ANALYSIS */

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

.comparison-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 16px;
}

.comparison-card h3 {
    font-size: 13px;
    margin: 0 0 10px;
}

.compare-row {
    display: grid;
    grid-template-columns: 100px 1fr 49px;
    align-items: center;
    gap: 8px;
    margin: 9px 0;
    font-size: 11px;
    color: var(--muted);
}

.mini-track {
    height: 9px;
    background: #334858;
    border-radius: 2px;
    overflow: hidden;
}

.mini-track div {
    height: 100%;
    background: var(--teal);
}

.compare-row b {
    text-align: right;
    color: var(--text);
    font-weight: 600;
}

/* METHODOLOGY */

.methodology {
    max-width: 850px;
    color: var(--muted);
    font-size: 13px;
}

.methodology p {
    margin: 0 0 14px;
}

.methodology strong {
    color: var(--text);
}

.methodology a {
    color: var(--teal);
}

.methodology code {
    color: var(--blue);
    overflow-wrap: anywhere;
}

footer {
    border-top: 1px solid var(--line);
    margin-top: 44px;
    padding-top: 18px;
    font-size: 12px;
    color: var(--muted);
}

/* MOBILE */

@media (max-width: 750px) {
    .kpis {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .page {
        padding: 30px 14px 55px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .track div {
        transition: none;
    }
}

/* github code */


.github-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 18px;
    background: #1a2738;
    color: #7ccbc6;
    border: 1px solid #2e4154;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
}

.github-link:hover {
    background: #263e52;
    border-color: #7ccbc6;
    color: #ffffff;
}