:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #172b3a;
  background: #f2f5f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; min-width: 320px; }

.shell { max-width: 1280px; margin: 0 auto; padding: 38px 24px 24px; }

header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.brand {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  color: white; background: #126d70; font-weight: 750; letter-spacing: -.04em;
}
.eyebrow { margin: 0 0 5px; color: #657887; font-size: .72rem; font-weight: 700; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.04em; }
h2 { margin: 0; font-size: 1.2rem; }
.local-badge { margin-left: auto; padding: 7px 11px; border-radius: 999px; background: #e2eeed; color: #126d70; font-size: .8rem; font-weight: 650; }

.panel { background: white; border: 1px solid #e1e8ed; border-radius: 16px; box-shadow: 0 5px 22px #19344a0a; }
.setup { padding: 22px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: flex; flex-direction: column; gap: 8px; color: #415665; font-size: .88rem; font-weight: 650; }
input:not([type="checkbox"]) {
  width: 100%; min-height: 43px; padding: 9px 12px; border: 1px solid #cad6de;
  border-radius: 8px; background: white; color: #172b3a; font: inherit;
}
select {
  width: 100%; min-height: 43px; padding: 9px 36px 9px 12px; border: 1px solid #cad6de;
  border-radius: 8px; background: white; color: #172b3a; font: inherit;
}
.checks { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.check, .consent { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: #126d70; }
.hint { margin: 16px 0 0; color: #657887; font-size: .84rem; line-height: 1.5; }
.consent { margin-top: 17px; color: #415665; font-size: .84rem; }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
button { min-height: 40px; padding: 9px 15px; border: 0; border-radius: 8px; font: inherit; font-weight: 650; cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
.primary { color: white; background: #126d70; }
.primary:hover:not(:disabled) { background: #0c595c; }
.stop { color: #8e3030; background: #f8eaea; }
#status { margin-left: 4px; color: #657887; font-size: .85rem; }
#status.error { color: #a22b36; }

.transcript-panel { margin-top: 18px; padding: 22px; }
.transcript-heading { display: flex; align-items: center; justify-content: space-between; }
.quiet { min-height: 34px; padding: 6px 10px; color: #415665; background: #f0f4f6; font-size: .82rem; }
.logout-form { margin-left: 8px; }
.login-shell { max-width: 520px; }
#login-form { display: grid; gap: 18px; }
#login-form .login-message { margin: 0; color: #a22b36; font-size: .88rem; }
#setup-help { color: #415665; line-height: 1.6; }
.columns-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 8px;
  color: #657887; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.transcript { display: flex; flex-direction: column; gap: 10px; height: 58vh; min-height: 260px; overflow-y: auto; padding-right: 4px; }
.empty { align-self: center; margin: auto; color: #85939d; font-size: .92rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cell { padding: 11px 14px; border-radius: 10px; transition: background .2s; }
.cell.original { background: #f6f8fa; }
.cell.translation { background: #edf5f7; }
.cell .meta { margin-bottom: 4px; color: #738391; font-size: .74rem; }
.cell .text { margin: 0; line-height: 1.45; white-space: pre-wrap; }
.cell.original .text { color: #3c4f5d; }
.cell.translation .text { color: #114c65; font-size: 1.04rem; font-weight: 600; }
.cell.draft .text { color: #7d8f9b; font-style: italic; font-weight: 500; }
footer { max-width: 800px; margin: 18px auto 0; color: #75848f; font-size: .78rem; line-height: 1.55; text-align: center; }

.setup .grid { grid-template-columns: repeat(3, 1fr); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.side-panel { padding: 18px; }
.side-panel h2 { margin-bottom: 10px; font-size: 1.02rem; }
.side-text { margin: 10px 0; color: #536775; font-size: .84rem; line-height: 1.5; }
.side-note, .side-empty { margin: 10px 0 0; color: #85939d; font-size: .76rem; line-height: 1.45; }
.small { min-height: 36px; padding: 7px 12px; font-size: .86rem; }
.invite-box { display: flex; gap: 6px; margin-top: 10px; }
.invite-box input { min-height: 36px; padding: 6px 9px; font-size: .78rem; }
.quiet.muted { color: #8e3030; background: #f8eaea; }
.summary { max-height: 32vh; overflow-y: auto; }
.summary ul { margin: 0; padding-left: 18px; color: #2f4553; font-size: .86rem; line-height: 1.5; }
.summary li + li { margin-top: 5px; }
.summary li.highlight { color: #126d70; font-weight: 650; list-style: "➜ "; }
.usage { width: 100%; border-collapse: collapse; font-size: .8rem; }
.usage th, .usage td { padding: 6px 0; border-bottom: 1px solid #edf1f4; text-align: left; font-weight: 500; }
.usage th { color: #536775; }
.usage td { color: #738391; text-align: right; white-space: nowrap; padding-left: 8px; }
.usage td:last-child { color: #172b3a; font-variant-numeric: tabular-nums; }
.usage .total th, .usage .total td:last-child { color: #126d70; font-weight: 750; border-bottom: 0; }

/* Speaker turns: each speaker gets a colour and a small horizontal offset. */
.row { position: relative; transition: margin .2s; }
.row.turn { margin-top: 8px; }
.row.speaker > .cell { border-left: 4px solid var(--speaker); }
.row.speaker-0 { --speaker: #126d70; margin-left: 0; }
.row.speaker-1 { --speaker: #b5651d; margin-left: 28px; }
.row.speaker-2 { --speaker: #6a4bb5; margin-left: 56px; }
.row.speaker-3 { --speaker: #2f6fb8; margin-left: 84px; }
.row.speaker .cell .meta { color: var(--speaker); font-weight: 650; }

@keyframes subtitle-row-in {
  from { opacity: .8; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes subtitle-text-in {
  from { opacity: .8; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .row { animation: subtitle-row-in 200ms ease-out; }
  .cell .text:not(:empty) { animation: subtitle-text-in 180ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  .row, .cell { transition: none; }
}

/* Guest page */
.guest-setup { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 18px 22px; }
.guest-setup label { min-width: 220px; }
.join-card { max-width: 520px; margin: 0 auto; padding: 28px; }
.join-card p { color: #415665; line-height: 1.6; }
.join-message { color: #a22b36; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .setup .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .shell { padding: 22px 14px; }
  .grid, .setup .grid { grid-template-columns: 1fr; gap: 13px; }
  .checks { padding-top: 4px; }
  .actions { flex-wrap: wrap; }
  #status { flex-basis: 100%; margin: 4px 0 0; }
  .setup, .transcript-panel { padding: 17px; }
  .columns-head { display: none; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row.speaker-1 { margin-left: 12px; }
  .row.speaker-2 { margin-left: 24px; }
  .row.speaker-3 { margin-left: 36px; }
  .actions, .guest-setup { flex-wrap: wrap; }
}
