:root {
  --bg: #f4f6f6;
  --card: #ffffff;
  --ink: #17262a;
  --muted: #5d6f73;
  --line: #dde4e5;
  --brand: #0f3d3e;
  --accent: #1d7a74;
  --accent-soft: #e3f1ef;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --danger: #b3261e;
  --rec: #d93025;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: 1rem; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-family: Consolas, monospace; }
.err { color: var(--danger); min-height: 1.2em; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top));
  background: var(--brand); color: #fff;
}
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar nav[hidden] { display: none; }
.topbar nav a, .topbar .link { color: #d7ecea; font-size: .95rem; }
.link { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }

main { max-width: 920px; margin: 0 auto; padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.narrow { max-width: 380px; margin: 3rem auto; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }

input, textarea, select {
  width: 100%; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; background: #fff;
}
textarea { resize: vertical; min-height: 3.2rem; line-height: 1.45; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .8rem; }
.field input { margin-top: .3rem; color: var(--ink); }

button { font: inherit; cursor: pointer; border-radius: 8px; padding: .6rem 1rem; border: 1px solid transparent; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--accent); color: #fff; }
.secondary { background: #fff; color: var(--accent); border-color: var(--accent); display: inline-block; padding: .6rem 1rem; border-radius: 8px; cursor: pointer; }
.danger { background: #fff; color: var(--danger); border-color: #e7b7b3; }
#login-form { display: grid; gap: .7rem; }

.new-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.recorder { display: flex; align-items: center; gap: .8rem; }
.rec { display: inline-flex; align-items: center; gap: .55rem; background: #fff; color: var(--rec); border: 2px solid var(--rec); font-weight: 600; padding: .7rem 1.2rem; border-radius: 999px; }
.rec .dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--rec); }
.rec.on { background: var(--rec); color: #fff; }
.rec.on .dot { background: #fff; border-radius: 2px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.or { color: var(--muted); font-size: .9rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem .2rem; color: var(--ink); }
.list a:hover { background: var(--accent-soft); }
.list .who { font-weight: 600; }
.list .when { font-size: .82rem; color: var(--muted); }

.badge { font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; background: #eef1f1; color: var(--muted); }
.badge.gata { background: var(--accent-soft); color: var(--accent); }
.badge.aprobat { background: var(--accent); color: #fff; }
.badge.lucru { background: var(--warn-soft); color: var(--warn); }
.badge.eroare { background: #fdecea; color: var(--danger); }

audio { width: 100%; margin-top: .5rem; }
.status-line { margin: .6rem 0 0; color: var(--warn); font-size: .9rem; min-height: 1em; }
.status-line.error { color: var(--danger); }

.tabs { display: flex; gap: .3rem; margin: 0 0 -.05rem; }
.tabs button { background: transparent; color: var(--muted); border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: 0; }
.tabs button.active { background: var(--card); color: var(--ink); border-color: var(--line); font-weight: 600; }
.tab { border-top-left-radius: 0; }

.section { margin-bottom: 1rem; }
.section label { display: flex; justify-content: space-between; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.section .edited { font-weight: 400; font-size: .78rem; color: var(--accent); }
.section textarea.empty { background: #fafbfb; }

.notice { background: var(--warn-soft); border: 1px solid #f0d9a8; border-radius: 8px; padding: .7rem .9rem; margin-bottom: 1rem; }
.notice h4 { margin: 0 0 .3rem; font-size: .92rem; color: var(--warn); }
.notice ul { margin: 0; padding-left: 1.1rem; }
.terms { background: var(--accent-soft); border-radius: 8px; padding: .7rem .9rem; margin-top: .5rem; font-size: .9rem; }
.terms h4 { margin: 0 0 .3rem; font-size: .9rem; }
.terms ul { margin: 0; padding-left: 1.1rem; }

.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.actions.sticky { position: sticky; bottom: 0; background: var(--card); padding: .7rem 0 max(.7rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

.transcript { font-size: .93rem; line-height: 1.55; }
.transcript .seg { padding: .25rem 0; display: flex; gap: .6rem; }
.transcript .t { color: var(--muted); font-family: Consolas, monospace; font-size: .8rem; padding-top: .15rem; min-width: 3rem; }
.transcript .lang { font-size: .7rem; text-transform: uppercase; border-radius: 4px; padding: .05rem .3rem; background: #eef1f1; color: var(--muted); height: fit-content; margin-top: .15rem; }
.transcript .lang.ru { background: #e8eefc; color: #2f4f9a; }
.pre { white-space: pre-wrap; }

table.gl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.gl th { text-align: left; color: var(--muted); font-weight: 600; font-size: .82rem; padding: .3rem; }
table.gl td { padding: .25rem; vertical-align: middle; }
table.gl td input[type=checkbox] { width: auto; }
table.gl tr.todo td:first-child input { border-color: #f0c674; background: var(--warn-soft); }

@media (max-width: 640px) {
  main { padding: .6rem; }
  .card { padding: .9rem; }
  table.gl thead { display: none; }
  table.gl tr { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; border-top: 1px solid var(--line); padding: .5rem 0; }
}
