/* ═══════════════════════════════════════════════════════════════════
   PLAYBOOK PAGE STYLES — Floating catalog overlay + map-first layout
   ═══════════════════════════════════════════════════════════════════ */

/* Page container — sits below the map section */
.pb-page {
    max-width: 100%;
}

/* ── Map Section (hero — full-width, primary element) ────────────── */
.pb-map-section {
    position: relative;
    overflow: hidden;
    background: #1a1a2e;
    padding-top: 60px;
    margin-bottom: 0;
    flex-shrink: 0;
    transition: height 0.3s ease, min-height 0.3s ease, padding-top 0.3s ease;
}

.pb-map-section #map_wrapper {
    position: relative;
    overflow: hidden;
}

.pb-map-section #graphic {
    height: 55vh;
    min-height: 400px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: height 0.3s ease;
}

@media (min-width: 1400px) {
    .pb-map-section #graphic { height: 55vh; min-height: 500px; }
}

/* ── Floating Catalog Overlay ────────────────────────────────────── */
.pb-catalog-overlay {
    position: absolute;
    top: 72px;
    left: 12px;
    width: 320px;
    max-height: calc(100% - 84px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Catalog body: flex child that fills remaining height and enables list scrolling */
.pb-catalog-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;       /* allows shrinking below content size */
    overflow: hidden;
}

/* Minimized state: collapse body, keep titlebar */
.pb-catalog-overlay.minimized .pb-catalog-body { display: none; }
.pb-catalog-overlay.minimized { max-height: none; overflow: visible; }
.pb-catalog-overlay.minimized .pb-overlay-titlebar { border-bottom: none; }

/* ── Shared Overlay Titlebar (drag handle) ──────────────────────── */
.pb-overlay-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(0,0,0,0.04);
    border-bottom: 1px solid #e9ecef;
    cursor: move;
    flex-shrink: 0;
    user-select: none;
    min-height: 28px;
}

.pb-overlay-title {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: 0.82rem;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Info overlay: allow play name to wrap so users see the full title */
#pb_info_title.pb-overlay-title {
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.pb-overlay-controls {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.pb-overlay-controls button {
    border: none;
    background: transparent;
    color: #888;
    font-size: 0.62rem;
    padding: 2px 5px;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1;
}
.pb-overlay-controls button:hover { background: rgba(0,0,0,0.08); color: #333; }

/* ── Play Info Overlay (right side) ─────────────────────────────── */
.pb-info-overlay {
    position: absolute;
    top: 72px;
    right: 12px;
    width: 340px;
    max-height: calc(100% - 84px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pb-info-overlay.minimized .pb-info-content { display: none; }
.pb-info-overlay.minimized { max-height: none; overflow: visible; }
.pb-info-overlay.minimized .pb-overlay-titlebar { border-bottom: none; }

.pb-info-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.6rem;
}

/* ── Catalog Header (inside overlay) ─────────────────────────────── */
.pb-catalog-header {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.pb-title {
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
}

.pb-catalog-stats {
    font-size: 0.68rem;
    color: #888;
    white-space: nowrap;
}

.pb-search {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
}

.pb-search-help-btn {
    padding: 2px 4px;
    font-size: 0.85rem;
    color: #999;
    flex-shrink: 0;
}
.pb-search-help-btn:hover { color: #239BCD; }

.pb-legacy-toggle {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.pb-legacy-toggle input { margin-right: 2px; }

/* Source buttons — compact in overlay */
.pb-catalog-overlay .btn-group-sm .btn {
    font-size: 0.62rem;
    padding: 1px 5px;
}

/* ── Filter Badges ───────────────────────────────────────────────── */
.pb-filter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px 0;
}
.pb-filter-badges:empty { display: none; }

.pb-filter-badge {
    font-size: 0.62rem;
    font-family: 'Inconsolata', monospace;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    border: 2px solid #28a745;
    background: #f8f9fa;
    color: #495057;
    white-space: nowrap;
}

.pb-filter-badge-negated {
    text-decoration: line-through;
    border-color: #dc3545;
}

.pb-filter-badge-or {
    border-color: #e65100;
    background: #fff3e0;
    color: #e65100;
    font-weight: 700;
}

.pb-search-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25) !important;
}

/* ── Category Pills ──────────────────────────────────────────────── */
.pb-pills {
    display: flex;
    gap: 0.25rem;
    padding: 0.3rem 0.6rem 0.15rem;
    overflow-x: auto;
    scrollbar-width: thin;
    flex-wrap: nowrap;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f0f0;
}

.pb-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 2px 8px;
    font-size: 0.62rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    user-select: none;
}

.pb-pill:hover {
    border-color: #239BCD;
    color: #239BCD;
}

.pb-pill.active {
    background: #239BCD;
    border-color: #239BCD;
    color: #fff;
}

.pb-pill-count {
    font-size: 0.55rem;
    font-weight: 500;
    opacity: 0.75;
}

.pb-pill.active .pb-pill-count {
    opacity: 0.9;
}

/* ── Play List (scrollable, fills remaining space) ───────────────── */
.pb-play-list-wrap {
    flex: 1;
    min-height: 0;       /* allows shrinking below content size for scrolling */
    overflow-y: scroll;
    max-height: none;
    border: none;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.25) rgba(0,0,0,0.05);
}
.pb-play-list-wrap::-webkit-scrollbar { width: 8px; }
.pb-play-list-wrap::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); border-radius: 4px; }
.pb-play-list-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.25); border-radius: 4px; min-height: 40px; }
.pb-play-list-wrap::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.4); }

