/* Everything below is specific to this page. Colour, type and spacing all
   come from /css/site.css, so the theme toggle in the nav works here with
   nothing extra. The site uses no border-radius anywhere; neither does this. */

/* The site stands a page's heading 64px under the bar and its first section
   64px under that: room an essay's title wants. This page is opened on a
   phone, for what is under the heading, so on a narrow screen the heading
   sits close to both; closest on a student's dashboard (main.is-dashboard,
   which headFor sets), whose heading has no sentence under it. */
@media (max-width: 640px) {
  .pagehead { padding-top: 24px; }
  .pagehead + .section { padding-top: 20px; }
  .is-dashboard .pagehead + .section { padding-top: 0; }
}

.token-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

/* The site styles .btn for links; these are real buttons. */
button.btn,
button.btn--ghost {
  font-family: var(--sans);
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
}
button.btn:hover { background: var(--accent-hover); }
button.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* .btn--ghost is a hero class: the site only ever uses it inside .hero, on
   top of a dark image, so it takes its text colour from --hero-title, which
   is white in BOTH themes. On an ordinary page background that is white on
   near-white. These buttons are not in a hero, so they name their own colour. */
button.btn--ghost,
button.btn--ghost:hover,
a.btn--ghost,
a.btn--ghost:hover {
  color: var(--strong);
  border-color: var(--ghost-border);
}
button.btn--ghost:hover, a.btn--ghost:hover { border-color: var(--muted); }
.callout .token-actions { margin-top: 12px; }

/* A callout in the site's idiom: flat, squared, one accent edge. */
.callout {
  border: 1px solid var(--panel-line);
  border-left: 2px solid var(--accent);
  background: var(--panel-bg);
  padding: 14px 18px;
  margin: 22px 0;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout strong { color: var(--strong); }

/* The one warning on the page that has to land before the sign-in button is
   even visible: a thicker accent edge and a headline in the accent colour. */
#phone-first .callout { border-left-width: 5px; }
#phone-first .callout p.warn-head {
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--accent);
}
#phone-first .callout p.warn-sub { font-size: 18px; color: var(--strong); margin-top: 6px; }

/* Eight characters, read off a phone and typed on a keyboard across the
   room. Big, spaced, and never broken across a line. */
.token-value {
  font-family: var(--mono);
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 600;
  letter-spacing: .09em;
  color: var(--strong);
  white-space: nowrap;
  line-height: 1.5;
}

.phone-url {
  font-family: var(--mono);
  font-size: clamp(16px, 4.5vw, 20px);
  color: var(--strong);
  word-break: break-all;
}

.hint { color: var(--muted); font-size: 14px; }
.error { color: var(--accent); font-weight: 500; }
.low { color: var(--accent); font-weight: 600; }

.steps { color: var(--text); }
.steps code {
  font-family: var(--mono);
  font-size: .92em;
  color: var(--strong);
}

/* Your submissions: one flat card per activity, squared like the rest of the
   site. The left edge and the chip in the corner say where a student stands:
   green, handed in; amber, something to do while it is still open; red,
   missed. A closed activity with nothing in it gets no colour at all, which
   is how a lab run before the grader existed must look -- not red. */
:root {
  /* Soft status colours beside the site's own --green: the word in the
     colour on a faint wash of it. The site has no amber or red of its own. */
  --ok-wash: rgba(63, 185, 80, .12);
  --warn: #d29922;
  --warn-wash: rgba(210, 153, 34, .13);
  --bad: #f47067;
  --bad-wash: rgba(244, 112, 103, .12);
  /* Under the class's picture: the bars' colour in its legend, as Grades'
     drawing paints them, and the wash behind the line about the median. */
  --bar: #3a3e45;
  --note-wash: rgba(255, 255, 255, .04);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ok-wash: rgba(26, 127, 55, .09);
    --warn: #9a6700;
    --warn-wash: rgba(154, 103, 0, .10);
    --bad: #c93c37;
    --bad-wash: rgba(201, 60, 55, .08);
    --bar: #cfcac0;
    --note-wash: rgba(120, 100, 70, .055);
  }
}
:root[data-theme="light"] {
  --ok-wash: rgba(26, 127, 55, .09);
  --warn: #9a6700;
  --warn-wash: rgba(154, 103, 0, .10);
  --bad: #c93c37;
  --bad-wash: rgba(201, 60, 55, .08);
  --bar: #cfcac0;
  --note-wash: rgba(120, 100, 70, .055);
}

