/* ============================================================
   DEBT-TO-INCOME RATIO CALCULATOR — Fincote Theme
   Light mode default + dark mode via body.dark-mode class
   Matches theme-toggle.php architecture exactly
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===== LIGHT MODE (default) ===== */
.dti-wrapper {
    --fc-bg:           #ffffff;
    --fc-bg-2:         #f8f9fc;
    --fc-bg-3:         #f0f2f7;
    --fc-bg-card:      #ffffff;
    --fc-bg-input:     #f4f5f8;
    --fc-border:       rgba(0,0,0,0.08);
    --fc-border-focus: rgba(5,150,105,0.4);
    --fc-green:        #059669;
    --fc-green-dark:   #047857;
    --fc-green-glow:   rgba(5,150,105,0.12);
    --fc-green-pale:   rgba(5,150,105,0.07);
    --fc-white:        #0f172a;
    --fc-text:         #1f2937;
    --fc-text-light:   #475569;
    --fc-text-muted:   #94a3b8;
    --fc-danger:       #dc2626;
    --fc-warning:      #d97706;
    --fc-blue:         #2563eb;
    --fc-purple:       #7c3aed;
    --fc-shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
    --fc-shadow-md:    0 2px 12px rgba(0,0,0,0.08);
    --fc-shadow-lg:    0 4px 24px rgba(0,0,0,0.10);
    --fc-shadow-green: 0 0 20px rgba(5,150,105,0.10);
    --fc-radius:       16px;
    --fc-radius-sm:    10px;
    --fc-transition:   all 0.25s ease;
    --fc-font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* stat card tokens */
    --fc-red-bg:       rgba(220,38,38,0.07);
    --fc-red-text:     #b91c1c;
    --fc-red-bar:      #dc2626;
    --fc-orange-bg:    rgba(217,119,6,0.08);
    --fc-orange-text:  #b45309;
    --fc-orange-bar:   #d97706;
    --fc-blue-bg:      rgba(37,99,235,0.07);
    --fc-blue-text:    #1d4ed8;
    --fc-blue-bar:     #2563eb;
    --fc-purple-bg:    rgba(124,58,237,0.07);
    --fc-purple-text:  #6d28d9;
    --fc-purple-bar:   #7c3aed;
    /* gauge tokens */
    --fc-gauge-track:     #e5e7eb;
    --fc-gauge-needle:    #111827;
    --fc-gauge-excellent: #16a34a;
    --fc-gauge-good:      #2563eb;
    --fc-gauge-fair:      #d97706;
    --fc-gauge-poor:      #dc2626;
    /* legend tokens */
    --fc-legend-excellent-bg:   rgba(22,163,74,0.12);
    --fc-legend-excellent-text: #15803d;
    --fc-legend-good-bg:        rgba(37,99,235,0.10);
    --fc-legend-good-text:      #1d4ed8;
    --fc-legend-fair-bg:        rgba(217,119,6,0.10);
    --fc-legend-fair-text:      #b45309;
    --fc-legend-poor-bg:        rgba(220,38,38,0.10);
    --fc-legend-poor-text:      #b91c1c;
    /* badge tokens */
    --fc-badge-blue-bg:   rgba(37,99,235,0.10);
    --fc-badge-blue-text: #1d4ed8;
    --fc-badge-red-bg:    rgba(220,38,38,0.10);
    --fc-badge-red-text:  #b91c1c;
    /* col border tokens */
    --fc-col-income-border: rgba(37,99,235,0.2);
    --fc-col-loan-border:   rgba(5,150,105,0.2);
}

