:root {
  --ink: #1a1a1a;
  --muted: #666;
  --line: #e3e3e0;
  --bg: #fdfdfc;
  --accent: #b3261e;
  --accent-ink: #fff;
  --hl: #fff3a3;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 860px;
  padding: 32px 20px 64px;
  font: 16px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

header { margin-bottom: 24px; }
.brand { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.tagline { color: var(--muted); margin: 4px 0 0; }

#fetch-form { display: flex; gap: 8px; }
#url-input {
  flex: 1;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
#fetch-btn {
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
#fetch-btn:disabled { opacity: 0.55; cursor: wait; }

.status { min-height: 1.4em; color: var(--muted); margin: 14px 0; }
.status.error { color: var(--accent); }

#video-title { font-size: 20px; margin: 8px 0 12px; }

.player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.toolbar .toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); }
#search {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
}
.search-count { color: var(--muted); font-size: 14px; min-width: 3.5em; }
.toolbar button, .toolbar select {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.transcript { padding-top: 6px; }
.sentence {
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.sentence:hover { background: #f3f3f0; }
.sentence .ts {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  margin-right: 8px;
  user-select: none;
}
.sentence.dim { opacity: 0.35; }
.sentence mark { background: var(--hl); padding: 0 1px; border-radius: 2px; }
body.hide-ts .sentence .ts { display: none; }

footer { margin-top: 48px; color: var(--muted); font-size: 14px; }
