:root {
    --accent: #2C5282;
    --accent-dark: #16355d;
    --accent-soft: #e8f0fb;
    --accent-border: #d5e2f3;
    --surface: rgba(255, 255, 255, 0.92);
    --positive: #0d8c60;
    --negative: #dc4c64;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
    --shadow-strong: 0 20px 50px rgba(22, 53, 93, 0.16);
}

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top, rgba(44, 82, 130, 0.14), transparent 38%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
    min-height: 100vh;
}

button,
input,
select,
textarea {
    font: inherit;
}

.section-title {
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }
}

.panel-base {
    background:
        linear-gradient(180deg, rgba(232, 240, 251, 0.82) 0%, rgba(255, 255, 255, 0) 54px),
        var(--surface);
    border: 1px solid rgba(213, 226, 243, 0.9);
    border-radius: 24px;
    box-shadow: 0 0 0 1px rgba(44, 82, 130, 0.08), var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.metric-card {
    background:
        linear-gradient(180deg, rgba(232, 240, 251, 0.72) 0%, rgba(255, 255, 255, 0.88) 50px),
        rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(213, 226, 243, 0.85);
    border-radius: 20px;
    box-shadow: 0 0 0 1px rgba(44, 82, 130, 0.07), var(--shadow-soft);
}

.control-shell {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(213, 226, 243, 0.9);
    border-radius: 9999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.accent-ring {
    box-shadow: 0 0 0 1px rgba(44, 82, 130, 0.14), var(--shadow-soft);
}

.change-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    border: 1px solid transparent;
}

.change-pill.positive {
    color: var(--positive);
    background: rgba(13, 140, 96, 0.1);
    border-color: rgba(13, 140, 96, 0.18);
}

.change-pill.negative {
    color: var(--negative);
    background: rgba(220, 76, 100, 0.1);
    border-color: rgba(220, 76, 100, 0.18);
}

.summary-chip {
    border-radius: 18px;
    border: 1px solid rgba(213, 226, 243, 0.9);
    background:
        linear-gradient(180deg, rgba(232, 240, 251, 0.76) 0%, rgba(248, 251, 255, 0.95) 48px),
        rgba(248, 251, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(44, 82, 130, 0.06), var(--shadow-soft);
    padding: 0.9rem 1rem;
}

.summary-chip strong {
    color: #0f172a;
}

.option-row-top {
    background: linear-gradient(90deg, rgba(44, 82, 130, 0.1), rgba(255, 255, 255, 0.98));
}

.table-stat {
    color: var(--accent);
    font-weight: 800;
}

.details-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.details-main,
.details-sidebar {
    min-width: 0;
}

@media (min-width: 1200px) {
    .details-layout {
        grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
        gap: 0.75rem;
    }

    .details-sidebar {
        margin-top: 0;
    }
}

.range-slider-thumb::-webkit-slider-thumb {
    pointer-events: auto;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2C5282;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    border: 2px solid white;
}

.range-slider-thumb::-moz-range-thumb {
    pointer-events: auto;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 50%;
    background: #2C5282;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Premium Tooltip System */
.tooltip-container {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* Floating tooltip — rendered at fixed position via JS to escape overflow:hidden parents */
#premiumTooltip {
    position: fixed;
    background-color: #0F172A;
    color: #fff;
    text-align: left;
    border-radius: 14px;
    padding: 12px 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
    width: max-content;
    min-width: 150px;
    font-size: 13px;
    line-height: 1.4;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(6px);
}

#premiumTooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

#premiumTooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: var(--arrow-left, 50%);
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: #0F172A transparent transparent transparent;
}
