
:root {
    --bg: #f4f6fa;
    --white: #ffffff;
    --navy: #101b35;
    --text: #17243d;
    --muted: #8490a5;
    --border: #e8ecf3;
    --green: #13a879;
    --green-light: #e7f8f1;
    --blue: #4768ed;
    --red: #e45d68;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    height: 76px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 7%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 43px;
    height: 43px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--navy);
    color: white;
    font-size: 23px;
    font-weight: 800;
}

.brand h2 {
    font-size: 19px;
    letter-spacing: -0.7px;
}

.brand h2 span {
    color: var(--blue);
}

.brand small {
    font-size: 11px;
    color: var(--muted);
}

.header-right {
    color: #637087;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.container {
    max-width: 1250px;
    margin: auto;
    padding: 45px 25px;
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.eyebrow {
    color: var(--blue);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.8px;
    margin-bottom: 12px;
}

.welcome h1 {
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: -1.4px;
    margin-bottom: 9px;
}

.welcome p:not(.eyebrow) {
    color: var(--muted);
    font-size: 13px;
}

.reset-btn {
    border: 1px solid var(--border);
    background: white;
    padding: 12px 17px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 0.95fr;
    gap: 22px;
    align-items: start;
}

.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 25px;
    box-shadow: 0 4px 18px rgba(20, 35, 70, 0.025);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 23px;
}

.section-heading h2 {
    font-size: 17px;
    margin-bottom: 6px;
}

.section-heading p {
    font-size: 11px;
    color: var(--muted);
}

.step {
    font-size: 11px;
    color: var(--blue);
    background: #edf0ff;
    padding: 8px 11px;
    border-radius: 7px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 19px 15px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 11px;
    font-weight: 700;
    color: #4d5b72;
}

.field input {
    width: 100%;
    padding: 13px 12px;
    border: 1px solid #dfe4ed;
    border-radius: 7px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    background: #fcfdff;
}

.field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(71, 104, 237, .09);
}

.field small {
    font-size: 10px;
    color: var(--muted);
}

.quantity-info {
    display: flex;
    justify-content: space-between;
    background: #f1f4ff;
    padding: 13px;
    border-radius: 7px;
    font-size: 11px;
}

.quantity-info strong {
    color: var(--blue);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px !important;
    cursor: pointer;
}

.toggle-row input {
    width: auto;
    accent-color: var(--blue);
}

.input-suffix {
    position: relative;
}

.input-suffix span {
    position: absolute;
    right: 13px;
    top: 13px;
    color: var(--muted);
    font-size: 12px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 27px 0;
}

.calculate-btn {
    width: 100%;
    border: none;
    padding: 15px;
    background: var(--navy);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 25px;
    cursor: pointer;
    transition: .2s;
}

.calculate-btn:hover {
    background: var(--blue);
    transform: translateY(-1px);
}

.calculate-btn span {
    margin-left: 8px;
}

.results-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.investment-card {
    background: var(--navy);
    color: white;
    border: none;
}

.result-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 13px;
}

.investment-card .result-label {
    color: #a8b6d3;
}

.investment-card h2 {
    font-size: 29px;
    letter-spacing: -1px;
}

.result-icon, .quantity-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    font-size: 20px;
}

.mini-stats {
    display: flex;
    gap: 45px;
    margin-top: 27px;
    padding-top: 17px;
    border-top: 1px solid rgba(255,255,255,.15);
}

.mini-stats div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.mini-stats small {
    color: #a8b6d3;
    font-size: 10px;
}

.mini-stats strong {
    font-size: 13px;
}

.quantity-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quantity-card h2 {
    font-size: 27px;
}

.quantity-card h2 small {
    font-size: 12px;
    color: var(--muted);
}

.muted {
    font-size: 10px;
    color: var(--muted);
    margin-top: 8px;
}

.quantity-icon {
    background: #edf0ff;
    color: var(--blue);
}

.profit-card {
    border-left: 4px solid var(--green);
}

.profit-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 19px 0;
}

.profit-range small {
    color: var(--muted);
    font-size: 10px;
}

.profit-range h2 {
    font-size: 22px;
    margin: 9px 0;
    color: var(--green);
    overflow-wrap: anywhere;
}

.profit-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--green);
    background: var(--green-light);
    padding: 6px 8px;
    border-radius: 5px;
}

.range-divider {
    border-right: 1px solid var(--border);
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    margin-right: -6px;
}

.range-track {
    height: 6px;
    background: #e8edf2;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.range-track div {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #20b88a, #70d9ac);
}

.final-card {
    background: #edf8f3;
    border: 1px solid #d5f0e4;
}

.final-card .result-label {
    color: #388b69;
}

.final-card h2 {
    font-size: clamp(20px, 2.2vw, 27px);
    color: #087e57;
    margin: 13px 0;
    overflow-wrap: anywhere;
}

.final-card > p:not(.result-label) {
    color: #668b7a;
    font-size: 10px;
    margin-bottom: 19px;
}

.final-breakdown {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #d5ebdf;
    font-size: 11px;
}

.final-breakdown strong {
    color: #087e57;
}

.analytics, .risk-panel {
    margin-top: 23px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.metric {
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fcfdff;
}

.metric span {
    color: var(--muted);
    font-size: 10px;
}

.metric h2 {
    margin: 13px 0 8px;
    font-size: 22px;
    color: var(--text);
    overflow-wrap: anywhere;
}

.metric small {
    color: var(--muted);
    font-size: 9px;
}

.risk-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff8e9;
    padding: 17px;
    border-radius: 8px;
    color: #9b7022;
    font-size: 12px;
}

.risk-indicator {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: #e6a83e;
    border-radius: 50%;
    margin-right: 8px;
}

.risk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}

.risk-item {
    display: flex;
    gap: 13px;
}

.risk-item > span {
    color: var(--blue);
    font-weight: 800;
    font-size: 12px;
}

.risk-item strong {
    font-size: 12px;
}

.risk-item p {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.7;
    margin-top: 6px;
}

.risk-note {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.7;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 35px;
    color: var(--muted);
    font-size: 10px;
}

footer button {
    border: none;
    background: transparent;
    color: var(--blue);
    font-weight: 700;
    cursor: pointer;
}

@media(max-width: 850px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media(max-width: 550px) {
    .topbar {
        padding: 0 18px;
    }

    .container {
        padding: 30px 14px;
    }

    .welcome {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field.full {
        grid-column: auto;
    }

    .analytics-grid, .risk-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 18px;
    }

    .mini-stats {
        gap: 20px;
    }

    footer {
        gap: 15px;
        flex-direction: column;
        align-items: flex-start;
    }
}

@media print {
    body {
        background: white;
    }

    .topbar, .reset-btn, .calculate-btn, footer button {
        display: none;
    }

    .container {
        max-width: 100%;
        padding: 10px;
    }

    .panel {
        break-inside: avoid;
        box-shadow: none;
    }
}
