.ref-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px 40px;
    overflow-y: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

.ref-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ref-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.ref-header-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.ref-header-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    flex-shrink: 0;
}

.ref-search-wrap {
    position: relative;
    margin-bottom: 16px;
}

.ref-search {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 0 16px 0 40px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ref-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
    outline: none;
}

.ref-search::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.ref-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.ref-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ref-nav::-webkit-scrollbar {
    display: none;
}

.ref-nav-btn {
    flex: 0 0 auto;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.ref-nav-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.ref-nav-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.ref-section {
    margin-bottom: 24px;
    scroll-margin-top: 16px;
}

.ref-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
}

.ref-section-title .ref-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.ref-section.collapsed .ref-chevron {
    transform: rotate(-90deg);
}

.ref-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 12px;
    padding-left: 24px;
}

.ref-section.collapsed .ref-section-body {
    display: none;
}

.ref-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    scrollbar-width: thin;
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.ref-table th {
    background: var(--bg-app);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}

.ref-table th:last-child,
.ref-table td:last-child {
    white-space: normal;
    min-width: 200px;
}

.ref-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: top;
}

.ref-table tr:last-child td {
    border-bottom: none;
}

.ref-table tbody tr:nth-child(even) {
    background: var(--bg-app);
}

.ref-table tbody tr:hover {
    background: rgba(108, 99, 255, 0.05);
}

.ref-table td:first-child {
    font-weight: 600;
    color: var(--primary);
}

.ref-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ref-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.ref-badge-clearance {
    background: #e8f5e9;
    color: #2e7d32;
}

.ref-badge-transition {
    background: #fff3e0;
    color: #e65100;
}

.ref-badge-interference {
    background: #ffebee;
    color: #c62828;
}

[data-theme="dark"] .ref-badge-clearance {
    background: rgba(46, 125, 50, 0.2);
    color: #81c784;
}

[data-theme="dark"] .ref-badge-transition {
    background: rgba(230, 81, 0, 0.2);
    color: #ffb74d;
}

[data-theme="dark"] .ref-badge-interference {
    background: rgba(198, 40, 40, 0.2);
    color: #ef9a9a;
}

@media (min-width: 769px) {
    .ref-container {
        padding: 24px 32px 40px;
    }

    .ref-header h2 {
        font-size: 26px;
    }

    .ref-table {
        font-size: 13px;
    }

    .ref-table th {
        font-size: 11px;
    }
}
