:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --ink: #26262c;
  --muted: #7a7a85;
  --line: #e4e1da;
  --a: #1f4e9c;
  --b: #2e8b57;
  --red: #c82828;
  --focus: #1f4e9c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { margin: 4px 0 0; font-size: 12px; }
.error { color: var(--red); margin: 10px 0 0; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card { width: 380px; max-width: 100%; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }

/* ---------- layout ---------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
header h1 { margin: 0; font-size: 20px; }
header p { margin: 2px 0 0; font-size: 13px; }

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  display: grid;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.card h2 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

.grid2, .grid3 { display: grid; gap: 14px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
label { display: block; font-size: 12px; font-weight: 600; margin: 0 0 4px; color: var(--muted); }
input, select {
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }

.login-card input { margin-bottom: 12px; }
.login-card label { color: var(--ink); }

button, .button {
  font: inherit;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.primary, .button.primary { background: var(--a); color: #fff; }
button.primary:hover, .button.primary:hover { background: #173d7e; }
button.primary:disabled { background: #9aa4b8; cursor: default; }
button.ghost, .button.ghost { background: transparent; color: var(--a); border: 1px solid var(--line); }
button.ghost:hover { border-color: var(--a); }
button.big { padding: 12px 26px; font-size: 16px; }

/* ---------- speakers ---------- */
.speakers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}
.speaker { display: flex; align-items: end; gap: 12px; }
.speaker > div { flex: 1; }
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  padding: 0 8px;
}
.tag-a { background: var(--a); }
.tag-b { background: var(--b); }
.tag-c { background: #c86e14; }
.tag-d { background: #6e32a0; }
.tag-e { background: #147878; }
.tag-f { background: #961e3c; }

/* ---------- lines table ---------- */
table.lines { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
table.lines th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
}
table.lines td { padding: 5px 4px; vertical-align: middle; }
table.lines td:first-child, table.lines td:last-child { white-space: nowrap; width: 1%; }
table.lines select { width: 64px; }
.row-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  margin: 0 1px;
  color: var(--muted);
  cursor: pointer;
}
.row-btn:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- samples ---------- */
.samples { display: flex; flex-wrap: wrap; gap: 8px; }
.samples button { background: #eef2fa; color: var(--a); border: 1px solid #d5deee; }
.samples button:hover { background: #e2eaf8; }

/* ---------- generate ---------- */
.progress {
  height: 10px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0 4px;
}
#gen-bar {
  height: 100%;
  width: 0%;
  background: var(--b);
  border-radius: 6px;
  transition: width 0.8s linear;
}
#gen-video { width: 100%; max-width: 720px; border-radius: 10px; margin: 14px 0 10px; background: #000; }
