:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: #101115;
  color: #f6f3ed;
  --surface: #191a20;
  --border: #34353e;
  --muted: #b0afb8;
  --accent: #f6cc86;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(100%, 760px); margin: auto; padding: calc(20px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.app-header, .app-title, .library-heading, .controls, .player-options, .button-row { display: flex; align-items: center; gap: 10px; }
.app-header { justify-content: space-between; margin-bottom: 24px; }
.app-title img { border-radius: 12px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.2rem, 5vw, 1.6rem); letter-spacing: -.045em; }
h2 { font-size: 1.35rem; letter-spacing: -.035em; overflow-wrap: anywhere; }
p, label { line-height: 1.45; }
button, input, select { font: inherit; }
button, select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; background: #24252d; }
button { cursor: pointer; font-weight: 650; }
button:active:not(:disabled) { filter: brightness(.83); }
button:disabled, select:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { background: var(--accent); color: #21170b; border-color: var(--accent); }
.quiet { background: transparent; color: var(--muted); }
.panel, .player { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.panel { padding: 18px; }
.panel > p { color: var(--muted); margin-top: 8px; }
form { display: grid; gap: 8px; margin-top: 16px; }
form label { margin-top: 4px; font-weight: 650; }
form input { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #101115; color: inherit; font-size: 1rem; }
.button-row { margin-top: 8px; }
.message { margin: 10px 0; color: var(--muted); }
.message:empty, .detail:empty { display: none; }
.player { overflow: hidden; margin-bottom: 25px; }
.screen { position: relative; background: #070708; }
video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.screen-status { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; text-align: center; background: #070708ac; pointer-events: none; }
.player-body { padding: 14px; }
.detail { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.timeline { margin: 12px 0; }
.timeline input { display: block; width: 100%; margin: 0; height: 30px; accent-color: var(--accent); }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.controls { flex-wrap: wrap; }
.controls button { flex: 1 0 auto; }
.player-options { flex-wrap: wrap; margin-top: 12px; }
.player-options button, .subtitle-control { font-size: .875rem; }
.subtitle-control { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.subtitle-control select { max-width: 160px; }
#crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-bottom: 2px; }
#crumbs:empty { display: none; }
#crumbs button { background: transparent; color: var(--muted); border: 0; min-height: 44px; padding: 4px 7px; overflow-wrap: anywhere; }
#crumbs span { color: var(--muted); }
.library-heading { justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.library-heading button { flex: none; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li + li { border-top: 1px solid var(--border); }
.file-list button { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; width: 100%; gap: 12px; align-items: center; text-align: left; background: transparent; border: 0; padding: 13px 8px; min-height: 54px; overflow-wrap: anywhere; }
.file-list button[aria-current="true"] { background: #232128; }
.file-icon { position: relative; width: 16px; height: 12px; border: 1.5px solid var(--accent); border-radius: 2px; }
.file-icon.folder::before { content: ''; position: absolute; bottom: 100%; left: -1px; width: 8px; height: 4px; border: 1.5px solid var(--accent); border-bottom: 0; border-radius: 2px 2px 0 0; }
.file-icon.video { width: 0; height: 0; margin-left: 4px; border: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid var(--accent); border-radius: 0; }
.file-kind { color: var(--muted); font-size: .75rem; font-weight: 600; }
