/* Detail Panel */
.detail-panel {
    width: var(--panel-width);
    min-width: var(--panel-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: min-width 0.3s, width 0.3s;
}
.detail-panel.hidden { min-width: 0; width: 0; border: none; overflow: hidden; display: flex !important; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
.panel-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    margin-right: 8px;
}
.panel-close-btn {
    width: 28px; height: 28px;
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.panel-close-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.panel-breadcrumb {
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}

/* Tabs */
.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 8px;
}
.tab {
    padding: 10px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-hover) transparent;
}

/* Panel Sections */
.panel-section { margin-bottom: 16px; }
.panel-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.panel-description {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}
.badge-process-group { background: var(--bg-tertiary); color: var(--text-primary); }
.badge-ka { background: var(--bg-tertiary); color: var(--text-primary); }
.badge-heat-high { background: rgba(248,81,73,0.2); color: #f85149; }
.badge-heat-medium { background: rgba(210,153,34,0.2); color: #d29922; }
.badge-heat-low { background: var(--bg-tertiary); color: var(--text-secondary); }

/* Chips */
.chip {
    display: inline-block;
    padding: 4px 10px;
    margin: 3px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.chip:hover { border-color: var(--accent-blue); background: var(--bg-hover); }

/* ITTO Flow */
.itto-flow {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.itto-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 10px 12px;
}
.itto-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.itto-section-title.inputs { color: var(--accent-blue); }
.itto-section-title.tools { color: var(--accent-orange); }
.itto-section-title.outputs { color: var(--accent-green); }

/* Arrow between sections */
.itto-arrow {
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    padding: 2px 0;
}

/* Mnemonic Card */
.mnemonic-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}
.mnemonic-phrase {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    padding: 8px;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.mnemonic-expansion {
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Exam frequency bar */
.freq-bar-container { margin: 8px 0; }
.freq-bar {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}
.freq-bar-label { width: 60px; color: var(--text-secondary); }
.freq-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin: 0 8px;
    overflow: hidden;
}
.freq-bar-fill { height: 100%; border-radius: 4px; }
.freq-bar-fill.choice { background: var(--accent-blue); }
.freq-bar-fill.case { background: var(--accent-green); }
.freq-bar-fill.essay { background: var(--accent-red); }
.freq-bar-value { width: 24px; text-align: right; color: var(--text-secondary); }

/* Essay items in panel */
.essay-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}
.essay-list-item:last-child { border-bottom: none; }
.essay-list-year {
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    font-size: 11px;
    color: var(--accent-blue);
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .detail-panel {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 50vh;
        min-width: 100%;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        z-index: 300;
    }
}
