/* ============================================================================
 * Constellation Modal — Knowledge Graph Constellation View
 * Toolbar-based layout: all controls in header, full canvas below
 * Stage 7: Toolbar restructure, cluster morphing animation, maximize
 * ============================================================================ */

/* ── Overlay (fills App Pane) ── */
.se-overlay {
    position: fixed;
    top: var(--nav-height, 60px);
    left: var(--side-nav-width, 60px);
    right: 0;
    bottom: 0;
    background: rgba(8, 8, 20, 0.97);
    z-index: 10500;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 250ms ease;
    pointer-events: none;
}
.se-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Origin banner ── */
.se-origin-banner {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    background: rgba(16, 16, 32, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    flex-shrink: 0;
    height: 40px;
    overflow: hidden;
}
.se-origin-banner.se-origin-visible {
    display: flex;
}
.se-origin-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.se-origin-icon { font-size: calc(14px * var(--type-scale, 1)); }
.se-origin-text {
    font-size: calc(12px * var(--type-scale, 1));
    color: rgba(245, 158, 11, 0.9);
    font-weight: 600;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.se-origin-trail {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.se-origin-trail::-webkit-scrollbar { display: none; }
.se-origin-sep { color: rgba(255, 255, 255, 0.2); font-size: calc(12px * var(--type-scale, 1)); flex-shrink: 0; }
.se-origin-ellipsis { color: rgba(255, 255, 255, 0.3); font-size: calc(14px * var(--type-scale, 1)); flex-shrink: 0; }
.se-origin-hop {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    transition: all 150ms ease;
}
.se-origin-hop:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}
.se-origin-hop-thumb {
    width: 20px; height: 20px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.se-origin-hop-title {
    font-size: calc(11px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}
.se-origin-hop:hover .se-origin-hop-title { color: rgba(255, 255, 255, 0.85); }
.se-origin-hop-count {
    display: none;
    font-size: calc(11px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    flex-shrink: 0;
}
.se-origin-return {
    flex-shrink: 0;
    margin-left: auto;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 14px;
    color: rgba(245, 158, 11, 0.9);
    font-size: calc(11px * var(--type-scale, 1));
    font-weight: 600;
    padding: 3px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms ease;
}
.se-origin-return:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.6);
}

/* ── Breadcrumb bar ── */
.se-breadcrumb-bar {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: rgba(16, 16, 32, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    min-height: 0;
    overflow: hidden;
}
.se-breadcrumb-bar.se-breadcrumb-visible { display: flex; }
.se-crumb {
    font-size: calc(12px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.se-crumb-current {
    color: rgba(245, 158, 11, 0.9);
    font-weight: 600;
}
.se-crumb-parent {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: calc(12px * var(--type-scale, 1));
    cursor: pointer;
    padding: 2px 8px;
    transition: all 150ms ease;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.se-crumb-parent:hover {
    border-color: rgba(245, 158, 11, 0.5);
    color: rgba(245, 158, 11, 0.9);
    background: rgba(245, 158, 11, 0.08);
}
.se-crumb-sep { color: rgba(255, 255, 255, 0.2); font-size: calc(14px * var(--type-scale, 1)); flex-shrink: 0; }
.se-crumb-count { font-size: calc(10px * var(--type-scale, 1)); color: rgba(255, 255, 255, 0.3); margin-left: 4px; }
.se-crumb-galaxy {
    background: none;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 4px;
    color: rgba(168, 85, 247, 0.7);
    font-size: calc(12px * var(--type-scale, 1));
    cursor: pointer;
    padding: 2px 8px;
    transition: all 150ms ease;
    white-space: nowrap;
}
.se-crumb-galaxy:hover {
    border-color: rgba(168, 85, 247, 0.7);
    color: rgba(168, 85, 247, 1);
    background: rgba(168, 85, 247, 0.1);
}

/* ============================================================================
 * TOOLBAR — compact horizontal control bar
 * ============================================================================ */

.se-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(16, 16, 32, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    min-height: 40px;
}

.se-toolbar-back {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: calc(12px * var(--type-scale, 1));
    cursor: pointer;
    padding: 4px 10px;
    transition: all 150ms ease;
    flex-shrink: 0;
}
.se-toolbar-back:hover {
    border-color: rgba(245, 158, 11, 0.6);
    color: rgba(245, 158, 11, 0.9);
}

.se-toolbar-spacer { flex: 1; }

.se-toolbar-capture,
.se-toolbar-list-btn,
.se-toolbar-maximize,
.se-toolbar-close {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: calc(16px * var(--type-scale, 1));
    cursor: pointer;
    padding: 3px 8px;
    transition: all 150ms ease;
    flex-shrink: 0;
    line-height: 1;
}
.se-toolbar-capture {
    font-size: calc(12px * var(--type-scale, 1));
    padding: 4px 10px;
    white-space: nowrap;
}
.se-toolbar-capture:hover,
.se-toolbar-list-btn:hover,
.se-toolbar-maximize:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.95);
}

/* Person thread dropdown */
.se-thread-select {
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: calc(12px * var(--type-scale, 1));
    cursor: pointer;
    max-width: 220px;
}
.se-thread-select:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.6);
}
.se-thread-pivot-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 3px 8px;
    margin-left: 4px;
    font-size: calc(14px * var(--type-scale, 1));
    line-height: 1;
}
.se-thread-pivot-btn:hover {
    border-color: rgba(245, 158, 11, 0.6);
    color: rgba(245, 158, 11, 0.95);
}

/* Capture Media Profile dialog */
.se-capture-dialog {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.se-capture-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.se-capture-panel {
    position: relative;
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 24px;
    min-width: 360px;
    max-width: 480px;
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.se-capture-panel h3 {
    margin: 0 0 8px 0;
    font-size: calc(18px * var(--type-scale, 1));
}
.se-capture-count {
    margin: 0 0 16px 0;
    font-size: calc(13px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.6);
}
.se-capture-label {
    display: block;
    font-size: calc(12px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}
.se-capture-name {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
    color: rgba(255, 255, 255, 0.95);
    font-size: calc(14px * var(--type-scale, 1));
    box-sizing: border-box;
    margin-bottom: 14px;
}
.se-capture-name:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.6);
}
.se-capture-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: calc(13px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 18px;
    cursor: pointer;
}
.se-capture-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.se-capture-cancel,
.se-capture-confirm {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 16px;
    font-size: calc(13px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
}
.se-capture-confirm {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
    color: rgba(255, 220, 150, 0.95);
}
.se-capture-confirm:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.35);
}
.se-capture-cancel:hover {
    border-color: rgba(255, 255, 255, 0.4);
}
.se-capture-confirm:disabled {
    opacity: 0.6;
    cursor: wait;
}
.se-toolbar-list-btn.active {
    border-color: rgba(245, 158, 11, 0.6);
    color: rgba(245, 158, 11, 0.9);
    background: rgba(245, 158, 11, 0.1);
}
.se-toolbar-close:hover {
    border-color: rgba(239, 68, 68, 0.6);
    color: rgba(239, 68, 68, 0.9);
}

/* ── Toolbar controls (zoom + filter chips) ── */
.se-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 1;
    min-width: 0;
}

.se-resolution-control {
    display: flex;
    align-items: center;
    gap: 6px;
}
.se-resolution-label {
    font-size: calc(10px * var(--type-scale, 1));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}
.se-resolution-slider {
    width: 80px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
}
.se-resolution-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.3);
}
.se-resolution-count {
    font-size: calc(11px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.se-filter-chips {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}
.se-filter-chip {
    font-size: 0;
    padding: 4px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    cursor: pointer;
    transition: all 150ms ease;
    line-height: 0;
}
.se-filter-chip.active {
    border-color: rgba(245, 158, 11, 0.6);
    background: rgba(245, 158, 11, 0.1);
}
.se-filter-chip:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* ── Toolbar person threads ── */
.se-toolbar-threads {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.se-toolbar-threads::-webkit-scrollbar { display: none; }
.se-toolbar-threads:empty { display: none; }

.se-thread-label {
    font-size: calc(10px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 2px;
    flex-shrink: 0;
}
.se-thread-chip {
    font-size: calc(11px * var(--type-scale, 1));
    padding: 2px 6px 2px 2px;
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    background: transparent;
    color: rgba(168, 85, 247, 0.7);
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.se-thread-face {
    width: 20px; height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(168, 85, 247, 0.1);
}
.se-thread-chip.active {
    border-color: rgba(168, 85, 247, 0.8);
    background: rgba(168, 85, 247, 0.15);
    color: rgba(168, 85, 247, 1);
}
.se-thread-chip.active .se-thread-face {
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.6);
}
.se-thread-chip:hover {
    border-color: rgba(168, 85, 247, 0.6);
    color: rgba(168, 85, 247, 0.9);
}
.se-thread-count { font-size: calc(9px * var(--type-scale, 1)); opacity: 0.6; margin-left: 2px; }
.se-thread-pivot {
    margin-left: 3px;
    font-size: calc(10px * var(--type-scale, 1));
    opacity: 0.5;
    transition: opacity 150ms;
}
.se-thread-pivot:hover { opacity: 1; }

/* ── Toolbar analyze button ── */
.se-toolbar-analyze {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.se-analyze-btn {
    font-size: calc(12px * var(--type-scale, 1));
    padding: 4px 12px;
    border-radius: 14px;
    border: 1px solid rgba(147, 51, 234, 0.5);
    background: rgba(147, 51, 234, 0.15);
    color: rgba(147, 51, 234, 0.9);
    cursor: pointer;
    transition: all 200ms ease;
    white-space: nowrap;
    font-weight: 500;
}
.se-analyze-btn:hover {
    background: rgba(147, 51, 234, 0.3);
    border-color: rgba(147, 51, 234, 0.7);
}
.se-analyze-btn.analyzing { opacity: 0.7; cursor: wait; }
.se-analyze-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid rgba(147, 51, 234, 0.3);
    border-top-color: rgba(147, 51, 234, 0.9);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
.se-analyze-meta {
    font-size: calc(10px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

/* ============================================================================
 * MAIN AREA — canvas fills all space
 * ============================================================================ */

.se-main-area {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* ── Canvas (constellation area — now full width) ── */
.se-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-width: 0;
}
.se-canvas svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* ── Anchor thumbnail (center) ── */
.se-anchor-wrap {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transform: translate(-50%, -50%);
    z-index: 5;
}
.se-anchor-thumb {
    width: 120px; height: 120px;
    border-radius: 12px;
    border: 3px solid rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.25), 0 0 60px rgba(245, 158, 11, 0.08);
    object-fit: cover;
    background: #1a1f2e;
    transition: transform 200ms ease;
}
.se-anchor-wrap:hover .se-anchor-thumb { transform: scale(1.05); }
.se-anchor-label {
    font-size: calc(11px * var(--type-scale, 1));
    color: rgba(245, 158, 11, 0.9);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 140px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.se-anchor-person-circle { border-radius: 50%; border-color: rgba(245, 158, 11, 0.9); }
.se-anchor-person .se-anchor-label { color: rgba(245, 158, 11, 0.95); }

/* ── Orbit thumbnails ── */
.se-orbit-wrap {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -50%);
    z-index: 3;
    cursor: pointer;
    transition: opacity 200ms ease;
}
.se-orbit-thumb {
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    object-fit: cover;
    background: #1a1f2e;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.se-orbit-wrap:hover .se-orbit-thumb,
.se-orbit-wrap.se-highlighted .se-orbit-thumb {
    transform: scale(1.15);
    border-color: rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}
.se-orbit-label {
    font-size: calc(10px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.6);
    max-width: 80px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 150ms ease;
}
.se-orbit-wrap:hover .se-orbit-label { color: rgba(255, 255, 255, 0.95); }

/* ── Media-type visual encoding (v2 constellation) ── */
/* Non-photo types get colored borders, a badge, and a size multiplier so the
   diversity-aware selection is visible at a glance. Photo is the default. */
.se-orbit-wrap { position: absolute; }
.se-orbit-wrap .se-mt-badge {
    display: none;
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: calc(11px * var(--type-scale, 1));
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
    pointer-events: none;
    z-index: 4;
}
.se-orbit-wrap:not(.se-mt-photo) .se-mt-badge { display: block; }

/* Document: blue */
.se-orbit-wrap.se-mt-document .se-orbit-thumb {
    border-color: #4A90D9;
    box-shadow: 0 0 0 1px rgba(74, 144, 217, 0.35), 0 0 14px rgba(74, 144, 217, 0.25);
}
.se-orbit-wrap.se-mt-document .se-mt-badge {
    background: #4A90D9;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}
.se-orbit-wrap.se-mt-document .se-mt-badge::before { content: "\1F4C4"; }

/* Video: red, diamond-ish via slight rotation on border color + ▶ badge */
.se-orbit-wrap.se-mt-video .se-orbit-thumb {
    border-color: #E74C3C;
    box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.35), 0 0 14px rgba(231, 76, 60, 0.25);
}
.se-orbit-wrap.se-mt-video .se-mt-badge {
    background: #E74C3C;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}
.se-orbit-wrap.se-mt-video .se-mt-badge::before { content: "\25B6"; font-size: calc(10px * var(--type-scale, 1)); }

/* Audio: purple */
.se-orbit-wrap.se-mt-audio .se-orbit-thumb {
    border-color: #9B59B6;
    box-shadow: 0 0 0 1px rgba(155, 89, 182, 0.35), 0 0 14px rgba(155, 89, 182, 0.25);
}
.se-orbit-wrap.se-mt-audio .se-mt-badge {
    background: #9B59B6;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}
.se-orbit-wrap.se-mt-audio .se-mt-badge::before { content: "\266A"; }

/* Size multiplier — 1.3× for non-photo orbits so they stand out.
   Applied per ring to keep proportions consistent. */
.se-orbit-wrap.se-ring-1:not(.se-mt-photo) .se-orbit-thumb { width: 94px; height: 94px; }
.se-orbit-wrap.se-ring-2:not(.se-mt-photo) .se-orbit-thumb { width: 76px; height: 76px; }
.se-orbit-wrap.se-ring-3:not(.se-mt-photo) .se-orbit-thumb { width: 62px; height: 62px; }
.se-canvas.se-dense .se-orbit-wrap.se-ring-1:not(.se-mt-photo) .se-orbit-thumb { width: 73px; height: 73px; }
.se-canvas.se-dense .se-orbit-wrap.se-ring-2:not(.se-mt-photo) .se-orbit-thumb { width: 62px; height: 62px; }
.se-canvas.se-dense .se-orbit-wrap.se-ring-3:not(.se-mt-photo) .se-orbit-thumb { width: 52px; height: 52px; }

/* Sidebar list: same color cue + small badge */
.se-list-thumb-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}
.se-list-thumb-wrap .se-mt-badge {
    display: none;
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: calc(9px * var(--type-scale, 1));
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
    pointer-events: none;
}
.se-list-item:not(.se-mt-photo) .se-list-thumb-wrap .se-mt-badge { display: block; }
.se-list-item.se-mt-document .se-list-thumb { border: 2px solid #4A90D9; }
.se-list-item.se-mt-document .se-mt-badge { background: #4A90D9; }
.se-list-item.se-mt-document .se-mt-badge::before { content: "\1F4C4"; }
.se-list-item.se-mt-video .se-list-thumb { border: 2px solid #E74C3C; }
.se-list-item.se-mt-video .se-mt-badge { background: #E74C3C; }
.se-list-item.se-mt-video .se-mt-badge::before { content: "\25B6"; font-size: calc(8px * var(--type-scale, 1)); }
.se-list-item.se-mt-audio .se-list-thumb { border: 2px solid #9B59B6; }
.se-list-item.se-mt-audio .se-mt-badge { background: #9B59B6; }
.se-list-item.se-mt-audio .se-mt-badge::before { content: "\266A"; }

/* ── Person thread dimming ── */
.se-orbit-wrap.se-thread-dimmed { opacity: 0.25; }
.se-orbit-wrap.se-thread-dimmed:hover { opacity: 0.7; }
.se-line.se-line-dimmed { opacity: 0.08 !important; }

/* ── Ring size classes ── */
.se-orbit-wrap.se-ring-1 .se-orbit-thumb { width: 72px; height: 72px; }
.se-orbit-wrap.se-ring-2 .se-orbit-thumb { width: 58px; height: 58px; }
.se-orbit-wrap.se-ring-3 .se-orbit-thumb { width: 48px; height: 48px; }

/* Dense constellation (>30 items) — shrink further */
.se-canvas.se-dense .se-orbit-wrap.se-ring-1 .se-orbit-thumb { width: 56px; height: 56px; }
.se-canvas.se-dense .se-orbit-wrap.se-ring-2 .se-orbit-thumb { width: 48px; height: 48px; }
.se-canvas.se-dense .se-orbit-wrap.se-ring-3 .se-orbit-thumb { width: 40px; height: 40px; }
.se-canvas.se-dense .se-anchor-thumb { width: 90px; height: 90px; }

/* ── SVG edge lines ── */
.se-line {
    stroke-width: 1.5;
    opacity: 0.3;
    transition: opacity 400ms ease-out, stroke-width 400ms ease-out;
}
.se-line.se-line-active { stroke-width: 3; opacity: 0.85; }
.se-line-person-tag { stroke: #ec4899; }
.se-line-shared-person { stroke: #f59e0b; }
.se-line-direct-edge { stroke: #3b82f6; }
.se-line-story-sibling { stroke: #a855f7; }
.se-line-co-event { stroke: #10b981; }
.se-line-co-located { stroke: #c2702e; }
.se-line-temporal-neighbor { stroke: #6b7280; }
.se-line-co-era { stroke: #64748b; }
.se-line-period { stroke: #8b5cf6; }
.se-line-cluster-member { stroke: #14b8a6; }
.se-line-entity-member { stroke: #f472b6; }

/* ── Predicate tooltip ── */
.se-edge-tooltip {
    position: absolute;
    background: rgba(30, 30, 50, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: calc(11px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    white-space: nowrap;
    z-index: 20;
    opacity: 0;
    transition: opacity 150ms ease;
}
.se-edge-tooltip.visible { opacity: 1; }

/* ── Hover inspection tooltip ── */
.se-inspect-tooltip {
    position: absolute;
    background: rgba(20, 20, 40, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
    max-width: 280px;
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.se-inspect-tooltip.visible { opacity: 1; }
.se-inspect-title {
    font-size: calc(11px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.se-inspect-narration {
    font-size: calc(12px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Ring guides ── */
.se-ring-guide {
    fill: none;
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 1;
    stroke-dasharray: 4 6;
}

/* ── Cluster preview toast ── */
.se-cluster-preview {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 50, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: calc(12px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-line;
    max-width: 400px;
    z-index: 25;
    opacity: 0;
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
}
.se-cluster-preview.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================================
 * CONNECTION DRAWER — slide-out panel from right
 * ============================================================================ */

.se-drawer {
    width: 320px;
    flex-shrink: 0;
    background: rgba(16, 16, 32, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInRight 200ms ease;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.se-drawer-header {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}
.se-drawer-title {
    flex: 1;
    font-size: calc(13px * var(--type-scale, 1));
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}
.se-drawer-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: calc(16px * var(--type-scale, 1));
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.se-drawer-close:hover { color: rgba(255, 255, 255, 0.9); }
.se-drawer-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Drawer list items (same styling as old sidebar) ── */
.se-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 120ms ease;
}
.se-list-item:hover,
.se-list-item.se-highlighted {
    background: rgba(245, 158, 11, 0.08);
}
.se-list-thumb {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #1a1f2e;
}
.se-list-info { flex: 1; min-width: 0; }
.se-list-title {
    font-size: calc(12px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.se-list-meta {
    font-size: calc(10px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}
.se-list-strength { width: 40px; flex-shrink: 0; text-align: right; }
.se-strength-bar {
    width: 100%; height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}
.se-strength-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 2px;
    transition: width 300ms ease;
}
.se-list-predicate-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    margin-right: 3px;
}
.se-dot-shared-person { background: #f59e0b; }
.se-dot-direct-edge { background: #3b82f6; }
.se-dot-story_sibling { background: #a855f7; }
.se-dot-co_event { background: #10b981; }
.se-dot-co_located { background: #c2702e; }
.se-dot-temporal_neighbor { background: #6b7280; }
.se-dot-co_era { background: #64748b; }

/* ============================================================================
 * CLUSTER ANALYSIS — morphing animation + overlay cards
 * ============================================================================ */

/* Sweep pulse from center when analysis starts */
.se-canvas.se-analysis-sweep::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.25) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: analysisSweep 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 5;
}
@keyframes analysisSweep {
    0% { width: 0; height: 0; opacity: 0.8; }
    70% { opacity: 0.4; }
    100% { width: 150%; height: 150%; opacity: 0; }
}

/* Cluster color palette */
.se-orbit-wrap[data-cluster-color="0"] { --cluster-hue: 280; }
.se-orbit-wrap[data-cluster-color="1"] { --cluster-hue: 330; }
.se-orbit-wrap[data-cluster-color="2"] { --cluster-hue: 25; }
.se-orbit-wrap[data-cluster-color="3"] { --cluster-hue: 50; }
.se-orbit-wrap[data-cluster-color="4"] { --cluster-hue: 170; }
.se-orbit-wrap[data-cluster-color="5"] { --cluster-hue: 210; }
.se-orbit-wrap[data-cluster-color="6"] { --cluster-hue: 0; }
.se-orbit-wrap[data-cluster-color="7"] { --cluster-hue: 140; }

/* Clustered node: colored ring */
.se-orbit-wrap.se-clustered .se-orbit-thumb {
    box-shadow: 0 0 0 3px hsla(var(--cluster-hue, 280), 70%, 60%, 0.7);
    transition: box-shadow 400ms ease-out;
}
.se-orbit-wrap.se-cluster-winner {
    z-index: 11;
    filter: drop-shadow(0 0 12px hsla(var(--cluster-hue, 280), 70%, 60%, 0.7));
}

/* Cluster member highlighting */
.se-orbit-wrap.se-cluster-member {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 10;
    filter: drop-shadow(0 0 8px rgba(147, 51, 234, 0.6));
    transition: transform 400ms ease-out, opacity 400ms ease-out, filter 400ms ease-out;
}
.se-orbit-wrap.se-cluster-dimmed {
    opacity: 0.25;
    transition: opacity 400ms ease-out;
}
.se-orbit-wrap.se-unclustered {
    opacity: 0.25;
    transform: translate(-50%, -50%) scale(0.75);
    filter: grayscale(0.4);
    transition: opacity 600ms ease, transform 600ms ease, filter 600ms ease, left 800ms cubic-bezier(0.25, 1, 0.5, 1), top 800ms cubic-bezier(0.25, 1, 0.5, 1);
}
.se-orbit-wrap.se-unclustered:hover {
    opacity: 0.6;
    filter: grayscale(0);
    transform: translate(-50%, -50%) scale(0.85);
}

.se-line.se-line-cluster {
    stroke: rgba(147, 51, 234, 0.6) !important;
    stroke-width: 2.5 !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 3px rgba(147, 51, 234, 0.4));
}

/* Fork ghost nodes (items in multiple clusters) */
.se-fork-ghost {
    pointer-events: none;
}
.se-fork-ghost .se-orbit-thumb {
    border-style: dashed;
    opacity: 0.7;
}

/* Cluster group ring (SVG) */
.se-cluster-group-ring {
    opacity: 0;
}
@keyframes fadeIn {
    to { opacity: 1; }
}

/* Analysis overlay — floating cluster cards on canvas */
.se-analysis-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(147, 51, 234, 0.3) transparent;
    z-index: 30;
    pointer-events: auto;
    padding: 4px;
}

.se-analysis-cluster {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(16, 16, 32, 0.9);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all 200ms ease;
    min-width: 140px;
    max-width: 220px;
    opacity: 0;
    transform: translateY(12px);
    animation: clusterReveal 300ms ease-out forwards;
}
@keyframes clusterReveal {
    to { opacity: 1; transform: translateY(0); }
}
.se-analysis-cluster:hover {
    border-color: rgba(147, 51, 234, 0.3);
    background: rgba(147, 51, 234, 0.08);
}
.se-analysis-cluster.active {
    border-color: rgba(147, 51, 234, 0.6);
    background: rgba(147, 51, 234, 0.12);
}

.se-cluster-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.se-cluster-label { font-size: calc(13px * var(--type-scale, 1)); color: rgba(255, 255, 255, 0.9); font-weight: 600; }
.se-cluster-score {
    font-size: calc(10px * var(--type-scale, 1)); color: rgba(147, 51, 234, 0.8); font-weight: 600;
    margin-left: 8px; padding: 1px 5px;
    background: rgba(147, 51, 234, 0.12); border-radius: 4px;
    white-space: nowrap;
}
.se-cluster-meta { display: flex; gap: 8px; font-size: calc(10px * var(--type-scale, 1)); color: rgba(255, 255, 255, 0.4); }

/* Entity promotion form */
.se-promote-section { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.se-promote-form { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.se-promote-name {
    flex: 1; min-width: 60px;
    padding: 3px 6px; font-size: calc(11px * var(--type-scale, 1));
    border-radius: 6px;
    border: 1px solid rgba(147, 51, 234, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.9);
    outline: none;
}
.se-promote-name:focus { border-color: rgba(147, 51, 234, 0.6); }
.se-promote-type {
    padding: 3px 4px; font-size: calc(11px * var(--type-scale, 1));
    border-radius: 6px;
    border: 1px solid rgba(147, 51, 234, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.9);
    outline: none;
}
.se-promote-btn {
    padding: 3px 8px; font-size: calc(10px * var(--type-scale, 1));
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.15);
    color: rgba(16, 185, 129, 0.9);
    cursor: pointer;
    white-space: nowrap;
    transition: all 200ms;
}
.se-promote-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.7);
}
.se-promote-hint { font-size: calc(9px * var(--type-scale, 1)); color: rgba(16, 185, 129, 0.4); margin-top: 2px; text-align: right; }

/* ============================================================================
 * EMPTY / LOADING STATES
 * ============================================================================ */

.se-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}
.se-empty-icon { font-size: calc(48px * var(--type-scale, 1)); opacity: 0.3; margin-bottom: 16px; }
.se-empty-text {
    font-size: calc(14px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.5);
    max-width: 280px;
    line-height: 1.5;
}

/* crisp-anchoring-cradle S3 D3-C: tagged-persons fallback in the Constellation
 * empty state. When no co-tagged media exists for an anchor but the anchor
 * has tagged persons of its own, those persons surface as navigable chips. */
.se-empty-with-persons .se-empty-text {
    max-width: 360px;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 18px;
}
.se-person-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 480px;
}
.se-person-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fef3c7;
    font-size: calc(14px * var(--type-scale, 1));
    font-weight: 500;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.se-person-chip:hover,
.se-person-chip:focus-visible {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.75);
    outline: none;
}
.se-person-chip:active {
    transform: scale(0.97);
}
.se-person-chip-icon {
    font-size: calc(16px * var(--type-scale, 1));
    line-height: 1;
}
.se-person-chip-name {
    white-space: nowrap;
}
.se-person-chip-count {
    font-size: calc(11px * var(--type-scale, 1));
    color: rgba(254, 243, 199, 0.65);
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.18);
}
.se-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.se-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
 * MOBILE — list-only mode
 * ============================================================================ */

.se-mobile-anchor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(16, 16, 32, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}
.se-mobile-anchor:active { background: rgba(245, 158, 11, 0.08); }
.se-mobile-anchor-thumb {
    width: 60px; height: 60px;
    border-radius: 10px;
    border: 2px solid rgba(245, 158, 11, 0.6);
    object-fit: cover;
    background: #1a1f2e;
    flex-shrink: 0;
}
.se-mobile-anchor-info { flex: 1; min-width: 0; }
.se-mobile-anchor-title {
    font-size: calc(14px * var(--type-scale, 1));
    font-weight: 600;
    color: rgba(245, 158, 11, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.se-mobile-anchor-count {
    font-size: calc(12px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
}

.se-overlay.se-mobile { left: 0; top: 0; }
.se-overlay.se-mobile .se-main-area { flex-direction: column; }
.se-overlay.se-mobile .se-canvas { flex: 0; overflow: visible; }
.se-overlay.se-mobile .se-canvas svg { display: none; }
.se-overlay.se-mobile .se-drawer { flex: 1; width: 100%; border-left: none; }
.se-overlay.se-mobile .se-breadcrumb-bar { padding: 6px 12px; }
.se-overlay.se-mobile .se-crumb { font-size: calc(11px * var(--type-scale, 1)); max-width: 120px; }
.se-overlay.se-mobile .se-toolbar { flex-wrap: wrap; gap: 4px; }
.se-overlay.se-mobile .se-toolbar-controls { order: 10; width: 100%; }
.se-overlay.se-mobile .se-origin-trail { display: none; }
.se-overlay.se-mobile .se-origin-hop-count { display: inline; }
.se-overlay.se-mobile .se-origin-text { max-width: 140px; }

/* ============================================================================
 * CLUSTER ZOOM — Cluster constellation and galaxy view
 * ============================================================================ */

.se-cluster-center {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: translate(-50%, -50%);
    z-index: 5;
}
.se-cluster-center-thumb {
    width: 180px; height: 60px;
    border-radius: 8px;
    border: 3px solid rgba(168, 85, 247, 0.7);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.2), 0 0 60px rgba(168, 85, 247, 0.06);
    object-fit: cover;
    background: #1a1f2e;
    transition: transform 200ms ease;
}
.se-cluster-center:hover .se-cluster-center-thumb { transform: scale(1.05); }
.se-cluster-center-info { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.se-cluster-center-label {
    font-size: calc(12px * var(--type-scale, 1)); color: rgba(168, 85, 247, 0.9);
    font-weight: 600; max-width: 200px;
    text-align: center; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.se-cluster-center-badge { font-size: calc(10px * var(--type-scale, 1)); color: rgba(255, 255, 255, 0.5); letter-spacing: 0.3px; }

/* ── Cluster orbit items ── */
.se-cluster-orbit .se-cluster-thumb-wrap { position: relative; display: inline-block; }
.se-cluster-orbit-thumb { aspect-ratio: 3 / 1; object-fit: cover; border-radius: 6px !important; }
.se-cluster-orbit.se-ring-1 .se-cluster-orbit-thumb { width: 120px; height: 40px; }
.se-cluster-orbit.se-ring-2 .se-cluster-orbit-thumb { width: 96px; height: 32px; }

.se-cluster-badge {
    position: absolute;
    top: -6px; right: -8px;
    background: rgba(168, 85, 247, 0.9);
    color: #fff;
    font-size: calc(9px * var(--type-scale, 1)); font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.4;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.se-line-cluster-child { stroke: rgba(168, 85, 247, 0.35); stroke-width: 1.5; }
.se-line-cluster-sibling { stroke: rgba(100, 116, 139, 0.25); stroke-width: 1; stroke-dasharray: 4 4; }

.se-cluster-more {
    position: absolute;
    transform: translateX(-50%);
    font-size: calc(10px * var(--type-scale, 1));
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

/* ── Galaxy center ── */
.se-galaxy-center {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transform: translate(-50%, -50%);
    z-index: 5;
}
.se-galaxy-icon { font-size: calc(36px * var(--type-scale, 1)); filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.4)); }
.se-galaxy-label {
    font-size: calc(16px * var(--type-scale, 1)); font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-align: center; line-height: 1.3;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}
.se-galaxy-count { font-size: calc(11px * var(--type-scale, 1)); color: rgba(168, 85, 247, 0.7); letter-spacing: 0.5px; }

/* ── Cluster sidebar sections (used in drawer) ── */
.se-cluster-sidebar-section { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.se-cluster-sidebar-heading {
    font-size: calc(10px * var(--type-scale, 1)); font-weight: 600;
    color: rgba(168, 85, 247, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 16px 6px;
}
.se-cluster-list-badge {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.15);
    color: rgba(168, 85, 247, 0.9);
    font-size: calc(11px * var(--type-scale, 1)); font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.se-cluster-list-item { cursor: pointer; }
.se-cluster-list-item:hover { background: rgba(168, 85, 247, 0.08); }

/* ── Child vs sibling orbit distinction ── */
.se-orbit-child .se-orbit-thumb { border-color: rgba(168, 85, 247, 0.4); }
.se-orbit-child:hover .se-orbit-thumb,
.se-orbit-child.se-highlighted .se-orbit-thumb {
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.4);
}
.se-orbit-sibling .se-orbit-thumb { border-color: rgba(100, 116, 139, 0.3); }
.se-orbit-sibling:hover .se-orbit-thumb,
.se-orbit-sibling.se-highlighted .se-orbit-thumb {
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

/* ============================================================================
 * THUMBNAIL FALLBACK CHAIN — branded fallback replaces broken-image glyph
 * when thumbnail_url 404s or is missing. Engaged by sesHandleThumbError
 * adding .se-thumb-broken to the wrap.
 * ============================================================================ */

.se-thumb-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.9), rgba(15, 15, 32, 0.9));
    color: rgba(245, 158, 11, 0.75);
    border-radius: inherit;
    box-sizing: border-box;
    padding: 2px;
    pointer-events: none;
}
.se-thumb-fallback-icon {
    font-size: calc(18px * var(--type-scale, 1));
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}
.se-thumb-fallback-ext {
    font-size: calc(8px * var(--type-scale, 1));
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.65);
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.35);
    text-transform: uppercase;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Reveal the fallback when the image errored or was absent. */
.se-thumb-wrap.se-thumb-broken .se-thumb-fallback,
.se-list-thumb-wrap.se-thumb-broken .se-thumb-fallback,
.se-mobile-anchor-hero.se-thumb-broken .se-thumb-fallback {
    display: flex;
}

/* Per-type fallback tint — matches the type-color identity used on borders. */
.se-thumb-wrap.se-mt-document .se-thumb-fallback,
.se-list-thumb-wrap.se-mt-document .se-thumb-fallback { color: rgba(74, 144, 217, 0.9); }
.se-thumb-wrap.se-mt-video .se-thumb-fallback,
.se-list-thumb-wrap.se-mt-video .se-thumb-fallback { color: rgba(231, 76, 60, 0.9); }
.se-thumb-wrap.se-mt-audio .se-thumb-fallback,
.se-list-thumb-wrap.se-mt-audio .se-thumb-fallback { color: rgba(155, 89, 182, 0.9); }

/* Scale fallback icon up in the mobile hero slot. */
.se-mobile-anchor-hero .se-thumb-fallback-icon { font-size: calc(72px * var(--type-scale, 1)); }
.se-mobile-anchor-hero .se-thumb-fallback-ext { font-size: calc(14px * var(--type-scale, 1)); padding: 3px 10px; margin-top: 6px; }

/* ============================================================================
 * MOBILE — hero anchor slot + home-return button
 * S3 polish: focal thumbnail promoted to hero size; bail-back-to-origin
 * control shows 🏠 + originating filename.
 * ============================================================================ */

@media (max-width: 767px) {
    /* Reserve room below the constellation for the persistent mobile tab bar
       (Home + Fergi AI). Per user directive (2026-04-20), the Control Panel
       must be visible on every mobile screen — including Find Clusters. */
    .se-overlay.se-mobile {
        bottom: calc(
            var(--mobile-tab-bar-height, 56px)
            + env(safe-area-inset-bottom, 0px)
        );
    }

    .se-overlay.se-mobile .se-mobile-anchor.se-mobile-anchor-v {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 0 14px;
    }
    .se-overlay.se-mobile .se-mobile-anchor-hero {
        position: relative;
        width: 100%;
        height: min(35vh, 280px);
        background: #0b0d18;
        border-radius: 0;
        border: none;
        border-bottom: 2px solid rgba(245, 158, 11, 0.45);
        overflow: hidden;
        flex-shrink: 0;
    }
    .se-overlay.se-mobile .se-mobile-anchor-hero .se-mobile-anchor-thumb {
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 0;
        object-fit: contain;
        background: #0b0d18;
    }
    .se-overlay.se-mobile .se-mobile-anchor-v .se-mobile-anchor-info {
        padding: 0 20px;
    }
    .se-overlay.se-mobile .se-mobile-anchor-v .se-mobile-anchor-title {
        font-size: calc(15px * var(--type-scale, 1));
        white-space: normal;
        line-height: 1.3;
    }
    .se-overlay.se-mobile .se-mobile-anchor-v .se-mobile-anchor-count {
        font-size: calc(12px * var(--type-scale, 1));
    }

    /* Home-return button — larger tap target, 🏠 + truncated origin title. */
    .se-overlay.se-mobile .se-origin-return.se-origin-return-mobile {
        min-height: 32px;
        padding: 6px 12px;
        font-size: calc(12px * var(--type-scale, 1));
        border-radius: 16px;
        max-width: 58%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Give the origin banner more vertical room for the larger button. */
    .se-overlay.se-mobile .se-origin-banner { height: auto; min-height: 44px; padding-top: 8px; padding-bottom: 8px; }

    /* I5 (steady-piloting-compass): connected-media list thumbs much larger on mobile.
       Desktop uses 40px squares which are tap-hostile and visually weak on phones. */
    .se-overlay.se-mobile .se-list-thumb,
    .se-overlay.se-mobile .se-list-thumb-wrap {
        width: 84px;
        height: 84px;
    }
    .se-overlay.se-mobile .se-list-item {
        padding: 10px 14px;
        gap: 12px;
        min-height: 96px;
    }
    .se-overlay.se-mobile .se-list-title {
        font-size: calc(15px * var(--type-scale, 1));
        white-space: normal;
        line-height: 1.3;
    }
    .se-overlay.se-mobile .se-list-meta {
        font-size: calc(12px * var(--type-scale, 1));
        margin-top: 4px;
    }
    .se-overlay.se-mobile .se-list-strength { width: 56px; }
}
