:root {
  color-scheme: dark;
  --bg: #090a0d;
  --surface: #101216;
  --surface-2: #171a20;
  --text: #f5f5f1;
  --muted: #8b909a;
  --line: rgba(255,255,255,.09);
  --accent: #9ee8cb;
  --accent-ink: #10251d;
  --danger: #ff7262;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
.cloud-shortcut { color: var(--accent); font-size: 13px; text-decoration: none; white-space: nowrap; }
.cloud-download { border-bottom: 1px solid var(--line); padding: 24px 0; scroll-margin-top: 85px; }
.cloud-download summary { cursor: pointer; font-size: 18px; font-weight: 650; }
.cloud-download summary h2 { display: inline; margin: 0; font-size: inherit; font-weight: inherit; }
.cloud-download summary span { margin-left: 12px; font-size: 12px; font-weight: 400; color: var(--muted); }
.cloud-download form { margin-top: 22px; }
.cloud-download form > label { display: block; margin-bottom: 8px; font-size: 13px; }
.cloud-download textarea { display: block; width: 100%; resize: vertical; min-height: 110px; max-height: 420px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; line-height: 1.6; caret-color: var(--accent); }
.cloud-download textarea::placeholder { color: #a1a7b0; }
.cloud-download :is(button, textarea, select, a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.cloud-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 12px; }
.cloud-mode { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-left: auto; }
.cloud-mode select { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); padding: 8px; }
.cloud-feedback { min-height: 20px; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.cloud-preview, .cloud-tasks { list-style: none; padding: 0; margin: 0; }
.cloud-preview { max-height: 180px; overflow: auto; color: var(--muted); font-size: 12px; }
.cloud-preview li { padding: 5px 0; overflow-wrap: anywhere; }
.cloud-history-head { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.cloud-history-head h3 { font-size: 14px; font-weight: 600; }
.library-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 22px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.library-footer a { color: var(--accent); text-decoration: none; padding: 8px 0; }
.library-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.library-footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.library-footer a span { margin-left: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cloud-tasks { max-height: 420px; overflow: auto; }
.cloud-task { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .55fr) auto; align-items: center; gap: 20px; min-height: 62px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; font-variant-numeric: tabular-nums; }
.cloud-task strong { font-weight: 500; overflow-wrap: anywhere; }
.cloud-task-state { color: var(--muted); overflow-wrap: anywhere; }
.cloud-task-state[data-state="ready"] { color: var(--accent); }
.cloud-task-state[data-state="error"] { color: var(--danger); }
.cloud-task-actions { display: flex; gap: 12px; }
.cloud-empty { padding: 16px 0; color: var(--muted); font-size: 13px; }
@media (max-width: 700px) {
  .library-page .topbar { height: auto; min-height: 72px; flex-wrap: wrap; padding-block: 14px; gap: 14px; }
  .library-page .topbar-actions { flex-wrap: wrap; gap: 12px; }
  .cloud-task { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .cloud-task strong { grid-column: 1 / -1; }
  .cloud-download summary span { display: inline-block; }
  .cloud-mode { margin-left: 0; }
}
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
.topbar { height: 72px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: rgba(9,10,13,.86); backdrop-filter: blur(18px); }
.brand { color: var(--text); text-decoration: none; font-weight: 760; letter-spacing: -.02em; display: inline-flex; gap: 11px; align-items: center; }
.brand-mark { width: 11px; height: 22px; background: var(--accent); border-radius: 2px 9px 2px 9px; transform: skew(-8deg); box-shadow: 0 0 22px rgba(217,255,67,.35); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.service-state { color: var(--muted); font-size: 13px; }
.primary-button { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); font-weight: 750; cursor: pointer; transition: transform .18s ease, opacity .18s ease; }
.primary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: .48; cursor: wait; }
.logout-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; padding: 8px 2px; }
.logout-button:hover { color: var(--text); }
.workspace { width: min(1460px, 92vw); margin: 0 auto; }
.overview { min-height: 380px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 10vw; align-items: end; padding: 9vh 0 64px; border-bottom: 1px solid var(--line); animation: rise .5s ease both; }
.eyebrow { margin: 0 0 14px; color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 800; }
.overview h1 { margin: 0; font-size: clamp(50px, 6vw, 96px); line-height: .9; letter-spacing: -.065em; max-width: 820px; white-space: nowrap; }
.subcopy { color: var(--muted); max-width: 560px; font-size: 16px; line-height: 1.65; margin: 28px 0 0; }
.capacity { padding-bottom: 8px; }
.capacity-copy { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 13px; }
.capacity-copy strong { font-size: 30px; color: var(--text); letter-spacing: -.04em; }
.capacity-track { height: 4px; background: var(--surface-2); margin: 15px 0 12px; overflow: hidden; }
.capacity-track span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .7s cubic-bezier(.2,.8,.2,1), background .2s; }
.capacity small { color: var(--muted); }
.library { padding: 56px 0 100px; }
.library-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.library h2 { font-size: 28px; letter-spacing: -.04em; margin: 0 0 7px; }
.library-head p { margin: 0; color: var(--muted); font-size: 13px; }
.library-tools { display: flex; align-items: flex-end; gap: 24px; }
.sort-control { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.sort-control select { min-width: 150px; border: 0; border-bottom: 1px solid var(--line); outline: none; appearance: none; background: var(--bg); color: var(--text); padding: 10px 20px 10px 2px; cursor: pointer; }
.sort-control select:focus { border-color: var(--accent); }
.search { min-width: min(400px, 45vw); display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 10px 2px; }
.search span { color: var(--accent); font-size: 20px; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.root-status { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 20px; }
.root-chip { color: var(--muted); font-size: 12px; border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; }
.root-chip[data-status="complete"] { color: var(--text); }
.root-chip[data-status="running"] { border-color: rgba(217,255,67,.45); color: var(--accent); }
.media-list { border-top: 1px solid var(--line); }
.media-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 130px 160px; gap: 24px; align-items: center; min-height: 72px; border-bottom: 1px solid var(--line); animation: fade .3s ease both; }
.media-name { overflow: hidden; }
.media-name strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.media-name small, .media-meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-link { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 720; text-align: right; }
.media-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; position: relative; }
.media-organize { position: relative; color: var(--muted); font-size: 12px; }
.media-organize summary { cursor: pointer; list-style: none; }
.media-organize summary::-webkit-details-marker { display: none; }
.media-organize > div { position: absolute; z-index: 4; right: 0; top: calc(100% + 8px); display: flex; flex-direction: column; min-width: 104px; max-width: calc(100vw - 40px); padding: 6px; gap: 4px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.media-organize button { border: 0; background: transparent; color: var(--text); min-height: 40px; padding: 9px 12px; text-align: left; font-size: 12px; cursor: pointer; }
.media-organize button:hover { color: var(--accent); }
.empty { color: var(--muted); padding: 44px 0; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 24px 0; color: var(--muted); font-size: 12px; }
.pagination button { border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); padding: 8px 13px; cursor: pointer; }
.pagination button:disabled { opacity: .32; cursor: default; }
.back-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.player-page { min-height: 100vh; }
.player-topbar { position: relative; }
.player-shell { width: min(1500px, 100%); margin: 0 auto; padding: clamp(16px, 3vw, 42px); }
.video-stage { --video-ratio: 1.7777778; position: relative; display: flex; justify-content: center; align-items: center; width: min(100%, calc((100svh - 180px) * var(--video-ratio))); min-height: 240px; margin-inline: auto; background: #000; overflow: hidden; }
.video-player-frame { width: 100%; aspect-ratio: var(--video-ratio); max-height: calc(100svh - 180px); background: #000; touch-action: pan-y pinch-zoom; }
.video-player-frame video { object-fit: contain; }
.video-player-frame video-player, .video-player-frame video-skin, .native-video { width: 100%; height: 100%; }
.video-player-frame video-skin { display: block; --media-accent-color: var(--accent); --media-accent-text-color: var(--accent-ink); --media-video-border-radius: 0; }
.video-loading { position: absolute; z-index: 20; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: #050506; color: var(--muted); transition: opacity .3s ease; }
.video-loading.hidden { opacity: 0; pointer-events: none; }
.video-loading span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.web-fullscreen-toggle { position: absolute; z-index: 18; top: 14px; left: 14px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; padding: 0; color: #fff; background: rgba(10,11,14,.82); box-shadow: 0 8px 24px rgba(0,0,0,.28); backdrop-filter: blur(12px); cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.web-fullscreen-toggle:hover { background: rgba(24,27,32,.94); border-color: rgba(158,232,203,.55); transform: translateY(-1px); }
.web-fullscreen-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.web-fullscreen-toggle .fullscreen-exit-icon { display: none; }
.web-fullscreen-toggle[aria-pressed="true"] .fullscreen-enter-icon { display: none; }
.web-fullscreen-toggle[aria-pressed="true"] .fullscreen-exit-icon { display: block; }
.web-fullscreen-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.seek-progress { position: absolute; z-index: 17; left: 16px; right: 16px; bottom: 10px; height: 3px; overflow: hidden; border-radius: 2px; background: rgba(255,255,255,.25); pointer-events: none; opacity: 0; }
.seek-progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.seek-progress.is-visible { opacity: 1; }
.has-web-fullscreen { overflow: hidden; overscroll-behavior: none; }
.video-stage.is-web-fullscreen { position: fixed; z-index: 1000; inset: 0; width: 100dvw; height: 100dvh; min-height: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border: 0; border-radius: 0; background: #000; }
.video-stage.is-web-fullscreen .video-player-frame, .video-stage.is-web-fullscreen .video-player-frame.is-portrait { --media-border-radius: 0; width: min(100%, calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * var(--video-ratio))); max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); touch-action: none; }
.video-stage.is-web-fullscreen .video-player-frame, .video-stage.is-web-fullscreen media-i18n, .video-stage.is-web-fullscreen video-player, .video-stage.is-web-fullscreen video-skin, .video-stage.is-web-fullscreen video { border-radius: 0 !important; }
.video-stage.is-web-fullscreen .web-fullscreen-toggle { top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); }
.player-info { padding: 30px 0 70px; }
.player-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.player-heading h1 { max-width: 980px; font-size: clamp(22px, 3vw, 38px); line-height: 1.22; letter-spacing: -.045em; margin: 0; overflow-wrap: anywhere; }
.external-players { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 280px; }
.external-players > span { color: var(--muted); font-size: 12px; margin-right: 4px; }
.external-player { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: transparent; color: var(--text); padding: 8px 12px; border-radius: 999px; font-size: 12px; line-height: normal; text-decoration: none; cursor: pointer; touch-action: manipulation; transition: border-color .16s ease, color .16s ease, transform .16s ease; }
.external-player:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.external-player-primary { border-color: rgba(217,255,67,.45); }
.external-player:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.external-player:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.organize-media { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.organize-media[hidden] { display: none; }
.organize-media > span { color: var(--muted); font-size: 12px; margin-right: 4px; }
.organize-media button { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px; padding: 8px 13px; font-size: 12px; cursor: pointer; transition: border-color .16s ease, color .16s ease; }
.organize-media button:hover { border-color: var(--accent); color: var(--accent); }
.organize-media button:disabled { opacity: .35; cursor: wait; }
.player-media-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; }
.player-media-actions .organize-media { margin-top: 0; }
.delete-media, .media-delete { border: 0; background: transparent; color: var(--danger); font-size: 12px; cursor: pointer; }
.delete-media { min-height: 36px; border: 1px solid rgba(255,107,122,.28); border-radius: 8px; padding: 8px 12px; }
.delete-media:hover, .media-delete:hover { color: #ff8795; }
.delete-media:hover { border-color: rgba(255,107,122,.7); background: rgba(255,107,122,.06); }
.delete-media:disabled, .media-delete:disabled { opacity: .4; cursor: wait; }
.media-delete { padding: 8px 0; }
.media-facts { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); margin: 34px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.media-facts div { padding: 16px 0; font-size: 13px; }
.media-facts dt { color: var(--muted); margin-bottom: 6px; }
.media-facts dd { margin: 0; }
.episode-panel { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 28px; }
.episode-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.episode-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.episode-heading > span { color: var(--muted); font-size: 12px; }
.episode-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--line); }
.episode-link { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.episode-link:hover, .episode-link[aria-current="true"] { color: var(--accent); background: rgba(217,255,67,.035); }
.episode-link span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.episode-link small { flex: none; color: var(--muted); }
.episode-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding-top: 16px; color: var(--muted); font-size: 12px; }
.episode-pagination button { border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); padding: 7px 12px; cursor: pointer; }
.episode-pagination button:disabled { opacity: .32; cursor: default; }
.player-notice { color: var(--accent); font-size: 13px; line-height: 1.5; }
.player-error { color: var(--danger); font-size: 13px; line-height: 1.5; }
.login-page { display: grid; place-items: center; background: #07080a; }
.login-shell { width: min(100%, 520px); padding: 32px; }
.login-panel { border-top: 1px solid var(--line); padding-top: 26px; animation: rise .45s ease both; }
.login-copy { margin: 12vh 0 48px; }
.login-copy h1 { margin: 0; font-size: clamp(38px, 8vw, 62px); line-height: .96; letter-spacing: -.06em; }
.login-copy > p:last-child { color: var(--muted); line-height: 1.65; max-width: 420px; margin: 22px 0 0; }
.login-form { display: grid; gap: 12px; }
.login-form label { color: var(--muted); font-size: 12px; }
.login-form input { width: 100%; border: 0; border-bottom: 1px solid var(--line); outline: none; background: transparent; color: var(--text); font-size: 18px; padding: 14px 2px; }
.login-form input:focus { border-color: var(--accent); }
.login-form .primary-button { justify-self: start; margin-top: 10px; min-width: 120px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 800px) {
  .overview { grid-template-columns: 1fr; gap: 48px; padding-top: 70px; }
  .overview h1 { white-space: normal; }
  .library-head { align-items: stretch; flex-direction: column; }
  .library-tools { width: 100%; align-items: stretch; flex-direction: column; gap: 12px; }
  .search { min-width: 100%; }
  .media-row { grid-template-columns: minmax(0, 1fr) 76px; gap: 14px; }
  .media-row .media-meta:nth-of-type(1), .media-row .media-meta:nth-of-type(2) { display: none; }
  .player-shell { padding: 12px; }
  .video-stage { width: min(100%, calc((100svh - 140px) * var(--video-ratio))); }
  .video-player-frame { width: 100%; max-height: calc(100svh - 140px); }
  .player-heading { flex-direction: column; }
  .external-players { min-width: 0; justify-content: flex-start; }
  .external-player { min-height: 42px; padding-inline: 14px; }
  .media-facts { grid-template-columns: repeat(2, 1fr); }
  .login-shell { padding: 24px; }
}

/* Media workspace: compact navigation, quiet surfaces, readable file rows. */
.topbar { height: 76px; background: rgba(9,10,13,.94); }
.brand { font-size: 19px; }
.brand-mark { box-shadow: none; width: 17px; height: 23px; border-radius: 4px; transform: none; clip-path: polygon(0 0,100% 50%,0 100%); }
.workspace { width: min(1460px, 90vw); }
.overview { min-height: 0; padding: 48px 0 36px; gap: 48px; align-items: center; grid-template-columns: 1fr minmax(220px, 320px); }
.overview h1 { font-size: clamp(36px,4vw,58px); line-height: 1.12; letter-spacing: -.045em; }
.heading-dot { color: var(--accent); margin-left: 5px; }
.overview .eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .2em; margin-bottom: 12px; }
.subcopy { font-size: 14px; margin-top: 13px; }
.capacity-copy strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.capacity-track { height: 5px; border-radius: 4px; }
.capacity small { display: block; font-size: 11px; line-height: 1.6; }
.library { padding: 0 0 64px; }
.library-tabs { display: flex; gap: 28px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 32px; scrollbar-width: thin; }
.library-tabs button { flex: none; border: 0; border-bottom: 2px solid transparent; padding: 20px 0 17px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; transition: color .18s, border-color .18s; }
.library-tabs button:hover { color: var(--text); }
.library-tabs button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.library h2 { font-size: 22px; }
.library-head { margin-bottom: 22px; align-items: center; }
.library-tools { gap: 16px; align-items: center; }
.search { min-width: 300px; background: var(--surface); border: 1px solid var(--line); padding: 11px 14px; border-radius: 9px; }
.search:focus-within { border-color: var(--accent); }
.search span { font-size: 22px; line-height: 1; color: var(--muted); }
.search input { font-size: 13px; }
.sort-control { display: flex; align-items: center; gap: 10px; }
.sort-control select { padding: 11px 24px 11px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.root-status { gap: 16px; margin-bottom: 22px; }
.root-chip { border: 0; padding: 0; font-size: 11px; color: var(--muted); }
.root-chip[data-status="complete"] { color: var(--muted); }
.media-columns, .media-row { grid-template-columns: minmax(0,1fr) 80px 100px 190px; gap: 24px; }
.media-columns { display: grid; padding: 12px 16px; background: var(--surface); border-radius: 8px 8px 0 0; font-size: 11px; color: var(--muted); }
.media-columns span:last-child { text-align: right; }
.media-row { padding: 16px; min-height: 82px; transition: background .18s ease; }
.media-row:hover { background: rgba(255,255,255,.025); }
.media-name strong { font-weight: 550; line-height: 1.6; }
.media-name small { display: block; margin-top: 4px; font-size: 11px; opacity: .8; }
.media-meta { font-variant-numeric: tabular-nums; }
.play-link { padding: 8px 12px; border-radius: 7px; background: rgba(158,232,203,.07); white-space: nowrap; transition: background .18s; }
.play-link:hover { background: rgba(158,232,203,.14); }
.pagination { justify-content: center; padding-top: 28px; }
.media-organize > div { border-radius: 9px; }
.player-topbar { height: 64px; border: 0; }
.player-shell { width: min(1560px,100%); padding-top: 8px; }
.video-stage { border-radius: 12px; border: 1px solid var(--line); }
.video-player-frame { width: min(100%,calc((100svh - 180px) * var(--video-ratio))); max-height: calc(100svh - 180px); }
.video-player-frame.is-portrait { width: min(100%,calc((100svh - 180px) * var(--video-ratio))); }
.player-info { width: min(1240px,100%); margin: 0 auto; padding: 32px 0 48px; animation: rise .4s ease both; }
.player-heading { gap: 24px; }
.player-heading > div:first-child { flex: 1; min-width: 0; }
.player-heading h1 { font-size: clamp(20px,2.2vw,30px); line-height: 1.45; letter-spacing: -.025em; }
.external-players { max-width: 430px; min-width: 0; }
.external-players > span { width: 100%; text-align: right; margin-bottom: 4px; }
.external-player { border-radius: 8px; background: var(--surface); }
.media-facts { margin-top: 26px; }
.media-facts div { padding: 18px 0; }
.media-facts dt { font-size: 11px; }
.media-facts dd { font-variant-numeric: tabular-nums; }
.episode-heading h2 { font-size: 21px; }
.episode-panel[hidden] { display: none; }
.episode-list { gap: 0 20px; }
.episode-link { min-height: 60px; border-radius: 5px; transition: background .18s,color .18s; }
.episode-link[aria-current="true"] { box-shadow: inset 3px 0 var(--accent); }
.player-notice:empty, .player-error:empty { display: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 1000px) {
  .library-tools { gap: 10px; }
  .search { min-width: 220px; }
  .sort-control > span { display: none; }
}
@media (max-width: 800px) {
  .topbar { height: 64px; padding: 0 5vw; }
  .brand { font-size: 16px; gap: 8px; }
  .topbar-actions { gap: 12px; }
  .library-page .service-state { display: none; }
  .library-page .topbar { height: auto; min-height: 64px; flex-wrap: wrap; gap: 10px; padding-block: 12px; }
  .library-page .topbar-actions { flex-wrap: wrap; gap: 10px; }
  .primary-button { padding: 9px 13px; font-size: 12px; }
  .overview { padding: 30px 0 24px; gap: 24px; grid-template-columns: 1fr; }
  .capacity { padding: 0; }
  .capacity-copy strong { font-size: 21px; }
  .capacity-track { margin: 10px 0 8px; }
  .library-tabs { gap: 24px; margin-bottom: 24px; }
  .library-tabs button { padding: 17px 0 14px; }
  .library-tools { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .library-head { align-items: stretch; }
  .search { order: -1; min-width: 100%; }
  .sort-control { width: 100%; }
  .sort-control select { width: 100%; }
  .root-status { gap: 8px 14px; }
  .media-columns { display: none; }
  .media-row { grid-template-columns: minmax(0,1fr) 92px; gap: 12px; padding: 14px 0; }
  .media-name strong { font-size: 13px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .media-actions { flex-wrap: wrap; gap: 8px; }
  .play-link { min-height: 42px; display: inline-flex; align-items: center; }
  .player-shell { padding: 0 12px; }
  .video-stage { border-radius: 8px; min-height: 180px; }
  .video-player-frame, .video-player-frame.is-portrait { width: 100%; max-height: calc(100svh - 140px); }
  .web-fullscreen-toggle { top: 10px; left: 10px; }
  .player-info { padding: 24px 4px 40px; }
  .external-players { max-width: 100%; justify-content: flex-start; }
  .external-players > span { text-align: left; }
  .organize-media { justify-content: flex-start; flex-wrap: wrap; }
  .player-media-actions { justify-content: flex-start; align-items: flex-start; flex-wrap: wrap; }
  .media-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .episode-list { grid-template-columns: minmax(0,1fr); }
  .back-link { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.external-player-primary { border-color: rgba(158,232,203,.4); }
.subtitle-section { padding: 25px 0; border-bottom: 1px solid var(--line); }
.subtitle-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.subtitle-heading .eyebrow { margin-bottom: 8px; }
#subtitle-state { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.subtitle-actions, .subtitle-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.subtitle-section button, .subtitle-dialog button:not(.primary-button) { border: 1px solid var(--line); color: var(--text); background: var(--surface); border-radius: 8px; padding: 10px 13px; font-size: 12px; cursor: pointer; transition: border-color .18s, background .18s; }
.subtitle-section button:hover, .subtitle-dialog button:hover { border-color: var(--accent); }
.subtitle-section button:disabled, .subtitle-dialog button:disabled { opacity: .4; cursor: wait; }
.subtitle-controls { margin-top: 18px; }
.subtitle-controls[hidden] { display: none; }
.subtitle-controls label { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; }
.subtitle-controls input, .subtitle-controls select { width: 76px; border: 1px solid var(--line); border-radius: 7px; padding: 9px; color: var(--text); background: var(--surface); }
.subtitle-controls select { width: 112px; }
.subtitle-controls .subtitle-save { color: var(--accent); border-color: rgba(158,232,203,.3); }
.subtitle-notice { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 12px 0 0; overflow-wrap: anywhere; }
.subtitle-notice:empty { display: none; }
.subtitle-notice.is-error, #subtitle-save-error { color: var(--danger); }
.subtitle-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(560px,100%); max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--line); padding: 30px; background: #101216; color: var(--text); overflow-y: auto; }
.subtitle-dialog[open] { animation: subtitle-enter .2s ease both; }
.subtitle-dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.subtitle-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.subtitle-dialog h2 { font-size: 24px; margin: 0; letter-spacing: -.035em; }
.subtitle-help, .subtitle-save-dialog p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.subtitle-search-form { display: grid; grid-template-columns: minmax(0,1fr) 106px auto; gap: 8px; margin-top: 22px; }
.subtitle-search-form input, .subtitle-search-form select { min-width: 0; width: 100%; padding: 11px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 13px; }
#subtitle-search-state { font-size: 12px; color: var(--muted); line-height: 1.8; min-height: 22px; }
#subtitle-results h3 { font-size: 13px; font-weight: 500; margin-top: 28px; }
.subtitle-result { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.subtitle-result > div { min-width: 0; }
.subtitle-result strong { display: block; font-size: 13px; font-weight: 550; overflow-wrap: anywhere; line-height: 1.7; }
.subtitle-result small { display: block; color: var(--muted); margin-top: 6px; font-size: 11px; }
.subtitle-result button { flex: none; }
.subtitle-save-dialog { width: min(480px,calc(100% - 24px)); height: auto; max-height: calc(100dvh - 40px); inset: 0; margin: auto; border: 1px solid var(--line); border-radius: 14px; }
.subtitle-save-dialog .subtitle-temp-warning { color: var(--accent); }
#subtitle-save-detail { overflow-wrap: anywhere; }
video::cue { background: rgba(0,0,0,.8); color: white; }
@keyframes subtitle-enter { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 800px) {
  .subtitle-heading { flex-direction: column; align-items: flex-start; }
  .subtitle-section button { min-height: 42px; }
  .subtitle-dialog:not(.subtitle-save-dialog) { inset: auto 0 0; height: 85dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 24px 18px; }
  .subtitle-search-form { grid-template-columns: minmax(0,1fr) 104px; }
  .subtitle-search-form button { grid-column: 1 / -1; }
}


/* ReelDock: one media workspace, three destinations. */
:root { --bg: #0b0e11; --surface: #151b20; --surface-2: #1d262b; --text: #edf3ef; --muted: #a5b4ae; --accent: #b4edcf; --accent-ink: #14291e; --danger: #ff9b90; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button, a, select, input, summary { -webkit-tap-highlight-color: transparent; }
a { text-underline-offset: 4px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 12px; }
.skip-link:focus { top: 12px; }
.library-page { margin: 0; background: var(--bg); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; background: #101519; border-right: 1px solid var(--line); padding: 35px 22px 24px; display: flex; flex-direction: column; z-index: 25; }
.sidebar .brand { align-items: center; gap: 14px; font-size: 25px; letter-spacing: 0; }
.sidebar .brand small { display: block; margin-top: 3px; font-size: 12px; font-weight: 450; color: var(--muted); letter-spacing: .02em; }
.brand-mark { display: inline-block; flex-shrink: 0; width: 27px; height: 30px; background: var(--accent); clip-path: polygon(0 0,78% 0,100% 20%,100% 100%,0 100%,0 0,32% 29%,32% 72%,72% 50%,32% 29%); border-radius: 3px; transform: none; box-shadow: none; }
.workspace-nav { display: grid; gap: 7px; margin-top: 48px; }
.workspace-nav button { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 12px 15px; text-align: left; background: transparent; border: 0; border-radius: 7px; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; transition: color 160ms, background 160ms; }
.workspace-nav button:hover { background: var(--surface); color: var(--text); }
.workspace-nav button[aria-current=true] { background: #21372e; color: var(--accent); }
.workspace-nav svg, .search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; flex-shrink: 0; }
.sidebar-context { display: grid; grid-template-columns: 7px 1fr; align-items: center; column-gap: 9px; row-gap: 8px; margin: auto 0 30px; padding-top: 40px; }
.connection-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.sidebar-context .service-state { font-size: 12px; color: var(--text); white-space: normal; overflow-wrap: anywhere; }
#deployment-kind { grid-column: 2; font-size: 11px; color: var(--muted); }
.sidebar .capacity-copy strong { font-size: 15px; letter-spacing: 0; }
.sidebar .capacity-track { margin: 12px 0 9px; height: 4px; }
.sidebar .capacity small { overflow-wrap: anywhere; font-size: 11px; }
.sidebar-bottom { margin-top: 27px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.sidebar-bottom a { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; text-decoration: none; }
.sidebar-bottom a:hover { color: var(--accent); }
.sidebar-bottom .logout-button { justify-self: start; padding: 0; font-size: 12px; }
.library-page .workspace { width: auto; max-width: 1560px; margin: 0 0 0 224px; padding: 40px 46px 24px; min-height: 100svh; }
.workspace-heading { display: flex; gap: 24px; align-items: center; justify-content: space-between; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.workspace-heading h1 { margin: 0 0 10px; font-size: 26px; font-weight: 620; letter-spacing: -.02em; }
.workspace-heading p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 65ch; }
.workspace-heading .cloud-shortcut { font-size: 13px; min-height: 42px; display: inline-flex; gap: 22px; align-items: center; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.library-page .cloud-download { padding: 29px 0 32px; border-bottom: 1px solid var(--line); }
.cloud-download summary { list-style: none; display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
.cloud-download summary::-webkit-details-marker { display: none; }
.cloud-download form { margin-top: 20px; }
.cloud-download textarea { min-height: 140px; border-radius: 8px; border-color: #35443e; padding: 16px; font-size: 14px; }
.cloud-download textarea:focus { border-color: var(--accent); outline: 1px solid var(--accent); }
.cloud-controls { gap: 12px; }
.cloud-controls .cloud-mode { margin-left: auto; }
.library-page h2 { font-size: 17px; font-weight: 570; letter-spacing: -.01em; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin: 30px 0 18px; }
.section-heading h2 { margin: 0; }
.section-heading > span { font-size: 12px; color: var(--muted); }
.local-queue { min-height: 210px; }
.cloud-history-head { margin-top: 30px; }
.cloud-history-head h3 { font-size: 15px; font-weight: 550; }
.library-page .empty, .cloud-empty { padding: 36px 0; margin: 0; font-size: 13px; color: var(--muted); line-height: 1.9; max-width: 68ch; }
.library-page .library-tabs { margin: 0 0 30px; gap: 24px; }
.library-page .library-head { gap: 20px; align-items: center; margin-bottom: 20px; }
.library-page .library-head h2 { margin: 0 0 7px; }
.library-page .library-tools { flex-wrap: wrap; gap: 12px; }
.library-page .sort-control, .library-page select { font-size: 12px; }
.library-page .search { min-width: 190px; }
.library-page .search svg { width: 17px; height: 17px; }
.sync-detail { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.sync-detail summary { cursor: pointer; padding: 5px 0; }
.root-status { margin: 14px 0; }
.library-page .media-columns, .library-page .media-row { grid-template-columns: minmax(0,1fr) 54px 80px 255px; gap: 14px; }
.library-page .media-columns { padding: 12px 0; background: none; border-bottom: 1px solid var(--line); border-radius: 0; }
.library-page .media-row { padding: 20px 0; animation: none; min-height: 86px; }
.library-page .media-name strong { font-size: 14px; font-weight: 520; line-height: 1.7; }
.library-page .media-name small { color: var(--muted); margin-top: 5px; font-size: 11px; }
.library-page .media-meta { font-size: 12px; font-variant-numeric: tabular-nums; }
.library-page .media-actions { gap: 12px; flex-wrap: wrap; }
.local-save { position: relative; font-size: 12px; }
.local-save summary { list-style: none; color: var(--text); cursor: pointer; padding: 7px 0; }
.local-save summary:hover { color: var(--accent); }
.save-options { position: absolute; top: calc(100% + 7px); right: 0; width: 250px; padding: 17px; background: #1d262b; box-shadow: 0 12px 28px #0006; border-radius: 12px; z-index: 30; display: grid; gap: 10px; }
.save-options select { width: 100%; min-height: 38px; padding: 8px; border: 1px solid #52655c; border-radius: 5px; color: var(--text); background: var(--surface); }
.save-options .primary-button { min-height: 38px; }
.save-feedback { margin: 0; font-size: 12px; line-height: 1.7; color: var(--text); }
.download-row { display: flex; gap: 24px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 22px 0; }
.download-copy { display: grid; gap: 9px; min-width: 0; flex: 1; }
.download-copy strong { font-size: 13px; font-weight: 520; overflow-wrap: anywhere; }
.download-copy span, .download-copy small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.download-copy .error-copy { color: var(--danger); }
.download-copy progress { width: min(480px,100%); height: 4px; accent-color: var(--accent); }
.download-actions { display: flex; gap: 12px; }
.disk-ledger { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.disk-item { display: grid; gap: 12px; padding: 8px 24px 24px 0; }
.disk-item strong { font-size: 14px; font-weight: 550; }
.disk-item span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.disk-item meter { width: 100%; height: 7px; accent-color: var(--accent); }
.local-hint { font-size: 12px; line-height: 1.8; color: var(--muted); }
.library-page .local-media-row { grid-template-columns: minmax(0,1fr) 90px 60px; }
.text-link { color: var(--accent); font-size: 13px; }
.library-page .library-footer { margin-top: 48px; padding: 20px 0; display: flex; gap: 16px; justify-content: space-between; align-items: center; }
.maintenance-actions { display: flex; gap: 20px; }
.maintenance-actions button { font-size: 12px; }
#workspace-notice { color: var(--danger); line-height: 1.8; font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 1120px) {
 .library-page .workspace { padding: 32px 26px 20px; }
 .library-page .media-columns, .library-page .media-row { grid-template-columns: minmax(0,1fr) 60px 230px; }
 .library-page .media-row > .media-meta:nth-child(2), .library-page .media-columns > span:nth-child(2) { display: none; }
 .disk-ledger { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .library-page .local-media-row { grid-template-columns: minmax(0,1fr) 80px 50px; }
}
@media (max-width: 800px) {
 .sidebar { position: static; width: auto; padding: 23px 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
 .sidebar .brand { font-size: 23px; }
 .sidebar .brand > span:last-child { display: flex; align-items: baseline; gap: 9px; }
 .workspace-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; margin-top: 23px; padding-bottom: 14px; }
 .workspace-nav button { justify-content: center; padding: 10px 3px; gap: 7px; font-size: 12px; min-height: 44px; }
 .workspace-nav svg { width: 16px; height: 16px; }
 .sidebar-context { margin: 0; position: absolute; top: 29px; right: 20px; display: flex; padding: 0; gap: 7px; max-width: 115px; }
 .sidebar-context .service-state { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 #deployment-kind { display: none; }
 .sidebar .capacity { display: none; }
 .sidebar-bottom { margin: 0; padding: 0 0 13px; border: 0; display: flex; align-items: center; justify-content: space-between; }
 .sidebar-bottom a { gap: 10px; }
 .library-page .workspace { margin: 0; padding: 27px 20px 18px; min-height: 70svh; }
 .workspace-heading { align-items: flex-start; gap: 15px; padding-bottom: 24px; }
 .workspace-heading h1 { font-size: 24px; }
 .workspace-heading p { font-size: 12px; }
 .workspace-heading .cloud-shortcut { gap: 8px; min-height: 38px; padding: 9px 12px; font-size: 12px; }
 .workspace-heading .cloud-shortcut span { display: none; }
 .library-page .cloud-download { padding-top: 24px; }
 .cloud-controls .cloud-mode { margin-left: 0; }
 .cloud-controls #cloud-submit { margin-left: auto; }
 .library-page .library-head { flex-direction: column; align-items: stretch; }
 .library-page .library-tools { justify-content: space-between; }
 .library-page .search { min-width: 0; flex: 1; }
 .library-page .search input { width: 100%; min-width: 0; }
 .library-page .media-columns { display: none; }
 .library-page .media-row, .library-page .local-media-row { grid-template-columns: minmax(0,1fr); gap: 10px; }
 .library-page .media-row .media-meta { display: none; }
 .library-page .media-actions { justify-content: flex-start; gap: 20px; }
 .media-organize > div { right: auto; left: 0; }
 .library-page .media-name strong { white-space: normal; overflow-wrap: anywhere; }
 .save-options { right: auto; left: -55px; width: 245px; }
 .disk-item { padding-right: 15px; }
 .disk-item span { font-size: 11px; line-height: 1.7; }
 .library-page .library-footer { flex-wrap: wrap; font-size: 11px; gap: 20px; }
 .library-page .local-media-row > .play-link { justify-self: start; }
 .download-row { gap: 15px; }
}
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.search input::placeholder { color: var(--muted); opacity: 1; }

.access-controls { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 18px; color: var(--muted); font-size: 12px; }
.access-controls summary { cursor: pointer; padding: 5px 0; }
.access-controls label { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--text); min-height: 32px; }
.access-controls input { width: 16px; height: 16px; accent-color: var(--accent); }
.access-controls p { line-height: 1.8; max-width: 65ch; }
