/* ============================================================================
 * COMPONENTS — cards, KPIs, inputs, buttons, panels, chips, modals
 * ========================================================================== */

/* ============================== PANELS / CARDS ============================== */
.panel {
    background: var(--surface);
    border: 1px solid var(--line-1);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--t-med), transform var(--t-med);
}
.panel:hover { box-shadow: var(--shadow-md); }
.panel.interactive { cursor: pointer; }
.panel.interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.panel-head {
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    border-bottom: 1px solid var(--line-1);
    background: var(--grad-surface);
}
[data-theme="dark"] .panel-head { background: transparent; }

.panel-head h3 {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 13px;
    font-weight: var(--fw-bold);
    color: var(--navy-600);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
[data-theme="dark"] .panel-head h3 { color: var(--emerald-400); }

.panel-head h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--emerald-500);
    border-radius: 2px;
    display: inline-block;
}

.panel-head h3 svg { width: 16px; height: 16px; color: var(--ink-3); }

.panel-head .panel-sub {
    font-size: 11px;
    color: var(--ink-4);
    font-weight: var(--fw-regular);
    margin-left: var(--sp-3);
}

.panel-actions { display: flex; gap: var(--sp-2); align-items: center; }

.panel-body { padding: var(--sp-5); }
.panel-body.tight { padding: var(--sp-4); }
.panel-body.loose { padding: var(--sp-6); }

/* ============================== KPI CARDS =================================== */
.kpi {
    background: var(--surface);
    border: 1px solid var(--line-1);
    border-radius: var(--r-md);
    padding: var(--sp-4) var(--sp-5);
    box-shadow: var(--shadow-xs);
    transition: all var(--t-med);
    position: relative;
    overflow: hidden;
    min-height: 130px;
    display: flex;
    flex-direction: column;
}

.kpi::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: var(--emerald-500);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform var(--t-med);
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-2); }
.kpi:hover::before { transform: scaleX(1); }

.kpi.kpi-navy::before { background: var(--navy-600); }
.kpi.kpi-emerald::before { background: var(--emerald-500); }
.kpi.kpi-warning::before { background: var(--warning); }
.kpi.kpi-danger::before { background: var(--danger); }

.kpi-label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 11px;
    font-weight: var(--fw-semi);
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--sp-2);
}
.kpi-label svg { width: 14px; height: 14px; color: var(--ink-4); }

.kpi-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: var(--fw-black);
    color: var(--navy-600);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .kpi-value { color: white; }

.kpi-value .unit {
    font-size: 14px;
    font-weight: var(--fw-medium);
    color: var(--ink-4);
    margin-left: var(--sp-1);
}

