@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@600;700&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #f6f6f4; --surface: #ffffff; --surface-2: #efefec; --ink: #111111; --ink-2: #3d3d3b;
  --muted: #73736f; --line: #e3e3df; --accent: #111111; --on-accent: #ffffff;
  --ok: #1f7a3d; --warn: #8a5a00; --err: #b3261e; --bar: #111111;
  --radius: 18px; --pill: 999px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f; --surface: #181818; --surface-2: #222221; --ink: #f2f2ef; --ink-2: #cfcfca;
    --muted: #93938e; --line: #2c2c2a; --accent: #f2f2ef; --on-accent: #111111;
    --ok: #6cc98b; --warn: #e0b45c; --err: #f08a80; --bar: #f2f2ef; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0f; --surface: #181818; --surface-2: #222221; --ink: #f2f2ef; --ink-2: #cfcfca;
  --muted: #93938e; --line: #2c2c2a; --accent: #f2f2ef; --on-accent: #111111;
  --ok: #6cc98b; --warn: #e0b45c; --err: #f08a80; --bar: #f2f2ef; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3 { font-family: Manrope, Inter, sans-serif; letter-spacing: -.01em; margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 880px; margin: 0 auto; padding: 20px 16px 64px; }

header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.logo { font: 700 20px Manrope, sans-serif; display: flex; align-items: center; gap: 8px; }
.logo i { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: inline-block; }
nav { display: flex; gap: 4px; background: var(--surface-2); border-radius: var(--pill); padding: 4px; margin-left: auto; flex-wrap: wrap; }
nav button { border: 0; background: none; padding: 6px 14px; border-radius: var(--pill); cursor: pointer; color: var(--ink-2); }
nav button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.logout { border: 0; background: none; color: var(--muted); cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

textarea.url { width: 100%; min-height: 52px; resize: vertical; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg); padding: 14px 16px; outline: none; }
textarea.url:focus, input:focus, select:focus { border-color: var(--ink); }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 9px 18px; border-radius: var(--pill);
  cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--pill);
  padding: 6px 12px; cursor: pointer; user-select: none; }
.chip input { accent-color: var(--accent); margin: 0; }

.job { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.job img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.job .title { font-weight: 600; overflow-wrap: anywhere; }
.part { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.bar { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--bar); transition: width .3s; }
.state { font-size: 13px; padding: 2px 10px; border-radius: var(--pill); background: var(--surface-2); }
.state.done { color: var(--ok); } .state.failed { color: var(--err); } .state.needs_asr { color: var(--warn); }
.err { color: var(--err); font-size: 13px; }
.summary { white-space: pre-wrap; background: var(--bg); border-radius: 12px; padding: 14px; margin-top: 8px; font-size: 14px; }
.summary a.ts { font-variant-numeric: tabular-nums; font-weight: 600; text-decoration: none; border-bottom: 1px dotted; }
@media (max-width: 560px) { .job { grid-template-columns: 1fr; } .job img { width: 100%; } }

.list > * + * { margin-top: 10px; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }
input[type=search], input[type=text], input[type=password], select { border: 1px solid var(--line); background: var(--bg);
  border-radius: var(--pill); padding: 9px 14px; outline: none; min-width: 0; }
.field { display: grid; grid-template-columns: 220px 1fr; gap: 10px; align-items: center; }
@media (max-width: 560px) { .field { grid-template-columns: 1fr; } }
table.models { width: 100%; border-collapse: collapse; font-size: 13px; }
table.models td, table.models th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.models td.num { font-variant-numeric: tabular-nums; text-align: right; }
.banner { border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--accent); color: var(--on-accent);
  padding: 10px 18px; border-radius: var(--pill); font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }

.login { max-width: 360px; margin: 14vh auto 0; padding: 0 16px; }
.login input { width: 100%; }

/* страница конспекта */
.player { position: sticky; top: 8px; z-index: 5; }
.player audio { width: 100%; margin-bottom: 8px; }
.read { font-size: 16px; line-height: 1.65; }
.read .line { padding: 2px 8px; margin: 0 -8px; border-radius: 8px; transition: background .2s; }
.read .line.now { background: var(--surface-2); }
button.ts { border: 0; background: var(--accent); color: var(--on-accent); border-radius: var(--pill); padding: 0 8px;
  font: 600 13px/1.6 Inter, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer; vertical-align: 1px; }
button.ts:hover { opacity: .85; }
.ts-plain { font-variant-numeric: tabular-nums; font-weight: 600; }
.speed { display: inline-flex; align-items: center; gap: 6px; } .speed b { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
