* {
    box-sizing: border-box;
}

:root {
    --background: #f7f8fa;
    --surface: #ffffff;
    --border: #e5e7eb;

    --text: #17191c;
    --muted: #6b7280;

    --accent: #111827;
    --accent-hover: #252b36;

    --user-message: #eef1f5;

    --error-text: #b42318;
    --error-background: #fff4f2;
    --error-border: #f5c2c0;
}


/* --------------------------------
   HTML / BODY
-------------------------------- */

html,
body {
    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);

    -webkit-font-smoothing: antialiased;
}


/* --------------------------------
   APP
-------------------------------- */

.app {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}


/* --------------------------------
   HEADER
-------------------------------- */

.header {
    height: 64px;

    display: flex;
    align-items: center;

    padding: 0 32px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 20px;
    font-weight: 700;

    letter-spacing: -0.5px;
}


/* --------------------------------
   CHAT CONTAINER
-------------------------------- */

.chat-container {
    width: 100%;
    max-width: 900px;

    margin: 0 auto;

    flex: 1;

    display: flex;
    flex-direction: column;

    padding: 40px 24px 32px;
}

.conversation-layout {
    width: 100%;
    max-width: 1420px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 32px;
    padding: 0 28px;
}

.conversation-layout > .messages {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: 980px;
    margin: 0;
}

.stats-panel {
    flex: 0 0 296px;
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 108px);
    min-height: 300px;
    overflow: hidden;
    margin: 32px 0 24px;
    padding: 20px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

