/* HPRA SearchPlus – Styles */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #eef1f5; color: #1d1d1f;
    transition: background 0.3s ease, color 0.3s ease;
}
body.dark { background: #161618; color: #f5f5f7; }

/* ── Header ─────────────────────────────────────────── */
.header {
    background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
    padding: 20px 24px 16px; border-bottom: 1px solid #d8dae0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
body.dark .header { background: rgba(29,29,31,0.92); border-bottom-color: #3a3a3c; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.header-content { max-width: 1600px; margin: 0 auto; }

.header-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.header-text { display: flex; flex-direction: column; gap: 2px; }
.header-text h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; }
.app-logo { flex-shrink: 0; vertical-align: middle; }
.publication-date { font-size: 12px; color: #86868b; }
.header-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Buttons */
.btn {
    border: none; padding: 7px 14px; border-radius: 10px; cursor: pointer;
    font-size: 13px; font-weight: 500; transition: all 0.2s ease;
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.btn-primary { background: #0071e3; color: #fff; }
.btn-primary:hover { background: #0077ed; }
body.dark .btn-primary { background: #0a84ff; }
.btn-secondary {
    background: #f5f5f7; color: #1d1d1f; border: 1px solid #e5e5e7;
}
.btn-secondary:hover { background: #e8e8ed; border-color: #0071e3; }
body.dark .btn-secondary { background: #424245; color: #f5f5f7; border-color: #555558; }
body.dark .btn-secondary:hover { background: #555558; border-color: #0a84ff; }
.btn-secondary.active { background: #0071e3; color: #fff; border-color: #0071e3; }
body.dark .btn-secondary.active { background: #0a84ff; border-color: #0a84ff; }
.btn-icon {
    background: #f5f5f7; border: none; width: 38px; height: 38px;
    border-radius: 10px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 18px; transition: background 0.2s;
}
body.dark .btn-icon { background: #424245; }
.btn-icon:hover { background: #e5e5e7; }
body.dark .btn-icon:hover { background: #555558; }
.btn-danger { background: transparent; color: #ff3b30; border: 1px solid #ff3b30; }
.btn-danger:hover { background: #ff3b30; color: #fff; }

#xmlFileInput { display: none; }

/* Search */
.search-row { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.search-input-wrapper { position: relative; flex: 1; max-width: 520px; }
.search-input {
    width: 100%; padding: 9px 36px 9px 14px; font-size: 14px;
    border: 1px solid #d0d2d8; border-radius: 10px;
    background: white; color: #1d1d1f; transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
body.dark .search-input { background: #424245; color: #f5f5f7; border-color: #555558; }
.search-input:focus { outline: none; border-color: #0071e3; box-shadow: 0 0 0 3px rgba(0,113,227,0.12); }
.search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; font-size: 16px; cursor: pointer;
    color: #86868b; display: none; padding: 4px;
}
.search-clear.visible { display: block; }
.search-shortcut {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 11px; color: #aaa; background: #f0f0f0; padding: 1px 6px;
    border-radius: 4px; pointer-events: none; border: 1px solid #ddd;
}
body.dark .search-shortcut { background: #555; border-color: #666; color: #aaa; }

/* Filters */
.filters-row {
    display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 3px; min-width: 150px; flex: 1; max-width: 220px; }
.filter-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: #86868b; }

select {
    padding: 7px 10px; border: 1px solid #e5e5e7; border-radius: 8px;
    background: white; color: #1d1d1f; font-size: 13px;
    cursor: pointer; transition: all 0.2s ease; width: 100%;
}
body.dark select { background: #424245; color: #f5f5f7; border-color: #555558; }
select:focus { outline: none; border-color: #0071e3; }

/* Multiselect */
.multiselect-wrapper { position: relative; width: 100%; }
.multiselect-button {
    padding: 7px 10px; border: 1px solid #e5e5e7; border-radius: 8px;
    background: white; color: #1d1d1f; font-size: 13px; cursor: pointer;
    transition: all 0.2s; text-align: left; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
}
body.dark .multiselect-button { background: #424245; color: #f5f5f7; border-color: #555558; }
.multiselect-button:hover { border-color: #0071e3; }
.multiselect-dropdown {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: white; border: 1px solid #e5e5e7; border-top: none;
    border-radius: 0 0 8px 8px; margin-top: -1px; z-index: 1000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
body.dark .multiselect-dropdown { background: #424245; border-color: #555558; box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.multiselect-dropdown.active { display: block; }
.multiselect-search {
    padding: 6px 8px; border-bottom: 1px solid #e5e5e7;
    position: sticky; top: 0; background: white; z-index: 1001;
}
body.dark .multiselect-search { background: #424245; border-bottom-color: #555558; }
.multiselect-search input {
    width: 100%; padding: 5px 8px; border: 1px solid #e5e5e7;
    border-radius: 6px; font-size: 12px; background: #f5f5f7; color: #1d1d1f;
}
body.dark .multiselect-search input { background: #555558; color: #f5f5f7; border-color: #666669; }
.multiselect-search input:focus { outline: none; border-color: #0071e3; }
.multiselect-actions {
    padding: 4px 8px; border-bottom: 1px solid #e5e5e7; display: flex; gap: 8px;
}
body.dark .multiselect-actions { border-bottom-color: #555558; }
.multiselect-actions button {
    font-size: 11px; color: #0071e3; background: none; border: none; cursor: pointer; padding: 2px;
}
body.dark .multiselect-actions button { color: #0a84ff; }
.multiselect-options { max-height: 220px; overflow-y: auto; }
.multiselect-option {
    padding: 6px 10px; cursor: pointer; display: flex; align-items: center;
    font-size: 13px; border-bottom: 1px solid #f5f5f7; transition: background 0.1s;
}
body.dark .multiselect-option { border-bottom-color: #555558; }
.multiselect-option:hover { background: #f5f5f7; }
body.dark .multiselect-option:hover { background: #555558; }
.multiselect-option input[type="checkbox"] { margin-right: 8px; cursor: pointer; width: 15px; height: 15px; }
.multiselect-option .count { margin-left: auto; font-size: 11px; color: #86868b; min-width: 30px; text-align: right; }
.multiselect-placeholder { color: #86868b; }

/* Stats bar */
.stats-bar {
    display: flex; gap: 16px; margin-top: 12px; align-items: center; flex-wrap: wrap;
    font-size: 12px; color: #86868b;
    background: rgba(0,0,0,0.02); padding: 8px 12px; border-radius: 8px;
    border: 1px solid #e5e5e7;
}
body.dark .stats-bar { background: rgba(255,255,255,0.03); border-color: #3a3a3c; }
.stats-bar .stat-total { font-weight: 600; color: #1d1d1f; font-size: 13px; }
body.dark .stats-bar .stat-total { color: #f5f5f7; }
.stat-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500;
}
.stat-marketed { background: #e8f5e9; color: #1b5e20; }
body.dark .stat-marketed { background: #1b4620; color: #81c784; }
.stat-not-marketed { background: #ffebee; color: #b71c1c; }
body.dark .stat-not-marketed { background: #4c1419; color: #ef5350; }
.stat-unknown { background: #f3e5f5; color: #4a148c; }
body.dark .stat-unknown { background: #3d1a47; color: #ce93d8; }

/* Container */
.container { max-width: 1600px; margin: 0 auto; padding: 20px 24px; }

/* Loading & Drop Zone */
.loading { text-align: center; padding: 48px 24px; color: #86868b; }
.loader {
    width: 36px; height: 36px; border: 3px solid #e5e5e7;
    border-top-color: #0071e3; border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 0 auto 14px;
}
body.dark .loader { border-color: #555558; border-top-color: #0a84ff; }
@keyframes spin { to { transform: rotate(360deg); } }

.drop-zone {
    border: 2px dashed #ccc; border-radius: 16px; padding: 60px 40px;
    text-align: center; transition: all 0.3s ease; cursor: pointer;
    margin: 40px auto; max-width: 600px;
}
.drop-zone.drag-over { border-color: #0071e3; background: rgba(0,113,227,0.05); transform: scale(1.01); }
body.dark .drop-zone { border-color: #555; }
body.dark .drop-zone.drag-over { border-color: #0a84ff; background: rgba(10,132,255,0.08); }
.drop-zone-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.drop-zone-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: #1d1d1f; }
body.dark .drop-zone-title { color: #f5f5f7; }
.drop-zone-sub { font-size: 14px; color: #86868b; margin-bottom: 20px; }
.drop-zone-hint { font-size: 12px; color: #aaa; margin-top: 12px; }

/* Card view */
.products-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}
.product-card {
    background: white; border-radius: 12px; padding: 18px;
    border: 1px solid #dcdee3; transition: all 0.2s ease; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.dark .product-card { background: #2a2a2c; border-color: #3a3a3c; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.product-card:hover { border-color: #0071e3; box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
body.dark .product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.35); }
.product-name {
    font-size: 15px; font-weight: 600; margin-bottom: 10px;
    color: #1d1d1f; line-height: 1.35;
}
body.dark .product-name { color: #f5f5f7; }
.product-detail {
    font-size: 12px; margin-bottom: 5px; color: #86868b;
    display: flex; justify-content: space-between; align-items: baseline;
}
.detail-label { font-weight: 500; color: #1d1d1f; flex-shrink: 0; }
body.dark .detail-label { color: #e8e8ed; }
.detail-value { text-align: right; flex: 1; margin-left: 10px; word-break: break-word; }

.badge {
    display: inline-block; padding: 3px 8px; border-radius: 6px;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.4px; margin-top: 10px; margin-right: 4px;
}
.badge-marketed { background: #e8f5e9; color: #1b5e20; }
body.dark .badge-marketed { background: #1b4620; color: #81c784; }
.badge-not-marketed { background: #ffebee; color: #b71c1c; }
body.dark .badge-not-marketed { background: #4c1419; color: #ef5350; }
.badge-unknown { background: #f3e5f5; color: #4a148c; }
body.dark .badge-unknown { background: #3d1a47; color: #ce93d8; }

.substance-tags { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e5e7; }
body.dark .substance-tags { border-top-color: #424245; }
.substance-tag {
    display: inline-block; background: #e8ecf2; color: #1d1d1f;
    padding: 3px 7px; border-radius: 5px; margin: 2px 3px 2px 0; font-size: 10px;
    border: 1px solid #d8dae0;
}
body.dark .substance-tag { background: #3a3a3c; color: #f5f5f7; border-color: #4a4a4c; }

/* Table view */
.products-table-wrapper { overflow-x: auto; border-radius: 12px; border: 1px solid #dcdee3; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
body.dark .products-table-wrapper { border-color: #3a3a3c; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.products-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: white;
}
body.dark .products-table { background: #2a2a2c; }
.products-table th {
    position: sticky; top: 0; background: #f0f2f5; padding: 10px 12px;
    text-align: left; font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.3px; color: #6e6e73;
    border-bottom: 2px solid #d0d2d8; cursor: pointer; user-select: none;
    white-space: nowrap;
}
body.dark .products-table th { background: #2f2f31; border-bottom-color: #424245; color: #98989d; }
.products-table th:hover { color: #0071e3; }
body.dark .products-table th:hover { color: #0a84ff; }
.products-table th .sort-arrow { margin-left: 4px; font-size: 10px; }
.products-table td {
    padding: 9px 12px; border-bottom: 1px solid #ecedf0;
    vertical-align: top; max-width: 250px; word-break: break-word;
}
body.dark .products-table td { border-bottom-color: #333335; }
.products-table tr { cursor: pointer; transition: background 0.15s; }
.products-table tbody tr:nth-child(even) { background: #f8f9fb; }
body.dark .products-table tbody tr:nth-child(even) { background: #252527; }
.products-table tbody tr:hover { background: #e8ecf2; }
body.dark .products-table tbody tr:hover { background: #36363a; }
.products-table .cell-badge {
    display: inline-block; padding: 2px 6px; border-radius: 4px;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
}

/* No results */
.no-results { text-align: center; padding: 60px 24px; color: #86868b; }
.no-results-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.no-results-text { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: #1d1d1f; }
body.dark .no-results-text { color: #f5f5f7; }

/* Pagination */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; margin: 30px 0; flex-wrap: wrap;
}
.pagination button {
    padding: 7px 12px; border: 1px solid #dcdee3; border-radius: 8px;
    background: white; color: #1d1d1f; font-size: 13px; cursor: pointer;
    transition: all 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
body.dark .pagination button { background: #2a2a2c; color: #f5f5f7; border-color: #3a3a3c; box-shadow: none; }
.pagination button:hover:not(:disabled) { background: #e8ecf2; border-color: #0071e3; }
body.dark .pagination button:hover:not(:disabled) { background: #3a3a3c; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { color: #86868b; font-size: 13px; min-width: 120px; text-align: center; }
.pagination select { width: auto; min-width: 60px; }

/* Modal */
.modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
    background: white; border-radius: 14px; padding: 28px;
    max-width: 680px; max-height: 85vh; overflow-y: auto; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.08);
}
body.dark .modal-content { background: #2a2a2c; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal-header h2 { font-size: 20px; font-weight: 700; line-height: 1.3; flex: 1; margin-right: 16px; }
.modal-close {
    font-size: 22px; cursor: pointer; color: #86868b; border: none;
    background: #f5f5f7; width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
body.dark .modal-close { background: #424245; }
.modal-close:hover { background: #e5e5e7; color: #1d1d1f; }
body.dark .modal-close:hover { background: #555; color: #f5f5f7; }

.modal-section { margin-bottom: 20px; background: #f8f9fb; border-radius: 10px; padding: 14px 16px; }
body.dark .modal-section { background: #232325; }
.modal-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: #0071e3; margin-bottom: 10px;
    padding-bottom: 6px; border-bottom: 1px solid #e5e5e7;
}
body.dark .modal-section-title { color: #0a84ff; border-bottom-color: #424245; }
.modal-field { margin-bottom: 12px; }
.modal-field-label {
    font-weight: 500; color: #86868b; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px;
}
.modal-field-value { color: #1d1d1f; font-size: 14px; line-height: 1.5; }
body.dark .modal-field-value { color: #f5f5f7; }
.modal-field-value ul { list-style: none; }
.modal-field-value li { padding: 2px 0; }
.modal-field-value li::before { content: "\2022 "; color: #86868b; }
.copy-btn {
    background: none; border: none; cursor: pointer; font-size: 14px;
    padding: 2px 4px; margin-left: 6px; opacity: 0.5; transition: opacity 0.2s;
    vertical-align: middle;
}
.copy-btn:hover { opacity: 1; }
.copy-btn.copied { opacity: 1; }

/* Toast */
.toast {
    position: fixed; bottom: 24px; right: 24px; background: #1d1d1f;
    color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px;
    z-index: 2000; opacity: 0; transform: translateY(20px);
    transition: all 0.3s ease; pointer-events: none;
}
body.dark .toast { background: #f5f5f7; color: #1d1d1f; }
.toast.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 768px) {
    .header { padding: 14px 16px 12px; }
    .header-text h1 { font-size: 18px; }
    .container { padding: 14px 16px; }
    .products-grid { grid-template-columns: 1fr; }
    .search-input-wrapper { max-width: 100%; }
    .filter-group { min-width: 120px; max-width: none; }
    .filters-row { gap: 6px; }
}

/* Highlight */
mark {
    background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px;
}
body.dark mark { background: #854d0e; color: #fef08a; }

/* Freshness indicator */
.freshness-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500;
    margin-left: 8px; vertical-align: middle;
}
.freshness-fresh { background: #e8f5e9; color: #1b5e20; }
body.dark .freshness-fresh { background: #1b4620; color: #81c784; }
.freshness-aging { background: #fff3e0; color: #e65100; }
body.dark .freshness-aging { background: #4e2a00; color: #ffb74d; }
.freshness-stale { background: #ffebee; color: #b71c1c; }
body.dark .freshness-stale { background: #4c1419; color: #ef5350; }

/* Column picker */
.column-picker-wrapper { position: relative; }
.column-picker-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    background: white; border: 1px solid #e5e5e7; border-radius: 10px;
    margin-top: 6px; z-index: 1000; min-width: 220px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    max-height: 400px; overflow-y: auto;
}
body.dark .column-picker-dropdown { background: #424245; border-color: #555558; box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.column-picker-dropdown.active { display: block; }
.cp-header {
    padding: 8px 12px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: #86868b; border-bottom: 1px solid #e5e5e7;
}
body.dark .cp-header { border-bottom-color: #555558; }
.cp-actions {
    padding: 4px 12px; border-bottom: 1px solid #e5e5e7; display: flex; gap: 8px;
}
body.dark .cp-actions { border-bottom-color: #555558; }
.cp-actions button {
    font-size: 11px; color: #0071e3; background: none; border: none; cursor: pointer; padding: 2px;
}
body.dark .cp-actions button { color: #0a84ff; }
.column-picker-option {
    padding: 6px 12px; cursor: pointer; display: flex; align-items: center;
    font-size: 13px; border-bottom: 1px solid #f5f5f7; transition: background 0.1s;
}
body.dark .column-picker-option { border-bottom-color: #555558; }
.column-picker-option:hover { background: #f5f5f7; }
body.dark .column-picker-option:hover { background: #555558; }
.column-picker-option:last-child { border-bottom: none; }
.column-picker-option input[type="checkbox"] { margin-right: 8px; cursor: pointer; width: 15px; height: 15px; }

/* ── Footer ────────────────────────────────────────── */
.app-footer {
    text-align: center; padding: 16px 24px; font-size: 12px; color: #86868b;
    border-top: 1px solid #d8dae0; background: #f0f2f5;
}
body.dark .app-footer { background: #1a1a1c; border-top-color: #2a2a2c; color: #98989d; }
.app-footer a { color: #0071e3; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
body.dark .app-footer a { color: #0a84ff; }
.footer-sep { margin: 0 8px; opacity: 0.4; }

/* ── Changelog Modal ──────────────────────────────── */
.changelog-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex;
    align-items: center; justify-content: center; z-index: 3000;
    opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s;
    padding: 24px;
}
.changelog-overlay.active { opacity: 1; visibility: visible; }
.changelog-modal {
    background: #fff; border-radius: 14px; width: 100%; max-width: 620px;
    max-height: 80vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); transform: translateY(20px);
    transition: transform 0.25s;
}
.changelog-overlay.active .changelog-modal { transform: translateY(0); }
body.dark .changelog-modal { background: #2c2c2e; }
.changelog-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; border-bottom: 1px solid #e5e5ea;
}
body.dark .changelog-header { border-bottom-color: #3a3a3c; }
.changelog-header h3 { margin: 0; font-size: 17px; font-weight: 600; }
.changelog-close {
    width: 30px; height: 30px; border: none; background: #f5f5f7; color: #666;
    border-radius: 50%; cursor: pointer; font-size: 14px; display: flex;
    align-items: center; justify-content: center; transition: background 0.15s;
}
.changelog-close:hover { background: #ff3b30; color: #fff; }
body.dark .changelog-close { background: #3a3a3c; color: #aaa; }
body.dark .changelog-close:hover { background: #ff453a; color: #fff; }
.changelog-body { padding: 24px; overflow-y: auto; flex: 1; }
.changelog-loading { text-align: center; padding: 40px; color: #86868b; }

/* Changelog rendered content */
.changelog-rendered h1 { font-size: 20px; margin: 0 0 16px; color: #1d1d1f; }
.changelog-rendered h2 {
    font-size: 16px; color: #0071e3; margin: 24px 0 8px; padding-bottom: 6px;
    border-bottom: 2px solid #0071e3;
}
.changelog-rendered h2:first-child { margin-top: 0; }
.changelog-rendered h3 { font-size: 14px; margin: 14px 0 6px; color: #1d1d1f; }
.changelog-rendered ul { margin: 0 0 14px 0; padding-left: 20px; }
.changelog-rendered li { color: #6e6e73; margin-bottom: 5px; font-size: 13px; line-height: 1.5; }
.changelog-rendered hr { border: none; border-top: 1px solid #e5e5ea; margin: 20px 0; }
.changelog-rendered p { color: #6e6e73; font-size: 13px; margin-bottom: 10px; line-height: 1.5; }
.changelog-rendered a { color: #0071e3; }
.changelog-rendered strong { color: #1d1d1f; }
body.dark .changelog-rendered h1,
body.dark .changelog-rendered h3,
body.dark .changelog-rendered strong { color: #f5f5f7; }
body.dark .changelog-rendered h2 { color: #0a84ff; border-bottom-color: #0a84ff; }
body.dark .changelog-rendered li,
body.dark .changelog-rendered p { color: #98989d; }
body.dark .changelog-rendered hr { border-top-color: #3a3a3c; }
body.dark .changelog-rendered a { color: #0a84ff; }

/* ── ATC Browser ──────────────────────────────────── */
.atc-browser-panel {
    background: white; border: 1px solid #e5e5e7; border-radius: 12px;
    margin-bottom: 16px; overflow: hidden;
}
body.dark .atc-browser-panel { background: #2a2a2c; border-color: #424245; }

.atc-browser-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid #e5e5e7;
    background: #f9f9fb;
}
body.dark .atc-browser-header { background: #333; border-bottom-color: #424245; }

.atc-browser-title { font-size: 13px; font-weight: 600; }

.atc-browser-search {
    padding: 8px 12px; border-bottom: 1px solid #f0f0f2;
}
body.dark .atc-browser-search { border-bottom-color: #424245; }

.atc-browser-search input {
    width: 100%; padding: 6px 10px; border: 1px solid #e5e5e7;
    border-radius: 8px; font-size: 13px; background: #f5f5f7; color: #1d1d1f;
}
body.dark .atc-browser-search input { background: #424245; color: #f5f5f7; border-color: #555558; }
.atc-browser-search input:focus { outline: none; border-color: #0071e3; }

.atc-browser-tree { max-height: 420px; overflow-y: auto; padding: 4px 0; }

.atc-node-row {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px; cursor: pointer; transition: background 0.1s;
    font-size: 13px; user-select: none;
}
.atc-node-row:hover { background: #f5f5f7; }
body.dark .atc-node-row:hover { background: #3a3a3c; }

.atc-node-active > .atc-node-row {
    background: rgba(0,113,227,0.08);
    box-shadow: inset 3px 0 0 #0071e3;
}
body.dark .atc-node-active > .atc-node-row {
    background: rgba(10,132,255,0.12);
    box-shadow: inset 3px 0 0 #0a84ff;
}

.atc-toggle {
    width: 16px; font-size: 10px; color: #86868b;
    flex-shrink: 0; text-align: center;
    transition: transform 0.15s; display: inline-block;
}
.atc-toggle.expanded { transform: rotate(90deg); }
.atc-toggle:hover { color: #0071e3; }
body.dark .atc-toggle:hover { color: #0a84ff; }

.atc-toggle-spacer { width: 16px; flex-shrink: 0; }

.atc-code-label {
    font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 600; font-size: 12px; flex-shrink: 0;
    min-width: 60px;
}

.atc-level-name {
    color: #86868b; font-size: 11px; flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.atc-node-count {
    margin-left: auto; font-size: 11px; color: #86868b;
    background: #f0f0f5; padding: 1px 6px; border-radius: 4px;
    flex-shrink: 0;
}
body.dark .atc-node-count { background: #424245; }

.atc-active-filter {
    font-size: 12px; font-weight: 500; color: #0071e3;
    padding: 2px 8px; background: rgba(0,113,227,0.08);
    border-radius: 6px; font-family: monospace;
}
body.dark .atc-active-filter { color: #0a84ff; background: rgba(10,132,255,0.12); }

.atc-collapse-btn {
    background: none; border: none; cursor: pointer;
    font-size: 16px; color: #86868b; padding: 2px 4px;
    border-radius: 4px; transition: all 0.15s;
}
.atc-collapse-btn:hover { color: #0071e3; background: rgba(0,113,227,0.06); }
body.dark .atc-collapse-btn:hover { color: #0a84ff; background: rgba(10,132,255,0.08); }

/* ── Filter Pills Bar ─────────────────────────────── */
.filter-pills-bar {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 10px; align-items: center;
}
.filter-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(0,113,227,0.07); border: 1px solid rgba(0,113,227,0.22);
    border-radius: 20px; padding: 3px 4px 3px 10px;
    font-size: 12px; color: #0055b3; max-width: 240px;
}
body.dark .filter-pill { background: rgba(10,132,255,0.1); border-color: rgba(10,132,255,0.3); color: #4da3ff; }
.filter-pill-label { font-weight: 600; white-space: nowrap; }
.filter-pill-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.filter-pill-remove {
    background: rgba(0,113,227,0.12); border: none; color: #0071e3;
    font-size: 13px; cursor: pointer; line-height: 1; border-radius: 50%;
    width: 18px; height: 18px; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; transition: all 0.15s;
}
.filter-pill-remove:hover { background: #0071e3; color: white; }
body.dark .filter-pill-remove { color: #0a84ff; background: rgba(10,132,255,0.15); }
body.dark .filter-pill-remove:hover { background: #0a84ff; color: white; }

/* ── Table sort indicators & keyboard nav ─────────── */
.products-table th.sort-active { color: #0071e3; background: #e4eaf5; }
body.dark .products-table th.sort-active { color: #0a84ff; background: #2a3040; }
.sort-arrow { font-size: 9px; vertical-align: middle; margin-left: 2px; }
.sort-arrow-inactive { opacity: 0.25; }
.products-table th[data-sort-field] { cursor: pointer; }

/* ── Column resize handle ─────────────────────────── */
.col-resize-handle {
    position: absolute; top: 0; right: 0;
    width: 6px; height: 100%;
    cursor: col-resize; z-index: 2;
    border-right: 2px solid transparent;
    transition: border-color 0.15s;
}
.col-resize-handle:hover, .col-resize-handle.resizing {
    border-right-color: #0071e3;
}
body.dark .col-resize-handle:hover,
body.dark .col-resize-handle.resizing { border-right-color: #0a84ff; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }

.products-table tbody tr:focus {
    outline: 2px solid #0071e3; outline-offset: -2px;
    background: rgba(0,113,227,0.05) !important;
}
body.dark .products-table tbody tr:focus {
    outline-color: #0a84ff; background: rgba(10,132,255,0.08) !important;
}

/* ── No-results suggestions ───────────────────────── */
.no-results-suggestions {
    margin-top: 18px; display: flex; flex-direction: column;
    gap: 8px; align-items: center;
}
.no-results-suggest-label {
    font-size: 12px; color: #86868b; margin-bottom: 2px;
}
.suggestion-btn {
    padding: 7px 16px; border-radius: 10px; font-size: 12px;
    background: white; border: 1px solid #dcdee3; color: #1d1d1f;
    cursor: pointer; transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.suggestion-btn:hover { border-color: #0071e3; color: #0071e3; background: rgba(0,113,227,0.04); }
body.dark .suggestion-btn { background: #2a2a2c; border-color: #424245; color: #f5f5f7; }
body.dark .suggestion-btn:hover { border-color: #0a84ff; color: #0a84ff; }
.suggestion-count {
    background: #eef1f5; padding: 2px 8px; border-radius: 5px;
    font-weight: 600; font-size: 11px; white-space: nowrap;
}
body.dark .suggestion-count { background: #3a3a3c; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
body.dark ::-webkit-scrollbar-thumb { background: #555; }
