:root {
    color-scheme: light;
    --ink: #10213d;
    --muted: #667085;
    --line: #e5e9f0;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --blue: #1769e0;
    --blue-dark: #0e4da8;
    --cyan: #14b8c8;
    --green: #15866a;
    --shadow: 0 18px 46px rgba(35, 55, 80, 0.08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 90% 0%, rgba(20, 184, 200, 0.10), transparent 28rem),
        var(--canvas);
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.shell {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: white;
    font-weight: 850;
    letter-spacing: -0.07em;
    background: linear-gradient(145deg, var(--blue), var(--cyan));
    box-shadow: 0 10px 24px rgba(23, 105, 224, 0.24);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.brand small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 650;
}

.prototype-badge {
    padding: 8px 12px;
    border: 1px solid #bfdde2;
    border-radius: 999px;
    color: #116876;
    background: #edfbfd;
    font-size: 0.74rem;
    font-weight: 750;
}

.topbar-actions,
.topbar-actions nav {
    display: flex;
    align-items: center;
}

.topbar-actions {
    gap: 18px;
}

.topbar-actions nav {
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.topbar-actions nav a {
    padding: 8px 11px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
    text-decoration: none;
}

.topbar-actions nav a.active {
    color: white;
    background: var(--blue);
}

main {
    min-height: calc(100vh - 172px);
}

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    padding: 52px 56px;
    border-radius: 30px;
    overflow: hidden;
    color: white;
    background:
        radial-gradient(circle at 82% 20%, rgba(46, 213, 221, 0.35), transparent 15rem),
        linear-gradient(120deg, #0c326a 0%, #1267ca 58%, #12a9bb 100%);
    box-shadow: 0 24px 60px rgba(21, 77, 150, 0.18);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #8ff3f6;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 0;
    font-size: 1.15rem;
    letter-spacing: -0.025em;
}

.hero-copy {
    max-width: 650px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.02rem;
}

.simulator-hero {
    align-items: center;
}

.hero-note {
    width: min(310px, 100%);
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    background: rgba(8, 38, 86, 0.24);
}

.hero-note strong,
.hero-note span {
    display: block;
}

.hero-note strong {
    margin-bottom: 5px;
    font-size: 0.82rem;
}

.hero-note span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.74rem;
    line-height: 1.5;
}

.month-picker {
    min-width: 280px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.23);
    border-radius: 18px;
    background: rgba(8, 38, 86, 0.24);
    backdrop-filter: blur(10px);
}

.month-picker label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
    font-weight: 750;
}

.month-picker div {
    display: flex;
    gap: 8px;
}

.month-picker select,
.month-picker button {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
}

.month-picker select {
    flex: 1;
    padding: 0 36px 0 12px;
    color: var(--ink);
    background: white;
}

.month-picker button {
    padding: 0 16px;
    color: white;
    background: #10213d;
    cursor: pointer;
    font-weight: 750;
}