/* ===== DARK MODE — via body.dark-mode (matches theme-toggle.php) ===== */
body.dark-mode .dti-wrapper {
    --fc-bg:           #090714;
    --fc-bg-2:         #13161e;
    --fc-bg-3:         #1a1e2a;
    --fc-bg-card:      #161923;
    --fc-bg-input:     #1e2333;
    --fc-border:       rgba(255,255,255,0.08);
    --fc-border-focus: rgba(72,199,142,0.5);
    --fc-green:        #48c78e;
    --fc-green-dark:   #3aad7a;
    --fc-green-glow:   rgba(72,199,142,0.15);
    --fc-green-pale:   rgba(72,199,142,0.08);
    --fc-white:        #ffffff;
    --fc-text:         #e8edf5;
    --fc-text-light:   #a0aec0;
    --fc-text-muted:   #64748b;
    --fc-danger:       #f56565;
    --fc-warning:      #ed8936;
    --fc-blue:         #4299e1;
    --fc-purple:       #9f7aea;
    --fc-shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
    --fc-shadow-md:    0 4px 20px rgba(0,0,0,0.4);
    --fc-shadow-lg:    0 8px 40px rgba(0,0,0,0.5);
    --fc-shadow-green: 0 0 30px rgba(72,199,142,0.15);
    --fc-red-bg:       rgba(245,101,101,0.10);
    --fc-red-text:     #fc8181;
    --fc-red-bar:      #f56565;
    --fc-orange-bg:    rgba(237,137,54,0.10);
    --fc-orange-text:  #f6ad55;
    --fc-orange-bar:   #ed8936;
    --fc-blue-bg:      rgba(66,153,225,0.10);
    --fc-blue-text:    #63b3ed;
    --fc-blue-bar:     #4299e1;
    --fc-purple-bg:    rgba(159,122,234,0.10);
    --fc-purple-text:  #b794f4;
    --fc-purple-bar:   #9f7aea;
    --fc-gauge-track:     #1e2333;
    --fc-gauge-needle:    #ffffff;
    --fc-gauge-excellent: #48c78e;
    --fc-gauge-good:      #63b3ed;
    --fc-gauge-fair:      #ed8936;
    --fc-gauge-poor:      #f56565;
    --fc-legend-excellent-bg:   rgba(72,199,142,0.15);
    --fc-legend-excellent-text: #48c78e;
    --fc-legend-good-bg:        rgba(66,153,225,0.15);
    --fc-legend-good-text:      #63b3ed;
    --fc-legend-fair-bg:        rgba(237,137,54,0.15);
    --fc-legend-fair-text:      #f6ad55;
    --fc-legend-poor-bg:        rgba(245,101,101,0.15);
    --fc-legend-poor-text:      #fc8181;
    --fc-badge-blue-bg:   rgba(66,153,225,0.15);
    --fc-badge-blue-text: #63b3ed;
    --fc-badge-red-bg:    rgba(245,101,101,0.15);
    --fc-badge-red-text:  #fc8181;
    --fc-col-income-border: rgba(66,153,225,0.2);
    --fc-col-loan-border:   rgba(72,199,142,0.2);
}

/* ===== WRAPPER BORDER/SHADOW — light vs dark ===== */
.dti-wrapper {
    border: 1px solid rgba(5,150,105,0.15);
    box-shadow:
        0 0 0 1px rgba(5,150,105,0.06),
        0 8px 32px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

body.dark-mode .dti-wrapper {
    border: 1px solid rgba(72,199,142,0.15);
    box-shadow:
        0 0 0 1px rgba(72,199,142,0.08),
        0 8px 32px rgba(0,0,0,0.5),
        0 0 60px rgba(72,199,142,0.06),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ===== RESET ===== */
.dti-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== WRAPPER ===== */
.dti-wrapper {
    margin: 0 auto 60px;
    padding: 36px 28px 48px;
    font-family: var(--fc-font);
    color: var(--fc-text);
    background: var(--fc-bg-2);
    position: relative;
    border-radius: 24px;
}

.dti-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fc-green), transparent);
    border-radius: 99px;
    opacity: 0.5;
}

/* ===== HEADER ===== */
.dti-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    padding: 28px 32px;
    background: var(--fc-bg-card);
    border-radius: var(--fc-radius);
    border: 1px solid var(--fc-border);
    box-shadow: var(--fc-shadow-lg);
    position: relative;
    overflow: hidden;
}

.dti-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fc-green), transparent);
}

.dti-header-icon {
    font-size: 2.4rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.dti-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--fc-white);
    margin: 0 0 5px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.dti-subtitle {
    font-size: 0.9rem;
    color: var(--fc-text-light);
    margin: 0;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ===== CURRENCY BAR ===== */
.dti-currency-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fc-text-light);
}

.dti-currency-select {
    padding: 9px 14px;
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-sm);
    background: var(--fc-bg-input);
    color: var(--fc-text);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--fc-font);
    cursor: pointer;
    transition: var(--fc-transition);
    outline: none;
    max-width: 220px;
}

.dti-currency-select:focus {
    border-color: var(--fc-green);
    box-shadow: 0 0 0 3px var(--fc-green-glow);
}

/* ===== TABS ===== */
.dti-tabs {
    display: grid;
    gap: 6px;
    margin-bottom: 28px;
    background: var(--fc-bg-card);
    padding: 5px;
    border-radius: var(--fc-radius);
    border: 1px solid var(--fc-border);
}

