/* The work sheet (6.2): a student's task, a teacher's review and the task
   builder share one full-screen sheet; plus the recorder (5.3) and small
   widgets of the learning screens. Tokens only, no colours of their own. */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--text);
  background: var(--bg);
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px max(16px, calc((100% - 760px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.sheet-close {
  flex: none;
}
.sheet-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.sheet-title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px max(16px, calc((100% - 760px) / 2)) 28px;
  overflow: auto;
}
.sheet-body > * {
  flex: none;
}
.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px max(16px, calc((100% - 760px) / 2))
    calc(12px + var(--safe-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.task-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}
.task-counter,
.task-savestate {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.task-savestate {
  margin-right: auto;
}
.task-due {
  color: var(--muted);
  font-size: 13px;
}
.task-banner {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--panel);
}
.task-banner p {
  margin: 0;
}
.task-banner.is-revision {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, var(--panel));
}
.task-banner.is-sent {
  border-color: var(--info);
  background: color-mix(in srgb, var(--info) 10%, var(--panel));
}
.task-banner.is-checked {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--panel));
}
.task-score {
  font-weight: 650;
}
.task-history {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}
.task-history summary {
  cursor: pointer;
  font-weight: 600;
}
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 650;
}
.result-badge.is-correct,
.choice-flag.is-correct {
  color: var(--success);
  border-color: var(--success);
}
.result-badge.is-wrong,
.choice-flag.is-wrong {
  color: var(--danger);
  border-color: var(--danger);
}
.result-badge.is-partial {
  color: var(--warning);
  border-color: var(--warning);
}
.choice-flag {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 650;
}
.fill-key {
  font-family: var(--mono);
  color: var(--success);
}
.task-image-answer {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--r-sm);
  object-fit: contain;
}
.form-link {
  color: var(--accent-readable, var(--accent-strong));
  text-decoration: underline;
  overflow-wrap: anywhere;
}
.practice-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.status-pill--task {
  white-space: nowrap;
}
.status-icon {
  width: 14px;
  height: 14px;
}
/* review */
.review-choices,
.review-fill {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.review-text {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.review-mark {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.review-decision {
  min-width: 140px;
}
.inbox-row {
  cursor: pointer;
}
/* builder */
.task-exercises,
.task-students,
.task-words {
  display: grid;
  gap: 10px;
}
.task-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
}
.task-add {
  justify-self: start;
}
/* recorder (5.3) */
.recorder-widget {
  display: grid;
  gap: 10px;
  justify-items: start;
}
.recorder-widget audio {
  width: 100%;
  max-width: 420px;
}
.recorder-live {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--danger);
  border-radius: var(--r-md);
}
.recorder-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--danger);
  animation: recorder-pulse 1.2s ease-in-out infinite;
}
.recorder-clock {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.recorder-note,
.recorder-draft {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.recorder-upload {
  cursor: pointer;
}
@keyframes recorder-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .recorder-dot {
    animation: none;
  }
}
html[data-anim="off"] .recorder-dot {
  animation: none;
}
/* the mistakes quiz, the pasted list, the lesson log */
.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quiz-option {
  min-height: 52px;
  justify-content: center;
  white-space: normal;
}
.quiz-type {
  display: flex;
  gap: 10px;
}
.quiz-type .input {
  flex: 1;
}
.quiz-feedback {
  display: grid;
  gap: 6px;
}
.dialog-card--wide {
  width: min(720px, calc(100vw - 32px));
}
.paste-preview {
  max-height: 40vh;
  overflow: auto;
}
.paste-table {
  width: 100%;
  border-collapse: collapse;
}
.paste-table th,
.paste-table td {
  padding: 6px;
  text-align: left;
  vertical-align: middle;
}
.paste-table tr.is-duplicate {
  opacity: 0.65;
}
.lesson-note {
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  list-style: none;
}
.lesson-note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lesson-note-form {
  margin-bottom: 12px;
}
.xp-adjust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.xp-adjust > strong {
  flex-basis: 100%;
}
.xp-adjust .xp-adjust-amount {
  flex: 0 0 7.5rem;
}
.xp-adjust input[type="text"] {
  flex: 1 1 12rem;
}
.pill--soft {
  background: var(--accent-soft);
}
@media (max-width: 520px) {
  .quiz-options {
    grid-template-columns: 1fr;
  }
}
.quiz-sentence {
  margin: 0;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 18px;
}
