.viewer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
}

.viewer__panel {
    position: relative;
    width: min(900px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: rgba(6, 6, 6, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.75);
}

.viewer__close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 2;
    transition: background .2s var(--ease), color .2s var(--ease);
    display: grid;
    place-items: center;
    line-height: 1;
}

.viewer__close:hover {
    background: var(--surface-3);
    color: var(--text);
}

.viewer__header h3 {
    margin: 0 2.5rem .3rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.viewer__meta {
    margin: 0 0 1rem;
    font-size: .78rem;
    color: var(--text-subtle);
}

.viewer__media {
    display: grid;
    place-items: center;
    min-height: 180px;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.viewer__image {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
}

.viewer__video {
    width: 100%;
    max-height: 65vh;
}

.viewer__prompt {
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.viewer__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.viewer__loading,
.viewer__error {
    padding: 2.5rem;
    color: var(--text-muted);
    text-align: center;
}

.viewer__thread {
    margin: -.25rem 0 1rem;
    padding: .65rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.viewer__thread-label {
    margin: 0 0 .45rem;
    font-size: .68rem;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.viewer__thread-strip {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
}

.viewer__thread-item {
    position: relative;
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    background: #000;
    cursor: pointer;
    transition: border-color .2s, transform .2s;
}

.viewer__thread-item:hover { transform: translateY(-2px); }

.viewer__thread-item--active {
    border-color: var(--accent);
}

.viewer__thread-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewer__thread-item__badge {
    position: absolute;
    left: .2rem;
    bottom: .2rem;
    padding: .06rem .28rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: .55rem;
    font-weight: 700;
}