/* ==========================================================================
   Hospitalization Timeline - Clean Rewrite (2025-12-10)
   Uses REAL data from dailyStates, no fake visualizations
   ========================================================================== */

/* Main Container */
.ht-timeline {
    background: var(--sol-bg-elevated, #1c1f2a);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

/* Header */
.ht-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ht-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Quick Day Toggle (2025-12-11) */
.ht-day-toggle {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 3px;
}

.ht-toggle-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sol-text-secondary, #94a3b8);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ht-toggle-btn:hover:not(.disabled) {
    color: var(--sol-text-primary, #f8fafc);
    background: rgba(255, 255, 255, 0.08);
}

.ht-toggle-btn.active {
    color: var(--sol-text-primary, #f8fafc);
    background: var(--sol-accent, #3b82f6);
}

.ht-toggle-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ht-toggle-btn:focus-visible {
    outline: 2px solid var(--sol-accent, #3b82f6);
    outline-offset: 2px;
}

.ht-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sol-text-primary, #f8fafc);
}

.ht-meta {
    font-size: 0.6875rem;
    color: var(--sol-text-tertiary, #64748b);
}

/* Status Summary Pills */
.ht-status-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ht-status-pill {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.ht-status-pill.worsening {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.ht-status-pill.active {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.ht-status-pill.improving {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.ht-status-pill.resolved {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Day Scale */
.ht-scale {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ht-scale-start,
.ht-scale-end {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--sol-text-tertiary, #64748b);
    white-space: nowrap;
}

.ht-scale-track {
    flex: 1;
    display: flex;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* Day ticks - clickable (PHASE 4) */
.ht-day-tick {
    flex: 1;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 8px;
}

.ht-day-tick:hover {
    background: rgba(59, 130, 246, 0.3);
}

.ht-day-tick:focus-visible {
    outline: 2px solid var(--sol-accent, #3b82f6);
    outline-offset: -2px;
}

.ht-day-tick.selected {
    background: rgba(59, 130, 246, 0.5);
}

.ht-day-tick.ht-day-today {
    background: rgba(34, 197, 94, 0.2);
}

.ht-day-tick:last-child {
    border-right: none;
}

/* Now button */
.ht-now-btn {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ht-now-btn:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.6);
}

/* Day selection indicator */
.ht-day-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.15);
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.ht-day-indicator.hidden {
    display: none;
}

.ht-day-indicator-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #93c5fd;
}

.ht-day-indicator-text #htSelectedDay {
    color: #fff;
}

.ht-day-indicator-close {
    font-size: 1rem;
    line-height: 1;
    padding: 2px 6px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #93c5fd;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ht-day-indicator-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Problem Rows */
.ht-problems {
    padding: 8px 0;
}

.ht-problem-row {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ht-problem-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ht-problem-row.selected {
    background: rgba(59, 130, 246, 0.1);
}

.ht-problem-label {
    width: 320px !important;
    min-width: 320px !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ht-problem-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sol-text-primary, #e2e8f0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 180px; /* Minimum readable width */
}

.ht-problem-row:hover .ht-problem-name {
    color: var(--sol-text-primary, #f8fafc);
}

/* Classification rationale badges (guard indicators) */
.ht-rationale-badges {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
    flex-shrink: 0;
}

.ht-rationale-badges .guard-badges-compact {
    display: inline-flex;
    gap: 2px;
}

.ht-rationale-badges .guard-badge-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 8px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    cursor: help;
}

.ht-rationale-badges .guard-badge-compact.guard-blocked {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.ht-problem-status {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ht-problem-status.worsening {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ht-problem-status.active {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.ht-problem-status.improving {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.ht-problem-status.resolved {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

/* Problem Track (the timeline bar area) */
.ht-problem-track {
    flex: 1;
    height: 14px;
    position: relative;
    margin-left: 12px;
}

/* Problem Bar */
.ht-problem-bar {
    position: absolute;
    top: 2px;
    height: 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    transition: transform 0.15s ease;
}

.ht-problem-row:hover .ht-problem-bar {
    transform: scaleY(1.2);
}

.ht-problem-bar.worsening {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.5));
    border: 1px solid rgba(239, 68, 68, 0.6);
}

.ht-problem-bar.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.5));
    border: 1px solid rgba(245, 158, 11, 0.6);
}

.ht-problem-bar.improving {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.5));
    border: 1px solid rgba(34, 197, 94, 0.6);
}

.ht-problem-bar.resolved {
    background: linear-gradient(90deg, rgba(107, 114, 128, 0.3), rgba(107, 114, 128, 0.5));
    border: 1px solid rgba(107, 114, 128, 0.6);
}

/* Markers on the bar */
.ht-marker {
    font-size: 0.625rem;
    z-index: 2;
}

.ht-marker.onset {
    color: var(--sol-text-secondary, #94a3b8);
}

.ht-marker.transition {
    position: absolute;
    transform: translateX(-50%);
}

.ht-marker.transition.worsening { color: #ef4444; }
.ht-marker.transition.active { color: #f59e0b; }
.ht-marker.transition.improving { color: #22c55e; }
.ht-marker.transition.resolved { color: #6b7280; }

.ht-marker.resolved {
    color: #22c55e;
}

.ht-marker.current {
    color: var(--sol-text-primary, #f8fafc);
}

/* Events Section */
.ht-events {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 16px;
}

.ht-events-header {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sol-text-tertiary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.ht-events-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ht-event-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.6875rem;
    color: var(--sol-text-secondary, #94a3b8);
}

.ht-event-day {
    font-weight: 600;
    color: var(--sol-text-tertiary, #64748b);
    width: 28px;
}

.ht-event-icon {
    width: 12px;
    text-align: center;
}

.ht-event-item.onset .ht-event-icon { color: #3b82f6; }
.ht-event-item.transition .ht-event-icon { color: #f59e0b; }
.ht-event-item.critical .ht-event-icon { color: #ef4444; }

.ht-event-label {
    flex: 1;
}

.ht-events-more {
    font-size: 0.625rem;
    color: var(--sol-text-tertiary, #64748b);
    padding-top: 4px;
}

/* No Data State */
.ht-no-data {
    padding: 32px 24px;
    text-align: center;
}

.ht-no-data-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    color: var(--sol-text-tertiary, #64748b);
    opacity: 0.5;
}

.ht-no-data-icon svg {
    width: 100%;
    height: 100%;
}

.ht-no-data-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sol-text-secondary, #94a3b8);
    margin: 0 0 4px;
}

.ht-no-data-desc {
    font-size: 0.75rem;
    color: var(--sol-text-tertiary, #64748b);
    margin: 0 0 8px;
}

.ht-no-data-hint {
    font-size: 0.6875rem;
    color: var(--sol-text-tertiary, #64748b);
    opacity: 0.7;
    margin: 0;
}

/* ==========================================================================
   Medication Timeline (PHASE 3 - 2025-12-10)
   ========================================================================== */

.ht-medications {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
}

.ht-meds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
}

.ht-meds-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sol-text-tertiary, #64748b);
}

.ht-meds-count {
    font-size: 0.625rem;
    color: var(--sol-text-tertiary, #64748b);
}

.ht-meds-list {
    padding: 0 0 8px;
}

.ht-meds-more {
    font-size: 0.625rem;
    color: var(--sol-text-tertiary, #64748b);
    padding: 4px 16px;
    text-align: center;
}

/* Medication Row */
.ht-med-row {
    display: flex;
    align-items: center;
    padding: 4px 16px;
    cursor: default;
    transition: background 0.15s ease;
}

.ht-med-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ht-med-label {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ht-med-name {
    font-size: 0.6875rem;
    color: var(--sol-text-tertiary, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.ht-med-row:hover .ht-med-name {
    color: var(--sol-text-secondary, #94a3b8);
}

/* Safety Flags */
.ht-med-flag {
    font-size: 0.625rem;
    flex-shrink: 0;
}

.ht-med-flag.nephrotoxic {
    color: #f59e0b;
}

.ht-med-flag.anticoagulant {
    color: #ef4444;
}

/* Medication row with safety flags gets border highlight */
.ht-med-row.nephrotoxic {
    border-left: 2px solid rgba(245, 158, 11, 0.5);
    padding-left: 14px;
}

.ht-med-row.anticoagulant {
    border-left: 2px solid rgba(239, 68, 68, 0.5);
    padding-left: 14px;
}

/* Medication Track */
.ht-med-track {
    flex: 1;
    height: 16px;
    position: relative;
    margin-left: 12px;
}

/* Medication Bar */
.ht-med-bar {
    position: absolute;
    top: 4px;
    height: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
    transition: transform 0.15s ease;
}

.ht-med-row:hover .ht-med-bar {
    transform: scaleY(1.3);
}

.ht-med-bar.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.5));
    border: 1px solid rgba(139, 92, 246, 0.6);
}

.ht-med-bar.stopped {
    background: linear-gradient(90deg, rgba(107, 114, 128, 0.3), rgba(107, 114, 128, 0.5));
    border: 1px solid rgba(107, 114, 128, 0.6);
}

.ht-med-bar.held {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.5));
    border: 1px solid rgba(245, 158, 11, 0.6);
    border-style: dashed;
}

/* Medication Markers */
.ht-med-marker {
    font-size: 0.5rem;
    z-index: 2;
}

.ht-med-marker.start {
    color: rgba(139, 92, 246, 0.8);
}

.ht-med-marker.stop {
    color: rgba(107, 114, 128, 0.8);
}

.ht-med-marker.current {
    color: rgba(139, 92, 246, 0.6);
}

/* Event Item Medication Colors */
.ht-event-item.med-start .ht-event-icon {
    color: #8b5cf6;
}

.ht-event-item.med-stop .ht-event-icon {
    color: #6b7280;
}

.ht-event-item.med-held .ht-event-icon {
    color: #f59e0b;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ht-problem-bar,
    .ht-problem-row,
    .ht-med-bar,
    .ht-med-row {
        transition: none;
    }
}

/* ==========================================================================
   ENHANCED TIMELINE (2025-12-13)
   Chief Complaint, Chronic Dimming, Treatment Markers, Outcome Indicators
   ========================================================================== */

/* Problem Sections */
.ht-problems-section {
    margin-bottom: 4px;
}

.ht-section-header {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sol-text-tertiary, #64748b);
    padding: 6px 16px 4px;
    background: rgba(0, 0, 0, 0.1);
}

.ht-problems-list {
    padding: 4px 0;
}

/* Chief Complaint Row - First row with highlighted styling */
.ht-problem-row.chief-complaint {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
    border-left: 3px solid var(--sol-accent, #3b82f6);
    position: relative;
}

.ht-problem-row.chief-complaint .ht-problem-name {
    font-weight: 600;
    color: var(--sol-text-primary, #f8fafc);
}

.ht-problem-row.chief-complaint .ht-problem-bar {
    border-width: 2px;
}

/* Chief complaint label badge */
.ht-problem-row.chief-complaint::before {
    content: 'CC';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.5rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    letter-spacing: 0.05em;
    z-index: 5;
}

.ht-problem-row.chief-complaint .ht-problem-label {
    padding-left: 28px; /* Make room for CC badge */
}

/* Chronic/Background Problems - Dimmed styling */
.ht-problem-row.chronic-dimmed {
    opacity: 0.5;
}

.ht-problem-row.chronic-dimmed:hover {
    opacity: 0.8;
}

.ht-problem-row.chronic-dimmed .ht-problem-bar {
    background: rgba(107, 114, 128, 0.3) !important;
    border-color: rgba(107, 114, 128, 0.4) !important;
}

/* ==========================================================================
   Core Problems - Taller timeline rows for main 1-3 problems (2025-12-14)
   ========================================================================== */

.ht-problem-row.core-problem {
    padding: 10px 16px;
    background: rgba(96, 165, 250, 0.03);
}

.ht-problem-row.core-problem .ht-problem-track {
    height: 28px; /* Taller track for core problems */
}

.ht-problem-row.core-problem .ht-problem-bar {
    top: 4px;
    height: 20px; /* Taller bar for core problems */
    border-radius: 6px;
    border-width: 2px;
}

.ht-problem-row.core-problem .ht-problem-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sol-text-primary, #f8fafc);
}

.ht-problem-row.core-problem .ht-problem-status {
    font-size: 0.625rem;
    padding: 3px 8px;
}

/* Core problem sparkline - larger and prominent */
.ht-problem-row.core-problem .ht-embedded-sparkline {
    width: 80px;
    height: 26px;
}

.ht-problem-row.core-problem .ht-sparkline-container {
    padding: 6px 10px;
    border-radius: 6px;
    border-color: rgba(100, 150, 255, 0.5);
}

/* Core problem score badge - larger */
.ht-problem-row.core-problem .ht-score-badge {
    font-size: 0.6875rem;
    padding: 4px 10px;
}

/* Core problem lab indicator */
.ht-problem-row.core-problem .ht-lab-indicator {
    font-size: 0.625rem;
    padding: 3px 6px;
}

.ht-problem-row.chronic-dimmed .ht-problem-name {
    color: var(--sol-text-tertiary, #64748b);
}

/* Chronic Section Toggle */
.ht-problems-section.chronic .ht-section-header {
    color: #64748b;
    font-style: italic;
}

.ht-section-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
}

.ht-section-toggle::before {
    content: '▾';
    margin-right: 6px;
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.ht-problems-section.collapsed .ht-section-toggle::before {
    content: '▸';
}

.ht-problems-section.collapsed .ht-problems-list {
    display: none;
}

.ht-section-toggle:hover {
    color: var(--sol-text-secondary, #94a3b8);
}

/* Treatment Markers on Problem Bars */
.ht-marker.treatment {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.625rem;
    z-index: 3;
    cursor: pointer;
    transition: transform 0.15s ease;
    top: -2px;
}

.ht-marker.treatment:hover {
    transform: translateX(-50%) scale(1.4);
}

.ht-marker.treatment.active {
    filter: brightness(1.1);
}

.ht-marker.treatment.stopped {
    opacity: 0.6;
}

.ht-marker.treatment.held {
    filter: sepia(1) hue-rotate(-10deg);
}

/* Outcome Indicators */
.ht-marker.outcome {
    font-size: 0.75rem;
    z-index: 4;
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
}

.ht-marker.outcome.success {
    color: #22c55e;
}

.ht-marker.outcome.partial {
    color: #f59e0b;
}

.ht-marker.outcome.failure {
    color: #ef4444;
}

.ht-marker.outcome.ongoing {
    color: #93c5fd;
}

.ht-marker.outcome.monitor {
    color: #64748b;
}

/* Status Evolution Gradient Bars */
.ht-problem-bar.gradient {
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Mobile Optimizations for Enhanced Features */
@media (max-width: 768px) {
    .ht-problem-row.chief-complaint::before {
        font-size: 0.4375rem;
        padding: 1px 3px;
        left: 4px;
    }

    .ht-problem-row.chief-complaint .ht-problem-label {
        padding-left: 24px;
    }

    .ht-marker.treatment {
        font-size: 0.5rem;
    }

    .ht-marker.outcome {
        font-size: 0.625rem;
    }

    /* Larger touch targets on mobile */
    .ht-section-toggle {
        padding: 8px 16px;
        min-height: 36px;
    }
}

/* Touch-friendly marker interaction */
@media (pointer: coarse) {
    .ht-marker.treatment {
        padding: 8px;
        margin: -8px;
    }
}

/* ==========================================================================
   LAB-BASED SEVERITY GRADIENTS (2025-12-14)
   LifeLines-inspired data-driven visualization
   ========================================================================== */

/* Lab gradient bars get a subtle glow effect */
.ht-problem-bar.lab-gradient {
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Indicator showing which lab is being tracked */
.ht-lab-indicator {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--sol-text-tertiary, #64748b);
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.ht-problem-row:hover .ht-lab-indicator {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* Lab-based severity colors (mirroring ProblemRegistry) */
.ht-problem-bar.severity-normal { border-color: rgba(34, 197, 94, 0.6); }
.ht-problem-bar.severity-mild { border-color: rgba(132, 204, 22, 0.6); }
.ht-problem-bar.severity-moderate { border-color: rgba(234, 179, 8, 0.6); }
.ht-problem-bar.severity-severe { border-color: rgba(249, 115, 22, 0.6); }
.ht-problem-bar.severity-critical { border-color: rgba(239, 68, 68, 0.6); }

/* ==========================================================================
   EMBEDDED SPARKLINES (2025-12-14)
   Tiny trend graphs embedded inside timeline bars
   ========================================================================== */

/* Sparkline container - PROMINENT visibility */
.ht-sparkline-container {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 10;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: help;
    border: 1px solid rgba(100, 150, 255, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Sparkline SVG styling - PROMINENT */
.ht-embedded-sparkline {
    display: block;
    width: 64px;
    height: 20px;
}

.ht-embedded-sparkline.no-data {
    opacity: 0.4;
}

/* Sparkline line - thicker and more visible */
.ht-embedded-sparkline path[stroke] {
    stroke-width: 2 !important;
}

/* Sparkline fill area - more visible */
.ht-embedded-sparkline path[fill-opacity] {
    fill-opacity: 0.35 !important;
}

/* Hover effect on sparkline - ENHANCED */
.ht-problem-row:hover .ht-sparkline-container {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Make sparkline more visible on hover */
.ht-problem-row:hover .ht-embedded-sparkline {
    transform: scale(1.15);
}

/* ==========================================================================
   STATUS TRAJECTORY SPARKLINE (2025-12-30)
   Visualizes status drift over time (Active→Stable too fast)
   ========================================================================== */

.ht-trajectory-container {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
    vertical-align: middle;
}

.ht-trajectory-container:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Drift alert styling - pulsing border for concerning transitions */
.ht-trajectory-container.has-drift {
    border-color: rgba(239, 68, 68, 0.5);
    animation: drift-pulse 2s infinite;
}

@keyframes drift-pulse {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0.3);
        box-shadow: none;
    }
    50% {
        border-color: rgba(239, 68, 68, 0.7);
        box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
    }
}

/* Status sparkline SVG */
.status-sparkline {
    display: inline-block;
    vertical-align: middle;
}

.status-sparkline.no-data line {
    opacity: 0.5;
}

/* Status trajectory detailed view (problem detail panel) */
.status-trajectory-detailed {
    margin: 8px 0;
}

.status-trajectory-empty {
    font-size: 0.75rem;
    color: var(--sol-text-tertiary, #6b7280);
    font-style: italic;
}

/* Mobile: hide trajectories and sparklines to save space */
@media (max-width: 640px) {
    .ht-sparkline-container,
    .ht-trajectory-container {
        display: none;
    }

    .ht-lab-indicator {
        display: none;
    }
}

/* ==========================================================================
   SEVERITY LEGEND (optional - can be enabled via JS)
   ========================================================================== */

.ht-severity-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.625rem;
}

.ht-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--sol-text-tertiary, #64748b);
}

.ht-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ht-legend-dot.normal { background: #22c55e; }
.ht-legend-dot.mild { background: #84cc16; }
.ht-legend-dot.moderate { background: #eab308; }
.ht-legend-dot.severe { background: #f97316; }
.ht-legend-dot.critical { background: #ef4444; }

/* ==========================================================================
   ANIMATION EFFECTS
   ========================================================================== */

/* Subtle pulse animation for critical severity */
@keyframes ht-critical-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ht-problem-bar.lab-gradient[data-severity="critical"] {
    animation: ht-critical-pulse 2s ease-in-out infinite;
}

/* Gradient transition for smooth updates */
.ht-problem-bar.gradient {
    transition: background 0.3s ease;
}

/* Reduced motion: disable animations */
@media (prefers-reduced-motion: reduce) {
    .ht-problem-bar.lab-gradient[data-severity="critical"],
    .ht-problem-bar.gradient {
        animation: none;
        transition: none;
    }

    .ht-problem-row:hover .ht-embedded-sparkline {
        transform: none;
    }
}

/* ==========================================================================
   SCORE BADGES (2025-12-14)
   Clinical score indicators on problem rows (CIWA, NIHSS, GCS)
   ========================================================================== */

/* Score badge - shows current score value */
.ht-score-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: rgba(100, 100, 120, 0.3);
    color: var(--sol-text-secondary, #a0a0b0);
}

.ht-score-badge:hover {
    background: rgba(100, 100, 120, 0.5);
    transform: scale(1.05);
}

/* Score severity colors */
.ht-score-badge.severity-green {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.ht-score-badge.severity-yellow {
    background: rgba(234, 179, 8, 0.3);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.ht-score-badge.severity-orange {
    background: rgba(249, 115, 22, 0.3);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.ht-score-badge.severity-red {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.ht-score-badge.severity-darkred {
    background: rgba(220, 38, 38, 0.3);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.ht-score-badge.severity-gray {
    background: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.4);
}

/* Add score button - for problems needing manual scoring */
.ht-score-add-btn {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 500;
    border-radius: 4px;
    margin-left: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    color: var(--sol-text-secondary, #94a3b8);
    border: 1px dashed rgba(148, 163, 184, 0.4);
}

.ht-score-add-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    border-color: #60a5fa;
}

/* Responsive: hide score badges on very small screens */
@media (max-width: 480px) {
    .ht-score-badge,
    .ht-score-add-btn {
        display: none;
    }
}
