:root {
  color-scheme: dark;
  --background: #111214;
  --panel: #1a1b1e;
  --panel-light: #222327;
  --border: #34363b;
  --text: #f1f1f1;
  --muted: #a1a4aa;
  --blue: #2787f5;
  --blue-hover: #4699f7;
  --warning: #3b301b;
  --warning-border: #68542a;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body { margin: 0; background: var(--background); color: var(--text); font: 14px/1.45 Arial, Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.age-locked { overflow: hidden; }
.age-locked #app { filter: blur(5px); pointer-events: none; }
.age-gate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .82); }
.age-gate[hidden] { display: none; }
.age-card { width: min(390px, 100%); padding: 28px; border-radius: 8px; background: #fff; color: #202124; text-align: center; }
.age-icon { width: 58px; height: 58px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: #e23e3e; color: #fff; font-weight: 700; font-size: 20px; }
.age-card h1 { margin: 0 0 10px; font-size: 22px; }
.age-card p { margin: 0 0 22px; color: #5d6065; }
.age-card .primary-button, .age-card .plain-button { width: 100%; }
.age-card .plain-button { margin-top: 8px; color: #60646b; }

.header { height: 62px; display: grid; grid-template-columns: 190px minmax(260px, 720px) 1fr; gap: 20px; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--border); background: var(--panel); }
.logo { color: var(--text); font-size: 17px; font-weight: 700; text-decoration: none; }
.search-form { height: 38px; display: flex; }
.search-form input { min-width: 0; flex: 1; padding: 0 12px; border: 1px solid var(--border); border-right: 0; border-radius: 5px 0 0 5px; outline: none; background: #101114; color: var(--text); }
.search-form input:focus { border-color: var(--blue); }
.search-form button, .direct-row button { padding: 0 20px; border: 0; border-radius: 0 5px 5px 0; background: var(--blue); color: #fff; font-weight: 600; }
.search-form button:hover, .direct-row button:hover, .primary-button:hover { background: var(--blue-hover); }
.search-form button:disabled { cursor: wait; opacity: .7; }
.mode-badge { justify-self: end; padding: 5px 9px; border-radius: 4px; background: #373015; color: #e8cb78; font-size: 12px; }
.mode-badge.live { background: #173b2a; color: #72d99e; }

.demo-notice { padding: 10px 22px; border-bottom: 1px solid var(--warning-border); background: var(--warning); color: #e4d4a4; font-size: 13px; }
.workspace { min-height: calc(100vh - 105px); display: grid; grid-template-columns: minmax(0, 1fr) 390px; }
.watch-column { min-width: 0; padding: 22px; }
.player { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; background: #000; border: 1px solid #292a2d; }
.player iframe { width: 100%; height: 100%; border: 0; }
.player-empty { display: grid; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.player-empty .play-icon { width: 58px; height: 58px; display: grid; place-items: center; padding-left: 3px; border-radius: 50%; background: #26282c; color: #d7d9dc; font-size: 21px; }
.player-empty strong { color: #ddd; font-size: 16px; }
.video-info { padding: 18px 2px; border-bottom: 1px solid var(--border); }
.video-info h1 { margin: 0 0 7px; font-size: 20px; }
.video-info p { margin: 10px 0; color: var(--muted); }
.video-meta { color: #858990; font-size: 12px; }
.report-link { padding: 0; border: 0; background: transparent; color: #d66c6c; font-size: 12px; }
.report-link:disabled { color: #666; cursor: not-allowed; }

.direct-form { margin-top: 20px; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.direct-form > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.direct-form label { font-weight: 700; }
.direct-form span { color: var(--muted); font-size: 11px; }
.direct-row { height: 38px; display: flex; margin-top: 12px; }
.direct-row input { min-width: 0; flex: 1; padding: 0 11px; border: 1px solid var(--border); border-right: 0; border-radius: 5px 0 0 5px; outline: none; background: #111215; color: var(--text); }
.inline-message { min-height: 18px; margin: 8px 0 0; color: #d7b86c; font-size: 12px; }
.policy-box { margin-top: 14px; color: var(--muted); font-size: 12px; }
.policy-box summary { cursor: pointer; color: #c7c9cd; }

.results-panel { min-width: 0; border-left: 1px solid var(--border); background: #16171a; }
.results-header { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.results-header h2 { margin: 0; font-size: 16px; }
.results-header span { color: var(--muted); font-size: 12px; }
.results-header select { padding: 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel-light); color: var(--text); }
.search-message { padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.search-message.error { color: #eb8a8a; }
.search-message.success { color: #7bc89b; }
.result-list { max-height: calc(100vh - 174px); overflow-y: auto; }
.result-item { width: 100%; min-height: 94px; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 11px; padding: 11px; border: 0; border-bottom: 1px solid #2b2c30; background: transparent; color: inherit; text-align: left; }
.result-item:hover, .result-item.active { background: #25272b; }
.result-thumb { aspect-ratio: 16 / 9; position: relative; display: grid; place-items: center; overflow: hidden; background: #090909; color: #777; }
.result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-thumb .duration { position: absolute; right: 4px; bottom: 4px; padding: 2px 4px; border-radius: 2px; background: rgba(0,0,0,.82); color: #fff; font-size: 10px; }
.result-copy { min-width: 0; }
.result-copy strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; line-height: 1.35; }
.result-copy span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.no-results { padding: 28px 16px; color: var(--muted); text-align: center; }

.footer { min-height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-top: 1px solid var(--border); color: #777b82; font-size: 12px; }
.footer button { border: 0; background: transparent; color: #aeb1b6; }

.primary-button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 5px; background: var(--blue); color: #fff; font-weight: 600; }
.plain-button { min-height: 38px; border: 0; background: transparent; }
.report-dialog { width: min(460px, calc(100% - 28px)); padding: 0; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); color: var(--text); }
.report-dialog::backdrop { background: rgba(0,0,0,.7); }
.report-form { padding: 20px; display: grid; gap: 9px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dialog-header h2 { margin: 0; font-size: 19px; }
.close-button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.report-form label { margin-top: 6px; color: #c8c9cc; font-size: 12px; }
.report-form select, .report-form textarea { width: 100%; padding: 9px; border: 1px solid var(--border); border-radius: 4px; background: #111215; color: var(--text); resize: vertical; }

@media (max-width: 900px) {
  .header { grid-template-columns: 160px minmax(0, 1fr); }
  .mode-badge { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .results-panel { border-top: 1px solid var(--border); border-left: 0; }
  .result-list { max-height: none; }
}

@media (max-width: 620px) {
  .header { height: auto; grid-template-columns: 1fr; gap: 10px; padding-block: 12px; }
  .logo { display: none; }
  .demo-notice { padding-inline: 14px; }
  .watch-column { padding: 10px; }
  .direct-form > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .direct-row { height: auto; flex-direction: column; gap: 8px; }
  .direct-row input, .direct-row button { height: 40px; border: 1px solid var(--border); border-radius: 5px; }
  .result-item { grid-template-columns: 112px minmax(0, 1fr); }
}
