:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1c2230;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-ink: #ffffff;
  --error-bg: #fef2f2;
  --error-ink: #b91c1c;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.05rem; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user { color: var(--muted); font-size: .9rem; }
.container { max-width: 860px; margin: 24px auto; padding: 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 20px;
}
.card-narrow { max-width: 380px; margin: 60px auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-size: 1.4rem; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 14px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
.form input {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; color: var(--ink); background: #fff;
}
.form input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.row { display: flex; gap: 14px; }
.row label { flex: 1; }
.hint { font-size: .8rem; color: var(--muted); }
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: .95rem; cursor: pointer; text-decoration: none; background: #eef0f3; color: var(--ink);
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.inline { display: inline; }
.alert { padding: 10px 12px; border-radius: 8px; margin: 12px 0; font-size: .9rem; }
.alert-error { background: var(--error-bg); color: var(--error-ink); }
.alert-info { background: #eef2ff; border: 1px solid #dbe1ff; color: #3730a3; }
.alert-ok { background: #dcfce7; border: 1px solid #bbf7d0; color: #166534; }
.amounts-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.amounts-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #eef2ff; border: 1px solid #dbe1ff; color: #3730a3;
  padding: 4px 11px; border-radius: 999px; font-size: .8rem; white-space: nowrap;
}
.amounts-chip strong { font-weight: 700; }
.amounts-chip.amounts-low { background: var(--error-bg); border-color: #fecaca; color: var(--error-ink); }
table.jobs { width: 100%; border-collapse: collapse; }
table.jobs th, table.jobs td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.jobs th { font-size: .8rem; color: var(--muted); font-weight: 600; }
table.jobs a { color: var(--primary); text-decoration: none; font-weight: 600; }
.sub { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.ts { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-error { background: var(--error-bg); color: var(--error-ink); }
.badge-uploaded, .badge-converting, .badge-submitted,
.badge-transcribing, .badge-analyzing { background: #fef9c3; color: #854d0e; }
.muted { color: var(--muted); }
.meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.progress-box { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-top: 12px; }
.hidden { display: none; }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.summary { white-space: pre-wrap; word-wrap: break-word; }
.transcript {
  white-space: pre-wrap; word-wrap: break-word; background: #0f172a; color: #e2e8f0;
  padding: 14px; border-radius: 8px; font-size: .85rem; max-height: 520px; overflow: auto;
}
details summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; }
@media (max-width: 560px) { .row { flex-direction: column; } }