.kpi-detail {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: auto;
    padding-top: var(--sp-2);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
}
.kpi-delta.positivo { background: var(--emerald-50); color: var(--emerald-700); }
.kpi-delta.negativo { background: #FEE2E2; color: var(--danger); }
.kpi-delta.neutro { background: var(--canvas-2); color: var(--ink-3); }
[data-theme="dark"] .kpi-delta.positivo { background: rgba(34,197,94,0.18); color: var(--emerald-300); }
[data-theme="dark"] .kpi-delta.negativo { background: rgba(220,38,38,0.18); color: #FCA5A5; }

.kpi-spark {
    height: 26px;
    margin-top: var(--sp-2);
    opacity: 0.7;
}

/* ============================== BUTTONS ===================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-4);
    height: 36px;
    border: 0;
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-weight: var(--fw-semi);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
    background: var(--emerald-500);
    color: white;
    box-shadow: 0 1px 0 rgba(34,197,94,0.5), var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
    background: var(--emerald-600);
    box-shadow: 0 2px 6px rgba(34,197,94,0.35), var(--shadow-md);
    transform: translateY(-1px);
}

.btn-navy {
    background: var(--navy-600);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-navy:hover:not(:disabled) {
    background: var(--navy-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: var(--surface);
    color: var(--navy-600);
    border: 1px solid var(--line-2);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--emerald-500);
    color: var(--emerald-700);
    background: var(--emerald-50);
}
[data-theme="dark"] .btn-outline:hover:not(:disabled) { background: rgba(34,197,94,0.1); color: var(--emerald-400); }

.btn-ghost {
    background: transparent;
    color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--canvas-2); color: var(--navy-600); }

.btn-sm { height: 30px; padding: 0 var(--sp-3); font-size: 12px; }
.btn-lg { height: 44px; padding: 0 var(--sp-5); font-size: 14px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }

/* ============================== INPUT GROUPS (sidebar) ====================== */
.input-section {
    margin-bottom: var(--sp-3);
    border: 1px solid var(--line-1);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface);
}

.input-section-head {
    padding: var(--sp-3) var(--sp-4);
    background: var(--canvas-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background var(--t-fast);
}
.input-section-head:hover { background: var(--canvas); }

.input-section-head h4 {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 11.5px;
    font-weight: var(--fw-bold);
    color: var(--navy-600);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.input-section-head h4 svg { width: 14px; height: 14px; color: var(--ink-3); }

.input-section-head .chev {
    transition: transform var(--t-med);
    color: var(--ink-3);
    width: 16px; height: 16px;
}
.input-section.collapsed .chev { transform: rotate(-90deg); }
.input-section.collapsed .input-section-body { display: none; }

.input-section-body { padding: var(--sp-3) var(--sp-4); background: var(--surface); }

/* Input row */
.field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--sp-2);
    align-items: center;
    padding: var(--sp-2) 0;
    border-bottom: 1px dashed transparent;
    transition: border-color var(--t-fast);
}
.field:not(:last-child) { border-bottom-color: var(--line-1); }

.field-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.field-label .name {
    font-size: 11.5px;
    font-weight: var(--fw-medium);
    color: var(--ink-1);
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: var(--sp-1);
}
.field-label .unit-hint {
    font-size: 10px;
    color: var(--ink-4);
    line-height: 1.2;
    font-family: var(--font-mono);
}

.field-input {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--canvas-2);
    border: 1px solid var(--line-1);
    border-radius: var(--r-sm);
    overflow: hidden;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field-input:focus-within {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
    background: var(--surface);
}

.field-input input[type="number"], .field-input input[type="text"] {
    width: 100px;
    border: 0;
    background: transparent;
    padding: 7px 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: var(--fw-medium);
    color: var(--ink-1);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.field-input input:focus { outline: none; }

.field-input .suffix {
    padding: 0 8px 0 4px;
    font-size: 10.5px;
    color: var(--ink-4);
    font-family: var(--font-mono);
    border-left: 1px solid var(--line-1);
    background: var(--canvas);
    height: 100%;
    display: flex;
    align-items: center;
}

.field-input select {
    width: 130px;
    border: 0;
    background: transparent;
    padding: 7px 8px;
    font-size: 12px;
    color: var(--ink-1);
    font-weight: var(--fw-medium);
    cursor: pointer;
}
.field-input select:focus { outline: none; }

.field.alterado .field-input { border-color: var(--warning); background: #FFFBEB; }
[data-theme="dark"] .field.alterado .field-input { background: rgba(245, 158, 11, 0.1); }
.field.alterado .field-input::after {
    content: '✱';
    color: var(--warning);
    font-size: 11px;
    margin-right: 4px;
}

.field-help {
    color: var(--ink-4);
    font-size: 11px;
    cursor: help;
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
}
.field-help svg { width: 12px; height: 12px; }

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--line-2);
    border-radius: var(--r-full);
    transition: background var(--t-fast);
}
.switch-slider::before {
    content: '';
    position: absolute;
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--t-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider { background: var(--emerald-500); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }

/* Cenário selector grande */
.cenario-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--grad-protium);
    color: white;
    border-radius: var(--r-md);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.cenario-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cenario-card .ic {
    width: 30px; height: 30px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cenario-card .ic svg { width: 16px; height: 16px; color: white; }
.cenario-card .info { flex: 1; }
.cenario-card .info .lbl {
    font-size: 9.5px; opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: var(--fw-semi);
}
.cenario-card .info .nm {
    font-size: 13px;
    font-style: italic;
    font-weight: var(--fw-bold);
}
.cenario-card select {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: var(--fw-semi);
}
.cenario-card select option { color: var(--ink-1); background: white; }

/* ============================== CHIPS / TAGS ================================ */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 10.5px;
    font-weight: var(--fw-semi);
    background: var(--canvas-2);
    color: var(--ink-2);
    border: 1px solid var(--line-1);
    line-height: 1.4;
    letter-spacing: 0.02em;
}
.chip.chip-emerald { background: var(--emerald-50); color: var(--emerald-700); border-color: var(--emerald-200); }
.chip.chip-navy { background: var(--navy-50); color: var(--navy-600); border-color: var(--navy-100); }
.chip.chip-warning { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.chip.chip-danger { background: #FEE2E2; color: var(--danger); border-color: #FECACA; }
.chip svg { width: 12px; height: 12px; }

[data-theme="dark"] .chip { background: var(--surface-elev); color: var(--ink-2); border-color: var(--line-2); }
[data-theme="dark"] .chip.chip-emerald { background: rgba(34,197,94,0.15); color: var(--emerald-300); }
[data-theme="dark"] .chip.chip-navy { background: rgba(99,150,200,0.15); color: var(--navy-100); }

/* ============================== INCENTIVO CARD ============================== */
.inc-card {
    background: var(--surface);
    border: 1px solid var(--line-1);
    border-left: 4px solid var(--emerald-500);
    border-radius: var(--r-md);
    padding: var(--sp-4) var(--sp-5);
    transition: all var(--t-fast);
}
.inc-card.inativo {
    opacity: 0.55;
    border-left-color: var(--line-3);
    filter: saturate(0.4);
}
.inc-card:hover { box-shadow: var(--shadow-md); }
.inc-card:hover:not(.inativo) { border-left-color: var(--navy-600); }

.inc-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.inc-card .nome { font-weight: var(--fw-bold); color: var(--navy-600); font-size: 13.5px; line-height: 1.3; }
[data-theme="dark"] .inc-card .nome { color: white; }
.inc-card .base { font-size: 10.5px; color: var(--ink-4); margin-top: 2px; font-family: var(--font-mono); }
.inc-card .descr { font-size: 12px; color: var(--ink-2); line-height: 1.55; margin-top: var(--sp-2); }
.inc-card .montante {
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px dashed var(--line-2);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.inc-card .montante .lbl { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.inc-card .montante .val { font-size: 18px; font-weight: var(--fw-black); color: var(--emerald-600); font-family: var(--font-display); font-style: italic; }
.inc-card .obs { font-size: 11px; color: var(--ink-3); margin-top: var(--sp-1); font-style: italic; }

/* ============================== TABELAS ===================================== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--r-md);
    border: 1px solid var(--line-1);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.5px;
}

thead th {
    background: var(--canvas-2);
    color: var(--navy-600);
    text-transform: uppercase;
    font-size: 10.5px;
    font-weight: var(--fw-bold);
    letter-spacing: 0.08em;
    padding: var(--sp-3) var(--sp-3);
    text-align: left;
    border-bottom: 2px solid var(--line-2);
    white-space: nowrap;
    position: sticky; top: 0;
}
thead th.r { text-align: right; }
thead th.c { text-align: center; }

tbody td {
    padding: var(--sp-3) var(--sp-3);
    border-bottom: 1px solid var(--line-1);
    color: var(--ink-1);
    vertical-align: top;
}
tbody td.r { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
tbody td.c { text-align: center; }
tbody td.num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--canvas-2); }
[data-theme="dark"] tbody tr:hover td { background: rgba(34, 197, 94, 0.05); }

tbody tr.tech-h2 td:first-child       { box-shadow: inset 3px 0 0 var(--tech-h2); padding-left: 14px; }
tbody tr.tech-diesel td:first-child   { box-shadow: inset 3px 0 0 var(--tech-diesel); padding-left: 14px; }
tbody tr.tech-bev td:first-child      { box-shadow: inset 3px 0 0 var(--tech-bev); padding-left: 14px; }
tbody tr.tech-bio td:first-child      { box-shadow: inset 3px 0 0 var(--tech-bio); padding-left: 14px; }
tbody tr.tech-glp td:first-child      { box-shadow: inset 3px 0 0 var(--tech-glp); padding-left: 14px; }
tbody tr.tech-bateria td:first-child  { box-shadow: inset 3px 0 0 var(--tech-bateria); padding-left: 14px; }

tbody tr.total { background: var(--canvas-2); font-weight: var(--fw-bold); }
tbody tr.total td { border-top: 2px solid var(--line-2); }

/* ============================== ALERT BOXES ================================= */
.alert {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--r-md);
    border: 1px solid;
    margin-bottom: var(--sp-4);
}

.alert-icon { flex-shrink: 0; width: 22px; height: 22px; }
.alert-content { flex: 1; }
.alert-content h4 { font-size: 13px; font-weight: var(--fw-bold); margin-bottom: 4px; }
.alert-content p { font-size: 12.5px; line-height: 1.55; }

.alert-success {
    background: var(--emerald-50);
    border-color: var(--emerald-200);
    border-left: 4px solid var(--emerald-500);
}
.alert-success h4 { color: var(--emerald-700); }
.alert-success .alert-icon { color: var(--emerald-600); }
[data-theme="dark"] .alert-success { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.25); }
[data-theme="dark"] .alert-success h4 { color: var(--emerald-400); }

.alert-info {
    background: #EFF6FF;
    border-color: #BFDBFE;
    border-left: 4px solid #2563EB;
}
.alert-info h4 { color: #1D4ED8; }
.alert-info .alert-icon { color: #2563EB; }
[data-theme="dark"] .alert-info { background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.25); }
[data-theme="dark"] .alert-info h4 { color: #93C5FD; }

.alert-warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    border-left: 4px solid var(--warning);
}
.alert-warning h4 { color: #92400E; }
.alert-warning .alert-icon { color: var(--warning); }
[data-theme="dark"] .alert-warning { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.25); }
[data-theme="dark"] .alert-warning h4 { color: #FCD34D; }

.alert-danger {
    background: #FEF2F2;
    border-color: #FECACA;
    border-left: 4px solid var(--danger);
}
.alert-danger h4 { color: var(--danger); }
[data-theme="dark"] .alert-danger { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.25); }

/* ============================== MODAL ======================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 46, 80, 0.65);
    backdrop-filter: blur(6px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
}
.modal-overlay.active { display: flex; animation: fadeIn var(--t-med); }

.modal {
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 800px;
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-head {
    padding: var(--sp-5) var(--sp-6);
    background: var(--grad-navy);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--emerald-500);
}
.modal-head h2 { font-size: 16px; font-style: italic; color: white; }

.modal-close {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.15);
    border: 0;
    color: white;
    border-radius: var(--r-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast);
}
.modal-close:hover { background: rgba(255,255,255,0.30); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: var(--sp-6); overflow-y: auto; flex: 1; }
.modal-foot {
    padding: var(--sp-4) var(--sp-6);
    background: var(--canvas-2);
    border-top: 1px solid var(--line-1);
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-2);
}

/* ============================== CHART WRAPPER =============================== */
.chart-wrap {
    position: relative;
    width: 100%;
    height: 340px;
}
.chart-wrap.sm { height: 200px; }
.chart-wrap.lg { height: 420px; }
.chart-wrap.xl { height: 500px; }

.chart-caption {
    margin-top: var(--sp-2);
    font-size: 11px;
    color: var(--ink-4);
    text-align: center;
    font-style: italic;
}

/* ============================== RECOMENDAÇÃO box ============================ */
.reco {
    background: linear-gradient(135deg, var(--emerald-50) 0%, #ffffff 100%);
    border: 1px solid var(--emerald-200);
    border-left: 4px solid var(--emerald-500);
    border-radius: var(--r-md);
    padding: var(--sp-5);
    margin-bottom: var(--sp-5);
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .reco { background: linear-gradient(135deg, rgba(34,197,94,0.10) 0%, transparent 100%); }
.reco::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    background: radial-gradient(circle, rgba(34,197,94,0.18) 0%, transparent 70%);
    border-radius: 50%;
}
.reco h4 {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--emerald-700);
    font-size: 13px;
    font-style: italic;
    font-weight: var(--fw-black);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--sp-2);
}
[data-theme="dark"] .reco h4 { color: var(--emerald-400); }
.reco h4 svg { width: 18px; height: 18px; }
.reco p { font-size: 13.5px; color: var(--ink-1); line-height: 1.7; position: relative; z-index: 1; }
.reco p strong { color: var(--navy-600); font-weight: var(--fw-bold); }
[data-theme="dark"] .reco p strong { color: var(--emerald-300); }
.reco ul { font-size: 13px; color: var(--ink-1); line-height: 1.7; margin: var(--sp-2) 0 0 var(--sp-5); position: relative; z-index: 1; }
.reco ul li { margin-bottom: var(--sp-1); }

/* ============================== STEP / FLUXO ================================ */
.flow {
    display: flex;
    align-items: stretch;
    gap: var(--sp-3);
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--sp-2);
}
.flow-step {
    flex: 1;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--line-1);
    border-radius: var(--r-md);
    padding: var(--sp-4);
    position: relative;
}
.flow-step::after {
    content: '→';
    position: absolute;
    right: -16px; top: 50%;
    transform: translateY(-50%);
    color: var(--emerald-500);
    font-size: 18px;
    font-weight: var(--fw-bold);
    z-index: 1;
}
.flow-step:last-child::after { display: none; }

.flow-step .ic {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    background: var(--emerald-50);
    color: var(--emerald-600);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-2);
}
.flow-step .ic svg { width: 18px; height: 18px; }

.flow-step h5 {
    font-size: 12px;
    color: var(--navy-600);
    font-weight: var(--fw-bold);
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 0;
}
[data-theme="dark"] .flow-step h5 { color: white; }
.flow-step .num { font-family: var(--font-mono); font-size: 13px; font-weight: var(--fw-bold); color: var(--emerald-600); margin-top: 4px; }
.flow-step .det { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* ============================== STORYTELLING WRAP =========================== */
.story-block {
    background: var(--surface);
    border: 1px solid var(--line-1);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.story-block-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    background: var(--grad-surface);
    border-bottom: 1px solid var(--line-1);
}
.story-block-num {
    width: 30px; height: 30px;
    border-radius: var(--r-md);
    background: var(--grad-emerald);
    color: white;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: var(--fw-black);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}
.story-block-head h3 {
    font-style: italic;
    font-weight: var(--fw-black);
    font-size: 17px;
    color: var(--navy-600);
    letter-spacing: -0.01em;
}
[data-theme="dark"] .story-block-head h3 { color: white; }
.story-block-body { padding: var(--sp-5); }