.subs { margin: 26px 0 8px; }
/* Your exams: first on the page while an exam is out, its cards an
   activity's (.sub), the mark big and the way to the booklet a real button. */
.exams { margin: 26px 0 8px; }
.exams .exam .sub__title { font-size: 17px; }
.exams a.exam__go { text-decoration: none; }
.exams .exam .sub__note { margin-top: 12px; }
.subs__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 14px;
}
.subs__head h2 { margin: 0; }
/* The note on how fresh the list is, and the button that freshens it. */
.subs__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  margin-top: 10px;
}
.subs .subs__bar .hint { margin: 0; }

/* Your grader code: the Code tab, and what the whole page once was. In one
   of the student's labs, while they hold no code, the page opens on it
   (placeCode), and it says which lab. */
.code { margin: 26px 0 8px; }
.code .code__lede { margin: 10px 0 0; }
.code .code__for { margin: 14px 0 0; }
/* Lost it? The step before a new code, which ends the old one. */
#lost-box .token-actions { margin-top: 12px; }
.prose .lost__left { margin: 10px 0 0; }
/* check.py itself, under whichever of the three states is showing. */
.code .code__client {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-line);
}
.code .code__client .hint { margin: 0; flex: 1 1 220px; line-height: 1.5; }

.sub {
  border: 1px solid var(--panel-line);
  border-left: 3px solid var(--panel-line);   /* every card, so their text lines up */
  background: var(--panel-bg);
  margin-top: 12px;
}
.sub--ok { border-left-color: var(--green); }
.sub--warn { border-left-color: var(--warn); }
.sub--bad { border-left-color: var(--bad); }

/* The bar: which activity, and one word on where the student stands. */
.sub__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-line);
}
.sub__title { color: var(--strong); font-weight: 600; }
.sub__body { padding: 14px; }

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--panel-line);
  color: var(--muted);
  white-space: nowrap;
}
.chip--ok { color: var(--green); background: var(--ok-wash); border-color: transparent; }
.chip--warn { color: var(--warn); background: var(--warn-wash); border-color: transparent; }
.chip--bad { color: var(--bad); background: var(--bad-wash); border-color: transparent; }
.sub__top .chip { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }

/* The mark, readable at arm's length, and a thin bar of where it came from. */
.mark { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.mark__n {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--strong);
}
.mark__of { font-family: var(--mono); font-size: 15px; color: var(--muted); margin-right: 4px; }
.mark .chip { align-self: center; }
.meter { display: flex; height: 4px; margin: 10px 0 14px; background: var(--line); }
.meter .ok { background: var(--green); }
.meter .warn { background: var(--warn); }

/* The facts: a quiet key, then the value and its chips. */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  margin: 0;
}
.facts dt {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 22px;
  color: var(--muted);
}
.facts dd { margin: 0; font-size: 15px; line-height: 22px; color: var(--strong); }
.fact__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.facts dd > div + .fact__tags { margin-top: 4px; }
.facts .aside { color: var(--muted); font-size: 14px; }

/* Scoped under .sub: the site's `.prose p` and `.prose ul` outrank a lone
   class, and would put the notes back in body text and indent the files. */
