@font-face {
  font-family: "Geist";
  src: url("/static/fonts/GeistVF.woff") format("woff");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0c0e10;
  --panel: #141719;
  --panel-raised: #191d1f;
  --line: #292e30;
  --text: #f0f2ee;
  --muted: #929a97;
  --accent: #c6f36b;
  --accent-ink: #161b0e;
  --danger: #ff8f86;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Geist", Arial, sans-serif;
}
.topbar, main, footer { width: min(100% - 48px, 960px); margin-inline: auto; }
.topbar {
  height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222628;
}
.brand { color: var(--text); font: 700 20px "Geist", Arial, sans-serif; text-decoration: none; letter-spacing: -.7px; }
.brand span { color: var(--accent); }
.version, .eyebrow, .step-pill { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
.version { color: var(--muted); }
.intro { padding: 60px 0 34px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; font: 600 clamp(36px, 6vw, 55px)/1.06 "Geist", Arial, sans-serif; letter-spacing: -2.8px; }
h1 span { color: #a3aca7; }
.lede { max-width: 600px; margin-bottom: 0; color: #a0a8a4; font-size: 16px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.workflow { padding: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-heading h2 { margin: 0; font: 600 24px "Geist", Arial, sans-serif; letter-spacing: -.8px; }
.step-pill { padding: 6px 9px; border: 1px solid #363d36; border-radius: 99px; color: #c1c9c2; font-size: 9px; }
.platform-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 20px; }
.platform-card { display: grid; gap: 4px; min-height: 76px; padding: 12px; border: 1px solid #2b3031; border-radius: 7px; background: #101314; }
.platform-card strong { font-size: 12px; }
.platform-state { color: var(--muted); font-size: 10px; line-height: 1.35; }
.platform-state.state-connected { color: var(--accent); }
.platform-state.state-unavailable { color: #d1a36d; }
.platform-state.state-needs_setup { color: #c6c0a1; }
.link-lookup { display: grid; gap: 7px; margin-top: 22px; color: #dce0dc; font-size: 12px; font-weight: 600; }
.link-input-row { display: flex; gap: 8px; }
.link-input-row input { min-width: 0; height: 40px; flex: 1; padding: 0 11px; border: 1px solid #363d3e; border-radius: 5px; outline: none; background: #171a1b; color: var(--text); font: 13px "Geist", Arial, sans-serif; }
.link-input-row input:focus { border-color: var(--accent); }
.link-lookup small { color: var(--muted); font-size: 11px; font-weight: 400; }
.link-results { display: grid; gap: 9px; margin-top: 12px; padding: 13px; border: 1px solid #303837; border-radius: 7px; background: #101313; color: #cbd1cc; font-size: 12px; overflow-wrap: anywhere; }
.link-results p { margin: 0; }
.link-results.link-error { border-color: #603630; background: #251715; color: var(--danger); }
.link-message { color: #cfe0bd; }
.link-source { color: var(--muted); }
.link-setup-hint { color: #dbbf89; }
.candidate-heading { margin-top: 4px; font-size: 12px; }
.candidate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid #292e30; }
.candidate-details { display: grid; gap: 3px; min-width: 0; }
.candidate-details strong { font-size: 12px; }
.candidate-details span { color: var(--muted); font-size: 10px; }
.selected-original { display: grid; gap: 5px; margin-top: 10px; padding: 12px; border: 1px solid #536638; border-radius: 7px; background: #171e12; font-size: 11px; }
.selected-original strong { color: var(--accent); font-size: 12px; }
.selected-original a { width: fit-content; color: #cfdfa9; text-decoration: none; }
.selected-original a:hover { text-decoration: underline; }
.selected-original span { color: #b7c0b5; }
.workflow-divider { display: flex; align-items: center; gap: 11px; margin: 22px 0 0; color: #747e78; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.workflow-divider::before, .workflow-divider::after { height: 1px; flex: 1; background: #2c3233; content: ""; }
.upload-zone {
  display: flex; min-height: 150px; margin-top: 26px; padding: 20px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: 1px dashed #454e47; border-radius: 9px; background: #111414; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: #171b15; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { display: grid; width: 34px; height: 34px; margin-bottom: 3px; place-items: center; border: 1px solid #414943; border-radius: 50%; color: var(--accent); font-size: 20px; }
.upload-title { font-weight: 600; }
.upload-help { color: var(--muted); font-size: 12px; text-align: center; }
.search-field { display: grid; gap: 7px; margin-top: 19px; color: #dce0dc; font-size: 12px; font-weight: 600; }
.optional { margin-left: 4px; color: var(--muted); font-size: 9px; letter-spacing: .7px; }
.search-field textarea { width: 100%; padding: 10px; resize: vertical; border: 1px solid #363d3e; border-radius: 5px; outline: none; background: #171a1b; color: var(--text); font: 13px/1.5 "Geist", Arial, sans-serif; }
.search-field textarea:focus { border-color: var(--accent); }
.search-field small { color: var(--muted); font-size: 11px; font-weight: 400; }
.video-preview-wrap { overflow: hidden; margin-top: 12px; border-radius: 8px; background: #080909; }
.video-preview-wrap video { display: block; width: 100%; max-height: 330px; }
.hidden { display: none !important; }
.clips-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 27px 0 12px; }
.clips-heading h3 { margin: 0 0 2px; font-size: 14px; }
.clips-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 7px; font: 600 14px "Geist", Arial, sans-serif; cursor: pointer; transition: filter .15s, transform .15s; }
.button:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .6; }
.button-secondary { border: 1px solid #353c39; background: #1b201d; color: var(--text); }
.button-small { min-height: 34px; padding-inline: 11px; font-size: 12px; }
.clip-ranges { display: grid; gap: 9px; }
.range-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 36px; align-items: end; gap: 10px; padding: 12px; border: 1px solid #2b3031; border-radius: 7px; background: #101314; }
.range-number { align-self: center; color: #929a97; font: 600 12px "Geist", Arial, sans-serif; }
.time-field { display: grid; gap: 4px; color: #a4aca8; font-size: 11px; }
.time-field input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #363d3e; border-radius: 5px; outline: none; background: #171a1b; color: var(--text); font: 13px "Geist", Arial, sans-serif; }
.time-field input:focus { border-color: var(--accent); }
.remove-range { width: 34px; height: 34px; border: 1px solid #343a3b; border-radius: 6px; background: transparent; color: #aab1ae; font-size: 18px; cursor: pointer; }
.remove-range:hover { border-color: var(--danger); color: var(--danger); }
.toggle-row { display: flex; align-items: center; gap: 11px; margin: 20px 0; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle { position: relative; width: 35px; height: 20px; flex: 0 0 35px; border-radius: 99px; background: #3b4240; transition: background .15s; }
.toggle::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #ddd; content: ""; transition: transform .15s; }
.toggle-row input:checked + .toggle { background: #739637; }
.toggle-row input:checked + .toggle::after { transform: translateX(15px); background: #fff; }
.toggle-row input:focus-visible + .toggle { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { color: var(--muted); font-size: 11px; }
.status { margin: 14px 0; padding: 10px 12px; border: 1px solid #394a2b; border-radius: 6px; background: #191e16; color: #d7e8bf; font-size: 13px; overflow-wrap: anywhere; }
.status.error { border-color: #603630; background: #251715; color: var(--danger); }
.progress-wrap { margin-bottom: 14px; }
.search-results { padding: 9px 0 35px; }
.match-list { display: grid; gap: 10px; }
.no-matches { margin: 0; padding: 18px; border: 1px dashed #303637; border-radius: 8px; color: var(--muted); font-size: 12px; }
.search-error { padding: 9px 12px; border: 1px solid #603630; border-radius: 6px; background: #251715; color: var(--danger); font-size: 11px; overflow-wrap: anywhere; }
.search-error p { margin: 0; }
.search-error p + p { margin-top: 6px; }
.match-card { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.match-heading { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.match-platform { color: var(--accent); font-weight: 700; }
.match-timestamp { text-align: right; }
.match-card strong { font-size: 13px; }
.match-details { margin: 0; color: var(--muted); font-size: 11px; }
.match-card a { width: fit-content; color: #cfe7a4; font-size: 11px; text-decoration: none; }
.match-card a:hover { text-decoration: underline; }
.query-details { margin-top: 12px; color: var(--muted); font-size: 11px; }
.query-details summary { cursor: pointer; }
.query-list { display: grid; gap: 6px; margin-top: 10px; }
.query-item { display: grid; gap: 2px; padding: 8px; border: 1px solid #2b3031; border-radius: 5px; overflow-wrap: anywhere; }
.query-item small { color: #aabb8e; }
.progress-caption { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: #b4bcb8; font-size: 12px; }
progress { width: 100%; height: 7px; border: 0; border-radius: 99px; background: #282e2c; }
progress::-webkit-progress-bar { border-radius: 99px; background: #282e2c; }
progress::-webkit-progress-value { border-radius: 99px; background: var(--accent); }
progress::-moz-progress-bar { border-radius: 99px; background: var(--accent); }
.button-primary { display: flex; width: 100%; justify-content: center; align-items: center; gap: 10px; background: var(--accent); color: var(--accent-ink); }
.library { padding: 45px 0 58px; }
.library-heading { margin-bottom: 19px; }
.library-heading h2 { display: flex; align-items: center; gap: 10px; }
.count { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #353b39; border-radius: 50%; color: #abb3ae; font: 500 11px "Geist", Arial, sans-serif; letter-spacing: 0; }
.library-note { color: var(--muted); font-size: 11px; }
.empty-state { min-height: 170px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 1px dashed #303637; border-radius: 9px; color: var(--muted); text-align: center; }
.empty-state strong { color: #d3d8d3; font-size: 13px; }
.empty-state span { font-size: 12px; }
.empty-mark { margin-bottom: 4px; color: #6d7771; font-size: 24px; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.clip-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.clip-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #080909; object-fit: contain; }
.clip-info { padding: 12px; }
.clip-info strong { display: block; margin-bottom: 4px; font-size: 13px; }
.clip-meta { color: var(--muted); font-size: 11px; }
.clip-download { display: inline-block; margin-top: 9px; color: var(--accent); font-size: 12px; text-decoration: none; }
.clip-download:hover { text-decoration: underline; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 17px 0 24px; border-top: 1px solid #222628; color: #777f7b; font-size: 11px; }

@media (max-width: 620px) {
  .topbar, main, footer { width: min(100% - 30px, 960px); }
  .intro { padding: 42px 0 25px; }
  .workflow { padding: 19px 15px; }
  .step-pill { display: none; }
  .platform-list { grid-template-columns: 1fr; }
  .clips-heading { align-items: flex-start; }
  .clips-heading p { max-width: 210px; }
  .link-input-row { flex-direction: column; }
  .candidate-row { align-items: flex-start; flex-direction: column; }
  .range-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 6px; padding: 9px 7px; }
  .time-field input { padding-inline: 6px; font-size: 12px; }
  .library-heading { align-items: flex-start; }
  .library-note { max-width: 112px; text-align: right; }
  footer { flex-direction: column; gap: 4px; }
}

/* Legal pages */
.legal-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
footer a { color: var(--accent); text-underline-offset: 3px; }
.legal-page { max-width: 760px; padding-block: 48px; overflow-wrap: anywhere; }
.legal-page h1 { font-size: clamp(32px, 6vw, 46px); letter-spacing: -1px; }
.legal-page article { line-height: 1.8; }
.legal-page article p { margin-bottom: 16px; }
.legal-page article ul { padding-left: 24px; margin-bottom: 24px; }
.legal-draft { padding: 16px; margin-bottom: 32px; border: 1px solid #78633c; border-radius: 8px; background: #282216; color: #eed7a7; }

.research-options {display:flex;flex-wrap:wrap;gap:16px;margin-block:20px;align-items:center;}
.research-options label {font-size:13px;}
.research-options input[type=number] {width:65px;padding:7px;background:var(--bg);color:var(--text);border:1px solid var(--line);}
.research-options small {flex-basis:100%;color:var(--muted);}
.research-panel {padding:24px;margin-block:24px;}
.research-panel video {width:100%;max-height:420px;background:#000;}
.research-panel p {color:var(--muted);font-size:13px;}
.research-timeline {position:relative;height:36px;background:#252b28;margin-block:12px;border-radius:5px;}
.research-timeline .timeline-marker {position:absolute;top:0;height:100%;min-width:5px;background:var(--accent);border:1px solid #698343;}
.research-timeline button.timeline-marker, .research-timeline a.timeline-marker {cursor:pointer;}
.research-timeline .timeline-marker:focus-visible {outline:2px solid var(--text);outline-offset:2px;}
.original-video-link {display:inline-block;margin-block:4px 12px;color:var(--accent);}
.research-moment {padding:14px 0;border-bottom:1px solid var(--line);display:grid;gap:6px;}
.research-moment a {color:var(--accent);overflow-wrap:anywhere;}
.research-moment button {justify-self:start;}

/* Full-width workspace */
.accounts-nav { color: var(--muted); font-size: 12px; text-decoration: none; }
.accounts-nav:hover { color: var(--accent); }
.account-panel { width: min(100%, 520px); padding: 28px; margin-bottom: 20px; }
.account-panel h2, .account-dialog h2 { font-size: 20px; font-weight: 550; letter-spacing: -.5px; }
.account-form { display: grid; gap: 10px; }
.account-form label { color: var(--muted); font-size: 12px; }
.account-form input { width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--bg); margin-bottom: 8px; }
.account-profile { display: flex; align-items: center; gap: 14px; margin-block: 24px; }
.account-profile img { border-radius: 50%; object-fit: cover; }
.account-profile strong { font-size: 14px; overflow-wrap: anywhere; }
.account-profile p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.account-session { display: flex; gap: 16px; align-items: center; margin-bottom: 32px; color: var(--muted); font-size: 12px; }
.account-dialog { width: min(100% - 32px, 460px); padding: 28px; color: var(--text); }
.account-dialog::backdrop { background: #0009; }
.account-dialog p { color: var(--muted); font-size: 13px; }
.account-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
body { -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.dashboard { min-height: 100svh; display: flex; flex-direction: column; }
.dashboard .topbar, .dashboard main, .dashboard footer { width: calc(100% - 80px); max-width: none; }
.dashboard .topbar { height: 80px; flex-shrink: 0; }
.dashboard main { flex: 1; display: flex; flex-direction: column; }
.dashboard .intro { padding: 36px 0 30px; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.dashboard h1 { margin: 0; font-size: clamp(28px, 2.6vw, 42px); letter-spacing: -1.6px; line-height: 1.2; }
.dashboard .lede { font-size: 13px; }
.workspace-grid { display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 24px; flex: 1; padding-bottom: 32px; align-items: start; }
.workspace-grid > *, .workspace-results > * { min-width: 0; }
.dashboard .workflow { padding: 26px; background: #121617; }
.dashboard .section-heading h2, .dashboard .research-panel h2 { font-size: 18px; font-weight: 550; letter-spacing: -.45px; }
.dashboard .link-lookup { margin-top: 26px; gap: 9px; }
.dashboard .link-input-row { flex-direction: column; gap: 10px; }
.dashboard .link-input-row input { flex: auto; width: 100%; height: 46px; background: var(--bg); border-radius: 7px; font-size: 12px; }
.dashboard #resolve-link { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 13px; }
.dashboard .workflow-divider { margin-top: 24px; font-weight: 500; }
.dashboard .upload-zone { min-height: 176px; margin-top: 24px; gap: 9px; background: transparent; }
.upload-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
.dashboard .upload-icon { border-radius: 10px; width: 40px; height: 40px; margin-bottom: 5px; }
.dashboard .upload-title { font-size: 13px; font-weight: 500; }
.dashboard .upload-help { font-size: 11px; }
.dashboard .toggle-row { margin-block: 24px; }
.dashboard .toggle-row strong { font-weight: 450; }
.workspace-details { border-top: 1px solid var(--line); }
.workspace-details summary { padding-block: 16px; cursor: pointer; color: #b8c0ba; font-size: 12px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.workspace-details summary::-webkit-details-marker { display: none; }
.workspace-details summary::after { content: "+"; font-size: 16px; color: var(--muted); }
.workspace-details[open] > summary::after { content: "−"; }
.dashboard .research-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 20px; }
.dashboard .research-options label { display: grid; gap: 7px; font-size: 11px; color: var(--muted); }
.dashboard .research-options input[type=number] { width: 100%; border-radius: 6px; font: inherit; font-size: 13px; }
.dashboard .research-options .checkbox-option { grid-column: 1 / -1; display: flex; align-items: center; color: var(--text); }
.dashboard input[type=checkbox] { accent-color: var(--accent); }
.dashboard .research-options small { grid-column: 1 / -1; font-size: 11px; line-height: 1.6; }
.dashboard .research-options .full-option { grid-column: 1 / -1; }
.dashboard .research-options input[type=text] { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 9px; color: var(--text); background: var(--bg); font-size: 12px; }
.state-configured { color: var(--accent); }
.dashboard .platform-list { grid-template-columns: 1fr; gap: 12px; margin-top: 0; }
.dashboard .platform-card { min-height: 0; padding: 0; border: 0; background: none; gap: 4px; }
.dashboard .platform-card strong { font-size: 11px; font-weight: 500; }
.dashboard .platform-state { font-size: 11px; }
.connection-note { margin: 16px 0; color: var(--muted); font-size: 11px; }
.workspace-results { display: flex; flex-direction: column; align-self: stretch; }
.dashboard .library { display: flex; flex-direction: column; flex: 1; padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: #101314; }
.dashboard .library-heading { flex-wrap: wrap; gap: 8px 16px; margin-bottom: 24px; }
.dashboard .library-note { font-size: 11px; max-width: none; text-align: left; }
.dashboard .empty-state { flex: 1; min-height: 390px; border: 0; gap: 9px; padding: 24px; }
.dashboard .empty-state strong { font-size: 15px; font-weight: 450; }
.dashboard .empty-state span { font-size: 12px; }
.dashboard .empty-mark { margin-bottom: 8px; color: #68746b; }
.dashboard .clip-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.dashboard .clip-grid:empty { display: none; }
.dashboard .research-panel { margin: 0 0 24px; }
.dashboard .research-panel .query-details { margin-bottom: 16px; }
.dashboard .research-panel .query-details p { margin: 12px 0; }
#research-details { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; scroll-margin-top: 24px; }
#research-details > summary { color: var(--text); font-size: 14px; font-weight: 550; }
#research-details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.dashboard .match-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.dashboard .match-list > .search-error { grid-column: 1 / -1; }
.dashboard .candidate-row { flex-direction: column; align-items: stretch; }
.dashboard footer { padding: 18px 0; }
.dashboard footer a { color: var(--muted); text-decoration: none; }
.dashboard footer a:hover { color: var(--text); }

@media (min-width: 1600px) {
  .workspace-grid { grid-template-columns: 420px minmax(0, 1fr); gap: 32px; }
  .dashboard .workflow, .dashboard .library { padding: 32px; }
}
@media (max-width: 1000px) {
  .dashboard .topbar, .dashboard main, .dashboard footer { width: calc(100% - 40px); }
  .workspace-grid { grid-template-columns: 320px minmax(0, 1fr); gap: 16px; }
  .dashboard .workflow, .dashboard .library { padding: 20px; }
  .dashboard .intro { display: block; }
  .dashboard .lede { margin-top: 10px; }
}
@media (max-width: 760px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard .topbar { height: 64px; }
  .dashboard .intro { padding: 28px 0; }
  .dashboard h1 { font-size: 30px; letter-spacing: -1.1px; }
  .dashboard .empty-state { min-height: 260px; }
  .dashboard footer { flex-direction: row; flex-wrap: wrap; gap: 12px; }
}
