/* media — rules used only by this feature, split out of the global stylesheets so other routes do not
   download them. Loaded with the feature (public/features.json), directly after style.css in the cascade.
   Split by class/id ownership with cascade-order checks; edit freely. */
/*  ── from style.css ──  */
.vod-group-card:hover .vod-group-count { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.vod-group-hint { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 0.72rem; font-weight: 700;
    color: var(--accent-light, var(--accent)); background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 8px; padding: 5px 11px; cursor: pointer;
    transition: background .15s, border-color .15s, transform .12s; font-family: inherit; }
.vod-group-hint:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-1px); }
.vod-group-chev { transition: transform .22s ease; font-size: .68rem; }
.vod-group-card.expanded .vod-group-chev { transform: rotate(180deg); }
.vod-group-parts::before { content: ''; display: block; grid-column: 1 / -1; height: 1px; background: var(--border); margin: 2px 0 6px; }
.badge-unlisted {
    display: inline-block;
    background: var(--text-muted); color: #fff;
    padding: 2px 8px; border-radius: var(--radius-sm);
    font-size: 0.75rem; font-weight: 600; margin-bottom: 6px;
}
.vc-progress-wrap:hover .vc-progress-bar {
    height: 6px;
}
.vc-progress-wrap:hover .vc-progress-fill::after,
.vc-progress-wrap:active .vc-progress-fill::after {
    transform: translateY(-50%) scale(1.28);
}
.vc-speed-btn {
    font-size: 0.7rem; padding: 2px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.85);
    font-family: var(--font-mono);
    border: none; cursor: pointer;
    transition: all 0.2s;
}
.vc-speed-btn:hover { background: rgba(255,255,255,0.2); color: var(--accent-light); }
.vod-player-container video,
.vod-player-container .vod-video {
    width: 100%; max-height: 70vh;
    display: block; object-fit: contain;
}
.vod-player-container .video-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 0; opacity: 0;
    transition: opacity 0.3s; z-index: 5;
}
.vp-live-badge {
    background: #e53e3e; color: #fff;
    padding: 4px 10px; border-radius: 4px;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 5px;
}
.vp-jump-live-btn {
    background: rgba(255,255,255,0.15); color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 10px; border-radius: 4px;
    font-size: 11px; cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.vp-live-mode .vc-progress-fill { background: #e53e3e; }
.vp-live-mode .vc-progress-fill::after { background: #e53e3e; }
.vod-player-container:fullscreen video { max-height: 100vh; }
.vod-player-container:fullscreen .video-overlay { opacity: 0; }
.vod-player-container:fullscreen:hover .video-overlay { opacity: 1; }
@media (max-width: 900px) {
    .vod-player-row { flex-direction: column; }
    .chat-replay-sidebar {
        width: 100%; max-height: 280px;
        border-left: none; border-top: 1px solid var(--border);
    }
}
@media (max-width: 768px) {
    .vod-player-info,
    .comments-section { padding: 16px; border-radius: 16px; }
    .vod-player-row {
        flex-direction: column;
        max-height: none; /* remove desktop height constraint */
        border-radius: 12px;
    }
    .chat-replay-sidebar {
        width: 100%;
        max-height: 250px;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .vod-player-layout { gap: 12px; }
    .vod-player-meta { gap: 8px; font-size: 0.82rem; }
    .vod-extra-details { flex-wrap: wrap; }
    .vod-extra-details .detail-chip { font-size: 0.72rem; }
}

@media (max-width: 480px) {
    .vod-player-info { padding: 12px; border-radius: 12px; }
    .comments-section { padding: 12px; border-radius: 12px; }
    .chat-replay-sidebar { max-height: 200px; }
}
.vod-player-layout { max-width: 1200px; margin: 0 auto; }
.vod-player-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.vod-video {
    width: 100%; max-height: 70vh; background: #000;
    border-radius: 0; display: block;
}
.vod-player-info { margin-bottom: 24px; }
.vod-player-info {
    background: rgba(22,22,26,0.74);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}
.vod-player-meta {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
    margin-bottom: 12px; font-size: 0.9rem;
}
.vod-player-streamer {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600;
}
.vod-player-description {
    color: var(--text-secondary); font-size: 0.9rem;
    line-height: 1.5; white-space: pre-wrap;
}
.vod-source-info {
    margin-top: 6px; font-size: 0.85rem;
    color: var(--text-muted); display: flex; align-items: center; gap: 6px;
}
.vod-private-notice {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 300px; background: var(--bg-secondary);
    border-radius: var(--radius); border: 1px solid var(--border);
}
.vod-extra-details {
    display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px;
    font-size: 0.8rem; color: var(--text-muted);
}
.vod-extra-details .detail-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--bg-secondary); padding: 3px 10px;
    border-radius: 12px; border: 1px solid var(--border);
}
.clip-modal {
    background: var(--bg-card, #1e1e24); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px; width: 100%; max-width: 720px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6); overflow: hidden;
    animation: modalSlideUp 0.25s ease;
}
.clip-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.clip-modal-close {
    background: none; border: none; color: var(--text-secondary); cursor: pointer;
    padding: 6px 8px; border-radius: 8px; font-size: 1.1rem; transition: all 0.15s;
}
.clip-modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.clip-modal-body { padding: 16px 20px 12px; }
.clip-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 20px 16px; border-top: 1px solid rgba(255,255,255,0.07);
}
.clip-preview-video { width: 100%; height: 100%; object-fit: contain; display: block; }
.clip-preview-wrap:hover .clip-preview-play-btn { opacity: 1; }
.clip-preview-play-btn:hover { background: rgba(0,0,0,0.5); }
.clip-timeline-section { margin-bottom: 16px; }
.clip-timeline-label {
    font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 8px;
}
.clip-handle-grip {
    width: 12px; height: 22px; border-radius: 4px;
    background: var(--accent, var(--accent)); border: 2px solid rgba(255,255,255,0.35);
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}
.clip-handle:hover .clip-handle-grip,
.clip-handle:active .clip-handle-grip {
    transform: scaleY(1.15); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 50%, transparent);
}
.clip-handle-start .clip-handle-grip { border-radius: 4px 2px 2px 4px; }
.clip-handle-end .clip-handle-grip { border-radius: 2px 4px 4px 2px; }
.clip-time-controls {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px;
}
.clip-time-field {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.clip-time-input-group {
    display: flex; align-items: center; gap: 4px;
}
.clip-nudge-btn {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary); cursor: pointer; border-radius: 6px;
    padding: 4px 7px; font-size: 0.75rem; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.clip-nudge-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.clip-nudge-btn.clip-nudge-sm { font-weight: 700; min-width: 26px; }
.clip-set-btn {
    background: none; border: none; color: var(--accent, var(--accent)); cursor: pointer;
    font-size: 0.72rem; padding: 2px 0; transition: opacity 0.15s; opacity: 0.75;
}
.clip-set-btn:hover { opacity: 1; text-decoration: underline; }
.clip-duration-number {
    font-size: 2rem; font-weight: 800; line-height: 1;
    font-variant-numeric: tabular-nums; color: var(--accent, var(--accent));
    transition: color 0.2s;
}
.clip-duration-number.clip-duration-over { color: #e53e3e; }
.clip-duration-number.clip-duration-zero { color: var(--text-muted); }
.clip-duration-label { font-size: 0.7rem; color: var(--text-secondary); }
.clip-duration-bar-wrap {
    width: 100%; height: 3px; border-radius: 2px;
    background: rgba(255,255,255,0.08); margin-top: 4px; overflow: hidden;
}
.clip-duration-bar {
    height: 100%; border-radius: 2px; transition: width 0.1s;
    background: var(--accent, var(--accent));
}
.clip-title-section { margin-bottom: 4px; }
.clip-title-section .form-input {
    width: 100%; box-sizing: border-box;
}
@media (max-width: 600px) {
    .clip-modal { max-width: 100%; border-radius: 14px; }
    .clip-time-controls { flex-direction: column; align-items: stretch; gap: 8px; }
    .clip-duration-number { font-size: 1.3rem; }
    .clip-time-field { flex-direction: column; }
    .clip-handle { width: 28px; height: 36px; }
    .clip-handle-grip { width: 16px; height: 28px; }
}
.vod-player-row {
    display: flex; gap: 0; margin-bottom: 16px;
    border-radius: 20px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    background: #000;
    box-shadow: var(--shadow-soft);
    max-height: 75vh; /* constrain so chat replay doesn't push off screen */
}
.chat-replay-sidebar {
    width: 340px; flex-shrink: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    min-height: 0; /* allow flex children to shrink */
    overflow: hidden;
}
.chat-replay-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    font-size: 0.85rem; flex-shrink: 0;
}
.chat-replay-messages {
    flex: 1; overflow-y: auto; padding: 8px 12px;
    font-size: 0.82rem; line-height: 1.45;
    min-height: 0;
}
.chat-replay-msg {
    padding: 3px 0; animation: fadeIn 0.3s ease;
}
.chat-replay-msg .cr-time {
    color: var(--text-muted); font-size: 0.72rem; margin-right: 6px;
    font-variant-numeric: tabular-nums;
}
.chat-replay-msg .cr-user {
    font-weight: 600; margin-right: 4px;
}
.chat-replay-msg .cr-text { color: var(--text-secondary); word-break: break-word; }
.chat-replay-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; color: var(--text-muted);
    text-align: center; gap: 8px; padding: 20px;
    font-size: 0.82rem;
}
.chat-replay-sidebar.no-data .chat-replay-header h4::after {
    content: '(no chat data)'; margin-left: 6px;
    font-weight: 400; font-size: 0.75rem; color: var(--text-muted);
}
.comments-section {
    margin-top: 0;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px;
    background: rgba(22,22,26,0.72);
    box-shadow: var(--shadow-soft);
}
.comments-count {
    font-size: 0.85rem; color: var(--text-muted); font-weight: 400;
}
.comment-form {
    margin-bottom: 20px;
}
.comment-form-actions {
    display: flex; justify-content: flex-end; margin-top: 8px; gap: 8px;
}
.comments-list { display: flex; flex-direction: column; gap: 0; }
.stream-card-date {
    margin-left: auto; font-size: 0.75rem;
    color: var(--text-muted); white-space: nowrap;
}
@media (max-width: 900px) {
    .chat-replay-sidebar { width: 100% !important; max-height: min(60vh, 520px) !important; }
    .vod-player-row { max-height: none !important; }
}

.vod-ai-timeline {
    margin-top: 12px; display: flex; flex-direction: column; gap: 4px;
    max-height: 320px; overflow-y: auto;
    border: 1px solid var(--border, rgba(255,255,255,0.1)); border-radius: 10px; padding: 10px 12px;
    background: rgba(255,255,255,0.02);
}
.vod-ai-timeline-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; color: var(--accent, var(--accent)); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.vod-ai-timeline-hint {
    font-weight: 500; font-size: 0.72rem; color: var(--text-muted, #999);
    background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    padding: 1px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px;
}
.vod-ai-memory {
    display: flex; align-items: flex-start; gap: 10px; text-align: left; width: 100%;
    background: none; border: 1px solid transparent; color: inherit; cursor: pointer; padding: 6px 8px; border-radius: 7px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.vod-ai-memory:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.vod-ai-memory:active { transform: scale(0.99); }
.vod-ai-memory-play { font-size: 0.62rem; opacity: 0.55; transition: opacity 0.15s, transform 0.15s; }
.vod-ai-memory:hover .vod-ai-memory-play { opacity: 1; transform: scale(1.15); }
.vod-ai-memory-d { font-size: 0.82rem; color: var(--text-secondary, #bbb); line-height: 1.35; }
.vp-seek-flash { animation: vpSeekFlash 0.7s ease-out; }
.vp-visibility-control {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 6px 3px 10px; border-radius: 8px;
    border: 1px solid var(--border, rgba(255,255,255,0.12)); background: rgba(255,255,255,0.03);
}
.vp-visibility-icon { color: var(--accent, var(--accent)); font-size: 0.85rem; }
.vp-visibility-control select { border: none; background: transparent; padding: 4px 6px; }
.media-ai-overview {
    margin: 8px 0 10px; padding: 10px 12px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: 8px; font-size: 0.9rem; line-height: 1.5;
}
.media-ai-label { color: var(--accent); font-weight: 700; margin-right: 6px; }
.media-ai-text { color: var(--text-secondary); }
.media-transcript {
    margin: 10px 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    overflow: hidden;
}
.media-transcript-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
}
.media-transcript-toggle {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-primary); font-weight: 600; font-size: 0.9rem; text-align: left;
    padding: 2px 0;
}
.media-transcript-meta {
    font-size: 0.72rem; font-weight: 500; color: var(--text-muted);
}
.media-transcript-caret {
    margin-left: auto; font-size: 0.75rem; color: var(--text-secondary);
    transition: transform 0.2s ease;
}
.media-transcript.open .media-transcript-caret { transform: rotate(180deg); }
.media-transcript-dl { flex-shrink: 0; }
.media-transcript-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 1px solid transparent;
}
.media-transcript.open .media-transcript-body {
    max-height: 440px; overflow-y: auto;
    border-top-color: var(--border);
}
.media-transcript-text {
    white-space: pre-wrap; word-break: break-word;
    line-height: 1.6; font-size: 0.85rem; color: var(--text-secondary);
    padding: 12px; margin: 0;
}
.media-transcript-segs { display: flex; flex-direction: column; padding: 6px; gap: 1px; }
.ts-seg:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text-primary); }
.ts-text { flex: 1; }
