/* Clinical HUD (Top Bar) */
.hud-bar {
    position: fixed;
    top: 0;
    left: var(--rail-width);
    right: 0;
    height: var(--hud-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-md);
    z-index: 100;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.hud-left { display: flex; align-items: center; gap: var(--space-sm); }
.hud-divider { opacity: 0.3; }
.hud-section-name { color: var(--theme-focus); font-weight: bold; }

.hud-status-pill {
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--color-bg);
    margin-right: var(--space-md);
}

/* Shade Guide Toggle */
.shade-guide-container {
    display: inline-block;
}

.shade-guide {
    border: none;
    background: var(--color-border);
    padding: 2px;
    border-radius: 4px;
    display: flex;
    position: relative;
}

.shade-guide input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.shade-tab {
    display: block;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--color-text-muted);
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: color 0.2s;
}

.shade-guide input:checked + .shade-tab {
    color: var(--theme-focus);
}

/* Charting Rail (Nav) */
.charting-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    z-index: 101;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rail-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
}

.rail-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    color: var(--color-text-muted);
    position: relative;
    transition: all 0.3s ease;
}

.rail-link:hover, .rail-link:focus, .rail-link.active {
    color: var(--theme-focus);
    background: var(--theme-highlight);
}

.rail-glyph {
    width: 20px;
    height: 20px;
}

.rail-tooltip {
    position: absolute;
    left: 50px;
    background: var(--color-text-main);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.rail-link:hover .rail-tooltip,
.rail-link:focus .rail-tooltip {
    opacity: 1;
}

/* Projects Accordion */
.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.project-item {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 4px;
    overflow: hidden;
}

.project-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s;
}

.project-trigger:hover {
    background: var(--theme-highlight);
}

.project-code {
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-right: var(--space-md);
}

.project-title {
    font-weight: 600;
    font-size: 1.1rem;
    flex-grow: 1;
}

.project-category {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: var(--space-md);
    border: 1px solid var(--color-border);
}

.project-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

.project-trigger[aria-expanded="true"] .project-icon {
    transform: rotate(180deg);
}

.project-details {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.detail-inner {
    padding: var(--space-md);
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: var(--space-md);
}

.clinical-note {
    margin-top: var(--space-md);
    padding: var(--space-sm);
    border-left: 3px solid var(--theme-focus);
    background: var(--theme-highlight);
    font-size: 0.9rem;
}

.note-label {
    font-weight: bold;
    font-size: 0.8rem;
    color: var(--theme-focus);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hud-bar { left: 0; }
    
    .charting-rail {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        border-right: none;
        border-top: 1px solid var(--color-border);
        flex-direction: row;
    }
    
    .rail-list {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }

    .rail-tooltip { display: none; }
    
    .detail-inner { grid-template-columns: 1fr; }
    
    .project-category { display: none; }
}