.dti-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 10px;
    border: none;
    border-radius: var(--fc-radius-sm);
    background: transparent;
    color: var(--fc-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--fc-font);
    cursor: pointer;
    transition: var(--fc-transition);
    white-space: nowrap;
}

.dti-tab:hover {
    background: var(--fc-bg-3);
    color: var(--fc-text-light);
}

.dti-tab.active {
    background: var(--fc-green);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--fc-green-glow);
    font-weight: 700;
}

.dti-tab svg { flex-shrink: 0; }

/* ===== PANELS ===== */
.dti-panel { display: none; animation: dtiFadeIn 0.3s ease; }
.dti-panel.active { display: block; }

@keyframes dtiFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== PANEL INTRO ===== */
.dti-panel-intro { margin-bottom: 22px; }

.dti-panel-intro h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--fc-white);
    margin: 0 0 5px;
    letter-spacing: -0.01em;
}

.dti-panel-intro p {
    font-size: 0.85rem;
    color: var(--fc-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ===== SECTION CARDS ===== */
.dti-section-card {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 18px;
}

.dti-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--fc-border);
}

.dti-section-icon { font-size: 1.2rem; }

.dti-section-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--fc-white);
    margin: 0;
}

/* ===== INCOME GRID ===== */
.dti-income-grid { margin-bottom: 0; }

/* ===== INCOME / DEBT ROWS ===== */
.dti-income-row,
.dti-debt-row-simple {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 12px 0;
    border-bottom: 1px solid var(--fc-border);
}

.dti-income-row:last-child,
.dti-debt-row-simple:last-child { border-bottom: none; }

/* ===== IMPROVEMENT DEBT ROWS ===== */
.dti-imp-debt-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 14px;
    margin-bottom: 10px;
    position: relative;
}

.dti-imp-debt-row::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--fc-green);
    border-radius: 3px 0 0 3px;
    opacity: 0.6;
}

/* ===== DELETE BTN ===== */
.dti-delete-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(220,38,38,0.25);
    border-radius: var(--fc-radius-sm);
    background: rgba(220,38,38,0.06);
    color: var(--fc-danger);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--fc-font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fc-transition);
    flex-shrink: 0;
}

.dti-delete-btn:hover {
    background: var(--fc-danger);
    color: #ffffff;
    border-color: var(--fc-danger);
}

/* ===== INPUTS ===== */
.dti-input-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.dti-input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dti-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-sm);
    background: var(--fc-bg-input);
    color: var(--fc-text);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--fc-font);
    transition: var(--fc-transition);
    box-sizing: border-box;
    -webkit-appearance: none;
    outline: none;
}

.dti-input:focus {
    border-color: var(--fc-green);
    box-shadow: 0 0 0 3px var(--fc-green-glow);
    background: var(--fc-bg-3);
}

.dti-input::placeholder { color: var(--fc-text-muted); }

select.dti-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* ===== ADD BUTTON ===== */
.dti-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border: 1px dashed rgba(5,150,105,0.4);
    border-radius: var(--fc-radius);
    background: var(--fc-green-pale);
    color: var(--fc-green);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--fc-font);
    cursor: pointer;
    transition: var(--fc-transition);
    width: 100%;
    justify-content: center;
    margin-top: 12px;
}

body.dark-mode .dti-add-btn {
    border-color: rgba(72,199,142,0.4);
}

.dti-add-btn:hover {
    background: var(--fc-green-glow);
    border-color: var(--fc-green);
    transform: translateY(-1px);
}

.dti-add-small {
    padding: 9px 14px;
    font-size: 0.82rem;
    margin-top: 10px;
}

/* ===== CALCULATE BUTTON ===== */
.dti-calc-btn {
    width: 100%;
    padding: 15px;
    background: var(--fc-green);
    color: #ffffff;
    border: none;
    border-radius: var(--fc-radius);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--fc-font);
    cursor: pointer;
    transition: var(--fc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px var(--fc-green-glow);
    margin-bottom: 24px;
    margin-top: 16px;
    letter-spacing: 0.3px;
}

.dti-calc-btn:hover {
    background: var(--fc-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--fc-green-glow);
}

.dti-calc-btn:active { transform: translateY(0); }

/* ===== RESULTS ===== */
.dti-results { animation: dtiFadeIn 0.4s ease; }