#stats-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.stats-view[hidden] { display: none; }
.stats-view-empty { padding: 12px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.stats-view-navigation { display: flex; grid-column: 1 / -1; align-items: center; justify-content: center; gap: 9px; padding: 2px 0 0; margin: 0; border: 0; }
.stats-view-arrow, .stats-view-dot { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.stats-view-arrow { width: 28px; height: 28px; border-radius: 50%; font-size: 20px; line-height: 1; }
.stats-view-arrow:hover:not(:disabled) { background: #f2f4f7; color: var(--text); }
.stats-view-arrow:disabled { opacity: .3; cursor: default; }
.stats-view-dots { display: flex; align-items: center; gap: 9px; }
.stats-view-dot { width: 9px; height: 9px; border: 1px solid #98a2b3; border-radius: 50%; }
.stats-view-dot.active { border-color: var(--text); background: var(--text); }
.stats-view-arrow:focus-visible, .stats-view-dot:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.stats-panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: space-between;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 4px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.stats-period {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    text-align: right;
}

.stats-section {
    padding: 15px 0;
    border-top: 1px solid #eef0f2;
}

.stats-section:first-child { border-top: 0; padding-top: 0; }
.stats-section h3 { margin: 0 0 10px; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--muted); }
.stats-kpi-value { font-size: 34px; font-weight: 700; letter-spacing: -1px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stats-kpi-caption { margin-bottom: 2px; color: var(--muted); font-size: 11px; }
.stats-kpi-details { margin-top: 8px; }
.stats-kpi-change-label { margin-top: 5px; color: var(--muted); font-size: 11px; }
.stats-row, .stats-vintage-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 13px; color: var(--muted); }
.stats-row > span { min-width: 0; }
.stats-row > span:last-child { text-align: right; }
.stats-row > span:last-child, .stats-vintage-row > span:nth-child(2), .stats-vintage-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.stats-kpi-change { margin-top: 4px; font-size: 19px; line-height: 1.2; font-weight: 650; color: #137547; }
.stats-kpi-change.negative { color: #b42318; }
.stats-forecast-current-year { margin-bottom: 10px; }
.stats-forecast-current-year h4, .stats-forecast-subsection h4 { margin: 0 0 7px; font-size: 12px; line-height: 1.4; font-weight: 600; color: var(--text); }
.stats-forecast-subsection { margin-top: 12px; }
.stats-forecast-row { padding: 4px 0; color: var(--muted); font-size: 13px; }
.stats-forecast-row-main { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stats-forecast-row-main > span { min-width: 0; }
.stats-forecast-row-main strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-forecast-row small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.stats-conversion table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: right; }
.stats-conversion th, .stats-conversion td { padding: 5px 2px; font-variant-numeric: tabular-nums; }
.stats-conversion thead th { font-weight: 500; color: var(--muted); line-height: 1.3; }
.stats-conversion tbody th { text-align: left; font-size: 12px; font-weight: 600; }
.stats-conversion-change { display: inline-block; font-size: 9px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.stats-conversion-change.positive { color: #137547; }
.stats-conversion-change.negative { color: #b42318; }
.stats-vintage-row { font-size: 12px; }
.stats-vintage-row strong { font-size: 12px; }
.stats-vintage-total { margin: -2px 0 7px; color: var(--muted); font-size: 11px; }
.stats-source-row { padding: 4px 0; font-size: 13px; }
.stats-source-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stats-source-summary strong { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-source-row small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stats-source-highlight { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 9px; padding: 9px 10px; background: #f7f8fa; border-radius: 8px; font-size: 11px; color: var(--muted); }
.stats-source-highlight strong { color: var(--text); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats-fact { padding: 13px; background: #f7f8fa; border: 0; border-radius: 10px; margin-top: 8px; }
.stats-fact h3 { color: var(--text); }
.stats-fact p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
.stats-loading, .stats-empty { color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 1050px) {
    .conversation-layout { flex-direction: column; align-items: stretch; gap: 4px; padding: 0 20px; }
    .conversation-layout > .messages { order: 1; width: 100%; margin: 0 auto; }
    .stats-panel { order: 0; position: static; width: 100%; max-height: 390px; min-height: 260px; margin: 12px auto; }
}


/* --------------------------------
   MESSAGES
-------------------------------- */

.messages {
    flex: 1;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 40px 32px;

    min-height: 0;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.hidden {
    display: none !important;
}


/* --------------------------------
   WELCOME
-------------------------------- */

.welcome {
    width: 100%;
    max-width: 900px;

    margin: 0;

    text-align: center;
}

.welcome h1 {
    margin: 0 0 12px;

    font-size: 36px;
    line-height: 1.15;

    font-weight: 650;

    letter-spacing: -1.2px;
}

.welcome p {
    margin: 0;

    font-size: 17px;
    line-height: 1.6;

    color: var(--muted);
}


/* --------------------------------
   MESSAGE
-------------------------------- */

.message {
    display: flex;
    flex-direction: column;

    gap: 8px;

    max-width: 760px;
}

.message-role {
    font-size: 12px;
    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.7px;

    color: var(--muted);
}

.message-content {
    font-size: 16px;
    line-height: 1.65;

    max-width: 760px;
}


/* --------------------------------
   USER MESSAGE
-------------------------------- */

.message.user {
    align-self: flex-end;

    max-width: 650px;

    padding: 14px 18px;

    background: var(--user-message);

    border-radius: 16px;
}

.message.user .message-role {
    display: none;
}


/* --------------------------------
   DUVODIO MESSAGE
-------------------------------- */

.message.assistant {
    align-self: flex-start;
}

.message.assistant .message-content {
    max-width: 760px;
}


/* --------------------------------
   MARKDOWN CONTENT
-------------------------------- */

.message-content h1,
.message-content h2,
.message-content h3 {
    margin-top: 24px;
    margin-bottom: 10px;

    line-height: 1.3;
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child {
    margin-top: 0;
}

.message-content h1 {
    font-size: 24px;
    font-weight: 650;
}

.message-content h2 {
    font-size: 20px;
    font-weight: 650;
}

.message-content h3 {
    font-size: 17px;
    font-weight: 650;
}

.message-content p {
    margin: 0 0 14px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul,
.message-content ol {
    margin: 8px 0 16px;

    padding-left: 24px;
}

.message-content li {
    margin-bottom: 6px;

    line-height: 1.6;
}

.message-content li:last-child {
    margin-bottom: 0;
}

.message-content strong {
    font-weight: 650;
}

.message-content em {
    font-style: italic;
}

.message-content code {
    padding: 2px 5px;

    border-radius: 5px;

    background: #f1f3f5;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 0.9em;
}

.message-content blockquote {
    margin: 16px 0;

    padding-left: 16px;

    border-left: 3px solid var(--border);

    color: var(--muted);
}

.messages {
    padding-bottom: 80px;
}

/* --------------------------------
   CHAT INPUT
-------------------------------- */

.chat-form {
    position: sticky;
    bottom: 20px;

    width: 100%;
    max-width: 760px;

    margin: 0 auto;

    display: flex;
    align-items: flex-end;

    gap: 12px;

    padding: 10px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 18px;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.06);
}

.chat-input-wrapper {
    width: 100%;

    display: flex;
    align-items: flex-end;

    gap: 10px;
}

.chat-form textarea {
    flex: 1;

    width: 100%;

    resize: none;

    border: none;
    outline: none;

    padding: 12px 10px;

    min-height: 52px;
    max-height: 180px;

    font-family: inherit;

    font-size: 16px;
    line-height: 1.5;

    background: transparent;

    color: var(--text);
}

.chat-form textarea::placeholder {
    color: #9ca3af;
}

.chat-form textarea:disabled {
    opacity: 0.6;
}

/* --------------------------------
   SEND BUTTON
-------------------------------- */

.chat-form button {
    flex-shrink: 0;

    border: none;

    border-radius: 12px;

    padding: 11px 18px;

    background: var(--accent);

    color: white;

    font-family: inherit;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.1s ease;
}

.chat-form button:hover {
    background: var(--accent-hover);
}

.chat-form button:active {
    transform: translateY(1px);
}

.chat-form button:disabled {
    opacity: 0.5;

    cursor: default;
}

.chat-form button:disabled:hover {
    background: var(--accent);
}


/* --------------------------------
   LOADING
-------------------------------- */

.loading {
    display: flex;
    align-items: center;

    gap: 8px;

    color: var(--muted);

    font-size: 14px;
}

.loading-dots {
    display: flex;

    gap: 4px;
}

.loading-dots span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: currentColor;

    animation:
        pulse 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes pulse {
    0%,
    80%,
    100% {
        opacity: 0.3;
    }

    40% {
        opacity: 1;
    }
}


/* --------------------------------
   ERROR
-------------------------------- */

.error {
    color: var(--error-text);

    font-size: 14px;
    line-height: 1.5;

    padding: 12px 14px;

    background: var(--error-background);

    border: 1px solid var(--error-border);

    border-radius: 10px;
}


/* --------------------------------
   MOBILE
-------------------------------- */

@media (max-width: 700px) {

    .header {
        height: 56px;

        padding: 0 20px;
    }

    .logo {
        font-size: 19px;
    }

    .chat-container {
        padding: 24px 16px 20px;
    }

    .welcome h1 {
        font-size: 30px;
    }

    .welcome p {
        font-size: 16px;
    }

    .message-content {
        font-size: 15px;
    }

    .chat-form {
        bottom: 12px;

        border-radius: 15px;
    }

    .chat-form button {
        padding: 10px 14px;
    }
}


/* --------------------------------
   CONVERSATIONS SIDEBAR
-------------------------------- */

#conversations {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.conversation-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.conversation-item:hover {
    background: #f3f3f3;
}

.conversation-item.active {
    background: #e9e9e9;
}

.conversation-title {
    font-size: 14px;
    line-height: 1.4;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-empty {
    padding: 12px;
    color: #888;
    font-size: 13px;
}


/* --------------------------------
   NEW CONVERSATION
-------------------------------- */

#new-conversation {
    width: 100%;
    padding: 10px 12px;

    border: 1px solid #ddd;
    border-radius: 8px;

    background: white;
    color: #222;

    font-size: 14px;
    cursor: pointer;

    margin-bottom: 12px;
}

#new-conversation:hover {
    background: #f5f5f5;
}


/* --------------------------------
   WELCOME
-------------------------------- */

.welcome {
    text-align: center;
}

.welcome h1 {
    margin-bottom: 8px;
}

.welcome p {
    color: #777;
}


/* --------------------------------
   SIDEBAR
-------------------------------- */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 280px;

    padding: 20px;

    background: var(--surface);

    border-right: 1px solid var(--border);

    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);

    z-index: 1000;

    transform: translateX(-100%);

    transition: transform 0.25s ease;

    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}


/* --------------------------------
   SIDEBAR HEADER
-------------------------------- */

.sidebar-header {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 12px;
}

.sidebar-header .new-conversation {
    flex: 1;

    margin-bottom: 0;
}


/* --------------------------------
   CLOSE BUTTON
-------------------------------- */

.sidebar-close {
    flex-shrink: 0;

    width: 36px;
    height: 36px;

    border: none;
    border-radius: 8px;

    background: transparent;

    color: var(--text);

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

.sidebar-close:hover {
    background: #f3f3f3;
}


/* --------------------------------
   HAMBURGER
-------------------------------- */

.sidebar-toggle {
    flex-shrink: 0;

    border: none;

    background: transparent;

    color: var(--text);

    font-size: 20px;
    line-height: 1;

    padding: 6px 10px;

    margin-right: 8px;

    cursor: pointer;
}

.sidebar-toggle:hover {
    opacity: 0.65;
}


/* --------------------------------
   CONVERSATIONS
-------------------------------- */

#conversations {
    display: flex;

    flex-direction: column;

    gap: 4px;

    overflow-y: auto;
}

.conversation-item {
    padding: 10px 12px;

    border-radius: 8px;

    cursor: pointer;

    transition: background 0.15s ease;
}

.conversation-item:hover {
    background: #f3f3f3;
}

.conversation-item.active {
    background: #e9e9e9;
}

.conversation-title {
    font-size: 14px;
    line-height: 1.4;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.upload-panel {
    width: 100%;
    max-width: 900px;

    margin: 40px auto 0;
}

.upload-panel.hidden {
    display: none;
}

.upload-box {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    background: var(--surface);
    transition: border-color 0.15s ease,
                background 0.15s ease;
}

.upload-box.dragover {
    border-color: var(--accent);
    background: #fafafa;
}

.upload-box.is-disabled {
    opacity: 0.72;
}

.upload-button:disabled {
    cursor: default;
    opacity: 0.5;
}

.upload-title {
    font-size: 22px;
    font-weight: 650;
    margin-bottom: 8px;
}

.upload-description {
    color: var(--muted);
    margin-bottom: 24px;
}

.upload-button {
    border: none;
    border-radius: 10px;
    padding: 11px 18px;
    background: var(--accent);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.upload-file-name {
    margin-top: 16px;
    font-size: 14px;
    color: var(--muted);
}


/* --------------------------------
   AUTH SCREEN
-------------------------------- */

.auth-screen {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}


.auth-card {
    width: 100%;
    max-width: 400px;

    padding: 32px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 16px;

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.08);
}


.auth-card h1 {
    margin: 0 0 8px;

    font-size: 28px;
    font-weight: 700;

    letter-spacing: -0.5px;
}


.auth-card p {
    margin: 0 0 24px;

    color: var(--muted);

    font-size: 15px;
}


.auth-field {
    margin-bottom: 16px;
}


.auth-field label {
    display: block;

    margin-bottom: 6px;

    font-size: 14px;
    font-weight: 600;
}


.auth-field input {
    width: 100%;

    box-sizing: border-box;

    padding: 12px 14px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: var(--surface);

    color: var(--text);

    font-family: inherit;
    font-size: 15px;

    outline: none;
}


.auth-field input:focus {
    border-color: var(--accent);
}


.auth-button {
    width: 100%;

    padding: 12px 16px;

    border: none;

    border-radius: 8px;

    background: var(--accent);

    color: white;

    font-family: inherit;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.1s ease;
}


.auth-button:hover {
    background: var(--accent-hover);
}


.auth-button:active {
    transform: translateY(1px);
}


.auth-button:disabled {
    opacity: 0.5;

    cursor: default;
}


.auth-error {
    min-height: 20px;

    margin-bottom: 12px;

    color: var(--error-text);

    font-size: 14px;
    line-height: 1.5;
}

/* --------------------------------
   AUTH SWITCH
-------------------------------- */

.auth-switch {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;

    margin-top: 20px;

    color: var(--muted);
    font-size: 14px;
}

.auth-link {
    padding: 0;

    border: none;
    background: transparent;

    color: var(--text);

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.auth-link:hover {
    text-decoration: underline;
}

/* --------------------------------
   HEADER CONTROLS
-------------------------------- */

.icon-button {
    flex-shrink: 0;

    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: var(--text);

    font-family: inherit;
    font-size: 20px;
    line-height: 1;

    cursor: pointer;
}

.icon-button:hover {
    background: #f3f3f3;
}

.logout-button {
    margin-left: auto;

    padding: 8px 12px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);
    color: var(--text);

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
}

.logout-button:hover {
    background: #f3f3f3;
}


/* --------------------------------
   SIDEBAR
-------------------------------- */

.sidebar-title {
    flex: 1;

    font-size: 15px;
    font-weight: 650;
}

.new-conversation {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 12px;

    margin-bottom: 12px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);
    color: var(--text);

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
}

.new-conversation:hover {
    background: #f5f5f5;
}


/* --------------------------------
   CONVERSATIONS
-------------------------------- */

.conversations {
    display: flex;
    flex-direction: column;
    gap: 4px;

    overflow-y: auto;
}


/* --------------------------------
   CHAT INPUT
-------------------------------- */

.chat-input-wrapper {
    width: 100%;

    display: flex;
    align-items: flex-end;

    gap: 8px;
}

.send-button {
    flex-shrink: 0;

    width: 44px;
    height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 12px;

    background: var(--accent);
    color: white;

    font-family: inherit;
    font-size: 20px;
    font-weight: 600;

    cursor: pointer;
}

.send-button:hover {
    background: var(--accent-hover);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: default;
}


/* --------------------------------
   HEADER
-------------------------------- */

.header {
    flex-shrink: 0;
}


.chat-form.hidden {
    display: none !important;
}


/* ============================================================
   SCENARIOS
   ============================================================ */

.scenario-panel {
    width: 100%;
    max-width: 760px;
    margin: 24px auto 0;
}

.scenario-title {
    margin-bottom: 16px;

    font-size: 24px;
    font-weight: 700;

    color: #182b49;
}

.scenario-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scenario-list .scenario-button {
    padding: 16px 20px;
    border-color: #cbd8e8;
    border-radius: 14px;
    background: #ffffff;
    color: #243b59;
    font-size: 17px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(31, 57, 88, 0.08);
}

.scenario-button {
    width: 100%;
    padding: 12px 16px;

    border: 1px solid #e4e7ec;
    border-radius: 12px;

    background: #f8fafc;
    color: #344054;

    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.scenario-button:hover {
    background: #f1f5f9;

    border-color: #cbd5e1;

    box-shadow:
        0 2px 8px rgba(16, 24, 40, 0.06);

    transform: translateY(-1px);
}

.scenario-list .scenario-button:hover {
    border-color: #8eafd3;
    background: #f4f8fd;
    box-shadow: 0 5px 14px rgba(31, 75, 125, 0.13);
}

.scenario-button:active {
    transform: translateY(0);
}

.scenario-button:focus-visible {
    outline: none;

    border-color: #98a2b3;

    box-shadow:
        0 0 0 3px rgba(152, 162, 179, 0.18);
}


/* ============================================================
   SCENARIO SUBPANEL
   ============================================================ */

.scenario-subpanel {
    margin-top: 18px;

    padding-top: 18px;

    border-top: 1px solid #eaecf0;
}

.scenario-subpanel.what-if-panel {
    margin-top: 20px;
    padding: 24px;
    border: 1px solid #d7e3f4;
    border-radius: 18px;
    background: linear-gradient(145deg, #f8fbff 0%, #f4f7fc 100%);
    box-shadow: 0 12px 32px rgba(30, 64, 110, 0.09);
}

.scenario-subtitle {
    margin-bottom: 12px;

    font-size: 14px;
    font-weight: 600;

    color: #475467;
}

.what-if-panel .scenario-subtitle {
    margin-bottom: 10px;
    color: #182b49;
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.what-if-panel > .scenario-button {
    margin-bottom: 16px;
}

.simulation-intro {
    margin: 0 0 22px;
    color: #52637a;
    font-size: 16px;
    line-height: 1.55;
}

.source-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-button {
    width: 100%;

    padding: 12px 16px;

    border: 1px solid #eaecf0;
    border-radius: 10px;

    background: #ffffff;

    color: #344054;

    font-family: inherit;
    font-size: 14px;

    text-align: left;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.source-button:hover {
    background: #f8fafc;
    border-color: #d0d5dd;
}

.source-button-all {
    margin-top: 4px;

    background: #f8fafc;
    font-weight: 600;
}

.simulation-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.simulation-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(150px, 1.5fr) 80px 20px 46px;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #d5dfec;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(29, 52, 82, 0.05);
}

.simulation-result {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
    padding: 12px 14px;
    border: 1px solid #d9e8fb;
    border-radius: 10px;
    background: #f3f8ff;
    color: #45617f;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.simulation-result[hidden] {
    display: none;
}

.simulation-result-arrow {
    color: #537ca9;
    font-size: 18px;
    font-weight: 700;
}

.simulation-result-value {
    color: #174b87;
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -0.015em;
}

.simulation-result-current {
    color: #718198;
    font-size: 13px;
}

.simulation-row select,
.simulation-row input {
    min-width: 0;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #c8d3e1;
    border-radius: 10px;
    background: #ffffff;
    color: #263b57;
    font: inherit;
    font-size: 15px;
}

.simulation-row select:focus,
.simulation-row input:focus {
    border-color: #5790ce;
    outline: 3px solid rgba(87, 144, 206, 0.17);
}

.simulation-remove {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 11px;
    background: #f3f6fa;
    color: #596c83;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.simulation-remove:hover {
    background: #feeceb;
    color: #b42318;
}

.what-if-panel > .source-button {
    margin-top: 10px;
    padding: 15px 18px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 650;
}

.what-if-panel > .source-button:not(:last-child) {
    border-color: #245f9e;
    background: #2868a8;
    color: #ffffff;
    box-shadow: 0 5px 13px rgba(40, 104, 168, 0.2);
}

.what-if-panel > .source-button:not(:last-child):hover {
    border-color: #1f568b;
    background: #225b95;
}

.what-if-panel > .source-button:last-child {
    border-color: #bdcfe3;
    background: #ffffff;
    color: #294d73;
}

@media (max-width: 560px) {
    .scenario-subpanel.what-if-panel {
        padding: 16px 12px;
    }

    .what-if-panel .scenario-subtitle {
        font-size: 23px;
    }

    .simulation-intro {
        font-size: 15px;
    }

    .simulation-row {
        grid-template-columns: 1fr 1fr 64px 16px 36px;
        gap: 6px;
        padding: 10px;
    }

    .simulation-row select,
    .simulation-row input {
        padding: 8px 7px;
        font-size: 13px;
    }

    .simulation-remove {
        width: 36px;
        height: 40px;
        font-size: 26px;
    }

    .simulation-result {
        gap: 6px;
        padding: 10px;
    }

    .simulation-result-value {
        font-size: 19px;
    }
}
