:root {
  color-scheme: light;
  --bg: #f3efe6;
  --ink: #1d1a16;
  --muted: #5f584e;
  --line: #ddd4c4;
  --card: #fffdf8;
  --accent: #0f6e56;
  --accent-dark: #0b5340;
  --bad: #8d2c22;
  --bad-bg: #f8ece8;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", sans-serif;
}

.top, main {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.top { padding: 36px 0 8px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: Georgia, "Iowan Old Style", serif;
  font-weight: 500;
}

h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 { margin: 0 0 10px; font-size: 26px; }
h3 { margin: 0; font-size: 18px; line-height: 1.35; }

.lede, .note, .meta, .hint, small { color: var(--muted); }

.lede { margin: 10px 0 0; max-width: 62ch; }
.note { margin: 0 0 18px; max-width: 70ch; }
.meta { margin: 6px 0 0; }
.hint { margin: 0; }

main {
  display: grid;
  gap: 16px;
  padding: 18px 0 56px;
}

.panel, article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

form, .result-head, .row { display: flex; gap: 12px; }
form { flex-direction: column; }
.result-head, .row { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.result-head { margin-bottom: 8px; }

.drop {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 148px;
  place-items: center;
  align-content: center;
  padding: 22px;
  border: 1.5px dashed #c9beab;
  border-radius: 16px;
  background: #faf7f1;
  text-align: center;
  cursor: pointer;
}

.drop.over { border-color: var(--accent); background: #f3faf7; }

.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

#drop-title { font-size: 20px; }

fieldset {
  margin: 0;
  padding: 6px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

legend { padding: 0 6px; color: var(--muted); font-size: 13px; }

.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  cursor: pointer;
}

.choice strong { display: block; }
.choice small { display: block; max-width: 62ch; }

.lang {
  display: grid;
  gap: 6px;
  max-width: 280px;
  font-size: 14px;
  color: var(--muted);
}

select, button { font: inherit; }

select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--accent);
  color: white;
  font-weight: 650;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }
button:disabled { cursor: default; opacity: 0.5; }

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.ghost:hover { background: #f6f1e8; }

button:focus-visible, select:focus-visible, .drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bad-bg);
  color: var(--bad);
}

#status { margin: 0 0 10px; }

progress {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  accent-color: var(--accent);
}

.overview {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 21px;
  line-height: 1.4;
}

#lists, #topics, #transcript-wrap { margin-top: 22px; }

ul, ol { margin: 0; padding: 0; list-style: none; }

li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#topics h3 {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 14px;
}

#topics ul { margin: 6px 0 0 74px; }
#topics li { display: block; padding: 4px 0; border: 0; }

#transcript {
  max-height: 520px;
  overflow: auto;
  padding-right: 6px;
}

@media (max-width: 640px) {
  h1 { font-size: 32px; }
  .overview { font-size: 18px; }
  li { grid-template-columns: 52px 1fr; }
}
