:root {
  color-scheme: light;
  --ink: #14273b;
  --muted: #526378;
  --line: #d7e0e9;
  --wash: #f0f5fa;
  --paper: #fff;
  --blue: #1d4385;
  --blue-deep: #12336b;
  --error: #963129;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: #f6f8fb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: 0.16em; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #2459a6;
  outline-offset: 3px;
}
.bar {
  height: 64px;
  padding: 0 max(24px, calc((100vw - 1140px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.bar a { text-decoration: none; }
.brand { color: var(--ink); font-weight: 760; }
main { width: min(calc(100% - 48px), 1140px); margin: 49px auto 0; }
.intro { margin-bottom: 28px; }
h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4.5vw, 3.15rem); letter-spacing: -.05em; line-height: 1.07; }
p { margin: 0; }
.intro p, .empty p, .source-detail { color: var(--muted); }
.workspace { display: grid; grid-template-columns: 1fr 1.04fr; gap: 18px; align-items: stretch; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel-head { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; }
label { font-size: .87rem; font-weight: 650; }
label > span, #result-count { color: var(--muted); font-size: .77rem; font-weight: 500; }
label:not(.select-label, .file-control) { display: block; margin-bottom: 5px; }
input[type="text"], textarea, select {
  min-width: 0;
  border: 1px solid #b5c3d3;
  background: var(--paper);
  color: var(--ink);
  border-radius: 7px;
  padding: 9px 11px;
}
input[type="text"], textarea { display: block; width: 100%; }
input[type="text"] { font-size: .94rem; }
textarea { resize: vertical; min-height: 175px; line-height: 1.44; font-size: .89rem; }
textarea::placeholder, input::placeholder { color: #65768b; opacity: 1; }
#title { margin-bottom: 12px; }
.video-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 5px 0 10px; font-size: .81rem; }
.video-actions:has(> :not([hidden])) { min-height: 24px; }
.transcript-label { display: flex; gap: 5px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.transcript-label > label { margin: 0; }
.file-control { position: relative; display: inline-flex; text-decoration: underline; text-underline-offset: .17em; }
.file-control span { font-size: .81rem; font-weight: 630; color: var(--blue); }
.file-control input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.file-control:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.source-detail, #source-status, #export-status { font-size: .80rem; margin-top: 8px; line-height: 1.36; overflow-wrap: anywhere; }
[data-error="true"] { color: var(--error); }
.source-bottom, .exports { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.source-bottom { justify-content: space-between; margin-top: 15px; }
.select-label { display: flex; flex-direction: column; gap: 3px; }
select { min-height: 38px; padding: 7px 24px 7px 8px; font-size: .88rem; }
button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 12px;
  background: var(--blue);
  color: white;
  font-size: .88rem;
  font-weight: 660;
}
button:hover:not(:disabled) { background: var(--blue-deep); }
button:disabled { cursor: default; opacity: .55; }
button.neutral { background: var(--wash); color: var(--blue-deep); border-color: var(--line); }
button.neutral:hover:not(:disabled) { background: #dfe9f5; }
button.small { min-height: 31px; padding: 4px 9px; font-size: .80rem; }
button.link { min-height: 24px; padding: 0 2px; color: var(--blue); background: transparent; text-decoration: underline; font-size: inherit; }
button.link:hover:not(:disabled) { background: var(--wash); }
.results { display: flex; flex-direction: column; }
.empty { flex: 1; display: grid; place-content: center; gap: 6px; text-align: center; background: var(--wash); padding: 20px; border-radius: 8px; line-height: 1.35; }
.empty p:first-child { color: var(--ink); font-weight: 650; }
.empty p + p { font-size: .88rem; }
#highlights { flex: 1; padding: 0; margin: 0; list-style: none; }
#highlights li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
#highlights li:first-child { padding-top: 1px; }
#highlights li:last-child { border-bottom: 0; }
#highlights li p { min-width: 0; line-height: 1.38; font-size: .91rem; overflow-wrap: anywhere; }
.time { flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: .77rem; background: var(--wash); padding: 3px 6px; border-radius: 4px; line-height: 1.3; }
.exports { margin-top: 17px; }
.exports .select-label { margin-right: auto; }
footer { display: flex; width: min(calc(100% - 48px), 1140px); margin: 17px auto 30px; gap: 15px; font-size: .82rem; }
.info { max-width: 720px; line-height: 1.55; margin-bottom: 32px; }
.info section { margin: 25px 0; }
.info h2 { margin-bottom: 7px; }
.info p + p { margin-top: 9px; }
@media (max-width: 740px) {
  main { width: calc(100% - 28px); margin-top: 31px; }
  .workspace { grid-template-columns: 1fr; }
  .panel { padding: 15px; }
  .empty { min-height: 140px; }
  footer { width: calc(100% - 28px); }
}