/* ===== GAUGE ===== */
.dti-gauge-container {
    background: var(--fc-bg-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 24px 20px 18px;
    margin-bottom: 20px;
    text-align: center;
}

.dti-gauge-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--fc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.dti-gauge-wrap { position: relative; display: inline-block; }

.dti-gauge-svg {
    width: 200px;
    height: 110px;
    display: block;
    margin: 0 auto;
}

.dti-gauge-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--fc-white);
    letter-spacing: -0.03em;
    margin-top: 4px;
    transition: color 0.4s ease;
}

.dti-gauge-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--fc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.dti-gauge-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
}

.dti-legend-item {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    letter-spacing: 0.3px;
}

.dti-legend-excellent { background: var(--fc-legend-excellent-bg); color: var(--fc-legend-excellent-text); }
.dti-legend-good      { background: var(--fc-legend-good-bg);      color: var(--fc-legend-good-text); }
.dti-legend-fair      { background: var(--fc-legend-fair-bg);      color: var(--fc-legend-fair-text); }
.dti-legend-poor      { background: var(--fc-legend-poor-bg);      color: var(--fc-legend-poor-text); }

/* ===== STAT CARDS ===== */
.dti-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.dti-stat-card {
    padding: 18px 14px;
    border-radius: var(--fc-radius);
    text-align: center;
    border: 1px solid var(--fc-border);
    transition: var(--fc-transition);
    position: relative;
    overflow: hidden;
}

.dti-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
}

.dti-stat-card:hover { transform: translateY(-2px); box-shadow: var(--fc-shadow-md); }

.dti-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    opacity: 0.75;
}

.dti-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.dti-stat-red    { background: var(--fc-red-bg);    color: var(--fc-red-text); }
.dti-stat-red    .dti-stat-value { color: var(--fc-red-text); }
.dti-stat-red::before { background: var(--fc-red-bar); }

.dti-stat-orange { background: var(--fc-orange-bg); color: var(--fc-orange-text); }
.dti-stat-orange .dti-stat-value { color: var(--fc-orange-text); }
.dti-stat-orange::before { background: var(--fc-orange-bar); }

.dti-stat-gold   { background: var(--fc-green-pale); color: var(--fc-green); }
.dti-stat-gold   .dti-stat-value { color: var(--fc-green); }
.dti-stat-gold::before { background: var(--fc-green); }

.dti-stat-blue   { background: var(--fc-blue-bg);   color: var(--fc-blue-text); }
.dti-stat-blue   .dti-stat-value { color: var(--fc-blue-text); }
.dti-stat-blue::before { background: var(--fc-blue-bar); }

.dti-stat-green  { background: var(--fc-green-pale); color: var(--fc-green); }
.dti-stat-green  .dti-stat-value { color: var(--fc-green); }
.dti-stat-green::before { background: var(--fc-green); }

.dti-stat-purple { background: var(--fc-purple-bg); color: var(--fc-purple-text); }
.dti-stat-purple .dti-stat-value { color: var(--fc-purple-text); }
.dti-stat-purple::before { background: var(--fc-purple-bar); }

/* ===== RATING CARD ===== */
.dti-rating-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--fc-radius);
    border: 1px solid rgba(5,150,105,0.2);
    background: var(--fc-green-pale);
    margin-bottom: 20px;
    transition: var(--fc-transition);
}

body.dark-mode .dti-rating-card {
    border-color: rgba(72,199,142,0.2);
}

.dti-rating-icon { font-size: 2rem; flex-shrink: 0; }

.dti-rating-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--fc-white);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.dti-rating-desc {
    font-size: 0.82rem;
    color: var(--fc-text-light);
    line-height: 1.5;
}

/* ===== BREAKDOWN / SECTIONS ===== */
.dti-breakdown-table,
.dti-progress-section,
.dti-lender-standards,
.dti-affordability-scenarios,
.dti-improvement-strategies,
.dti-improvement-scenarios {
    background: var(--fc-bg-card);
    border-radius: var(--fc-radius);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--fc-border);
}

.dti-breakdown-table h4,
.dti-progress-section h4,
.dti-lender-standards h4,
.dti-affordability-scenarios h4,
.dti-improvement-strategies h4,
.dti-improvement-scenarios h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--fc-white);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--fc-border);
    letter-spacing: -0.01em;
}

.dti-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.dti-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.dti-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--fc-bg-3);
    color: var(--fc-text-muted);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--fc-border);
}

.dti-table th:first-child { border-radius: 8px 0 0 0; }
.dti-table th:last-child  { border-radius: 0 8px 0 0; }

