:root {
  color-scheme: light;
  --bg: #f8f9fc;
  --surface: #fff;
  --line: #e8eaf1;
  --text: #252736;
  --muted: #717687;
  --accent: #7058d5;
  --accent-soft: #f1edfc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a.quiet, a.primary { cursor: pointer; }
button { border: 0; }
button:disabled { opacity: .6; cursor: wait; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #b9aaf0; outline-offset: 3px; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
header { min-height: 78px; display: flex; justify-content: space-between; align-items: center; padding: 0 40px; border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-size: 17px; font-weight: 700; letter-spacing: -.5px; }
.brand-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--accent); color: white; border-radius: 14px; font-size: 17px; box-shadow: 0 4px 12px #7058d51a; }
.brand-icon.small { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.text-link { color: var(--muted); font-size: 13px; }
.text-link:hover { color: var(--accent); }
.quiet { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1px solid #dfe2eb; border-radius: 9px; padding: 10px 14px; color: #4d5264; font-size: 13px; font-weight: 500; line-height: 1.2; transition: background .15s, border-color .15s; }
.quiet .icon { width: 16px; height: 16px; }
.quiet:hover { background: #f6f5fc; border-color: #ccc2ee; color: var(--accent); }
.app-shell { display: grid; grid-template-columns: 226px minmax(0, 1fr); max-width: 1520px; margin: auto; min-height: calc(100dvh - 78px); }
.sidebar { padding: 34px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 28px; }
.sidebar-label { color: #9297a6; text-transform: uppercase; font-size: 10px; font-weight: 650; letter-spacing: 1.5px; margin: 0 14px 12px; }
.sidebar-link { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.storage { display: flex; gap: 11px; align-items: center; padding: 0 14px; color: #5f6576; }
.storage-icon { width: 30px; height: 30px; display: grid; place-items: center; background: white; border: 1px solid var(--line); border-radius: 9px; color: #828699; }
.storage strong { display: block; font-size: 12px; font-weight: 550; color: #4c5263; }
.storage small { display: block; color: #9499a8; font-size: 11px; margin-top: 4px; }
.sidebar-note { margin-top: auto; padding: 20px 14px 0; border-top: 1px solid var(--line); }
.sidebar-note p { color: #9297a6; font-size: 11px; line-height: 1.7; margin: 7px 0 0; }
.sidebar-note strong { font-size: 12px; font-weight: 550; color: #697083; }
.library { width: 100%; max-width: 1160px; padding: 32px 48px 40px; margin: 0 auto; min-width: 0; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #8b90a0; font-size: 12px; margin: 0 0 35px; line-height: 1.7; }
.breadcrumbs a:last-of-type { color: #545b70; font-weight: 500; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { color: #c4c8d3; }
.breadcrumbs span:last-child { display: none; }
.eyebrow { font-size: 10px; letter-spacing: 1.6px; color: var(--accent); font-weight: 650; margin: 0 0 14px; text-transform: uppercase; }
h1 { font-size: clamp(27px, 3vw, 36px); font-weight: 650; letter-spacing: -1.2px; margin: 0 0 10px; line-height: 1.2; overflow-wrap: anywhere; }
h2 { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; margin: 0; letter-spacing: -.4px; }
.muted, .footnote, .empty { color: var(--muted); line-height: 1.7; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 22px; }
.heading .muted { font-size: 13px; margin: 0; }
.heading #refresh { flex-shrink: 0; }
.library-summary { display: flex; align-items: center; gap: 10px; margin: 0 0 26px; font-size: 12px; color: #8b90a0; }
.summary-count { font-weight: 550; color: #666e81; }
.summary-dot { color: #b9bfcc; }
.file-panel { background: white; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; box-shadow: 0 3px 12px #25273603; }
.toolbar { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.search-field { display: flex; align-items: center; gap: 9px; color: #949aaa; flex: 1; min-width: 100px; max-width: 420px; border: 1px solid var(--line); background: #fafbfe; border-radius: 8px; padding: 0 12px; }
.search-field:focus-within { border-color: #b3a2eb; box-shadow: 0 0 0 3px #7058d50a; }
.search-field .icon { width: 17px; height: 17px; }
.search-field input { border: 0; background: transparent; min-width: 0; width: 100%; padding: 11px 0; outline: none; color: var(--text); }
input::placeholder { color: #9ba1b0; }
.toggle { font-size: 12px; color: #626b7f; display: flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer; padding: 10px 0; }
input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; cursor: pointer; }
.sort-control { margin-left: auto; position: relative; }
.sort-control select { max-width: 155px; padding: 10px 26px 10px 10px; border: 1px solid var(--line); border-radius: 8px; color: #626b7f; background: white; font-size: 12px; cursor: pointer; }
.list-head, .file-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 90px 90px 84px; align-items: center; gap: 14px; padding: 0 22px; }
.list-head { background: #fafbfe; height: 39px; border-block: 1px solid var(--line); font-size: 10px; font-weight: 550; letter-spacing: .6px; color: #9097a8; text-transform: uppercase; }
.list-head .name-label { grid-column: 1 / 3; }
.size-label { text-align: right; }
.file-row { min-height: 78px; border-bottom: 1px solid #eff0f5; transition: background .15s; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #faf9ff; }
.file-row:focus-visible { outline-offset: -3px; }
.file-icon { width: 40px; height: 44px; display: grid; place-items: center; border: 1px solid #e8e2fa; border-radius: 10px; background: #f5f1fe; color: #856bce; }
.file-icon .icon { width: 21px; height: 21px; }
.file-icon[data-kind=folder] { color: #b8974f; border-color: #f2e8d3; background: #fdf8ee; }
.file-icon[data-kind=subtitle] { color: #6c94b8; border-color: #e0eaf4; background: #f0f6fc; }
.file-icon[data-kind=file] { color: #8a90a0; border-color: #e8eaf1; background: #f7f8fb; }
.file-name { min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; font-weight: 500; }
.file-type { color: #9a9fb0; font-size: 10px; font-weight: 550; letter-spacing: .3px; }
.file-size { color: #808799; font-size: 12px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.file-action { font-size: 11px; font-weight: 500; color: #8b91a2; text-align: right; white-space: nowrap; }
.file-row:hover .file-action { color: var(--accent); }
.file-row[data-dir=false] .file-action[data-playable=true] { color: var(--accent); }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fdfdff; border-top: 1px solid var(--line); padding: 14px 22px; color: #9a9fb0; font-size: 11px; }
.freshness { display: flex; align-items: center; gap: 6px; }
.freshness .icon { width: 13px; height: 13px; }
.footnote { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; margin: 24px 2px 0; max-width: 740px; color: #959bab; }
.footnote .icon { width: 14px; height: 14px; margin-top: 2px; }
.empty { text-align: center; padding: 45px 20px; font-size: 13px; }
.empty strong { color: #656d80; display: block; font-size: 15px; margin-bottom: 8px; }
.login-page { display: grid; place-items: center; min-height: 100dvh; padding: 40px 24px; background: #f7f8fc; }
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 930px); min-height: 530px; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 14px 65px #36305b08; background: white; }
.auth-intro { background: #f0ecfb; padding: 44px 40px; display: flex; flex-direction: column; align-items: flex-start; }
.auth-intro .brand { margin-bottom: 57px; font-size: 16px; }
.auth-intro h2 { font-size: 34px; line-height: 1.3; letter-spacing: -1.1px; font-weight: 600; }
.auth-intro > p { color: #8b82a5; font-size: 13px; line-height: 1.8; max-width: 270px; margin: 14px 0 26px; }
.auth-art { margin-top: auto; align-self: stretch; height: 118px; position: relative; }
.art-card { position: absolute; display: flex; align-items: center; justify-content: center; width: 154px; height: 95px; background: #faf9ff; border: 1px solid #ded6f2; border-radius: 12px; color: #baabdc; top: 10px; left: 13px; transform: rotate(-9deg); box-shadow: 0 8px 20px #7058d50a; }
.art-card::before { content: ''; position: absolute; inset: 10px; border: 1px solid #e7e0f7; border-radius: 7px; }
.art-card.front { left: 91px; top: 16px; transform: rotate(5deg); color: var(--accent); background: white; }
.art-card span { width: 32px; height: 32px; display: grid; place-items: center; font-size: 11px; border-radius: 50%; background: var(--accent-soft); }
.login-card { width: 100%; padding: 73px 42px 36px; }
.login-card h1 { font-size: 27px; letter-spacing: -.8px; }
.login-card > .muted { font-size: 13px; margin: 0; }
.login-card label { display: block; font-size: 12px; font-weight: 550; color: #646b7c; margin: 32px 0 9px; }
.password-field { display: flex; border: 1px solid #dee2ed; border-radius: 9px; overflow: hidden; }
.password-field:focus-within { border-color: #b3a2eb; box-shadow: 0 0 0 3px #7058d50a; }
.password-field input { width: 100%; min-width: 0; padding: 13px 14px; background: white; color: var(--text); outline: none; border: 0; }
.password-field button { background: white; color: #9196a5; font-size: 11px; padding: 0 14px; }
.password-field button:hover { color: var(--accent); }
.primary { padding: 13px 18px; color: white; background: var(--accent); border: 1px solid var(--accent); border-radius: 9px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; font-size: 13px; font-weight: 550; line-height: 1.3; }
.primary:hover { background: #6249c9; }
.login-card .primary { width: 100%; margin-top: 18px; justify-content: space-between; }
.auth-footer { margin-top: 43px; display: flex; align-items: center; gap: 10px; color: #a0a5b2; font-size: 11px; }
.auth-footer a:hover { color: var(--accent); }
#login-error, #player-error { color: #b85353; font-size: 12px; line-height: 1.6; }
#login-error:empty { display: none; }
.starting-card { width: min(100%, 420px); border: 1px solid var(--line); border-radius: 22px; padding: 38px; background: white; box-shadow: 0 12px 50px #36305b06; }
.starting-card h1 { font-size: 26px; margin-top: 27px; }
.starting-card .muted { font-size: 13px; }
.starting-card .text-link { color: var(--accent); }
.starting-progress { height: 3px; width: 80px; overflow: hidden; background: var(--accent-soft); border-radius: 3px; margin: 26px 0; }
.starting-progress::after { content: ''; display: block; width: 40%; height: 100%; background: #ad9bdd; animation: loading 1.4s ease-in-out infinite alternate; }
@keyframes loading { to { transform: translateX(150%); } }
dialog { padding: 24px; max-width: 1060px; width: calc(100vw - 48px); border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--text); box-shadow: 0 25px 100px #25273633; }
dialog::backdrop { background: #34334266; backdrop-filter: blur(7px); }
.player-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 20px; }
.player-header .eyebrow { margin-bottom: 7px; }
.player-header h2 { font-size: 19px; }
.close-button { width: 34px; height: 34px; padding: 0; border: 0; background: #f5f6fa; border-radius: 50%; flex-shrink: 0; }
.video-stage { background: #111; border-radius: 11px; overflow: hidden; }
video { width: 100%; max-height: 65dvh; display: block; background: #111; }
.player-footer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.player-footer .primary { background: var(--accent-soft); color: var(--accent); border-color: transparent; padding: 10px 14px; font-size: 12px; }
.player-footer .primary:hover { background: #e9e2fb; }
#copy-status { font-size: 11px; color: var(--accent); }
.keyboard-hint { margin-left: auto; font-size: 11px; color: #a0a5b3; }
.prose { max-width: 850px; padding-top: 60px; padding-bottom: 70px; font-size: 14px; line-height: 1.9; color: #62697b; }
.prose h1, .prose h2 { color: var(--text); }
.prose h2 { margin-top: 32px; font-size: 18px; }
.prose a { color: var(--accent); }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 184px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .library { padding-inline: 30px; }
  .list-head, .file-row { grid-template-columns: 36px minmax(0, 1fr) 60px 76px 70px; gap: 11px; padding-inline: 18px; }
  .file-icon { width: 36px; height: 40px; }
  .toolbar { flex-wrap: wrap; }
  .search-field { max-width: none; }
  .sort-control { margin-left: 0; }
}
@media (max-width: 760px) {
  header { min-height: 68px; padding: 0 22px; }
  .app-shell { display: block; min-height: calc(100dvh - 68px); }
  .sidebar { display: none; }
  .library { padding: 25px 22px 35px; }
  .breadcrumbs { margin-bottom: 26px; }
  .auth-shell { grid-template-columns: 1fr; width: min(100%, 430px); min-height: auto; }
  .auth-intro { padding: 26px 30px; }
  .auth-intro .brand { margin-bottom: 0; }
  .auth-intro h2, .auth-intro > p, .auth-art { display: none; }
  .login-card { padding: 34px 30px 30px; }
  .login-card label { margin-top: 26px; }
  .auth-footer { margin-top: 30px; }
  .prose { padding-top: 35px; }
}
@media (max-width: 520px) {
  header { padding-inline: 18px; }
  .header-actions { gap: 12px; }
  .header-actions .text-link { display: none; }
  .brand { font-size: 15px; }
  .quiet { padding: 9px 12px; }
  .library { padding-inline: 16px; }
  .heading { gap: 12px; align-items: flex-start; }
  .heading .muted { font-size: 12px; }
  .heading #refresh { padding: 9px; font-size: 12px; }
  .heading #refresh .icon { display: none; }
  h1 { font-size: 27px; }
  .library-summary { font-size: 11px; margin-bottom: 22px; }
  .toolbar { padding: 14px; gap: 10px 16px; }
  .search-field { flex: 1 0 100%; }
  .sort-control { margin-left: auto; }
  .list-head, .file-row { grid-template-columns: 34px minmax(0, 1fr) 69px; padding-inline: 14px; gap: 11px; }
  .list-head .name-label { grid-column: 1 / 3; }
  .list-head .type-label, .list-head .action-label, .file-type, .file-action { display: none; }
  .file-name { font-size: 12px; }
  .file-icon { width: 34px; height: 39px; }
  .file-row { min-height: 78px; }
  .file-size { font-size: 11px; }
  .panel-footer { padding: 13px 14px; font-size: 10px; flex-wrap: wrap; gap: 8px; }
  .footnote { font-size: 10px; }
  dialog { padding: 16px; width: calc(100vw - 20px); border-radius: 13px; }
  .player-header h2 { font-size: 16px; }
  .player-footer .quiet, .player-footer .primary { font-size: 11px; }
  .keyboard-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.player-header-actions { display: flex; align-items: center; gap: 10px; }
.review-video { min-width: 0; }
.review-mode { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; inset: 0; }
.review-mode::backdrop { background: #111218; }
.review-mode .review-workspace, .review-workspace:fullscreen {
  color-scheme: dark; background: #111218; color: #e9eaf2; width: 100%; height: 100dvh; padding: 24px 30px 26px; display: flex; flex-direction: column; overflow: auto;
}
.review-mode .player-header { flex-shrink: 0; margin-bottom: 24px; }
.review-mode .player-header h2 { font-size: 18px; color: #d7d9e5; }
.review-mode .eyebrow { color: #a191d8; font-size: 9px; }
.review-mode .quiet { background: #1d1e28; border-color: #31333f; color: #aeb2c2; }
.review-mode .quiet:hover { background: #292736; color: #e1d9ff; border-color: #615779; }
.review-mode .close-button { background: #23242e; }
.review-mode .review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; flex: 1; min-height: 0; }
.review-mode .review-video { display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.review-mode .video-stage { border: 1px solid #262832; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #090a0d; }
.review-mode video { max-height: 100%; height: 100%; object-fit: contain; background: #090a0d; }
.review-mode .player-footer { flex-shrink: 0; margin-top: 18px; }
.review-mode .player-footer .quiet { font-size: 11px; }
.review-mode #enter-review { display: none; }
.review-notepad { display: flex; flex-direction: column; min-height: 0; background: #1a1b24; border: 1px solid #2d2e3b; border-radius: 12px; padding: 20px 17px 14px; }
.notes-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.notes-heading h2 { font-size: 15px; letter-spacing: -.2px; color: #dddfea; }
.notes-heading .quiet { padding: 7px 10px; font-size: 10px; }
.notes-description { font-size: 11px; color: #777e92; line-height: 1.7; margin: 12px 0 17px; }
#review-notes { flex: 1; min-height: 120px; width: 100%; resize: none; border: 0; background: transparent; color: #cbd0df; outline: none; padding: 0; font-family: inherit; font-size: 13px; line-height: 1.95; }
#review-notes::placeholder { color: #636b80; }
#review-notes:focus-visible { outline: none; }
.notes-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #2c2e3c; padding-top: 13px; margin-top: 14px; color: #656e85; font-size: 10px; }
#notes-time { font-variant-numeric: tabular-nums; color: #aa9ecd; }
@media (max-width: 900px) { .review-mode .review-workspace { padding: 20px; } .review-mode .review-layout { gap: 18px; grid-template-columns: minmax(0, 1fr) 265px; } }
@media (max-width: 650px) {
  .review-mode .review-workspace { padding: 15px; }
  .review-mode .player-header { margin-bottom: 16px; }
  .review-mode .player-header h2 { font-size: 14px; }
  .review-mode .review-layout { display: flex; flex-direction: column; min-height: 620px; }
  .review-mode .review-video { flex: 1; min-height: 230px; }
  .review-mode .review-notepad { flex: 1; min-height: 250px; }
  .review-mode .player-footer { gap: 7px; }
  .review-mode .player-header-actions .quiet { font-size: 10px; }
}

.cache-panel { border: 1px solid var(--line); background: #faf9fe; border-radius: 10px; padding: 14px 16px; margin-top: 14px; }
.cache-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cache-heading strong { font-size: 12px; }
.cache-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cache-actions .quiet { padding: 8px 11px; font-size: 11px; }
.text-button { background: transparent; color: var(--muted); padding: 6px; font-size: 11px; cursor: pointer; }
.text-button:hover { color: var(--accent); }
#cache-status { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 10px 0 0; }
.cache-detail { font-size: 10px; line-height: 1.6; color: var(--muted); opacity: .8; margin: 5px 0 0; }
#cache-progress { display: block; width: 100%; height: 5px; accent-color: var(--accent); margin-top: 12px; }
.review-mode .cache-panel { background: #1a1b24; border-color: #2d2e3b; flex-shrink: 0; }
.review-mode #cache-status, .review-mode .cache-detail, .review-mode .text-button { color: #aeb2c2; }
