.ht-tab { padding: 0.5rem 0; color: #cfd6e2; }

.ht-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding-bottom: 0.85rem; margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ht-head-title { color: #fff; font-size: 1.05rem; margin: 0; }
.ht-head-sys { color: #94a3b8; font-size: 0.78rem; margin-top: 0.25rem; letter-spacing: 0.02em; }
.ht-head-right { display: flex; align-items: center; gap: 0.6rem; }
.ht-gauge {
    width: 44px; height: 44px; border-radius: 50%;
    border: 3px solid; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.85rem;
}
.ht-refresh {
    background: transparent; border: 1px solid rgba(255,255,255,0.15);
    color: #cbd5e1; padding: 0.35rem 0.7rem; border-radius: 6px;
    font-size: 0.78rem; cursor: pointer;
}

.ht-section-title {
    color: #22d3a6; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.08em;
    margin: 1.2rem 0 0.5rem;
}
.ht-actions { display: flex; flex-direction: column; gap: 0.55rem; }
.ht-card {
    background: #0e1b30; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 0.85rem;
}
.ht-card--critical { border-left: 3px solid #ef4444; }
.ht-card--soon     { border-left: 3px solid #f59e0b; }
.ht-card--future   { border-left: 3px solid #38bdf8; }

.ht-card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.ht-num {
    background: #0e7390; color: #fff;
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}
.ht-card-title { color: #fff; font-weight: 600; flex: 1; }
.ht-badge { padding: 1px 8px; border-radius: 8px; font-size: 0.72rem; font-weight: 600; }
.ht-badge--critical { background: #3b1018; color: #fca5a5; }
.ht-badge--soon     { background: #3b2a10; color: #fcd34d; }
.ht-badge--future   { background: #10243b; color: #7dd3fc; }

.ht-card-meta { color: #94a3b8; font-size: 0.82rem; margin-bottom: 0.5rem; }
.ht-card-reason { color: #cbd5e1; font-size: 0.85rem; margin-bottom: 0.55rem; }
.ht-card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ht-cta {
    background: #0e7390; color: #fff;
    border: none; padding: 0.45rem 0.85rem;
    border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.ht-cta--ghost { background: transparent; border: 1px solid rgba(255,255,255,0.15); color: #cbd5e1; }
.ht-cta:hover { filter: brightness(1.1); }

.ht-empty-actions { color: #64748b; text-align: center; padding: 1rem 0; }

.ht-rest-head { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.4rem; }
.ht-rest-head h4 { margin: 0; color: #fff; font-size: 0.9rem; }
.ht-rest-toggle {
    background: transparent; border: none; color: #22d3a6;
    cursor: pointer; font-size: 0.85rem;
}
.ht-rest-meta { color: #64748b; font-size: 0.78rem; margin-left: auto; }
.ht-rest-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px dashed rgba(255,255,255,0.04); }
.ht-rest-label { color: #cbd5e1; }
.ht-rest-meta-row { color: #64748b; font-size: 0.82rem; }

.ht-summary {
    color: #cfd6e2; font-style: italic;
    border-left: 2px solid #0e7390; padding-left: 0.85rem; margin: 0;
    font-size: 0.88rem; line-height: 1.55;
}

.ht-empty {
    text-align: center; padding: 2.5rem 1rem; color: #94a3b8;
}
.ht-empty__icon { font-size: 2rem; margin-bottom: 0.5rem; }
.ht-empty__title { color: #fff; font-size: 1.1rem; margin: 0 0 0.4rem; }
.ht-empty__desc { font-size: 0.9rem; margin: 0 0 1.2rem; }
.ht-empty__cta {
    background: linear-gradient(90deg, #0EA5E9, #22d3a6);
    border: none; color: #fff; font-weight: 600;
    padding: 0.7rem 1.4rem; border-radius: 8px; cursor: pointer;
}

@media (max-width: 768px) {
    .ht-card-actions { flex-direction: column; align-items: stretch; }
    .ht-cta { text-align: center; }
}

/* ── Trend chip ── */
.ht-trend { display: inline-block; margin-top: 0.3rem; font-size: 0.72rem; font-weight: 600; padding: 1px 8px; border-radius: 8px; }
.ht-trend--improving { background: #0f2e23; color: #5eead4; }
.ht-trend--stable    { background: #1e293b; color: #94a3b8; }
.ht-trend--declining { background: #3b1018; color: #fca5a5; }

/* ── System health component bars ── */
.ht-comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.2rem; }
.ht-comp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.2rem; }
.ht-comp-label { color: #cbd5e1; font-size: 0.82rem; }
.ht-comp-val { font-weight: 700; font-size: 0.82rem; }
.ht-comp-bar { height: 6px; background: rgba(255,255,255,0.07); border-radius: 4px; overflow: hidden; }
.ht-comp-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }

/* ── Recalls ── */
.ht-section-title--alert { color: #fca5a5; }
.ht-recalls { display: flex; flex-direction: column; gap: 0.55rem; }
.ht-recall { background: #1a0e14; border: 1px solid rgba(239,68,68,0.25); border-left: 3px solid #ef4444; border-radius: 10px; padding: 0.8rem; }
.ht-recall-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.ht-recall-title { color: #fecaca; font-weight: 700; flex: 1; font-size: 0.9rem; }
.ht-recall-campaign { color: #94a3b8; font-size: 0.72rem; font-family: monospace; }
.ht-recall-summary { color: #e2e8f0; font-size: 0.85rem; margin-bottom: 0.4rem; line-height: 1.5; }
.ht-recall-line { color: #cbd5e1; font-size: 0.82rem; margin-top: 0.2rem; }
.ht-recall-line strong { color: #fca5a5; }
.ht-recall-status { color: #64748b; font-size: 0.75rem; margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Card consequence line ── */
.ht-card-consequence { color: #cbd5e1; font-size: 0.82rem; margin-bottom: 0.55rem; }
.ht-card-consequence strong { color: #fca5a5; }

/* ── Collapsible sections (manufacturer schedule, risk factors) ── */
.ht-collapse { margin-top: 1.1rem; border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; overflow: hidden; }
.ht-collapse-head { width: 100%; display: flex; justify-content: space-between; align-items: center; background: #0e1b30; border: none; color: #cbd5e1; font-size: 0.85rem; font-weight: 600; padding: 0.7rem 0.9rem; cursor: pointer; }
.ht-collapse-icon { color: #22d3a6; }
.ht-collapse-body { padding: 0.4rem 0.9rem 0.7rem; }
.ht-sched-row { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; border-bottom: 1px dashed rgba(255,255,255,0.05); gap: 0.6rem; }
.ht-sched-name { color: #cbd5e1; font-size: 0.85rem; }
.ht-sched-meta { display: flex; gap: 0.7rem; align-items: center; white-space: nowrap; }
.ht-sched-due { color: #94a3b8; font-size: 0.8rem; }
.ht-sched-cost { color: #5eead4; font-size: 0.8rem; }
.ht-risk-list { margin: 0; padding-left: 1.1rem; color: #cbd5e1; font-size: 0.85rem; }
.ht-risk-list li { margin: 0.25rem 0; }

/* ── Cost summary ── */
.ht-costs { display: flex; gap: 0.6rem; }
.ht-cost-cell { flex: 1; background: #0e1b30; border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 0.7rem; text-align: center; }
.ht-cost-val { display: block; color: #fff; font-weight: 800; font-size: 1.05rem; }
.ht-cost-label { display: block; color: #94a3b8; font-size: 0.72rem; margin-top: 0.15rem; }

/* ── Context strip (age · mileage) ── */
.ht-context { color: #64748b; font-size: 0.78rem; margin-top: 1rem; text-align: center; letter-spacing: 0.02em; }

/* ── Inline analyze CTA (shown when only real data, no AI yet) ── */
.ht-analyze-inline { margin-top: 1.2rem; width: 100%; }

@media (max-width: 768px) {
    .ht-comp-grid { grid-template-columns: 1fr; }
    .ht-costs { flex-direction: column; }
}

/* ── Analyzing / loading state ── */
.ht-loading { text-align: center; padding: 2.5rem 1rem; color: #94a3b8; }
.ht-spinner {
    width: 38px; height: 38px; margin: 0 auto 1rem;
    border: 3px solid rgba(34,211,166,0.18); border-top-color: #22d3a6;
    border-radius: 50%; animation: ht-spin 0.8s linear infinite;
}
@keyframes ht-spin { to { transform: rotate(360deg); } }
.ht-loading__title { color: #fff; font-size: 1.05rem; margin: 0 0 0.4rem; }
.ht-loading__desc { font-size: 0.88rem; line-height: 1.55; max-width: 360px; margin: 0 auto; }