.dti-table td {
    padding: 12px;
    border-bottom: 1px solid var(--fc-border);
    color: var(--fc-text);
    font-weight: 500;
}

.dti-table tr:last-child td { border-bottom: none; }
.dti-table tr:hover td { background: var(--fc-bg-3); }

.dti-td-danger  { color: var(--fc-danger);  font-weight: 700; }
.dti-td-warning { color: var(--fc-warning); font-weight: 700; }
.dti-td-success { color: var(--fc-green);   font-weight: 700; }
.dti-td-blue    { color: var(--fc-blue);    font-weight: 700; }
.dti-td-muted   { color: var(--fc-text-muted); }

/* ===== DTI BADGE PILLS ===== */
.dti-badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.dti-pill-excellent { background: var(--fc-legend-excellent-bg); color: var(--fc-legend-excellent-text); }
.dti-pill-good      { background: var(--fc-legend-good-bg);      color: var(--fc-legend-good-text); }
.dti-pill-fair      { background: var(--fc-legend-fair-bg);      color: var(--fc-legend-fair-text); }
.dti-pill-poor      { background: var(--fc-legend-poor-bg);      color: var(--fc-legend-poor-text); }

/* ===== PROGRESS BARS ===== */
.dti-progress-item { margin-bottom: 14px; }
.dti-progress-item:last-child { margin-bottom: 0; }

.dti-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.82rem;
    gap: 8px;
}

.dti-progress-name { font-weight: 600; color: var(--fc-text); }
.dti-progress-pct  { font-weight: 700; color: var(--fc-green); white-space: nowrap; }

.dti-progress-track {
    width: 100%;
    height: 6px;
    background: var(--fc-bg-3);
    border-radius: 99px;
    overflow: hidden;
}

.dti-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--fc-green-dark), var(--fc-green));
}

/* ===== LENDER STANDARDS ===== */
.dti-lender-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--fc-border);
    font-size: 0.82rem;
    gap: 8px;
    flex-wrap: wrap;
}

.dti-lender-row:last-child { border-bottom: none; }
.dti-lender-name   { font-weight: 600; color: var(--fc-text); flex: 1; min-width: 120px; }
.dti-lender-limit  { color: var(--fc-text-muted); font-size: 0.75rem; white-space: nowrap; }
.dti-lender-status { white-space: nowrap; }

/* ===== TWO-COL LAYOUT ===== */
.dti-two-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.dti-col-card {
    background: var(--fc-bg-card);
    border-radius: var(--fc-radius);
    padding: 18px;
    border: 1px solid var(--fc-border);
}

.dti-col-income { border-color: var(--fc-col-income-border); }
.dti-col-loan   { border-color: var(--fc-col-loan-border); }

.dti-col-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.dti-col-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--fc-white);
    margin: 0;
}

.dti-badge {
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.dti-badge-blue  { background: var(--fc-badge-blue-bg);  color: var(--fc-badge-blue-text); }
.dti-badge-green { background: var(--fc-green-pale);      color: var(--fc-green); }
.dti-badge-red   { background: var(--fc-badge-red-bg);    color: var(--fc-badge-red-text); }

/* ===== TWO-COL INLINE ===== */
.dti-two-col-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ===== FREEDOM HERO ===== */
.dti-freedom-hero {
    background: var(--fc-bg-card);
    border: 1px solid rgba(5,150,105,0.2);
    border-radius: var(--fc-radius);
    padding: 36px 20px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

body.dark-mode .dti-freedom-hero {
    border-color: rgba(72,199,142,0.2);
}

.dti-freedom-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fc-green), transparent);
}

.dti-freedom-emoji { font-size: 2.5rem; margin-bottom: 10px; position: relative; z-index: 1; }

.dti-freedom-date {
    font-size: 2rem;
    font-weight: 900;
    color: var(--fc-green);
    margin-bottom: 6px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}

.dti-freedom-label {
    font-size: 0.78rem;
    color: var(--fc-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

/* ===== SCENARIO ROWS ===== */
.dti-scenario-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--fc-border);
    font-size: 0.82rem;
    gap: 8px;
    flex-wrap: wrap;
}

.dti-scenario-row:last-child { border-bottom: none; }
.dti-scenario-label  { font-weight: 600; color: var(--fc-text); flex: 1; min-width: 100px; }
.dti-scenario-limit  { color: var(--fc-text-muted); font-size: 0.75rem; white-space: nowrap; }
.dti-scenario-amount { font-weight: 700; color: var(--fc-green); white-space: nowrap; }