.sub .sub__note { margin: 14px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.sub .sub__body > .sub__note:first-child { margin-top: 0; }
.sub .sub__note--warn { color: var(--warn); }
.sub .sub__note--bad { color: var(--bad); }

.past { margin-top: 18px; }
.past > summary { cursor: pointer; color: var(--muted); font-family: var(--mono); font-size: 13px; padding: 8px 0; }
.past > .sub { margin-top: 12px; }
.sub details { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--panel-line); }
.sub summary { cursor: pointer; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.sub details .hint { margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
/* At the foot of a card, one row each: the zip of what the mark rests on,
   and the zip of what the activity hands out. Each says what is in it. */
.sub .sub__get { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.sub .sub__get + .sub__get { margin-top: 10px; }
.sub .sub__get .hint { margin: 0; font-size: 13px; line-height: 1.5; }
.sub .files {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}
.sub .files li { display: flex; justify-content: space-between; gap: 12px; margin: 0; }
.sub .files .fp { color: var(--muted); }
/* The last run, a line a task: its number, its title, and the verdict as the
   word the receipt printed. The word says it; its colour only helps. */
.sub .run__list { list-style: none; margin: 8px 0 0; padding: 0; }
.sub .run__list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 3px 0;
  font-size: 14px;
  line-height: 20px;
}
.sub .run__list li + li { border-top: 1px solid var(--panel-line); }
.sub .run__n { flex: none; width: 1.6em; font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.sub .run__t { flex: 1 1 auto; min-width: 0; color: var(--strong); overflow-wrap: anywhere; }
.sub .run__t .aside { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.sub .run__list .chip { flex: none; font-size: 11px; line-height: 18px; letter-spacing: .04em; }

/* Your week: the recommender's note (handin-fcc-recommend), in the card
   idiom above. Scoped under .week for the same reason as .sub's notes. */
.week { margin: 26px 0 8px; }
.week h2 { margin: 0; }
.week .sub { border-left-color: var(--accent); }
.week .week__alarm {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-left: 4px solid var(--bad);
  background: var(--bad-wash);
  color: var(--bad);
  font-weight: 700;
}
.week .week__label {
  margin: 14px 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.week .sub__body > .week__label:first-child { margin-top: 0; }
.week .week__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.week .week__chips .chip { font-size: 13px; line-height: 22px; }
.week ol { margin: 0; padding-left: 22px; line-height: 1.55; }
.week li { margin: 3px 0; }
.week p { margin: 0; line-height: 1.55; }
.week .week__links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.week .week__aside { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* What is wrong now, before anything to work on: the attendance warning,
   lifted out of the week's card so it is the first line under their name. */
.alert {
  margin: 22px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--bad);
  background: var(--bad-wash);
  color: var(--bad);
  font-weight: 700;
}

/* Where they stand: their score out of a hundred, how far it is from the
   middle of the class, and the section as dots with one of them theirs. No
   letter is shown here. Every number is the grades service's own -- this
   page works nothing out and stores nothing. */
.standing { margin: 26px 0 8px; }
.standing h2 { margin: 0; }
.standing .sub { border-left-color: var(--accent); }
.standing__hero { display: flex; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.standing__score {
  font-family: var(--sans);
  font-size: 46px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--strong);
}
.standing__score.is-none { font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.standing__of { font-size: 14px; color: var(--muted); }
.standing__k {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
/* The middle of the class, in words: one tone whichever side they are on. */
.standing__note {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 4px solid var(--ghost-border);
  background: var(--note-wash);
  color: var(--strong);
  line-height: 1.5;
}
.standing__note b { font-weight: 600; }
.standing__more { margin: 12px 0 0; font-size: 14px; }

/* The class beside them, folded: their own score is the headline. */
.standing .compare { margin-top: 14px; border-top: 1px solid var(--panel-line); }
.standing .compare > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.standing .compare > summary::-webkit-details-marker { display: none; }
.standing .compare > summary::after { content: "+"; font-size: 16px; color: var(--muted); }
.standing .compare[open] > summary::after { content: "\2212"; }
.standing .compare .standing__note { margin-top: 2px; }

/* The chart is Grades' own drawing (/handin-grades/curve.js), its picture of
   the class with no letters on it, and it brings its look with it. It is
   drawn at the width it is given, so its type stays 11px whatever the phone
   is; a resize redraws it rather than scaling it. */
.chart { margin-top: 16px; }
.chart svg { display: block; width: 100%; height: auto; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; }
.legend i.dot { border-radius: 50%; background: var(--gc-dot, var(--muted)); }
.legend i.bars { background: var(--bar); }
.legend i.you { border-radius: 50%; background: var(--accent); }
.legend i.med {
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top: 0;
  border-bottom: 8px solid var(--muted);
  vertical-align: 1px;
}

[hidden] { display: none !important; }

/* ---- The four tabs (tabs.js) ----------------------------------------------
   On a phone the bar is fixed to the foot of the screen, where a thumb
   reaches, and the page keeps room under its last line for it. On a wider
   screen it is a row above the panels. Its own colours are the site's. */
:root { --new: #38bdf8; --new-wash: rgba(56, 189, 248, .12); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --new: #0b7fb4; --new-wash: rgba(11, 127, 180, .09); }
}
:root[data-theme="light"] { --new: #0b7fb4; --new-wash: rgba(11, 127, 180, .09); }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 22px 0 0;
  border-bottom: 1px solid var(--panel-line);
}
.tabs__tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 6px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.tabs__tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; flex: none; }
.tabs__tab:hover { color: var(--strong); }
.tabs__tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tabs__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  background: var(--accent);
  color: #fff;
}
.tabpanel > .subs:first-child,
.tabpanel > .exams:first-child,
.tabpanel > .code:first-child { margin-top: 22px; }

/* Who is signed in, under the greeting: one or two quiet lines on a
   student's page, where the name is already the heading. */
.is-dashboard .meta { gap: 4px 18px; padding: 10px 0; font-size: 12px; }

@media (max-width: 720px) {
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    margin: 0;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-line);
    border-bottom: 0;
  }
  .tabs__tab {
    flex-direction: column;
    gap: 3px;
    min-height: 58px;
    font-size: 12px;
    border-bottom: 0;
    margin-bottom: 0;
    border-top: 2px solid transparent;
  }
  .tabs__tab[aria-selected="true"] { border-top-color: var(--accent); }
  .tabs__tab svg { width: 22px; height: 22px; }
  .tabs__badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  body.has-tabs { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Now (now.js) ------------------------------------------------------- */
#panel-now .alert { margin-top: 18px; }
.labbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  background: var(--panel-bg);
}
.prose .labbar p { margin: 0; color: var(--strong); font-weight: 600; line-height: 1.4; }
.labbar p span { display: block; color: var(--muted); font-weight: 400; font-size: 14px; }
button.btn--sm, .btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; white-space: nowrap; }

.now__head { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 2px; }
.now__head h2 { margin: 0; }
.now__count { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.prose .now__empty { margin: 12px 0 0; color: var(--muted); }
.prose h3.now__sub {
  margin: 28px 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.now__pair { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--strong); }
.now__pair:first-of-type { border-top: 0; }
.now__pair span:last-child { color: var(--muted); text-align: right; }
.prose .now__done { margin: 0; padding: 5px 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.now__done b { color: var(--green); }

.sub--new { border-left-color: var(--new); }
.chip--new { color: var(--new); background: var(--new-wash); border-color: transparent; }
.todo .chip { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.todo__in { padding: 12px 14px; }
.todo__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.todo__row .sub__title { min-width: 0; }
.todo__mark { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--strong); white-space: nowrap; }
.todo__mark small { font-size: 13px; font-weight: 400; color: var(--muted); }
.prose .todo__clock {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}
.prose .todo__due { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.todo__when.is-soon { color: var(--warn); font-weight: 600; }
.todo__marks { font-family: var(--mono); color: var(--strong); }
.prose .todo__key { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--muted); }
.strip { display: flex; gap: 3px; margin: 12px 0 2px; }
.strip i { flex: 1; height: 10px; background: var(--line); }
.strip i.is-pass { background: var(--green); }
.strip i.is-fail { background: var(--bad); }
.todo .todo__fold { margin-top: 10px; padding-top: 0; border-top: 1px solid var(--panel-line); }
.todo .todo__fold > summary { display: flex; align-items: center; justify-content: space-between; min-height: 40px; font-size: 13px; list-style: none; }
.todo .todo__fold > summary::-webkit-details-marker { display: none; }
.todo .todo__fold > summary::after { content: "+"; font-size: 15px; }
.todo .todo__fold[open] > summary::after { content: "\2212"; }
.todo .todo__tasks { list-style: none; margin: 0; padding: 0; }
.todo .todo__tasks li { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 5px 0; font-size: 14px; line-height: 20px; border-top: 1px solid var(--panel-line); }
.todo .todo__tasks .run__n { flex: none; width: 1.6em; font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.todo .todo__tasks .run__t { flex: 1 1 auto; min-width: 0; color: var(--strong); }
.todo .todo__tasks .chip { flex: none; }
.todo .sub__get { margin-top: 12px; }
.todo a.todo__btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.todo__row a.todo__btn { margin-top: 0; }
.link {
  background: none;
  border: 0;
  padding: 0;
  min-height: 40px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}
.todo__go { margin-top: 4px; }

/* Google draws its own button and owns its markup; just give it room. */
#signin { margin: 4px 0 8px; min-height: 44px; }

/* The one choice sign-in asks, under Google's button. Scoped under .prose
   for the hint, as for .sub's notes: `.prose p` outranks a lone class. */
.keep {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 15px;
  color: var(--strong);
  cursor: pointer;
}
.keep input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.prose .keep__hint { margin: 4px 0 0 28px; font-size: 14px; line-height: 1.5; color: var(--muted); }
