/* The demo's styles. Text contrast is at least 4.5:1 and focus is always visible (WCAG 2.1 AA). */
:root {
  --text: #1a1a1a;
  --muted: #4d4d4d;
  --line: #8a8a8a;
  --link: #0645ad;
  --primary: #0b5394;
  --mark: #fff3a0;
  --ready: #1e6b2e;
  --draft: #8a4b00;
  --problem: #a40000;
  --focus: #b35900;
  --surface: #f4f4f4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
}
main { max-width: 72rem; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
main.wide { max-width: 100rem; }
main:focus { outline: none; }
a { color: var(--link); }
a:focus, button:focus, input:focus, select:focus, textarea:focus, summary:focus, [tabindex="-1"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
h1 { font-size: 1.75rem; line-height: 1.25; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* A comma for a screen reader: a pause in a name, such as "Place 1, not answered" (C4).
   It stays inline, so the name has no space before the comma. */
.pause { font-size: 0; }
header.site {
  border-bottom: 1px solid var(--line); padding: 0.5rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem;
}
/* Sign-in (C2): who is signed in, and the sign-out button. */
.account { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; font-size: 0.95rem; }
.account .who { color: var(--muted); overflow-wrap: anywhere; }
.account button { padding: 0.2rem 0.75rem; }
.notice { border: 3px solid var(--primary); padding: 0.75rem 1rem; margin: 0 0 1.5rem; }
.notice p { margin: 0; }
.brand { margin: 0; font-weight: 700; font-size: 1.2rem; }
.brand a { color: var(--text); text-decoration: none; }
.tag { font-weight: 400; font-size: 0.85rem; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 0.3rem; }
/* A test run must be unmistakable (MVP-3b): a strong band on every job screen. */
.test-run { margin: 0; padding: 0.75rem 1.25rem; background: #5c1a7a; color: #fff; font-size: 1.1rem; border-bottom: 4px solid #2e0d3d; }
.test-run p { margin: 0; }
.test-tag { font-size: 0.85rem; font-weight: 700; color: #5c1a7a; border: 2px solid #5c1a7a; border-radius: 3px; padding: 0 0.35rem; margin-left: 0.4rem; }
.hint, .meta, .crumbs { color: var(--muted); font-size: 0.95rem; }
.field { margin: 0 0 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  font: inherit; width: 100%; max-width: 36rem; padding: 0.45rem 0.55rem;
  border: 2px solid var(--line); border-radius: 4px; background: #fff; color: var(--text);
}
/* The file input fits a 320 px window (WCAG 1.4.10, C4). */
input[type="file"] { font: inherit; max-width: 100%; }
button, .button {
  display: inline-block; font: inherit; font-weight: 600; padding: 0.55rem 1.1rem;
  border-radius: 4px; border: 2px solid var(--primary); background: #fff; color: var(--primary);
  cursor: pointer; text-decoration: none;
}
button.primary, .button.primary { background: var(--primary); color: #fff; }
button[disabled] { opacity: 0.6; cursor: default; }
.error-summary { border: 3px solid var(--problem); padding: 0.75rem 1rem; margin: 0 0 1.5rem; }
.error-summary h2 { margin-top: 0; font-size: 1.15rem; color: var(--problem); }
.problem { color: var(--problem); font-weight: 600; }
/* An unsaved change kept in a card that was drawn again: words and a border, not color alone. */
.unsaved { border: 3px solid var(--draft); padding: 0.4rem 0.75rem; margin: 0 0 0.75rem; }
.status { font-size: 1.15rem; font-weight: 600; }
ul.questions, ul.jobs, ul.files, ul.links { padding-left: 1.25rem; }
ul.questions li { margin: 0.2rem 0; }
.state { font-size: 0.9rem; margin-left: 0.5rem; padding: 0 0.35rem; border-radius: 3px; border: 1px solid var(--line); }
.state-answered { color: var(--ready); border-color: var(--ready); }
.state-open, .state-skipped { color: var(--muted); }
.state-retry { color: var(--problem); border-color: var(--problem); }
.ready { color: var(--ready); font-weight: 600; }
.draft { color: var(--draft); font-weight: 600; }
.question-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
@media (min-width: 60rem) {
  .question-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.page-image { margin: 0; }
.page-image img { max-width: 100%; height: auto; border: 1px solid var(--line); }
.context {
  background: var(--surface); border-left: 4px solid var(--line);
  padding: 0.75rem 1rem; margin: 0 0 1rem; overflow-x: auto;
}
/* A marked formula: the mark element is for a screen reader. The formula shows the mark. */
mark.math-mark { background: none; color: inherit; }
mark.place, .math.place, .place {
  background: var(--mark); color: var(--text);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.gap {
  display: inline-block; min-width: 1.6em; text-align: center; font-weight: 700;
  border: 2px solid var(--text); background: var(--mark); padding: 0 0.25rem; margin: 0 0.15rem;
}
.math.display { display: block; margin: 0.5rem 0; }
.cannot-draw { font-style: italic; color: var(--muted); }
fieldset { border: 2px solid var(--line); border-radius: 4px; margin: 0 0 1.25rem; padding: 0.75rem 1rem; }
legend { font-weight: 700; padding: 0 0.35rem; }
.option { display: flex; gap: 0.6rem; align-items: baseline; margin: 0.45rem 0; }
.option input { width: 1.15rem; height: 1.15rem; flex: none; }
.option label { font-weight: 400; margin: 0; }
.reading { font-size: 1.1rem; }
.typed { margin: 0.25rem 0 0.75rem 1.75rem; }
.typed label { font-weight: 600; margin-top: 0.4rem; }
.drafted { border: 1px solid var(--line); padding: 0.5rem 1rem; margin-bottom: 1rem; }
.drafted h2 { margin-top: 0.25rem; font-size: 1.1rem; }

/* The page screen (MVP-3b): the page with its boxes, and the cards beside it. */
ul.pages { padding-left: 1.25rem; }
ul.pages li { margin: 0.25rem 0; }
.page-strip ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0 0 0.75rem; }
.page-strip a {
  display: inline-flex; flex-direction: column; align-items: center; min-width: 2.75rem;
  padding: 0.15rem 0.4rem; border: 2px solid var(--line); border-radius: 4px;
  color: var(--text); text-decoration: none; line-height: 1.25;
}
.page-strip a[aria-current="page"] { border-color: var(--primary); background: var(--primary); color: #fff; }
.page-strip .count { font-size: 0.8rem; }
.page-strip a.has-open .count { font-weight: 700; }
.saved { margin: 0 0 0.5rem; font-weight: 600; color: var(--ready); min-height: 1.5em; }
.page-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
.sheet { position: relative; line-height: 0; margin-top: 1.6rem; }
.sheet img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
@media (min-width: 60rem) {
  .page-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .page-view { position: sticky; top: 0.5rem; }
  /* The whole page fits the window, so it stays in view beside the cards. */
  .sheet { max-width: min(100%, calc((100vh - 6rem) * var(--aspect, 0.77))); }
}
.band {
  position: absolute; left: 0; right: 0; pointer-events: none;
  background: rgba(255, 214, 0, 0.22); border-top: 2px solid #b35900; border-bottom: 2px solid #b35900;
}
.box {
  position: absolute; display: block; min-width: 18px; min-height: 18px;
  border: 3px dashed var(--primary); border-radius: 3px; background: rgba(11, 83, 148, 0.06);
}
.box:hover { background: rgba(11, 83, 148, 0.16); }
.box:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.box-answered, .box-group { border: 3px solid var(--ready); background: transparent; }
.box-skipped { border: 3px dotted var(--muted); }
.box.selected { border-width: 4px; box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--primary); }
.box .badge { position: absolute; top: -1.55rem; left: -3px; white-space: nowrap; }
.badge {
  display: inline-block; min-width: 1.6rem; padding: 0 0.3rem; border-radius: 3px;
  font: 700 0.9rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center; color: #fff; background: var(--primary);
}
.badge-answered, .badge-group, .box-answered .badge, .box-group .badge { background: var(--ready); }
.badge-skipped, .box-skipped .badge { background: var(--muted); }
.cards h2 { font-size: 1.2rem; margin: 0.5rem 0 0.75rem; }
.card { border: 2px solid var(--line); border-radius: 6px; padding: 0.5rem 1rem 0.75rem; margin: 0 0 1rem; background: #fff; }
.card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.card.is-answered, .card.is-group { border-color: var(--ready); }
.card h3 { margin: 0.25rem 0 0.5rem; font-size: 1.1rem; }
.card h3 .badge { margin-right: 0.25rem; }
.card .state { font-weight: 400; }
.summary { font-weight: 600; }
.note { background: #fff7e0; border-left: 4px solid var(--draft); padding: 0.4rem 0.75rem; margin: 0 0 0.75rem; }
.zoom { margin: 0 0 0.5rem; }
.zoom img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }
.figure-crop { display: block; max-width: 100%; max-height: 14rem; border: 1px solid var(--line); margin: 0 0 0.75rem; }
.boxform { margin: 0 0 0.75rem; }
.link-button {
  border: none; background: none; padding: 0; color: var(--link); font-weight: 400;
  text-decoration: underline; cursor: pointer;
}
details > summary { cursor: pointer; color: var(--link); font-weight: 600; margin: 0.25rem 0 0.5rem; }
.next-step { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
