:root {
  --bg: oklch(0.17 0.008 75);
  --surface: oklch(0.215 0.009 75);
  --surface-2: oklch(0.255 0.01 75);
  --text: oklch(0.94 0.012 85);
  --body: oklch(0.78 0.013 85);
  --muted: oklch(0.64 0.012 80);
  --line: oklch(0.34 0.012 75);
  --accent: oklch(0.69 0.13 38);
  --accent-dark: oklch(0.57 0.12 38);
  --good: oklch(0.72 0.11 145);
  --bad: oklch(0.67 0.16 25);
  --focus: oklch(0.79 0.11 205);
  --radius: 4px;
  --shadow: 0 18px 50px oklch(0.08 0.005 75 / 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  letter-spacing: 0;
}

button, input { font: inherit; }
button, input, .file-picker { border-radius: var(--radius); }
button:focus-visible, input:focus-visible, .file-picker:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  min-height: 64px;
  padding: 0 max(20px, 5vw);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark { font-weight: 700; font-size: 15px; }
.security-label { color: var(--muted); font-size: 12px; }

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: clamp(44px, 8vw, 112px);
  align-items: start;
}

.intro { padding-top: 24px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font: 600 11px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { max-width: 12ch; font-size: clamp(42px, 6vw, 70px); line-height: 1.02; font-weight: 650; }
h2 { font-size: 24px; line-height: 1.2; font-weight: 650; }
.lede { max-width: 55ch; margin: 28px 0 0; color: var(--body); font-size: 18px; }

.facts { margin: 48px 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 13px; }

.upload-workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 38px);
}
.workspace-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 30px; }
.state { flex: 0 0 auto; border: 1px solid var(--line); padding: 6px 9px; color: var(--muted); font-size: 11px; }
.state[data-state="active"] { color: var(--focus); border-color: color-mix(in oklch, var(--focus), transparent 60%); }
.state[data-state="good"] { color: var(--good); border-color: color-mix(in oklch, var(--good), transparent 60%); }
.state[data-state="bad"] { color: var(--bad); border-color: color-mix(in oklch, var(--bad), transparent 60%); }

.field-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
input[type="password"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
}
.field-help { margin: 7px 0 22px; color: var(--muted); font-size: 12px; }

.file-picker {
  min-height: 146px;
  border: 1px dashed color-mix(in oklch, var(--accent), var(--line) 55%);
  background: color-mix(in oklch, var(--surface-2), var(--accent) 4%);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 28px;
  cursor: pointer;
  transition: border-color 180ms cubic-bezier(.16,1,.3,1), background 180ms cubic-bezier(.16,1,.3,1);
}
.file-picker:hover, .file-picker[data-drag="true"] { border-color: var(--accent); background: color-mix(in oklch, var(--surface-2), var(--accent) 9%); }
.file-picker input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.picker-title { font-weight: 650; }
.picker-detail { margin-top: 5px; color: var(--muted); font-size: 12px; }

