:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #182028;
  --muted: #66717c;
  --line: #d7dde3;
  --accent: #0f766e;
  --accent-strong: #0b5d55;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #287947;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  min-height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { font-weight: 750; color: var(--text); }
.nav { display: flex; gap: 18px; align-items: center; }
.nav form { margin: 0; }
.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.page { max-width: 1320px; margin: 0 auto; padding: 28px; }
.page-head, .meeting-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.05rem; margin-bottom: 14px; }
p { line-height: 1.55; }
.muted, .help { color: var(--muted); font-size: .92rem; display: block; }
.primary, button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}
.secondary {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}
.full { width: 100%; margin-top: 18px; }
.messages { display: grid; gap: 10px; margin-bottom: 16px; }
.message {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.message.success { border-color: #a8dbc1; color: var(--ok); }
.message.error { border-color: #f1aaa5; color: var(--danger); }
.auth-panel, .form, .table-wrap, .summary-panel, .side-panel, .transcript-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.auth-panel { max-width: 430px; margin: 60px auto; padding: 28px; }
.form { max-width: 720px; padding: 22px; display: grid; gap: 18px; }
.form label { display: grid; gap: 7px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  background: white;
  font: inherit;
}
textarea { resize: vertical; line-height: 1.5; }
.errorlist { color: var(--danger); margin: 0; padding-left: 18px; }
.table-wrap { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .84rem; text-transform: uppercase; letter-spacing: 0; }
.row-title { display: block; font-weight: 750; margin-bottom: 3px; }
.empty { color: var(--muted); text-align: center; padding: 42px; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 750;
  background: var(--surface-2);
  color: var(--muted);
}
.status-completed { background: #e6f5ec; color: var(--ok); }
.status-failed { background: #fdebea; color: var(--danger); }
.status-processing, .status-queued { background: #fff2dc; color: var(--warning); }
.backlink { display: inline-block; margin-bottom: 8px; font-size: .92rem; }
.status-block { display: grid; justify-items: end; gap: 6px; }
.player-band {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 22px;
}
audio { width: 100%; }
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}
.side-panel, .summary-panel, .transcript-panel { padding: 18px; }
.speaker-list { display: grid; gap: 10px; margin-bottom: 24px; }
.speaker-form { display: grid; grid-template-columns: 30px 1fr 48px; gap: 8px; align-items: center; }
.speaker-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}
.speaker-form input { padding: 8px; }
.speaker-form button, .segment-form button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 6px;
  min-height: 36px;
  cursor: pointer;
}
.export-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.export-grid a, .export-grid span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  text-align: center;
}
.export-grid span { color: var(--muted); background: var(--surface-2); }
.markdown {
  line-height: 1.62;
  max-width: 86ch;
}
.markdown p { margin: 0 0 12px; }
.transcript-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.transcript-toolbar input { max-width: 360px; }
.transcript-list { display: grid; gap: 12px; }
.segment {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.segment.hidden { display: none; }
.time-jump {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
}
.segment-form {
  display: grid;
  grid-template-columns: 180px 1fr 90px;
  gap: 10px;
  align-items: start;
}

@media (max-width: 880px) {
  .topbar, .page-head, .meeting-head, .transcript-toolbar { flex-direction: column; align-items: stretch; }
  .topbar { padding: 16px; }
  .nav { flex-wrap: wrap; }
  .page { padding: 18px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .segment, .segment-form { grid-template-columns: 1fr; }
  .time-jump { width: 96px; }
}