.period-banner {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 18px 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.period-banner strong {
    color: var(--ink);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #20b486;
    box-shadow: 0 0 0 4px rgba(32, 180, 134, 0.12);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.metric-card,
.panel {
    border: 1px solid rgba(220, 226, 236, 0.9);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 150px;
    padding: 24px;
    border-radius: 20px;
}

.metric-card > span,
.metric-card small {
    display: block;
    color: var(--muted);
}

.metric-card > span {
    font-size: 0.78rem;
    font-weight: 750;
}

.metric-card strong {
    display: block;
    margin: 14px 0 8px;
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    letter-spacing: -0.045em;
}

.metric-card small {
    font-size: 0.72rem;
}

.metric-card.primary {
    border-color: transparent;
    color: white;
    background: linear-gradient(135deg, #17375f, #0c5dba);
}

.metric-card.accent {
    border-color: transparent;
    color: #07313a;
    background: linear-gradient(135deg, #c9f8f8, #76e7e9);
}

.metric-card.primary > span,
.metric-card.primary small {
    color: rgba(255, 255, 255, 0.7);
}

.metric-card.accent > span,
.metric-card.accent small {
    color: rgba(7, 49, 58, 0.66);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
    gap: 16px;
    margin-top: 16px;
}

.panel {
    padding: 28px;
    border-radius: 22px;
}

.panel-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.panel-heading > span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.tier-pill {
    padding: 7px 11px;
    border-radius: 999px;
    color: #0d654f !important;
    background: #daf7ec;
}

.tier-count {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 32px 0 16px;
}

.tier-count strong {
    font-size: 2.6rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.tier-count span {
    color: var(--muted);
    font-size: 0.77rem;
}

progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border: 0;
    border-radius: 99px;
    background: #e8edf4;
}

progress::-webkit-progress-bar {
    background: #e8edf4;
}

progress::-webkit-progress-value {
    border-radius: 99px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

progress::-moz-progress-bar {
    border-radius: 99px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.tier-scale {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 0.69rem;
}

.assumption-panel {
    color: #eaf9ff;
    border-color: transparent;
    background: #142d4f;
}

.assumption-panel .eyebrow {
    color: #65dbe4;
}

.assumption-panel h2 {
    margin-bottom: 18px;
}

.assumption-panel p:not(.eyebrow) {
    color: rgba(234, 249, 255, 0.69);
    font-size: 0.78rem;
    line-height: 1.65;
}

.assumption-panel p:last-child {
    margin-bottom: 0;
}

.package-panel,
.detail-panel {
    margin-top: 16px;
}

.simulation-input-panel {
    margin-top: 16px;
}

.text-link {
    color: var(--blue);
    font-size: 0.75rem;
    font-weight: 750;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.simulation-form {
    display: grid;
    grid-template-columns: minmax(170px, 1.15fr) repeat(3, minmax(140px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.simulation-form label > span,
.simulation-form label > small {
    display: block;
}

.simulation-form label > span {
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 750;
}

.simulation-form label > small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.66rem;
}

.simulation-form input {
    width: 100%;
    min-height: 45px;
    padding: 0 12px;
    border: 1px solid #cfd7e5;
    border-radius: 10px;
    color: var(--ink);
    background: white;
}

.simulation-form input:focus {
    border-color: var(--blue);
    outline: 3px solid rgba(23, 105, 224, 0.13);
}

.simulation-form button {
    min-height: 45px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: var(--blue);
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
}

.simulation-form button:hover {
    background: var(--blue-dark);
}

.validation-message {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #f0b8b8;
    border-radius: 10px;
    color: #8f2020;
    background: #fff3f3;
    font-size: 0.78rem;
}

.statement-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: 14px;
    color: white;
    background: linear-gradient(120deg, #17375f, #0c5dba);
}

.statement-total span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.75rem;
}

.statement-total strong {
    font-size: 1.4rem;
    letter-spacing: -0.025em;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 15px 14px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
}

th:first-child,
td:first-child {
    padding-left: 0;
    text-align: left;
}

th:last-child,
td:last-child {
    padding-right: 0;
}

th {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

td {
    font-size: 0.84rem;
}

td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.65rem;
}

tfoot td {
    border-bottom: 0;
    padding-top: 19px;
    font-weight: 800;
}

.detail-list {
    display: grid;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 140px 90px 140px;
    gap: 16px;
    align-items: center;
    min-height: 58px;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.detail-row > span:not(:first-child),
.detail-row > strong:last-child {
    text-align: right;
}

.detail-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.66rem;
}

.empty-state,
.loading-state {
    padding: 72px 30px;
    border: 1px solid var(--line);
    border-radius: 24px;
    text-align: center;
    background: white;
}

.button-link {
    display: inline-block;
    padding: 11px 16px;
    border-radius: 10px;
    color: white;
    background: var(--blue);
    text-decoration: none;
    font-weight: 750;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 34px 4px 28px;
    color: var(--muted);
    font-size: 0.7rem;
}

@media (max-width: 960px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .simulation-form {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .shell {
        width: min(100% - 24px, 1240px);
    }

    .topbar {
        min-height: 76px;
    }

    .prototype-badge {
        display: none;
    }

    .topbar-actions {
        gap: 0;
    }

    .topbar-actions nav a {
        padding: 7px 9px;
        font-size: 0.68rem;
    }

    .hero {
        align-items: stretch;
        flex-direction: column;
        padding: 34px 24px;
        border-radius: 22px;
    }

    .month-picker {
        min-width: 0;
    }

    .simulation-form {
        grid-template-columns: 1fr;
    }

    .simulation-form button {
        margin-top: 4px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 130px;
    }

    .panel {
        padding: 22px 18px;
    }

    .detail-row {
        grid-template-columns: 1fr auto;
        padding: 12px 0;
    }

    .detail-row > span:nth-child(3) {
        display: none;
    }

    .detail-row > span:nth-child(2) {
        text-align: right;
    }

    footer {
        flex-direction: column;
    }

    .statement-total {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}
