:root {
  --accent: #ea580c;
  --accent-dark: #c2410c;
  --red: #dc2626;
  --bg: #f7f6f5;
  --card: #ffffff;
  --text: #1f1c1b;
  --muted: #736c69;
  --line: #e7e3e1;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141211; --card: #1e1b1a; --text: #f1eeed; --muted: #a39b97; --line: #312c2a; }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
header { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: inherit; text-decoration: none; }
.brand img { border-radius: 7px; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.35rem; margin: 4px 0 6px; line-height: 1.3; overflow-wrap: anywhere; }
h2 { font-size: 1rem; margin: 24px 0 8px; color: var(--muted); font-weight: 600; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
button, .btn, select {
  font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-dark); }
button.danger { color: var(--red); }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
input[type=password] {
  width: 100%; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}

/* upload */
.drop {
  display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.drop input { display: none; }
.drop strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.file { margin: 12px 0; font-weight: 600; overflow-wrap: anywhere; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0 6px; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }

/* list */
.tlist a { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; color: inherit; text-decoration: none; }
.tlist .name { font-weight: 600; overflow-wrap: anywhere; }
.tlist .card:hover { border-color: var(--accent); }

/* transcript */
audio { width: 100%; margin: 6px 0 2px; }
.transcript p { margin: 0 0 10px; }
.ts {
  font: .8rem ui-monospace, monospace; color: var(--muted); border: none; background: none; padding: 0 6px 0 0;
  display: inline; font-variant-numeric: tabular-nums;
}
.ts:hover { color: var(--accent); }
.voice { font-weight: 600; font-size: .8rem; padding: 1px 7px; border-radius: 99px; margin-right: 6px; color: #fff; }
.v-A { background: #0f766e; } .v-B { background: #b45309; } .v-C { background: #6d28d9; }
.v-D { background: #be185d; } .v-E { background: #1d4ed8; }
.status { font-size: .9rem; color: var(--muted); }
.status.failed { color: var(--red); }
.spin { display: inline-block; width: .8em; height: .8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: r .8s linear infinite; vertical-align: -1px; }
@keyframes r { to { transform: rotate(360deg); } }
.toolbar { margin: 12px 0; }
.toolbar button, .toolbar .btn { padding: 6px 11px; font-size: .9rem; }

#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #1f1c1b; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity .2s; max-width: 90vw;
}
#toast.show { opacity: .95; }
