:root {
  --ink: #1d1f23;
  --muted: #5d6470;
  --line: #d9dde3;
  --paper: #ffffff;
  --shade: #f4f6f8;
  --was: #ffe3a3;
  --now: #c7e6ff;
  --focus: #fff1b8;
  --accent: #1f5fbf;
  --warn: #9a3412;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; padding: 0.35rem 0.8rem; border: 1px solid var(--line); background: var(--shade); border-radius: 4px; }
button.main-action { background: var(--accent); color: #fff; border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.link { border: none; background: none; color: var(--accent); text-decoration: underline; padding: 0; }

.bar { display: flex; gap: 1rem; align-items: center; padding: 0.6rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--shade); }
.spacer { flex: 1; }
.banner { margin: 0; padding: 0.6rem 1.5rem; background: var(--focus); }
.status { color: var(--warn); min-height: 1.5em; }
.hint { color: var(--muted); }

.narrow { display: none; padding: 2rem; }
@media (max-width: 1199px) {
  .narrow { display: block; }
  .wide { display: none; }
}

.work { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; padding: 1.5rem; }
.swap-words { font-size: 1.4rem; margin: 0 0 0.5rem; }
.swap-words .arrow { margin: 0 0.6rem; color: var(--muted); }
.ask { font-weight: 600; }

.sentences { list-style: none; margin: 0; padding: 0; }
.sentence { display: grid; grid-template-columns: 2.2rem 1.6rem minmax(0, 1fr) auto; align-items: start; column-gap: 0.4rem; padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--line); }
.sentence.marked { background: var(--shade); box-shadow: inset 3px 0 0 var(--warn); }
.number { color: var(--muted); font-size: 0.8rem; text-align: right; padding-top: 0.15rem; }
.mark-box { margin-top: 0.3rem; }
.line { margin: 0; }
.line.source { color: var(--muted); font-size: 0.92rem; }
.sentence .link { font-size: 0.85rem; }
mark.was { background: var(--was); }
mark.now { background: var(--now); }

.questions { position: sticky; top: 1rem; align-self: start; display: flex; flex-direction: column; gap: 1rem; }
.questions fieldset { border: 1px solid var(--line); border-radius: 4px; }
.questions legend { font-weight: 600; padding: 0 0.3rem; }
.questions label { display: block; margin: 0.25rem 0; }
.note textarea { width: 100%; display: block; margin-top: 0.3rem; }

.finished { padding: 2rem 1.5rem; }

.context { width: min(1400px, 95vw); max-height: 90vh; padding: 0; border: 1px solid var(--line); }
.context-head { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 1rem; background: var(--shade); position: sticky; top: 0; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 1rem 1.5rem; }
.columns li { margin-bottom: 0.4rem; }
mark.focus { background: var(--focus); }

.login { max-width: 22rem; margin: 6rem auto; }
.login label { display: block; margin-bottom: 0.8rem; }
.login input { display: block; width: 100%; padding: 0.4rem; }

.admin { padding: 1.5rem; max-width: 1100px; }
.admin section { margin-bottom: 2rem; }
.row { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.8rem; }
.secret { padding: 0.6rem; background: var(--focus); font-family: ui-monospace, monospace; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--line); }

.instructions { max-width: 46rem; margin: 2rem auto; padding: 0 1.5rem; }

.feedback-question { display: block; max-width: 46rem; margin: 1rem 0; }
.feedback-question textarea { display: block; width: 100%; margin-top: 0.3rem; }

.review { max-width: 60rem; margin: 1.5rem auto; padding: 0 1.5rem; }
.review-tasks { list-style: none; padding: 0; }
.review-task { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 4px; padding: 0.6rem 1rem; margin-bottom: 1rem; }
.review-task.agrees { border-left-color: var(--accent); }
.review-task.differs { border-left-color: var(--warn); }
.review-swap { font-size: 1.15rem; margin: 0 0 0.4rem; }
.review-swap .arrow { color: var(--muted); }
.review-line, .review-marks li { display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: 0.6rem; margin: 0.2rem 0; }
.review-line.expected { font-weight: 600; }
.review-label { color: var(--muted); font-size: 0.9rem; }
.review-marks { list-style: none; padding-left: 0; }

.answers { border: 1px solid var(--line); border-radius: 4px; padding: 0.4rem 0.8rem; background: var(--shade); }
.answers h2 { font-size: 1rem; margin: 0.2rem 0; }
.answer { margin: 0.3rem 0; font-size: 0.95rem; }
.unsure { display: block; }
.who { float: right; }
.who-mark { display: inline-block; min-width: 1.4rem; margin-left: 0.2rem; padding: 0 0.3rem; border: 1px solid var(--warn); border-radius: 3px; color: var(--warn); font-size: 0.8rem; text-align: center; }
.intro { margin: 0 0 1rem; padding: 0.5rem 0.8rem; background: var(--focus); border-radius: 4px; }