.pb-play-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pb-play-row {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.1s;
    gap: 0.4rem;
    font-size: 0.74rem;
}

.pb-play-row:hover {
    background: #e8f4fc;
}

.pb-play-row.active {
    background: #d6ecfa;
    border-left: 3px solid #239BCD;
    padding-left: 7px;
}

.pb-play-row-name {
    font-family: 'Inconsolata', monospace;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.pb-play-row-meta {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    flex-shrink: 0;
}

/* ── Badges ──────────────────────────────────────────────────────── */
.pb-badge {
    display: inline-block;
    padding: 1px 5px;
    font-size: 0.55rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.pb-badge-faa { background: #e3f2fd; color: #1565c0; }
.pb-badge-dcc { background: #fff3e0; color: #e65100; }
.pb-badge-category { background: #f3e5f5; color: #7b1fa2; }
.pb-badge-routes { background: #e8f5e9; color: #2e7d32; font-family: 'Inconsolata', monospace; }
.pb-badge-archived { background: #eceff1; color: #546e7a; }
.pb-badge-draft { background: #fff8e1; color: #f57f17; }
.pb-badge-ecfmp { background: #e0f7fa; color: #00838f; }
.pb-badge-canoc { background: #fce4ec; color: #c62828; }
.pb-badge-faa_historical { background: #efebe9; color: #5d4037; }

/* ── Pagination ──────────────────────────────────────────────────── */
.pb-pagination {
    display: flex;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border-top: 1px solid #e9ecef;
}
.pb-pagination .pb-page-btn {
    min-width: 26px;
    padding: 1px 5px;
    font-size: 0.7rem;
}

/* ── Detail Panel (full-width below map) ─────────────────────────── */
.pb-detail-panel {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    padding: 0.75rem;
    overflow-y: auto;
    max-height: 45vh;
    margin-top: 0.5rem;
}

.pb-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.pb-detail-play-name {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: #2c3e50;
}

.pb-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0.35rem;
}

.pb-play-description {
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 0.35rem;
}

.pb-play-remarks {
    font-size: 0.75rem;
    color: #7a6b2a;
    background: #fef9e7;
    border-left: 3px solid #e2a300;
    padding: 4px 8px;
    margin-bottom: 0.35rem;
    border-radius: 2px;
}

.pb-play-facilities {
    font-size: 0.72rem;
    color: #888;
    font-family: 'Inconsolata', monospace;
    margin-bottom: 0.3rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    padding-left: 1.2em;
    text-indent: -1.2em;
}

.pb-inline-edit-btn {
    border: none;
    background: transparent;
    color: #aaa;
    font-size: 0.55rem;
    padding: 1px 4px;
    cursor: pointer;
    vertical-align: middle;
}
.pb-inline-edit-btn:hover { color: #239BCD; }
.pb-fac-edit-wrap {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 3px;
}
.pb-fac-input {
    font-family: 'Inconsolata', monospace;
    font-size: 0.72rem !important;
    padding: 2px 6px !important;
    flex: 1;
}
.pb-fac-edit-actions { display: flex; gap: 2px; flex-shrink: 0; }
.pb-fac-edit-actions .btn { font-size: 0.6rem; padding: 1px 6px; }

.pb-play-traffic {
    font-size: 0.72rem;
    color: #6aa;
    font-family: 'Inconsolata', monospace;
    margin-bottom: 0.3rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    padding-left: 1.2em;
    text-indent: -1.2em;
}

/* Traversed facilities collapsible section */
.pb-play-traversed {
    font-size: 0.7rem;
    font-family: 'Inconsolata', monospace;
    margin-bottom: 0.4rem;
}
.pb-traversed-header {
    cursor: pointer;
    color: #777;
    padding: 2px 0;
    user-select: none;
}
.pb-traversed-header:hover { color: #333; }
.pb-traversed-header.expanded i { transform: rotate(90deg); }
.pb-traversed-header i { transition: transform 0.15s; font-size: 0.55rem; margin-right: 2px; }
.pb-traversed-body {
    padding: 3px 0 3px 10px;
    border-left: 2px solid #e0e0e0;
    margin-left: 4px;
}
.pb-trav-row { margin-bottom: 2px; line-height: 1.4; }
.pb-trav-label {
    font-weight: 600;
    color: #555;
    display: inline-block;
    min-width: 90px;
}
.pb-fac-code {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0 3px;
    border-radius: 2px;
    background: rgba(0,0,0,0.04);
    color: #555;
}

/* ── Detail Placeholder ─────────────────────────────────────────── */
.pb-detail-placeholder {
    text-align: center;
    padding: 2rem 1rem;
    color: #aaa;
    font-size: 0.85rem;
}

.pb-detail-placeholder i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
    opacity: 0.5;
}

/* ── Route Table ─────────────────────────────────────────────────── */
.pb-route-table-wrap {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.pb-route-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
    table-layout: fixed;
}

.pb-route-table th {
    background: #f8f9fa;
    padding: 4px 6px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.pb-route-table td {
    padding: 3px 6px;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Inconsolata', monospace;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pb-route-table tr:hover td {
    background: #f8f9fa;
}

/* Route emphasis when catalog search is active */
.pb-route-table tr.pb-route-emphasized td {
    background: rgba(35, 155, 205, 0.08);
}
.pb-route-table tr.pb-route-dimmed td {
    opacity: 0.35;
}
.pb-route-table tr.pb-route-dimmed:hover td {
    opacity: 0.6;
}

/* Active route analysis highlight — persistent amber emphasis */
.pb-route-table tr.pb-route-analysis-active td,
.pb-compact-table tr.pb-route-analysis-active td {
    background: rgba(255, 193, 7, 0.12) !important;
    border-top: 1px solid rgba(255, 193, 7, 0.25);
    border-bottom: 1px solid rgba(255, 193, 7, 0.25);
}
.pb-route-table tr.pb-route-analysis-active td:first-child,
.pb-compact-table tr.pb-route-analysis-active td:first-child {
    border-left: 3px solid #ffc107;
}

.pb-route-table .pb-route-check {
    width: 24px;
    text-align: center;
}

/* Airport cells: space-separated codes wrap naturally */
.pb-route-table td.pb-rt-airports {
    font-size: 0.7rem;
    line-height: 1.35;
}

/* ── Action Buttons ──────────────────────────────────────────────── */
.pb-actions {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.pb-actions .btn {
    font-size: 0.72rem;
    padding: 3px 8px;
}

/* ── Route Textarea ──────────────────────────────────────────────── */
#routeSearch {
    font-family: 'Inconsolata', monospace;
    font-size: 0.9rem;
}

/* ── Select All ──────────────────────────────────────────────────── */
.pb-select-all {
    font-size: 0.68rem;
    cursor: pointer;
    color: #239BCD;
    user-select: none;
}
.pb-select-all:hover { text-decoration: underline; }

/* ── Checkbox Dropdown Multi-Select ──────────────────────────────── */
.pb-cb-dropdown { position: relative; display: inline-block; }

.pb-cb-trigger {
    font-size: 0.68rem;
    padding: 2px 8px;
    white-space: nowrap;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 3px;
    cursor: pointer;
    color: #495057;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.pb-cb-trigger:hover { border-color: #239BCD; }

.pb-cb-count {
    font-size: 0.58rem;
    background: #239BCD;
    color: #fff;
    border-radius: 8px;
    padding: 0 4px;
    line-height: 1.3;
}
.pb-cb-count:empty { display: none; }

.pb-cb-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    min-width: 140px;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px 0;
    margin-top: 1px;
}
.pb-cb-dropdown.open .pb-cb-menu { display: block; }

.pb-cb-group-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: #888;
    padding: 4px 10px 2px;
    text-transform: uppercase;
}

.pb-cb-item {
    display: block;
    font-size: 0.7rem;
    padding: 2px 10px;
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
    font-family: 'Inconsolata', monospace;
}
.pb-cb-item:hover { background: #f0f7fc; }
.pb-cb-item input { margin-right: 4px; vertical-align: middle; }

/* ── Selection Toolbar ───────────────────────────────────────────── */
.pb-select-toolbar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 0;
    flex-wrap: wrap;
}
.pb-select-label {
    font-size: 0.65rem;
    color: #888;
    white-space: nowrap;
}
.pb-select-toolbar .pb-select-route-text {
    font-size: 0.68rem;
    max-width: 120px;
    height: 24px;
    padding: 0 4px;
}

.pb-clear-filters {
    font-size: 0.62rem;
    padding: 1px 6px;
    color: #dc3545;
    border-color: #dc3545;
}
.pb-clear-filters:hover { background: #dc3545; color: #fff; }

/* ── Route Action Toolbar ───────────────────────────────────────── */
.pb-route-toolbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 0;
    font-size: 0.72rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 4px;
}
.pb-route-toolbar .btn-xs {
    font-size: 0.65rem;
    padding: 2px 6px;
}
.pb-toolbar-sep {
    font-size: 0.65rem;
    color: #ccc;
    margin: 0 2px;
}

/* ── Copy Menu (body-appended to escape overflow clipping) ──────── */
.pb-copy-menu {
    position: fixed;
    z-index: 1050;
    display: none;
    min-width: 200px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 4px 0;
    font-size: 0.75rem;
}
.pb-copy-menu.open { display: block; }
.pb-copy-menu a {
    display: block;
    padding: 6px 14px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}
.pb-copy-menu a:hover {
    background: #f0f4ff;
    color: #1a73e8;
}
.pb-copy-menu a i { color: #888; margin-right: 6px; }
.pb-copy-menu a:hover i { color: #1a73e8; }
.pb-copy-menu-sep {
    height: 1px;
    background: #e9ecef;
    margin: 3px 10px;
}

/* ── Region Color Toggle ────────────────────────────────────────── */
.pb-region-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    margin-left: 0.5rem;
    text-indent: 0;
}
.pb-region-toggle input { margin-right: 2px; }

.pb-region-code {
    padding: 0 3px;
    border-radius: 2px;
    font-weight: 600;
}

/* Traversed column: compact inline text, no truncation */
.pb-route-table td.pb-rt-traversed {
    font-size: 0.65rem;
    line-height: 1.2;
    padding: 2px 4px;
    word-wrap: break-word;
}

/* Tighter region-code badges inside traversed cells */
.pb-route-table td.pb-rt-traversed .pb-region-code {
    padding: 0 2px;
    font-size: 0.65rem;
    font-weight: 500;
}

/* ── Remarks Column ─────────────────────────────────────────────── */
.pb-remarks-cell {
    font-size: 0.65rem;
    color: #888;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Create/Edit Modal ───────────────────────────────────────────── */
.pb-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.pb-modal .table-responsive {
    max-height: 35vh;
    overflow-y: auto;
}
.pb-route-edit-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
}

.pb-modal .form-group label {
    font-weight: 600;
    font-size: 0.85rem;
}

.pb-modal .form-control-sm {
    font-size: 0.85rem;
}

.pb-route-edit-table {
    width: 100%;
    font-size: 0.75rem;
    table-layout: fixed;
}

.pb-route-edit-table th {
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 3px 4px;
    background: #f8f9fa;
    white-space: nowrap;
}

/* Column widths: proportional with table-layout:fixed — orig/dest | filter | route | icons */
.pb-route-edit-table th:nth-child(1),
.pb-route-edit-table th:nth-child(3) { width: 18%; }   /* origin / dest */
.pb-route-edit-table th:nth-child(2),
.pb-route-edit-table th:nth-child(4) { width: 6%; }    /* orig filter / dest filter */
.pb-route-edit-table .pb-re-th-route { width: auto; }
.pb-route-edit-table .pb-re-th-remarks { width: 28px; text-align: center; }
.pb-route-edit-table .pb-re-th-action { width: 24px; text-align: center; }

.pb-route-edit-table td.pb-re-cell { padding: 2px; vertical-align: top; overflow: hidden; }

.pb-route-edit-table input,
.pb-route-edit-table textarea {
    font-family: 'Inconsolata', monospace;
    font-size: 0.72rem;
    padding: 0.15rem 0.25rem;
    height: 26px;
    line-height: 1.3;
}

/* Airport & filter inputs — fill cell, ellipsis on overflow, show full on focus */
.pb-re-origin, .pb-re-dest,
.pb-re-origin-filter, .pb-re-dest-filter {
    width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Airport fields — compact monospace */
.pb-re-apt { text-transform: uppercase; }

/* Route string — auto-height, no manual resize */
.pb-re-route {
    resize: none;
    overflow: hidden;
    min-height: 26px;
    height: auto !important;
    width: 100%;
}

/* Route remarks icon button — match input height */
.pb-re-remarks-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0;
    font-size: 0.7rem;
    line-height: 26px;
    height: 26px;
}
.pb-re-remarks-btn:hover { color: #239BCD; }
.pb-re-remarks-btn.has-remarks { color: #239BCD; }

/* Remarks popover textarea */
.pb-re-remarks-popover {
    position: absolute;
    z-index: 1060;
    background: #2a2d35;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    width: 250px;
}
.pb-re-remarks-popover textarea {
    font-family: 'Inconsolata', monospace;
    font-size: 0.72rem;
    width: 100%;
    background: #1e2028;
    color: #eee;
    border: 1px solid #555;
    border-radius: 3px;
    padding: 4px 6px;
    resize: vertical;
    min-height: 50px;
}
.pb-re-remarks-popover textarea:focus {
    border-color: #239BCD;
    outline: none;
}

/* Delete button — compact, aligned to row */
.pb-re-delete {
    padding: 2px 5px !important;
    font-size: 0.6rem !important;
    line-height: 1 !important;
    border-width: 1px !important;
    margin-top: 3px;
}

/* ── View Toggle (Standard / Compact) ────────────────────────────── */
.pb-view-toggle {
    display: inline-flex;
    border: 1px solid #444;
    border-radius: 3px;
    overflow: hidden;
    font-size: 0.68rem;
    margin-left: 8px;
}
.pb-view-toggle button {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 1px 8px;
    cursor: pointer;
    font-size: inherit;
    line-height: 1.6;
}
.pb-view-toggle button:hover { color: #fff; background: rgba(255,255,255,0.08); }
.pb-view-toggle button.active { color: #fff; background: #239BCD; }

/* ── Consolidated Route Badge ────────────────────────────────────── */
.pb-consolidated-badge {
    display: inline-block;
    font-size: 0.6rem;
    color: #999;
    background: rgba(255,255,255,0.06);
    border: 1px solid #444;
    border-radius: 3px;
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.4;
}

/* ── Compact View (FROM/TO pivot tables) ─────────────────────────── */
.pb-compact-wrap { margin-top: 0.3rem; }

.pb-compact-pivot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    margin-bottom: 4px;
    background: rgba(35,155,205,0.08);
    border-left: 3px solid #239BCD;
    font-size: 0.75rem;
    font-weight: 600;
    color: #239BCD;
}
.pb-compact-pivot .pb-compact-pivot-fix { font-family: 'Inconsolata', monospace; }
.pb-compact-pivot .pb-compact-pivot-count {
    font-weight: 400;
    font-size: 0.65rem;
    color: #888;
}

.pb-compact-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    padding: 2px 4px;
    margin-top: 4px;
}

.pb-compact-table {
    width: 100%;
    font-size: 0.72rem;
    font-family: 'Inconsolata', monospace;
    border-collapse: collapse;
    margin-bottom: 6px;
}
.pb-compact-table th {
    font-size: 0.62rem;
    text-transform: uppercase;
    color: #888;
    padding: 2px 4px;
    border-bottom: 1px solid #333;
    font-weight: 600;
}
.pb-compact-table td {
    padding: 2px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: top;
}
.pb-compact-table tr:hover td { background: rgba(255,255,255,0.03); }

.pb-compact-unmatched {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #444;
}

/* ── Edit Modal Collapsible Sections ─────────────────────────────── */
.pb-edit-section { margin-bottom: 0.5rem; }

.pb-edit-section-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #239BCD;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.4rem;
    user-select: none;
}
.pb-edit-section-header:hover { color: #1a7aa3; }

.pb-edit-section-header .pb-section-icon {
    transition: transform 0.2s;
    font-size: 0.65rem;
}
.pb-edit-section-header[aria-expanded="false"] .pb-section-icon {
    transform: rotate(-90deg);
}

.pb-edit-section-body { padding: 0.25rem 0; }

/* ── Advisory Parse Area ─────────────────────────────────────────── */
#pb_advisory_parse_text {
    font-size: 0.68rem;
    line-height: 1.35;
    tab-size: 4;
    overflow-x: auto;
}

/* ── Changelog ───────────────────────────────────────────────────── */
.pb-changelog { margin-top: 0.5rem; }

.pb-changelog-header {
    font-size: 0.72rem;
    font-weight: 600;
    color: #239BCD;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pb-changelog-header i { transition: transform 0.2s; }
.pb-changelog-header.expanded i { transform: rotate(90deg); }

.pb-changelog-tab-header i { transition: transform 0.2s; }
.pb-changelog-tab-header.expanded i { transform: rotate(90deg); }

.pb-changelog-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    max-height: 200px;
    overflow-y: auto;
}

.pb-changelog-item {
    font-size: 0.68rem;
    padding: 2px 0;
    border-bottom: 1px solid #f5f5f5;
    color: #666;
}

.pb-changelog-action { font-weight: 600; color: #333; }
.pb-changelog-field { color: #239BCD; }
.pb-changelog-diff { font-family: 'Inconsolata', monospace; font-size: 0.62rem; }
.pb-changelog-old { color: #dc3545; text-decoration: line-through; }
.pb-changelog-new { color: #28a745; }

/* ── Detailed Changelog Table ──────────────────────────────────── */
.pb-changelog-table-wrap {
    overflow-x: auto;
    margin-top: 4px;
}
.pb-changelog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    line-height: 1.35;
}
.pb-changelog-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
    border-bottom: 2px solid #dee2e6;
    padding: 4px 6px;
    white-space: nowrap;
}
.pb-changelog-table tbody td {
    padding: 5px 6px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.pb-changelog-table tbody tr:hover { background: #f8f9fa; }
.pb-cl-ts {
    width: 140px;
    min-width: 120px;
    white-space: nowrap;
    color: #888;
    font-variant-numeric: tabular-nums;
}
.pb-cl-who {
    width: 90px;
    min-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}
.pb-cl-act {
    width: 70px;
    min-width: 60px;
    text-align: center;
}
.pb-cl-act .badge {
    font-size: 0.62rem;
    padding: 2px 5px;
    font-weight: 600;
}
.pb-cl-fld {
    width: 80px;
    min-width: 60px;
    color: #239BCD;
    font-weight: 500;
}
.pb-cl-chg {
    font-family: 'Inconsolata', 'Consolas', monospace;
    font-size: 0.72rem;
    word-break: break-all;
    overflow-wrap: break-word;
}
.pb-cl-old {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: line-through;
    margin-bottom: 3px;
    white-space: pre-wrap;
    word-break: break-all;
}
.pb-cl-new {
    background: #d4edda;
    color: #155724;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── Changelog Date Group Headers ──────────────────────────────── */
.pb-cl-group-header td {
    background: #f0f4f8;
    font-weight: 600;
    font-size: 0.7rem;
    color: #495057;
    padding: 4px 8px !important;
    border-bottom: 2px solid #dee2e6;
    letter-spacing: 0.03em;
}
.pb-cl-group-header:hover { background: #f0f4f8 !important; }

.pb-cl-date-divider {
    font-size: 0.62rem;
    color: #999;
    text-align: center;
    padding: 4px 0 2px;
    border-bottom: none !important;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ── Changelog Pagination ──────────────────────────────────────── */
.pb-cl-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border-top: 1px solid #e9ecef;
}
.pb-cl-pagination .pb-cl-page-btn {
    min-width: 26px;
    padding: 1px 5px;
    font-size: 0.7rem;
}
.pb-cl-pagination .pb-cl-page-info {
    font-size: 0.65rem;
    color: #888;
    margin: 0 4px;
    white-space: nowrap;
}

/* ── Empty / Loading States ──────────────────────────────────────── */
.pb-empty-state { text-align: center; padding: 1.5rem 1rem; color: #999; font-size: 0.8rem; }
.pb-empty-state i { font-size: 1.5rem; margin-bottom: 0.4rem; display: block; }

.pb-loading { text-align: center; padding: 1.5rem; }
.pb-loading .spinner-border { width: 1.2rem; height: 1.2rem; }

/* ── Map Legend ──────────────────────────────────────────────────── */
.pb-map-legend {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(20, 20, 30, 0.82);
    backdrop-filter: blur(6px);
    border-radius: 6px;
    padding: 6px 10px;
    z-index: 15;
    font-size: 0.62rem;
    color: #ddd;
    display: none;
}
.pb-map-legend-title {
    font-weight: 700;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    margin-bottom: 3px;
}
.pb-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 1px 0;
    white-space: nowrap;
}
.pb-legend-swatch {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
.pb-legend-swatch-border {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
    background: transparent;
    border: 2px solid;
}
.pb-legend-divider {
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 3px 0;
}
.pb-legend-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.55rem;
    cursor: pointer;
    margin: 0;
    line-height: 1.4;
}
.pb-legend-toggle input[type="checkbox"] {
    margin: 0;
    width: 10px;
    height: 10px;
    accent-color: #28a745;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .pb-catalog-overlay {
        width: 280px;
    }

    .pb-info-overlay {
        width: 280px;
    }

    .pb-detail-panel {
        max-height: none;
    }
}

@media (max-width: 767px) {
    .pb-map-section {
        padding-top: 50px;
    }

    .pb-map-section #graphic {
        height: 40vh;
        min-height: 250px;
    }

    /* Full-width overlays on mobile */
    .pb-catalog-overlay {
        width: calc(100% - 24px);
        max-height: 50%;
    }

    .pb-info-overlay {
        width: calc(100% - 24px);
        right: 12px;
        top: auto;
        bottom: 12px;
        max-height: 40%;
    }

    .pb-search {
        min-width: 0;
    }

    .pb-play-row-name {
        font-size: 0.72rem;
    }

    .pb-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .pb-detail-panel {
        padding: 0.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   ROUTE GROUPS — toolbar, swatches, list, table indicators
   ═══════════════════════════════════════════════════════════════════ */

/* ── Group Toolbar ──────────────────────────────────────────────── */
.pb-group-toolbar {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 6px 8px;
    margin-bottom: 6px;
    background: #fafbfc;
}

.pb-group-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.pb-group-actions .btn-xs {
    font-size: 0.62rem;
    padding: 2px 6px;
}

/* ── Inline Create/Edit Form ────────────────────────────────────── */
.pb-group-create-form {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 6px;
}

.pb-group-form-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.pb-group-name-input {
    font-size: 0.72rem !important;
    padding: 2px 6px !important;
    max-width: 150px;
    font-family: 'Inconsolata', monospace;
}

/* ── Color Palette Swatches ─────────────────────────────────────── */
.pb-group-palette {
    display: flex;
    gap: 3px;
    align-items: center;
}

.pb-group-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s, border-color 0.15s;
}

.pb-group-swatch:hover {
    transform: scale(1.2);
    border-color: rgba(0,0,0,0.3);
}

.pb-group-swatch.active {
    border-color: #333;
    transform: scale(1.25);
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #333;
}

/* ── Group List ─────────────────────────────────────────────────── */
.pb-group-list {
    margin-top: 4px;
    border-top: 1px solid #eee;
    padding-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
}

.pb-group-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
    font-size: 0.68rem;
    white-space: nowrap;
}

.pb-group-item-name {
    font-weight: 600;
    color: #333;
    cursor: pointer;
}
.pb-group-item-name:hover { text-decoration: underline; }

.pb-group-item-count {
    font-size: 0.6rem;
    color: #999;
}

.pb-group-edit-btn,
.pb-group-delete-btn {
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 0.55rem;
    padding: 1px 3px;
    cursor: pointer;
}
.pb-group-edit-btn:hover { color: #239BCD; }
.pb-group-delete-btn:hover { color: #dc3545; }

/* ── Group Dots ─────────────────────────────────────────────────── */
.pb-group-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.pb-group-dot-empty {
    background: transparent;
    border: 2px solid #ccc;
}

.pb-group-dot-inline {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ── Route Table Group Indicators ───────────────────────────────── */
.pb-route-table tr.pb-route-grouped td:first-child {
    position: relative;
}

/* Flash animation for scroll-to */
.pb-route-table tr.pb-route-flash td {
    animation: pb-row-flash 0.5s ease 2;
}

@keyframes pb-row-flash {
    0%, 100% { background: transparent; }
    50% { background: rgba(35, 155, 205, 0.15); }
}

/* ── Visibility Badges ─────────────────────────────────────────── */
.pb-visibility-badge {
    font-size: 0.5rem;
    padding: 1px 4px;
}
.pb-vis-local { background: #fff3e0; color: #e65100; }
.pb-vis-private { background: #e8eaf6; color: #283593; }
.pb-vis-org { background: #e0f2f1; color: #00695c; }

/* ── ACL Management Panel ──────────────────────────────────────── */
.pb-acl-panel {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    background: #fafbfc;
}
.pb-acl-header {
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
}
.pb-acl-add-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}
.pb-acl-add-row .btn { font-size: 0.72rem; padding: 2px 8px; }
.pb-acl-list { margin-top: 0.25rem; }

.pb-acl-table {
    width: 100%;
    font-size: 0.72rem;
    border-collapse: collapse;
}
.pb-acl-table th {
    font-size: 0.62rem;
    text-transform: uppercase;
    padding: 2px 6px;
    background: #f0f0f0;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}
.pb-acl-table td {
    padding: 3px 6px;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Inconsolata', monospace;
    text-align: center;
}
.pb-acl-table td:first-child { text-align: left; }
.pb-acl-table .btn-xs { font-size: 0.58rem; padding: 1px 4px; }

/* ── ACL Search Dropdown ──────────────────────────────────────── */
.pb-acl-search-wrap { position: relative; }
.pb-acl-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.pb-acl-search-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.pb-acl-search-item:hover { background: #e8f4fd; }
.pb-acl-search-item .acl-user-cid { font-family: 'Inconsolata', monospace; color: #239BCD; font-weight: 600; min-width: 70px; }
.pb-acl-search-item .acl-user-name { flex: 1; }
.pb-acl-search-item .acl-user-orgs { font-size: 0.62rem; color: #888; }
.pb-acl-search-item.acl-already-added { opacity: 0.5; cursor: default; }
.pb-acl-search-item.acl-already-added:hover { background: transparent; }
.pb-acl-search-no-results { padding: 8px; font-size: 0.72rem; color: #999; text-align: center; }

/* ── ACL Org Sharing Section ──────────────────────────────────── */
.pb-acl-org-header { font-size: 0.72rem; margin-bottom: 4px; }
.pb-acl-org-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.pb-acl-org-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    font-size: 0.68rem;
    border: 1px solid #ccc;
    border-radius: 12px;
    cursor: pointer;
    background: #f8f8f8;
    transition: all 0.15s;
}
.pb-acl-org-chip:hover { border-color: #239BCD; }
.pb-acl-org-chip.active {
    background: rgba(35,155,205,0.15);
    border-color: #239BCD;
    color: #239BCD;
}
.pb-acl-org-members {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
}
.pb-acl-org-member-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 0.7rem;
    border-bottom: 1px solid #f5f5f5;
}
.pb-acl-org-member-row:last-child { border-bottom: none; }
.pb-acl-org-member-row .acl-user-cid { font-family: 'Inconsolata', monospace; color: #239BCD; min-width: 70px; }
.pb-acl-org-member-row .acl-user-name { flex: 1; }
.pb-acl-org-member-row .acl-exclude-cb { margin-left: auto; }
.pb-acl-org-member-row.excluded { opacity: 0.5; text-decoration: line-through; }
.pb-acl-org-loading { padding: 8px; font-size: 0.72rem; color: #999; text-align: center; }
.pb-acl-org-actions { margin-top: 4px; display: flex; gap: 4px; }

/* ── Config dropdown items ──────────────────────────────────────── */
.pb-config-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pb-config-delete-btn {
    opacity: 0;
    transition: opacity 0.15s;
}
.pb-config-opt:hover .pb-config-delete-btn {
    opacity: 1;
}

/* ── Route Analysis Panel ─────────────────────────────────────────── */
#route-analysis-panel .card-header {
    background: #1a1a2e;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#route-analysis-panel .card-body {
    background: #16213e;
}

#route-analysis-panel .table th {
    position: sticky;
    top: 0;
    background: #1a1a2e;
    z-index: 1;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}

#route-analysis-panel .table td {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#analysis-route-info {
    color: #a8b2c1;
}

#analysis-route-info .route-label {
    color: #e0e0e0;
    font-weight: 600;
}

/* Facility type badges in traversal table */
.facility-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}
.facility-badge-artcc { background: #2d5a8e; color: #fff; }
.facility-badge-fir   { background: #5a2d8e; color: #fff; }
.facility-badge-tracon { background: #8e5a2d; color: #fff; }

/* ── Changelog Panel ──────────────────────────────────────────────── */
#play-changelog-panel .card-header {
    background: #1a1a2e;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#play-changelog-panel .card-body {
    background: #16213e;
}

#play-changelog-panel .table th {
    position: sticky;
    top: 0;
    background: #1a1a2e;
    color: #e0e0e0;
    z-index: 1;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}

#play-changelog-panel .table td {
    color: #ccc;
}

/* Changelog diff styling */
.cl-old {
    color: #e57373;
    text-decoration: line-through;
    font-size: 0.75rem;
}
.cl-new {
    color: #81c784;
    font-size: 0.75rem;
}
.cl-action {
    font-weight: 600;
    text-transform: capitalize;
}
.cl-action-created { color: #81c784; }
.cl-action-updated { color: #64b5f6; }
.cl-action-deleted { color: #e57373; }
.cl-action-archived { color: #ffb74d; }

/* ── Throughput Labels on Map ─────────────────────────────────────── */
.throughput-label {
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
}

/* Throughput toggle active state */
#btn-throughput-toggle.active {
    background: #2196f3 !important;
    color: #fff !important;
    border-color: #2196f3 !important;
}

/* ── Section Toggle Bar ──────────────────────────────────────────── */
.pb-section-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px 12px;
    background: #1a1a2e;
    border-bottom: 1px solid #2a2a4a;
    flex-shrink: 0;
}

.pb-section-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid #3a3a5a;
    border-radius: 3px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    transition: all 0.15s;
}

.pb-section-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: #ddd;
}

.pb-section-toggle.active {
    background: rgba(35,155,205,0.2);
    color: #239BCD;
    border-color: rgba(35,155,205,0.4);
}

.pb-section-toggle:not(.active) {
    opacity: 0.6;
}

/* Collapsed section states */
.pb-map-section.pb-collapsed {
    padding-top: 0 !important;
    min-height: 0 !important;
    background: #12122a;
}

.pb-map-section.pb-collapsed #map_wrapper {
    display: none;
}

/* In collapsed mode, flow overlays instead of absolute positioning */
.pb-map-section.pb-collapsed .pb-catalog-overlay {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: none;
    max-height: 300px;
    border-radius: 0;
    box-shadow: none;
    background: rgba(30, 30, 50, 0.98);
}

.pb-map-section.pb-collapsed .pb-catalog-overlay .pb-overlay-titlebar {
    cursor: default;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid #2a2a4a;
}

.pb-map-section.pb-collapsed .pb-catalog-overlay .pb-overlay-title {
    color: #ccc;
}

.pb-map-section.pb-collapsed .pb-info-overlay {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: none;
    max-height: 200px;
    border-radius: 0;
    box-shadow: none;
    background: rgba(30, 30, 50, 0.98);
    border-top: 1px solid #2a2a4a;
}

#pb_detail_section.pb-collapsed {
    display: none !important;
}

/* ── Query Builder Overlay ────────────────────────────────────────── */
.pb-builder-overlay {
    position: absolute;
    top: 72px;
    left: 344px;
    width: 300px;
    max-height: calc(100% - 84px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pb-builder-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.pb-builder-group {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 6px;
    background: #fafafa;
}

.pb-builder-group-label {
    font-family: 'Inconsolata', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 4px;
}

.pb-builder-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.pb-builder-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: 'Inconsolata', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    border: 2px solid #28a745;
    background: #f8f9fa;
    color: #495057;
    white-space: nowrap;
}

.pb-builder-chip-negated {
    border-color: #dc3545;
    text-decoration: line-through;
}

.pb-builder-chip-remove {
    cursor: pointer;
    color: #aaa;
    font-size: 0.7rem;
    margin-left: 2px;
}
.pb-builder-chip-remove:hover { color: #dc3545; }

.pb-builder-or-divider {
    text-align: center;
    margin: 4px 0;
    font-family: 'Inconsolata', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #e65100;
}

.pb-builder-subgroup {
    border: 2px dashed #90caf9;
    border-radius: 4px;
    padding: 3px 5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #fff;
}

.pb-builder-add {
    font-family: 'Inconsolata', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    color: #239BCD;
    cursor: pointer;
    border: none;
    background: none;
    padding: 2px 4px;
}
.pb-builder-add:hover { text-decoration: underline; }

.pb-builder-add-group {
    text-align: center;
    padding: 6px;
    border: 1px dashed #ccc;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 4px;
}
.pb-builder-add-group:hover { border-color: #239BCD; }

.pb-builder-preview {
    margin-top: 8px;
    padding: 4px 6px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Inconsolata', monospace;
    font-size: 0.6rem;
    color: #495057;
    word-break: break-all;
    cursor: pointer;
}

.pb-builder-preview-label {
    font-size: 0.55rem;
    color: #999;
    margin-bottom: 1px;
    text-transform: uppercase;
}

.pb-builder-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 6px;
    font-size: 0.62rem;
    color: #856404;
}

.pb-builder-toggle-btn {
    padding: 2px 4px;
    font-size: 0.8rem;
    color: #999;
}
.pb-builder-toggle-btn:hover { color: #239BCD; }
.pb-builder-toggle-btn.active { color: #239BCD; }

.pb-builder-minimized .pb-builder-content {
    display: none;
}

.pb-builder-add-form {
    display: flex;
    gap: 3px;
    align-items: center;
    margin-top: 4px;
}

.pb-builder-add-form select,
.pb-builder-add-form input {
    font-family: 'Inconsolata', monospace;
    font-size: 0.62rem;
    padding: 1px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    height: 22px;
}

.pb-builder-add-form input {
    flex: 1;
    min-width: 60px;
}

.pb-builder-empty {
    text-align: center;
    font-size: 0.62rem;
    color: #aaa;
    padding: 12px 6px;
    font-style: italic;
}

@media (max-width: 767px) {
    .pb-builder-overlay {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        max-height: none;
        margin-top: 8px;
    }
}

/* ── Cursor pointer utility ───────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
