:root {
  color-scheme: light;
  --ink: #202b28;
  --muted: #596760;
  --paper: #f4f2e9;
  --line: #cbcfc3;
  --accent: #235e48;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  line-height: 1.5;
}
main {
  max-width: 960px;
  margin: auto;
  padding: 40px 36px;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.label,
.segment-meta,
.video-rank {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}
header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
h1 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 52px 0 12px;
}
.intro {
  color: var(--muted);
  margin-bottom: 30px;
}
label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.prompt {
  display: flex;
  background: #fffef8;
  border: 1px solid var(--ink);
  padding: 10px;
  gap: 10px;
}
textarea {
  flex: 1;
  resize: vertical;
  min-width: 0;
  border: none;
  padding: 10px;
  font: inherit;
  background: transparent;
}
button {
  cursor: pointer;
  font: inherit;
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 8px 14px;
  background: transparent;
}
.prompt button {
  background: var(--accent);
  color: white;
  border: 0;
  align-self: stretch;
}
button:hover {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid #b27b2e;
  outline-offset: 3px;
}
.restriction {
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.restriction label {
  margin-top: 12px;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 10px;
  background: #fffef8;
  font: inherit;
}
#message {
  margin: 28px 0;
}
#stats {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.8rem;
}
#stats dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 16px;
  margin: 8px 0 0;
  font-family: "SFMono-Regular", Consolas, monospace;
}
#stats dt {
  font-weight: 600;
}
#stats dd {
  margin: 0;
}
article {
  padding: 28px 0 6px;
  border-top: 2px solid var(--ink);
}
.video-heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.video-rank {
  color: var(--muted);
}
h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}
.segments {
  list-style: none;
  padding: 0 0 0 36px;
}
.segments li {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.segment-meta {
  display: flex;
  gap: 16px;
  color: var(--muted);
  flex-wrap: wrap;
}
time {
  color: var(--accent);
}
blockquote {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.32rem;
  margin: 12px 0 16px;
  line-height: 1.45;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}
a {
  color: var(--accent);
}
.actions a {
  align-self: center;
  padding: 8px 4px;
}
.context {
  white-space: pre-wrap;
  padding: 16px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  margin-top: 12px;
}
.segment-error {
  color: #943b27;
  font-size: 0.85rem;
}
.player iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  margin-top: 16px;
}
footer {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 640px) {
  main {
    padding: 24px 18px;
  }
  header {
    flex-direction: column;
    gap: 8px;
  }
  .prompt {
    flex-direction: column;
  }
  .segments {
    padding-left: 0;
  }
}