.file-list { display: grid; gap: 10px; margin-top: 18px; }
.file-row { border-top: 1px solid var(--line); padding-top: 13px; }
.file-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.file-name { overflow-wrap: anywhere; font-weight: 600; }
.file-meta { flex: 0 0 auto; color: var(--muted); }
.progress-track { height: 5px; margin-top: 9px; overflow: hidden; background: var(--surface-2); }
.progress-bar { width: 0; height: 100%; background: var(--accent); transition: width 160ms linear; }
.file-status { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.file-row[data-state="verified"] .progress-bar { background: var(--good); }
.file-row[data-state="verified"] .file-status { color: var(--good); }
.file-row[data-state="error"] .progress-bar { background: var(--bad); }
.file-row[data-state="error"] .file-status { color: var(--bad); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
button { min-height: 46px; border: 1px solid transparent; padding: 10px 17px; font-weight: 700; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.46; }
.primary { background: var(--accent); color: var(--bg); }
.primary:not(:disabled):hover { background: var(--accent-dark); }
.secondary { border-color: var(--line); background: transparent; color: var(--body); }
.secondary:not(:disabled):hover { border-color: var(--muted); color: var(--text); }
.private-link-state {
  margin-bottom: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.private-link-state[data-state="good"] { color: var(--good); }
.private-link-state[data-state="bad"] { color: var(--bad); }
.form-message { min-height: 24px; margin: 16px 0 0; color: var(--body); font-size: 13px; }
.form-message[data-state="error"] { color: var(--bad); }
.form-message[data-state="good"] { color: var(--good); }

footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
}
footer p { margin: 0; }

@media (max-width: 780px) {
  .topbar { min-height: 58px; }
  main { grid-template-columns: 1fr; padding-top: 42px; gap: 44px; }
  .intro { padding-top: 0; }
  h1 { max-width: 14ch; font-size: 46px; }
  .lede { font-size: 16px; }
  footer { flex-direction: column; }
}

@media (max-width: 440px) {
  main, footer { width: min(100% - 28px, 1120px); }
  .security-label { display: none; }
  .upload-workspace { padding: 22px 18px; }
  .workspace-heading { align-items: center; }
  .facts div { grid-template-columns: 88px 1fr; }
  .actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.001ms !important; }
}

/* Earlier Podcast recipient guide */
.preserve-note {
  margin-top: 32px;
  padding: 18px 0 18px 20px;
  border-left: 3px solid var(--bad);
}
.preserve-note strong { display: block; color: var(--text); font-size: 13px; }
.preserve-note p { margin: 6px 0 0; color: var(--body); font-size: 14px; }

.model-guide { margin-top: 54px; }
.guide-heading { display: grid; gap: 12px; }
.guide-heading > p { margin: 0; max-width: 58ch; color: var(--muted); font-size: 13px; }
.model-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
  border: 1px solid var(--line);
}
.model-choice {
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}
.model-choice + .model-choice { border-left: 1px solid var(--line); }
.model-choice:hover { color: var(--text); }
.model-choice.active { background: var(--text); color: var(--bg); }
.model-panel { padding-top: 28px; }
.model-panel[hidden] { display: none; }
.model-tell { margin: 0 0 24px; color: var(--body); font-size: 14px; }
.model-tell strong { color: var(--text); }
.device-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.device-steps li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.device-steps li > span {
  color: var(--accent);
  font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.device-steps strong { display: block; font-size: 14px; }
.device-steps p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.device-steps b { color: var(--body); font-weight: 650; }
.official-tools { display: flex; flex-wrap: wrap; gap: 16px 22px; margin-top: 24px; }
.official-tools a { color: var(--focus); font-size: 12px; text-underline-offset: 4px; }

.upload-checklist {
  margin: 0 0 28px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.upload-checklist strong { font-size: 13px; }
.upload-checklist ul { margin: 10px 0 0; padding-left: 20px; color: var(--body); font-size: 13px; }
.upload-checklist li + li { margin-top: 5px; }
.upload-file-label { margin-top: 24px; }
.selected-explainer { margin-top: 12px; color: var(--muted); font-size: 12px; }
.after-first-batch { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.after-first-batch strong { font-size: 13px; }
.after-first-batch p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.help-assistant {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr);
  gap: clamp(32px, 7vw, 90px);
  margin-top: 24px;
  padding-top: 64px;
  border-top: 1px solid var(--line);
}
.help-intro p:last-child { margin: 16px 0 0; max-width: 48ch; color: var(--muted); font-size: 13px; }
.quick-questions {
  grid-column: 1;
  display: grid;
  gap: 8px;
  align-content: start;
  margin-top: -8px;
}
.quick-questions button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--body);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
}
.quick-questions button:hover { border-color: var(--accent); color: var(--text); }
.assistant-log {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 330px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 24px;
}
.assistant-message { max-width: 82%; }
.assistant-message + .assistant-message { margin-top: 18px; }
.assistant-message span {
  color: var(--accent);
  font: 600 10px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}
.assistant-message p { margin: 7px 0 0; color: var(--body); font-size: 14px; }
.user-message { margin-left: auto; padding-left: 22px; border-left: 2px solid var(--focus); }
.user-message span { color: var(--focus); }
.assistant-form { grid-column: 2; }
.assistant-form > label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 650; }
.assistant-form > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.assistant-form input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
}
.assistant-form button { background: var(--accent); color: var(--bg); }
.human-help {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 781px) {
  .upload-workspace { position: sticky; top: 24px; }
}

@media (max-width: 780px) {
  .help-assistant { grid-template-columns: 1fr; padding-top: 48px; }
  .quick-questions, .assistant-log, .assistant-form, .human-help { grid-column: 1; }
  .assistant-log { grid-row: auto; min-height: 280px; }
  .quick-questions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 500px) {
  .model-switch, .quick-questions { grid-template-columns: 1fr; }
  .model-choice + .model-choice { border-left: 0; border-top: 1px solid var(--line); }
  .device-steps li { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .assistant-form > div { grid-template-columns: 1fr; }
  .assistant-form button { width: 100%; }
  .assistant-message { max-width: 94%; }
}