/* Reference: Monocle ("ink on paper"). Serif for anything read at length,
   sans for controls, black hairlines, square corners, one yellow action. */
:root {
  --paper: #ffffff;
  --parchment: #fdfcf3;
  --ink: #000000;
  --sterling: #6e6e6e;
  --zinc: #d9d9d9;
  --cloud: #f1f1f1;
  --yellow: #ffc500;
  --stop: #a4161a;
  --read: Plantin, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--ui); letter-spacing: 0.01em; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--read); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 12px; }
.quiet { color: var(--sterling); font-size: 13px; }
a { color: inherit; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

button.action {
  font: 700 14px/1 var(--ui); letter-spacing: 0.01em; color: var(--ink);
  background: var(--yellow); border: 0; border-radius: 0; padding: 14px 20px; cursor: pointer;
}
button.action:hover { background: #ffd43b; }
button.action:disabled { background: var(--cloud); color: var(--sterling); cursor: default; }
input, textarea {
  font: 16px/1.5 var(--ui); color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink); border-radius: 0; padding: 10px 12px; width: 100%;
}

/* Passphrase */
.gate { max-width: 620px; margin: 0 auto; padding: 14vh 24px 40px; }
.gate h1 { font-size: 40px; line-height: 1.13; margin-bottom: 20px; }
.gate .lede { font: 20px/1.44 var(--read); margin-bottom: 40px; }
.gate label, .answer label { display: block; font: 700 14px/1.3 var(--ui); margin-bottom: 8px; }
.gate-row { display: flex; gap: 8px; }
.gate-row input { flex: 1; }
.problem { color: var(--stop); font-size: 14px; margin-top: 12px; }

/* Two columns: the task list stays put, the desk scrolls */
.app { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: 100vh; }
.tasks { border-right: 1px solid var(--ink); display: flex; flex-direction: column; min-height: 0; }
.tasks header { padding: 24px 20px 16px; border-bottom: 1px solid var(--ink); }
.tasks h1 { font-size: 24px; line-height: 1.25; }
.tasks header p { margin: 4px 0 16px; }
#task-list { overflow-y: auto; flex: 1; padding-bottom: 40px; }
.group h2 {
  font: 700 13px/1.3 var(--ui); letter-spacing: 0.01em; margin: 0;
  padding: 20px 20px 8px; position: sticky; top: 0; background: var(--paper);
  border-bottom: 1px solid var(--zinc);
}
.group ul { list-style: none; margin: 0; padding: 0; }
.group button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--zinc); padding: 10px 20px; cursor: pointer;
  font: 15px/1.3 var(--read); color: var(--ink);
}
.group button small { display: block; font: 13px/1.5 var(--ui); color: var(--sterling); margin-top: 2px; }
.group button:hover { background: var(--parchment); }
.group button[aria-current="true"] { background: var(--ink); color: var(--paper); }
.group button[aria-current="true"] small { color: var(--zinc); }
.none { padding: 20px; }

.desk { overflow-y: auto; padding: 40px 48px 80px; }
.desk > * { max-width: 720px; }
.empty h2, .task-head h2 { font-size: 32px; line-height: 1.15; margin-bottom: 12px; }
.empty p { font: 18px/1.5 var(--read); }
.empty p.quiet { font: 13px/1.5 var(--ui); }
.task-head { border-bottom: 1px solid var(--ink); padding-bottom: 12px; margin-bottom: 24px; }
.task-head p { margin: 0; }

/* The task exactly as the item supplies it */
.student { font: 18px/1.6 var(--read); letter-spacing: 0; }
.student h2 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; }
.student h3 { font-size: 20px; line-height: 1.3; margin: 28px 0 8px; }
.student h4, .student h5 { font-size: 18px; margin: 20px 0 6px; }
.student p { margin: 0 0 14px; }
.student ul, .student ol { margin: 0 0 14px; padding-left: 22px; }
.student li { margin-bottom: 8px; }
.student blockquote { margin: 0 0 14px; padding-left: 16px; border-left: 2px solid var(--ink); }
.student table { border-collapse: collapse; margin: 0 0 14px; font: 15px/1.4 var(--ui); }
.student th, .student td { border: 1px solid var(--zinc); padding: 6px 10px; text-align: left; vertical-align: top; }
.student img { max-width: 100%; }
.student section { margin-bottom: 8px; }
.student section.apone-writing-mode { font: 14px/1.5 var(--ui); color: var(--sterling); }
.student section.apone-writing-mode h2 { font: 700 14px/1.5 var(--ui); color: var(--ink); letter-spacing: 0.01em; }
.student section.apone-writing-mode p { margin: 0; }
.student section.apone-writing-rubric { background: var(--parchment); border: 1px solid var(--zinc); padding: 16px 20px 6px; margin: 16px 0 8px; font-size: 16px; line-height: 1.5; }
.student section.apone-writing-rubric h3 { margin-top: 0; font-size: 18px; }
.student section.apone-writing-scoring-guidance { font-size: 16px; line-height: 1.5; color: #333; border-top: 1px solid var(--zinc); margin-top: 20px; }

.answer { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--ink); }
.answer textarea { font: 17px/1.6 var(--read); min-height: 260px; resize: vertical; }
.answer-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.waiting { margin: 16px 0 0; font: 16px/1.5 var(--read); padding: 12px 16px; background: var(--parchment); border-left: 4px solid var(--yellow); }

.result { margin-top: 32px; border: 1px solid var(--ink); }
.result .score { display: flex; align-items: baseline; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--ink); flex-wrap: wrap; }
.result .score strong { font: 700 40px/1.13 var(--read); letter-spacing: -0.02em; }
.result .score span { font-size: 14px; color: var(--sterling); }
.result .feedback { padding: 20px 24px 8px; font: 17px/1.6 var(--read); letter-spacing: 0; }
.result .feedback p { margin: 0 0 12px; }
.result .feedback p.gap { height: 4px; margin: 0; }
.result.failed { border-color: var(--stop); }
.result.failed .why { padding: 20px 24px 4px; }
.result.failed h3 { font-size: 24px; line-height: 1.25; margin-bottom: 8px; color: var(--stop); }
.result.failed p { font: 17px/1.5 var(--read); }
.result footer { padding: 12px 24px; border-top: 1px solid var(--zinc); font-size: 13px; color: var(--sterling); }

.earlier { margin-top: 32px; }
.earlier h3 { font: 700 14px/1.3 var(--ui); letter-spacing: 0.01em; margin-bottom: 8px; }
.earlier ol { margin: 0 0 8px; padding: 0; list-style: none; border-top: 1px solid var(--zinc); }
.earlier li { border-bottom: 1px solid var(--zinc); padding: 8px 0; font-size: 14px; display: grid; grid-template-columns: 96px 80px 1fr; gap: 12px; }
.earlier li span:last-child { color: var(--sterling); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .tasks { border-right: 0; border-bottom: 1px solid var(--ink); max-height: 50vh; }
  .desk { padding: 24px 20px 60px; }
}
