
/* ================================================
   Credit Estimator Widget  (#credit-estimator)
   ================================================ */

/* --- Shell: two-column layout --- */
.lest-shell {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 767.98px) {
    .lest-shell {
        grid-template-columns: 1fr;
    }
}

/* --- Field groups (left column) --- */
.lest-field-group {
    margin-bottom: 22px;
}

.lest-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.lest-tip {
    color: #9ca3af;
    font-size: 13px;
    cursor: help;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    transition: color 0.15s;
}

.lest-tip:hover {
    color: #3b82f6;
}

.lest-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 6px 0 0;
}

.lest-hint code {
    background: #f3f4f6;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 11.5px;
    color: #4b5563;
}

/* --- Endpoint tab pills --- */
.lest-endpoint-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lest-etab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    line-height: 1;
}

.lest-etab:hover:not(.active) {
    border-color: #93c5fd;
    color: #1e3a8a;
}

.lest-etab.active {
    border-color: #3b82f6;
    background: #3b82f6;
    color: #fff;
}

/* --- Stepper (+/-) --- */
.lest-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.lest-step-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 300;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
    line-height: 1;
    padding: 0;
}

.lest-step-btn:hover {
    background: #f3f4f6;
    color: #1e3a8a;
}

.lest-step-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.lest-step-val {
    min-width: 36px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
    font-variant-numeric: tabular-nums;
}

/* --- Radio group (search mode) --- */
.lest-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lest-radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.lest-radio input[type="radio"] {
    margin-top: 3px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
}

.lest-radio-box {
    display: flex;
    flex-direction: column;
}

.lest-radio-box strong {
    font-size: 14px;
    color: #1e3a8a;
}

.lest-radio-box small {
    font-size: 12px;
    color: #6b7280;
    margin-top: 1px;
}

/* --- Range slider --- */
.lest-range-wrap {
    position: relative;
}

.lest-range {
    width: 100%;
    accent-color: #3b82f6;
    height: 6px;
    cursor: pointer;
}

.lest-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}

.lest-range-val {
    font-weight: 700;
    color: #1e3a8a;
}

/* --- Toggle switch row --- */
.lest-toggle-row {
    padding: 2px 0;
}

.lest-switch {
    cursor: pointer;
}

.lest-switch:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* --- Context box --- */
.lest-context-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 18px;
}

/* --- Endpoint panel transitions --- */
.lest-endpoint-panel {
    margin-bottom: 16px;
    animation: lest-fadein 0.18s ease;
}

@keyframes lest-fadein {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================
   Receipt (right column — dark card)
   ================================================ */

.lest-receipt {
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    color: #e2e8f0;
    font-size: 14px;
    position: sticky;
    top: 80px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.lest-receipt-header {
    background: #0f172a;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lest-receipt-endpoint {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    color: #93c5fd;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 5px;
    padding: 2px 10px;
}

.lest-receipt-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lest-receipt-body {
    padding: 16px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 80px;
}

/* Individual receipt rows */
.lest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 8px;
    animation: lest-fadein 0.2s ease;
}

.lest-row:last-child {
    border-bottom: none;
}

.lest-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
    flex: 1;
}

.lest-row-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

.lest-row-icon.base { background: rgba(59,130,246,0.2);  color: #93c5fd; }
.lest-row-icon.enr  { background: rgba(16,185,129,0.2);  color: #6ee7b7; }
.lest-row-icon.mult { background: rgba(245,158,11,0.2);  color: #fcd34d; }
.lest-row-icon.auto { background: rgba(139,92,246,0.18); color: #c4b5fd; }
.lest-row-icon.band { background: rgba(248,113,113,0.18);color: #fca5a5; }

.lest-row-val {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lest-row-val.dim {
    color: #64748b;
    font-weight: 400;
}

/* Multiplier badge (shown on radius) */
.lest-mult-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.35);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 12px;
    font-weight: 700;
    color: #fcd34d;
    font-variant-numeric: tabular-nums;
}

.lest-receipt-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 4px 20px 0;
}

.lest-receipt-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}

.lest-receipt-total span:first-child {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.lest-receipt-total-val {
    font-size: 2rem;
    font-weight: 800;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: color 0.25s;
}

.lest-receipt-total-val.high {
    color: #fcd34d;
}

.lest-receipt-note {
    padding: 0 20px 12px;
    font-size: 12px;
    color: #64748b;
    min-height: 18px;
    line-height: 1.4;
}

/* Plain-English formula footer */
.lest-formula-plain {
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.2);
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

.lest-formula-icon {
    color: #fcd34d;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 13px;
}

/* --- Receipt daily calc (inside receipt card) --- */
.lest-receipt-daily {
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.04);
    padding: 10px 16px;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 0 0 12px 12px;
}

.lest-daily-icon {
    color: #fcd34d;
    flex-shrink: 0;
}

/* --- Total unit text --- */
.lest-total-unit {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 4px;
}

/* --- Enrichment checkbox groups --- */
.lest-enrich-group {
    margin-bottom: 10px;
}

.lest-enrich-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}

.lest-enrichments {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.lest-enrichments label {
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-weight: 500;
}

.lest-enrichments input[type="checkbox"] {
    accent-color: #3b82f6;
    cursor: pointer;
}

/* --- Code type selector --- */
.lest-controls .form-select-sm {
    max-width: 320px;
    font-size: 13px;
}
