/* Action annotation app — dark around the video, one bright element: the interval being labelled. */
:root {
  --bg: #1d2126;
  --panel: #262b32;
  --panel-2: #2e343c;
  --line: #3a414a;
  --text: #e7eaee;
  --muted: #98a2ad;
  --sel: #ffd166;            /* the interval — the one loud colour */
  --action: #3dbf7a;
  --focus: #9cc7ff;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the hidden attribute wins over any display rule */
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); }
a { color: var(--focus); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 4px 8px;
}
button { cursor: pointer; }
button:hover { background: #38404a; }
button.primary { background: var(--action); border-color: var(--action); color: #0d1f16; font-weight: 600; }
button.primary:hover { background: #4bd08a; }
button.link { background: none; border: 0; padding: 0; color: var(--focus); }
button.link:hover { background: none; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.t { font-variant-numeric: tabular-nums; }

/* top bar */
.bar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; font-size: 15px; }

/* list pages (overview, your clips) */
main.list { padding: 20px 24px; max-width: 1100px; }
main.list table { border-collapse: collapse; width: 100%; }
main.list th, main.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
main.list th { color: var(--muted); font-weight: 500; }
main.list h3 { margin: 22px 0 8px; font-size: 15px; }
main.list h3:first-child { margin-top: 0; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px; font-size: 12px; background: var(--panel-2); color: var(--muted); }
.tag.warn { background: #4a3a1e; color: #ffd28a; }
.tag.done { background: #1f3f2d; color: #7fe0a8; }
.btn { padding: 3px 9px; border: 1px solid var(--line); border-radius: 4px; }
.empty { color: var(--muted); }
.note { margin-top: 14px; }
main.clips { max-width: 720px; margin: 0 auto; }
.clips-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 15px; }
.btn.go { padding: 7px 16px; background: var(--action); border-color: var(--action); color: #0d1f16; font-weight: 600; }
.btn.go:hover { text-decoration: none; background: #4bd08a; }
main.clips tr.is-done td:first-child a { color: var(--muted); }

/* sign-in */
main.login { display: flex; justify-content: center; padding: 12vh 16px; }
.login-card { display: flex; flex-direction: column; gap: 10px; width: min(340px, 100%); padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.login-card input { padding: 8px 10px; }
.login-card button { padding: 8px; }

/* ---------- one clip: video, question, answer ---------- */
main.clipview { max-width: 760px; margin: 0 auto; padding: 16px 16px 28px; display: flex; flex-direction: column; gap: 8px; }
.stage { position: relative; display: flex; }
video { width: 100%; max-height: 50vh; background: #000; border-radius: 4px; object-fit: contain; cursor: pointer; }
/* three columns: empty | buttons centred under the video | speed at the far right */
.transport { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.transport .buttons { display: inline-flex; gap: 8px; }
.transport button { width: 40px; height: 32px; padding: 0; font-size: 15px; line-height: 1; }
.transport button.play { width: 52px; font-size: 17px; }
.ico { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.12em; }
.transport select { height: 32px; justify-self: end; }


/* the clip's own timeline: only in step 2 */
.timeline { position: relative; height: 70px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; user-select: none;
  touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ruler { position: relative; height: 22px; border-bottom: 1px solid var(--line); cursor: ew-resize; background: var(--panel-2); }
.tick { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--line); padding: 3px 0 0 4px; font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.selection { position: absolute; top: 22px; bottom: 0; background: color-mix(in srgb, var(--sel) 22%, transparent); border-left: 3px solid var(--sel); border-right: 3px solid var(--sel); pointer-events: none; z-index: 3; }
.handle { position: absolute; top: 0; bottom: 0; width: 16px; cursor: col-resize; pointer-events: auto; }
.handle.l { left: -9px; }
.handle.r { right: -9px; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; z-index: 4; }
.playhead::before { content: ""; position: absolute; top: 0; left: -4px; border: 5px solid transparent; border-top: 7px solid #fff; }

/* question + answer */
.form { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.ask { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 17px; font-weight: 600; }
.ask button { font-size: 14px; font-weight: 400; }
.sub { margin: -6px 0 2px; line-height: 1.45; }
.sub .sel-word { color: var(--sel); font-weight: 600; }
.chosen { display: flex; align-items: baseline; gap: 10px; min-height: 1.5em; }
.preview { font-size: 17px; font-weight: 600; }
/* verb / noun: a field whose list holds the model's top predictions. The list opens in the page
   flow, pushing what's below down, so an open verb list never covers the noun field. */
.combo { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 4px 8px; }
.combo label { color: var(--muted); }
.combo .pick { width: 100%; cursor: pointer; }
.combo .options { grid-column: 2; margin: 0; padding: 4px 0; list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; }
.combo .options li { padding: 5px 10px; cursor: pointer; }
.combo .options li.hi, .combo .options li:hover { background: #3a4653; }
.combo .options li.on { color: var(--action); font-weight: 600; }
.combo .options li.none { color: var(--muted); cursor: default; }
.combo .options li.none:hover { background: none; }
/* duration, inside the yellow rectangle */
.sel-dur { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 11.5px; color: rgba(231, 234, 238, .6); white-space: nowrap; pointer-events: none; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { padding: 7px 16px; }
.msg { min-height: 1.3em; font-size: 12.5px; }
.msg.ok { color: #7fe0a8; }
.msg.err { color: #ffb3ad; }

/* phones and tablets: finger-sized targets, less padding */
@media (pointer: coarse) {
  .timeline { height: 88px; }
  .handle { width: 36px; }
  .handle.l { left: -19px; }
  .handle.r { right: -19px; }
  .selection { border-width: 4px; }
  .transport button { width: 52px; height: 44px; font-size: 18px; }
  .transport button.play { width: 64px; }
  .transport select { height: 44px; }
  .actions button { min-height: 44px; }
  .combo .pick { min-height: 40px; font-size: 16px; }   /* 16px stops iOS zooming into the field */
  .combo .options li { padding: 10px 12px; }
}
@media (max-width: 600px) {
  main.clipview { padding: 8px 10px 20px; }
  main.list { padding: 14px 12px; }
  .bar { gap: 10px; padding: 8px 10px; }
  video { max-height: 42vh; }
  .ask { font-size: 16px; }
  .clips-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