/* ===== VERDICT ===== */
.dti-verdict {
    padding: 16px 18px;
    border-radius: var(--fc-radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.7;
    border-left: 3px solid var(--fc-green);
    background: var(--fc-green-pale);
    color: var(--fc-text);
}

/* ===== IMPROVEMENT STRATEGY CARDS ===== */
.dti-strategy-action {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--fc-border);
}

.dti-strategy-action:last-child { border-bottom: none; }

.dti-action-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fc-green-pale);
    border: 1px solid rgba(5,150,105,0.3);
    color: var(--fc-green);
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

body.dark-mode .dti-action-num {
    border-color: rgba(72,199,142,0.3);
}

.dti-action-icon { font-size: 1.3rem; flex-shrink: 0; }

.dti-action-content { flex: 1; }
.dti-action-title   { font-size: 0.88rem; font-weight: 700; color: var(--fc-white); margin-bottom: 4px; }
.dti-action-detail  { font-size: 0.78rem; color: var(--fc-text-muted); line-height: 1.5; }
.dti-action-impact  {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--fc-green-pale);
    color: var(--fc-green);
    letter-spacing: 0.3px;
}

/* ===== CATEGORIES GRID ===== */
.dti-categories-grid { display: flex; flex-direction: column; gap: 12px; }

.dti-cat-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dti-cat-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.dti-cat-row .dti-input-group { flex: 1; }

/* ===== HINT TEXT ===== */
.dti-hint-text {
    font-size: 0.78rem;
    color: var(--fc-text-muted);
    margin-bottom: 12px;
    font-style: italic;
    line-height: 1.4;
}

/* ===== IMPROVEMENT SCENARIO ===== */
.dti-imp-scenario {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--fc-radius-sm);
    background: var(--fc-bg-3);
    border: 1px solid var(--fc-border);
    margin-bottom: 8px;
    font-size: 0.82rem;
    gap: 8px;
    flex-wrap: wrap;
    transition: var(--fc-transition);
}

.dti-imp-scenario:last-child { margin-bottom: 0; }
.dti-imp-scenario:hover { border-color: rgba(5,150,105,0.2); }
body.dark-mode .dti-imp-scenario:hover { border-color: rgba(72,199,142,0.2); }

.dti-imp-scenario-label { font-weight: 600; color: var(--fc-text); flex: 1; }
.dti-imp-scenario-dti   { font-weight: 800; white-space: nowrap; }

/* ===== GAUGE SVG — track & needle override for inline strokes ===== */
.dti-gauge-svg path[stroke="#1e2333"] { stroke: var(--fc-gauge-track) !important; }
.dti-gauge-svg line[stroke="#ffffff"] { stroke: var(--fc-gauge-needle) !important; }
#gauge-arc-excellent { stroke: var(--fc-gauge-excellent) !important; }
#gauge-arc-good      { stroke: var(--fc-gauge-good)      !important; }
#gauge-arc-fair      { stroke: var(--fc-gauge-fair)      !important; }
#gauge-arc-poor      { stroke: var(--fc-gauge-poor)      !important; }

/* ============================================================
   TABLET — 600px+
   ============================================================ */
@media (min-width: 600px) {
    .dti-wrapper { padding: 40px 24px 60px; }
    .dti-tabs { grid-template-columns: repeat(2, 1fr); }
    .dti-tab  { font-size: 0.82rem; }
    .dti-results-grid { grid-template-columns: repeat(4, 1fr); }
    .dti-stat-value   { font-size: 1.35rem; }
    .dti-two-col { flex-direction: row; }
    .dti-col-card { flex: 1; }
    .dti-income-row,
    .dti-debt-row-simple { grid-template-columns: 1.5fr 1fr auto; }
    .dti-imp-debt-row { grid-template-columns: 1fr 1fr 1fr auto; }
    .dti-categories-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .dti-gauge-svg   { width: 240px; height: 132px; }
    .dti-gauge-value { font-size: 2.4rem; }
}

/* ============================================================
   DESKTOP — 1024px+
   ============================================================ */
@media (min-width: 1024px) {
    .dti-wrapper { padding: 48px 32px 72px; }
    .dti-header  { padding: 32px 36px; }
    .dti-title   { font-size: 1.9rem; }
    .dti-tab     { font-size: 0.875rem; padding: 12px 14px; }
    .dti-stat-value { font-size: 1.5rem; }
    .dti-tabs { grid-template-columns: repeat(4, 1fr); }
}