/**
 * ACE Practice Banners
 *
 * The Community Questions banner on Practice, Mock Exam and Wrong Answers
 * (and, from 1.1.0, Quiz Review and the Syllabus; from 1.2.0, the Learning Path and the Calendar):
 * the same drawing sheet (charcoal, a drafting grid, a teal glow behind the
 * drawing), the same teal eyebrow over a Poppins title, the same Pause.
 *
 * Everything is scoped to .apb, the box this plugin puts round each page's
 * title. Nothing here reaches the rest of those pages, with one exception at
 * the end of "the band": on Mock Exam the line the banner now carries is put
 * out of sight where the page prints it a second time.
 *
 * Rules carried over from the other pages:
 *   - teal TEXT uses the lighter teal;
 *   - nothing waits on an animation to be seen: a drawing's undrawn states
 *     live in its keyframes and in the steps the script sets, never in a
 *     rule that holds without them. (One rule, under "motion", holds a
 *     drawing at its beginning until the script has run; the page's <head>
 *     lifts it if the script never does.)
 *   - written for the narrowest case first: without container queries (older
 *     phones) the banner keeps its phone form at every width, words over a
 *     strip of the drawing, heavy lines, no small print;
 *   - no :has().
 */

/* ============================================================ tokens */

.apb {
  --apb-sheet: #1b1d1d;
  --apb-line2: rgba(255, 255, 255, .14);
  --apb-line3: rgba(255, 255, 255, .24);
  --apb-text: var(--color-text, #e8e6dc);
  --apb-head: var(--color-heading, #f5f4ef);
  --apb-muted: var(--color-text-muted, #a39e93);
  --apb-teal: var(--color-primary, #008a81);
  /* The same accent as three numbers, for tints. ACE Palette supplies them;
     without it the accent is the theme's own terracotta, so that is what the
     numbers fall back to. */
  --apb-rgb: var(--ace-primary-rgb, 204, 120, 92);
  --apb-teal-text: #61b6b1;
  --apb-bad: #ef8a6f;
  --apb-bad-rgb: 239, 138, 111;
  --apb-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --apb-head-font: var(--font-heading, Poppins, system-ui, sans-serif);
  --apb-body-font: var(--font-body, Inter, system-ui, sans-serif);

  /* The drawing's ink, and the teal of what is found, solved or closed. */
  --apb-ink: 226, 236, 240;
  --apb-pick-rgb: 97, 182, 177;

  color: var(--apb-text);
  font-family: var(--apb-body-font);
  color-scheme: dark;
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
  .apb { --apb-teal-text: color-mix(in srgb, var(--apb-teal) 62%, #fff); }
}

/* ============================================================ base */

.apb, .apb *, .apb *::before, .apb *::after { box-sizing: border-box; }

.apb-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.apb-i { display: block; flex: none; width: 12px; height: 12px; }

.apb button:focus-visible {
  outline: 2px solid var(--apb-teal-text);
  outline-offset: 2px;
}

/* ============================================================ the box round the banner */

/* The banner is laid out from the width it is given, not the window's, so it
   is the same banner beside one sidebar or two. (The box holds the banner
   and nothing else: a page's own parts are never inside it.) */
.apb {
  container: apb / inline-size;
  margin: 0 0 22px;
}
/* Mock Exam's own column is 860px, in the middle of the content area. */
.apb-mock { max-width: 860px; margin-inline: auto; }

/* The banner makes way for a sitting. While a mock exam is under way on the
   page (from "Before you start" through the paper to its result), and from
   the moment a review is asked for until its last question is done, the
   banner is put away (the script says so with is-folded): no drawing, no
   label, no line, no band. The page's own title stands as the page's own
   stylesheet sets it, so that the sitting has the screen exactly as it did
   before this plugin. (Every rule of the band below is written for a box
   that is not folded; what the box itself is given above is taken back
   here; and the words' coming in, under "motion", is switched off by the
   script the first time the banner is put away.) */
.apb.is-folded { container-type: normal; max-width: none; margin: 0; color: inherit; font-family: inherit; color-scheme: inherit; }
.apb.is-folded .apb-art,
.apb.is-folded .apb-motion,
.apb.is-folded .apb-eyebrow,
.apb.is-folded .apb-lede { display: none; }

/* ============================================================ the band */

/* Written narrow-first: the words, then the drawing as a strip under them.
   The container query below lays it out side by side when there is room, so
   a browser without container queries keeps the narrow form. */
.apb:not(.is-folded) .apb-band {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 18px 18px 10px;
  border-radius: 16px;
  border: 1px solid var(--apb-line2);
  background:
    radial-gradient(60% 120% at 78% 50%, rgba(var(--apb-rgb), .16), transparent 70%),
    radial-gradient(40% 80% at 0% 100%, rgba(var(--apb-rgb), .07), transparent 70%),
    var(--apb-sheet);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 44px rgba(0, 0, 0, .28);
  overflow: hidden;
}
/* Drafting grid, strongest behind the drawing. */
.apb:not(.is-folded) .apb-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--apb-pick-rgb), .085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--apb-pick-rgb), .085) 1px, transparent 1px),
    linear-gradient(rgba(var(--apb-pick-rgb), .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--apb-pick-rgb), .04) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(90% 70% at 50% 80%, #000 25%, transparent 100%);
          mask-image: radial-gradient(90% 70% at 50% 80%, #000 25%, transparent 100%);
}

/* The words. On Practice they are the page's own header, as it prints it (a
   greeting, the title, a line); on the other two the page's own title with
   an eyebrow and a line beside it. Both are set the same. */
.apb:not(.is-folded) .apb-band > .ace-prac-head-icon { display: none; }
.apb:not(.is-folded) .apb-band > .apb-text,
.apb:not(.is-folded) .apb-band > .ace-prac-head-text { position: relative; min-width: 0; padding-right: 34px; }

.apb:not(.is-folded) .apb-band .apb-eyebrow,
.apb:not(.is-folded) .apb-band .ace-prac-hello {
  margin: 0;
  font-family: var(--apb-body-font);
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--apb-teal-text);
}
.apb:not(.is-folded) .apb-band .apb-title,
.apb:not(.is-folded) .apb-band .ace-prac-title {
  margin: 6px 0 0;
  padding: 0;
  font: 700 1.7rem/1.06 var(--apb-head-font);
  letter-spacing: -.03em;
  text-transform: none;
  color: var(--apb-head);
  text-wrap: balance;
  overflow-wrap: break-word;
}
.apb:not(.is-folded) .apb-band .apb-lede,
.apb:not(.is-folded) .apb-band .ace-prac-sub {
  margin: 8px 0 0;
  max-width: 44ch;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--apb-muted);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.apb-art { position: relative; min-width: 0; margin: 0 -4px; }
/* On a phone the drawing is a strip: the middle of it, 160 of its 196 high.
   (Its words are not shown there, and everything else is drawn inside the
   strip.) Wherever its words are shown, the whole drawing is. */
.apb-fig { display: block; width: 100%; height: auto; aspect-ratio: 600 / 160; overflow: hidden; }
@container apb (min-width: 480px) {
  .apb-fig { aspect-ratio: 600 / 196; }
}

/* Side by side, once there is room. */
@container apb (min-width: 620px) {
  .apb:not(.is-folded) .apb-band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.32fr);
    gap: 8px 28px;
    min-height: 176px;
    padding: 22px 26px 18px 30px;
    border-radius: 18px;
  }
  .apb:not(.is-folded) .apb-band::before {
    -webkit-mask-image: radial-gradient(70% 130% at 76% 50%, #000 25%, transparent 100%);
            mask-image: radial-gradient(70% 130% at 76% 50%, #000 25%, transparent 100%);
  }
  .apb:not(.is-folded) .apb-band > .apb-text,
  .apb:not(.is-folded) .apb-band > .ace-prac-head-text { padding-right: 0; }
  /* (Sized from the band, not the window: on Practice and Mock Exam the band
     stops at 860px however wide the window is.) */
  .apb:not(.is-folded) .apb-band .apb-title,
  .apb:not(.is-folded) .apb-band .ace-prac-title { margin-top: 8px; font-size: clamp(1.75rem, 3.4cqi, 2.2rem); }
  .apb:not(.is-folded) .apb-band .apb-lede,
  .apb:not(.is-folded) .apb-band .ace-prac-sub { margin-top: 10px; max-width: 36ch; font-size: .95rem; line-height: 1.55; }
  .apb-art { margin: 0; }
}
/* A very wide band: the drawing stops growing, so the band keeps its height. */
@container apb (min-width: 1000px) {
  .apb:not(.is-folded) .apb-band { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); }
}

/* Where the drawing is small its words are too small to read, and the
   picture stands without them: on a phone, and side by side until the band
   is wide. And where it is small its lines are drawn heavier, by --apb-k
   (every line's width is its drawn width times that). */
.apb-lbl { display: none; }
.apb-band { --apb-k: 1.45; }
@container apb (min-width: 480px) {
  .apb-lbl { display: inline; }
  .apb-band { --apb-k: 1; }
}
/* (Side by side in a band that is not yet wide, the drawing is as small as on
   a phone: no small print, and its lines a little heavier again.) */
@container apb (min-width: 620px) and (max-width: 819.98px) {
  .apb-lbl { display: none; }
  .apb-band { --apb-k: 1.3; }
}

/* Pause, as on the homepage, All Courses, the sign-in page, the Feed,
   Community Questions, the Dashboard, the lecture page and Rankings. */
.apb-motion {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--apb-line2);
  background: rgba(20, 20, 19, .72);
  color: var(--apb-text);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  transition: border-color .15s ease, background-color .15s ease;
}
@container apb (min-width: 620px) { .apb-motion { top: 12px; right: 12px; } }
@media (hover: hover) {
  .apb-motion:hover { border-color: var(--apb-line3); background: rgba(34, 34, 32, .9); }
}
.apb-motion-pause, .apb-motion-play { display: grid; place-items: center; }
.apb-motion-play, .apb-paused .apb-motion-pause { display: none; }
.apb-paused .apb-motion-play { display: grid; }
:root:not(.apb-js) .apb-motion,
.apb-motion[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .apb-motion { display: none; } }
@media (pointer: coarse) {
  .apb-motion { width: 40px; height: 40px; top: 6px; right: 6px; }
  .apb:not(.is-folded) .apb-band > .apb-text,
  .apb:not(.is-folded) .apb-band > .ace-prac-head-text { padding-right: 40px; }
}
@container apb (min-width: 620px) {
  @media (pointer: coarse) {
    .apb:not(.is-folded) .apb-band > .apb-text,
    .apb:not(.is-folded) .apb-band > .ace-prac-head-text { padding-right: 0; }
  }
}

/* Mock Exam: the line over its list of subjects is the banner's line now,
   word for word, so the page's own copy of it is put out of sight. Its small
   heading over that line goes out of sight with it (the banner's title says
   it) but stays where a screen reader finds it, so the page's headings run
   as they did. */
.apb-mock.has-intro ~ .ace-mock .ace-mock-intro {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.apb-mock.has-intro ~ .ace-mock .ace-mock-intro > p { display: none; }

/* ============================================================ the drawings: ink */

.apb-fig text { font-family: var(--apb-mono); }
.apb-ln { fill: none; stroke: rgba(var(--apb-ink), .3); stroke-width: calc(1px * var(--apb-k, 1)); }
.apb-ln2 { fill: none; stroke: rgba(var(--apb-ink), .58); stroke-width: calc(1.25px * var(--apb-k, 1)); }
.apb-hatch { fill: none; stroke: rgba(var(--apb-ink), .22); stroke-width: calc(1px * var(--apb-k, 1)); }
.apb-head { fill: rgba(var(--apb-ink), .62); }
.apb-tx { fill: rgba(var(--apb-ink), .62); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.apb-tx.is-key { fill: rgba(var(--apb-ink), .8); font-size: 12.5px; font-weight: 700; font-style: italic; letter-spacing: 0; }

/* One round at a time (the tests and the traverse print every round). A
   round carries its own step: the one on show is worked by the script, the
   others wait at their beginning, so that a round coming in never shows the
   end of its last showing. */
.apb-run { opacity: 0; transition: opacity .3s ease; }
.apb-fig[data-case="1"] .apb-run-1,
.apb-fig[data-case="2"] .apb-run-2,
.apb-fig[data-case="3"] .apb-run-3,
.apb-fig[data-case="4"] .apb-run-4 { opacity: 1; }

/* A mark that is drawn when a round ends well, or badly. (Hidden outright
   until then: a line with round ends shows a dot even when none of it is
   drawn.) */
.apb-mark {
  fill: none;
  stroke-width: calc(2.4px * var(--apb-k, 1));
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset .3s ease .1s, opacity .1s ease .1s;
}
.apb-mark.is-yes { stroke: rgb(var(--apb-pick-rgb)); }
.apb-mark.is-no { stroke: var(--apb-bad); }

/* ============================================================ Practice: the truss */

/* A member, before its joint is solved. (Square ends: each end is under its
   joint's pin.) */
.apb-m-base {
  fill: none;
  stroke: rgba(var(--apb-ink), .42);
  stroke-width: calc(1.7px * var(--apb-k, 1));
  transition: stroke .32s ease, stroke-width .32s ease, opacity .32s ease;
}
/* The broken line that stands for it when it carries nothing. */
.apb-m-zero {
  fill: none;
  stroke: rgba(var(--apb-ink), .5);
  stroke-width: calc(1.3px * var(--apb-k, 1));
  stroke-dasharray: calc(3.6px * var(--apb-k, 1)) calc(3.8px * var(--apb-k, 1));
  opacity: 0;
  transition: opacity .32s ease;
}
/* Solved: in tension (teal), in compression (the heavy line), or idle. */
.apb-m.is-t .apb-m-base { stroke: rgb(var(--apb-pick-rgb)); stroke-width: calc(2.5px * var(--apb-k, 1)); }
.apb-m.is-c .apb-m-base { stroke: rgba(var(--apb-ink), .97); stroke-width: calc(3.5px * var(--apb-k, 1)); }
.apb-m.is-0 .apb-m-base { opacity: 0; }
.apb-m.is-0 .apb-m-zero { opacity: 1; }

/* The same three lines, in the key. */
.apb-key { fill: none; }
.apb-key.is-t { stroke: rgb(var(--apb-pick-rgb)); stroke-width: 2.5; }
.apb-key.is-c { stroke: rgba(var(--apb-ink), .97); stroke-width: 3.5; }
.apb-key.is-0 { stroke: rgba(var(--apb-ink), .5); stroke-width: 1.3; stroke-dasharray: 3.6 3.8; }

/* A pin at every joint, and the ring round the one being solved. */
.apb-j { fill: var(--apb-sheet); stroke: rgba(var(--apb-ink), .8); stroke-width: calc(1.3px * var(--apb-k, 1)); }
.apb-jr { fill: none; stroke: rgb(var(--apb-pick-rgb)); stroke-width: calc(1.4px * var(--apb-k, 1)); opacity: 0; transform-box: fill-box; transform-origin: center; }

/* The load of the round on show. */
.apb-load { opacity: 0; transition: opacity .35s ease; }
.apb-truss[data-case="1"] .apb-load-1,
.apb-truss[data-case="2"] .apb-load-2,
.apb-truss[data-case="3"] .apb-load-3,
.apb-truss[data-case="4"] .apb-load-4 { opacity: 1; }

/* ============================================================ Mock Exam: the tests */

.apb-plate { fill: rgba(var(--apb-ink), .08); stroke: rgba(var(--apb-ink), .6); stroke-width: calc(1.25px * var(--apb-k, 1)); }
.apb-cyl { fill: rgba(var(--apb-ink), .07); stroke: rgba(var(--apb-ink), .74); stroke-width: calc(1.4px * var(--apb-k, 1)); }
.apb-crack { fill: none; stroke: rgba(var(--apb-ink), .84); stroke-width: calc(1.1px * var(--apb-k, 1)); stroke-linejoin: round; stroke-linecap: round; opacity: 0; }
/* f'c; the line no test may fall below; and the part of the chart under it. */
.apb-req { fill: none; stroke: rgba(var(--apb-ink), .68); stroke-width: calc(1.3px * var(--apb-k, 1)); }
.apb-floor { fill: none; stroke: rgba(var(--apb-ink), .52); stroke-width: calc(1.2px * var(--apb-k, 1)); stroke-dasharray: calc(5px * var(--apb-k, 1)) calc(4px * var(--apb-k, 1)); }
.apb-zone { fill: none; stroke: rgba(var(--apb-ink), .1); stroke-width: calc(1px * var(--apb-k, 1)); }

/* A test: on the chart from its own step on. */
.apb-pt {
  fill: rgba(var(--apb-ink), .96);
  stroke: var(--apb-sheet);
  stroke-width: calc(1.6px * var(--apb-k, 1));
  opacity: 0;
  transform: translateY(9px);
  transition: opacity .3s ease, transform .45s cubic-bezier(.2, .7, .2, 1), fill .3s ease;
}
.apb-tests .apb-run:not([data-step="0"]) .apb-pt-1,
.apb-tests .apb-run:not([data-step="0"]):not([data-step="1"]) .apb-pt-2,
.apb-tests .apb-run:not([data-step="0"]):not([data-step="1"]):not([data-step="2"]) .apb-pt-3 { opacity: 1; transform: none; }

/* From one test to the next. */
.apb-link {
  fill: none;
  stroke: rgba(var(--apb-ink), .46);
  stroke-width: calc(1.3px * var(--apb-k, 1));
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .45s ease;
}
.apb-tests .apb-run:not([data-step="0"]):not([data-step="1"]) .apb-link-2,
.apb-tests .apb-run:not([data-step="0"]):not([data-step="1"]):not([data-step="2"]) .apb-link-3 { stroke-dashoffset: 0; }

/* The average of the three, across them. */
.apb-avg {
  fill: none;
  stroke: rgb(var(--apb-pick-rgb));
  stroke-width: calc(2.4px * var(--apb-k, 1));
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset .55s ease, opacity .12s ease;
}
.apb-tx.apb-avg-tx { fill: rgb(var(--apb-pick-rgb)); opacity: 0; transition: opacity .3s ease; }
.apb-run.is-avg .apb-avg { stroke: var(--apb-bad); }
.apb-run.is-avg .apb-tx.apb-avg-tx { fill: var(--apb-bad); }
.apb-tests .apb-run[data-step="4"] .apb-avg,
.apb-tests .apb-run[data-step="5"] .apb-avg { stroke-dashoffset: 0; opacity: 1; }
.apb-tests .apb-run[data-step="4"] .apb-avg-tx,
.apb-tests .apb-run[data-step="5"] .apb-avg-tx { opacity: 1; }

/* Accepted or not; and the test that fell under the lower line. */
.apb-under { fill: rgba(var(--apb-bad-rgb), .16); stroke: var(--apb-bad); stroke-width: calc(1.3px * var(--apb-k, 1)); opacity: 0; transition: opacity .3s ease; }
.apb-tests .apb-run[data-step="5"] .apb-mark { stroke-dashoffset: 0; opacity: 1; }
.apb-tests .apb-run[data-step="5"] .apb-under { opacity: 1; }
.apb-tests .apb-run[data-step="5"] .apb-pt.is-under { fill: var(--apb-bad); }

/* ============================================================ Wrong Answers: the traverse */

/* As surveyed: drawn leg by leg at the pace of a pen (step 1), then left as
   a faint line under the adjusted figure (steps 3 and 4). */
.apb-sv {
  fill: none;
  stroke: rgba(var(--apb-ink), .86);
  stroke-width: calc(1.6px * var(--apb-k, 1));
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}
.apb-trav .apb-run[data-step="1"] .apb-sv,
.apb-trav .apb-run[data-step="2"] .apb-sv {
  opacity: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.4s linear, opacity .15s ease;
}
.apb-trav .apb-run[data-step="3"] .apb-sv,
.apb-trav .apb-run[data-step="4"] .apb-sv {
  opacity: .3;
  stroke-dashoffset: 0;
  transition: opacity .5s ease;
}

/* The stations and their letters. A, where the survey starts, is there from
   the beginning; the others come as the line reaches them. The stations (all
   but A) move when the figure is adjusted; the letters keep their place. */
.apb-st {
  fill: var(--apb-sheet);
  stroke: rgba(var(--apb-ink), .9);
  stroke-width: calc(1.4px * var(--apb-k, 1));
  opacity: 0;
  transition: opacity .25s ease, transform .7s cubic-bezier(.4, 0, .2, 1), stroke .4s ease;
}
.apb-sl { opacity: 0; transition: opacity .25s ease; }
.apb-st.apb-st-0,
.apb-sl.apb-sl-0,
.apb-trav .apb-run:not([data-step="0"]) .apb-st,
.apb-trav .apb-run:not([data-step="0"]) .apb-sl { opacity: 1; }
.apb-trav .apb-run[data-step="1"] .apb-st-1,
.apb-trav .apb-run[data-step="1"] .apb-sl-1 { transition-delay: .17s; }
.apb-trav .apb-run[data-step="1"] .apb-st-2,
.apb-trav .apb-run[data-step="1"] .apb-sl-2 { transition-delay: .44s; }
.apb-trav .apb-run[data-step="1"] .apb-st-3,
.apb-trav .apb-run[data-step="1"] .apb-sl-3 { transition-delay: .71s; }
.apb-trav .apb-run[data-step="1"] .apb-st-4,
.apb-trav .apb-run[data-step="1"] .apb-sl-4 { transition-delay: .87s; }
.apb-trav .apb-run[data-step="3"] .apb-st,
.apb-trav .apb-run[data-step="4"] .apb-st { transform: translate(var(--dx, 0), var(--dy, 0)); stroke: rgb(var(--apb-pick-rgb)); }

/* The error of closure: from where the survey ends back to where it began.
   (When it goes it fades: it is only taken back, undrawn, once it has.) */
.apb-gap {
  fill: none;
  stroke: var(--apb-bad);
  stroke-width: calc(2.6px * var(--apb-k, 1));
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: opacity .35s ease, stroke-dashoffset 0s linear .35s;
}
.apb-end { fill: var(--apb-sheet); stroke: var(--apb-bad); stroke-width: calc(1.5px * var(--apb-k, 1)); opacity: 0; transition: opacity .3s ease; }
.apb-trav .apb-run[data-step="1"] .apb-end { opacity: 1; transition-delay: 1.3s; }
.apb-trav .apb-run[data-step="2"] .apb-end { opacity: 1; }
.apb-trav .apb-run[data-step="2"] .apb-gap { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .45s ease, opacity .15s ease; }

/* As adjusted: closed. */
.apb-adj {
  fill: rgba(var(--apb-pick-rgb), .1);
  stroke: rgb(var(--apb-pick-rgb));
  stroke-width: calc(2.1px * var(--apb-k, 1));
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity .5s ease;
}
.apb-trav .apb-run[data-step="3"] .apb-adj,
.apb-trav .apb-run[data-step="4"] .apb-adj { opacity: 1; transition-delay: .2s; }
.apb-trav .apb-run[data-step="4"] .apb-mark { stroke-dashoffset: 0; opacity: 1; }

/* ============================================================ Quiz Review: the worked solution (1.1.0) */

.apb-pad { fill: rgba(var(--apb-ink), .04); stroke: rgba(var(--apb-ink), .3); stroke-width: calc(1px * var(--apb-k, 1)); }
.apb-rule { fill: none; stroke: rgba(var(--apb-pick-rgb), .16); stroke-width: 1px; }
.apb-margin { fill: none; stroke: rgba(var(--apb-bad-rgb), .45); stroke-width: calc(1.2px * var(--apb-k, 1)); }
.apb-stamp rect { fill: none; stroke: var(--apb-bad); stroke-width: 1.6px; }
.apb-fig .apb-stamp text { fill: var(--apb-bad); font: 700 10px var(--apb-body-font); letter-spacing: .16em; }
/* The handwriting: the drawings' monospace, slanted, and big enough to read on
   a phone (it is the figure there). Spaces are kept: the working is indented. */
.apb-fig .apb-hand { fill: rgba(var(--apb-ink), .92); font-size: 15px; font-weight: 500; font-style: italic; white-space: pre; }
.apb-fig .apb-hand.is-right { fill: rgb(var(--apb-pick-rgb)); font-weight: 700; }
.apb-hand-was { transition: fill .3s ease; }
.apb-sol .apb-run[data-step="5"] .apb-hand-was,
.apb-sol .apb-run[data-step="6"] .apb-hand-was { fill: rgba(var(--apb-ink), .5); }
.apb-pen { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.apb-strike { stroke: var(--apb-bad); stroke-width: calc(2.4px * var(--apb-k, 1)); }
.apb-arrow { stroke: var(--apb-bad); stroke-width: calc(1.3px * var(--apb-k, 1)); }
.apb-ok { stroke: rgb(var(--apb-pick-rgb)); stroke-width: calc(2.6px * var(--apb-k, 1)); }
.apb-fig .apb-tx.apb-note { fill: var(--apb-bad); }
.apb-fig .apb-tx.apb-ok-tx { fill: rgb(var(--apb-pick-rgb)); }

/* A line is written left to right: shown from its own step on. (Where a
   browser cannot clip a drawing's text, the line fades in instead.) */
.apb-w { transition: opacity .2s ease, clip-path .55s linear, -webkit-clip-path .55s linear, stroke-dashoffset .4s ease .05s; clip-path: inset(0 0 0 0); -webkit-clip-path: inset(0 0 0 0); }
.apb-sol .apb-run[data-step="0"] .apb-w-1,
.apb-sol .apb-run[data-step="0"] .apb-w-2,
.apb-sol .apb-run[data-step="0"] .apb-w-3,
.apb-sol .apb-run[data-step="0"] .apb-w-4,
.apb-sol .apb-run[data-step="0"] .apb-w-5,
.apb-sol .apb-run[data-step="0"] .apb-w-6,
.apb-sol .apb-run[data-step="1"] .apb-w-2,
.apb-sol .apb-run[data-step="1"] .apb-w-3,
.apb-sol .apb-run[data-step="1"] .apb-w-4,
.apb-sol .apb-run[data-step="1"] .apb-w-5,
.apb-sol .apb-run[data-step="1"] .apb-w-6,
.apb-sol .apb-run[data-step="2"] .apb-w-3,
.apb-sol .apb-run[data-step="2"] .apb-w-4,
.apb-sol .apb-run[data-step="2"] .apb-w-5,
.apb-sol .apb-run[data-step="2"] .apb-w-6,
.apb-sol .apb-run[data-step="3"] .apb-w-4,
.apb-sol .apb-run[data-step="3"] .apb-w-5,
.apb-sol .apb-run[data-step="3"] .apb-w-6,
.apb-sol .apb-run[data-step="4"] .apb-w-5,
.apb-sol .apb-run[data-step="4"] .apb-w-6,
.apb-sol .apb-run[data-step="5"] .apb-w-6 {
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  -webkit-clip-path: inset(0 100% 0 0);
  stroke-dashoffset: 1;
  transition: none;
}

/* ============================================================ Syllabus: the road to the board exam (1.1.0) */

.apb-ground { fill: none; stroke: rgba(var(--apb-ink), .32); stroke-width: calc(1.2px * var(--apb-k, 1)); stroke-dasharray: 2 4; }
.apb-grade { fill: none; stroke: rgb(var(--apb-pick-rgb)); stroke-width: calc(2.6px * var(--apb-k, 1)); stroke-linecap: round; }
.apb-sta { fill: var(--apb-sheet); stroke: rgba(var(--apb-ink), .9); stroke-width: calc(1.6px * var(--apb-k, 1)); transition: fill .3s ease, stroke .3s ease; }
.apb-sta-ring { fill: none; stroke: rgb(var(--apb-pick-rgb)); stroke-width: calc(1.4px * var(--apb-k, 1)); opacity: 0; transform-box: fill-box; transform-origin: center; }
.apb-flag { fill: rgba(var(--apb-pick-rgb), .85); transform-box: fill-box; transform-origin: 100% 0; transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s ease; }
.apb-sta-g .apb-tx { transition: fill .3s ease; }
/* Reached: the station in teal, its name brighter. Not yet reached: as
   surveyed; the flag not yet up. */
.apb-sta-g .apb-sta { fill: rgb(var(--apb-pick-rgb)); stroke: rgb(var(--apb-pick-rgb)); }
.apb-prof .apb-run[data-step="0"] .apb-k-1 .apb-sta,
.apb-prof .apb-run[data-step="0"] .apb-k-2 .apb-sta,
.apb-prof .apb-run[data-step="0"] .apb-k-3 .apb-sta,
.apb-prof .apb-run[data-step="0"] .apb-k-4 .apb-sta,
.apb-prof .apb-run[data-step="0"] .apb-k-5 .apb-sta,
.apb-prof .apb-run[data-step="0"] .apb-k-6 .apb-sta,
.apb-prof .apb-run[data-step="0"] .apb-k-7 .apb-sta,
.apb-prof .apb-run[data-step="1"] .apb-k-2 .apb-sta,
.apb-prof .apb-run[data-step="1"] .apb-k-3 .apb-sta,
.apb-prof .apb-run[data-step="1"] .apb-k-4 .apb-sta,
.apb-prof .apb-run[data-step="1"] .apb-k-5 .apb-sta,
.apb-prof .apb-run[data-step="1"] .apb-k-6 .apb-sta,
.apb-prof .apb-run[data-step="1"] .apb-k-7 .apb-sta,
.apb-prof .apb-run[data-step="2"] .apb-k-3 .apb-sta,
.apb-prof .apb-run[data-step="2"] .apb-k-4 .apb-sta,
.apb-prof .apb-run[data-step="2"] .apb-k-5 .apb-sta,
.apb-prof .apb-run[data-step="2"] .apb-k-6 .apb-sta,
.apb-prof .apb-run[data-step="2"] .apb-k-7 .apb-sta,
.apb-prof .apb-run[data-step="3"] .apb-k-4 .apb-sta,
.apb-prof .apb-run[data-step="3"] .apb-k-5 .apb-sta,
.apb-prof .apb-run[data-step="3"] .apb-k-6 .apb-sta,
.apb-prof .apb-run[data-step="3"] .apb-k-7 .apb-sta,
.apb-prof .apb-run[data-step="4"] .apb-k-5 .apb-sta,
.apb-prof .apb-run[data-step="4"] .apb-k-6 .apb-sta,
.apb-prof .apb-run[data-step="4"] .apb-k-7 .apb-sta,
.apb-prof .apb-run[data-step="5"] .apb-k-6 .apb-sta,
.apb-prof .apb-run[data-step="5"] .apb-k-7 .apb-sta,
.apb-prof .apb-run[data-step="6"] .apb-k-7 .apb-sta { fill: var(--apb-sheet); stroke: rgba(var(--apb-ink), .9); }
.apb-prof .apb-run[data-step="0"] .apb-k-1 .apb-flag,
.apb-prof .apb-run[data-step="0"] .apb-k-2 .apb-flag,
.apb-prof .apb-run[data-step="0"] .apb-k-3 .apb-flag,
.apb-prof .apb-run[data-step="0"] .apb-k-4 .apb-flag,
.apb-prof .apb-run[data-step="0"] .apb-k-5 .apb-flag,
.apb-prof .apb-run[data-step="0"] .apb-k-6 .apb-flag,
.apb-prof .apb-run[data-step="0"] .apb-k-7 .apb-flag,
.apb-prof .apb-run[data-step="1"] .apb-k-2 .apb-flag,
.apb-prof .apb-run[data-step="1"] .apb-k-3 .apb-flag,
.apb-prof .apb-run[data-step="1"] .apb-k-4 .apb-flag,
.apb-prof .apb-run[data-step="1"] .apb-k-5 .apb-flag,
.apb-prof .apb-run[data-step="1"] .apb-k-6 .apb-flag,
.apb-prof .apb-run[data-step="1"] .apb-k-7 .apb-flag,
.apb-prof .apb-run[data-step="2"] .apb-k-3 .apb-flag,
.apb-prof .apb-run[data-step="2"] .apb-k-4 .apb-flag,
.apb-prof .apb-run[data-step="2"] .apb-k-5 .apb-flag,
.apb-prof .apb-run[data-step="2"] .apb-k-6 .apb-flag,
.apb-prof .apb-run[data-step="2"] .apb-k-7 .apb-flag,
.apb-prof .apb-run[data-step="3"] .apb-k-4 .apb-flag,
.apb-prof .apb-run[data-step="3"] .apb-k-5 .apb-flag,
.apb-prof .apb-run[data-step="3"] .apb-k-6 .apb-flag,
.apb-prof .apb-run[data-step="3"] .apb-k-7 .apb-flag,
.apb-prof .apb-run[data-step="4"] .apb-k-5 .apb-flag,
.apb-prof .apb-run[data-step="4"] .apb-k-6 .apb-flag,
.apb-prof .apb-run[data-step="4"] .apb-k-7 .apb-flag,
.apb-prof .apb-run[data-step="5"] .apb-k-6 .apb-flag,
.apb-prof .apb-run[data-step="5"] .apb-k-7 .apb-flag,
.apb-prof .apb-run[data-step="6"] .apb-k-7 .apb-flag { opacity: 0; transform: scaleX(.2); }

/* The Syllabus's own header in the band: its exam line and its counts. (Its
   stylesheet sets these with !important; here they are the band's.) */
.apb-syllabus .apb-band .ace-syl-header-text { min-width: 0; }
.apb.apb-syllabus:not(.is-folded) .apb-band .ace-syl-title { margin: 6px 0 0 !important; font-size: 1.7rem !important; line-height: 1.06; color: var(--apb-head) !important; }
.apb-syllabus .apb-band .ace-syl-exam { margin: 10px 0 0 !important; font-size: .72rem !important; font-weight: 700; letter-spacing: .14em; line-height: 1.4; text-transform: uppercase; color: var(--apb-teal-text) !important; }
.apb-syllabus .apb-band .ace-syl-stats { display: flex; flex-wrap: wrap; gap: 14px 26px; margin: 16px 0 0; }
.apb-syllabus .apb-band .ace-syl-stats span { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--apb-muted); }
.apb-syllabus .apb-band .ace-syl-stats strong { display: block; margin-bottom: 4px; font: 700 1.45rem/1 var(--apb-head-font); letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--apb-head); }
@container apb (min-width: 620px) {
  .apb.apb-syllabus:not(.is-folded) .apb-band .ace-syl-title { margin-top: 8px !important; font-size: clamp(1.75rem, 3.4cqi, 2.2rem) !important; }
  .apb-syllabus .apb-band .ace-syl-stats { margin-top: 20px; }
  .apb-syllabus .apb-band .ace-syl-stats strong { font-size: 1.7rem; }
}

/* ============================================================ Learning Path: the building (1.2.0) */

.apb-st-plan { fill: none; stroke: rgba(var(--apb-ink), .3); stroke-width: calc(1px * var(--apb-k, 1)); stroke-dasharray: 4 3; }
.apb-st-done { fill: rgba(var(--apb-ink), .14); stroke: rgba(var(--apb-ink), .7); stroke-width: calc(1.2px * var(--apb-k, 1)); }
.apb-st-win { fill: rgba(var(--apb-pick-rgb), .45); }
.apb-st-part { fill: rgba(var(--apb-pick-rgb), .35); stroke: rgb(var(--apb-pick-rgb)); stroke-width: calc(1.2px * var(--apb-k, 1)); }
.apb-st-scaf { fill: none; stroke: rgba(var(--apb-pick-rgb), .7); stroke-width: calc(1.2px * var(--apb-k, 1)); }
.apb-st-hook { fill: rgb(var(--apb-pick-rgb)); }
.apb-fig .apb-tx.apb-st-name { fill: rgb(var(--apb-pick-rgb)); }

/* A storey goes up from its own step on (the script marks the ones still to
   come is-later); a storey begun is laid from the left, as far as it goes.
   Then the hook comes down over the lesson the student is on. Going back to
   the beginning of a round is at once: nothing is seen to come down. */
.apb-st-up, .apb-st-now { transform-box: fill-box; transition: opacity .35s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.apb-st-up { transform-origin: 50% 100%; }
.apb-st-part { transform-origin: 0 50%; }
.apb-st-up.is-later { opacity: 0; transform: translateY(-12px); transition: none; }
.apb-st-part.is-later { transform: scaleX(0); }
.apb-st-now.is-later { opacity: 0; transform: translateY(-16px); transition: none; }

/* ============================================================ Calendar: the desk calendar (1.2.0) */

.apb-desk-back { fill: rgba(var(--apb-ink), .28); stroke: rgba(var(--apb-ink), .4); stroke-width: 1px; }
.apb-desk-back.is-2 { fill: rgba(var(--apb-ink), .5); }
.apb-desk-page { fill: #e9eef0; stroke: rgba(var(--apb-ink), .6); stroke-width: 1px; }
.apb-desk-head { fill: var(--apb-bad); }
.apb-fig .apb-desk-mon { fill: #fff; font: 700 13px var(--apb-body-font); letter-spacing: .14em; }
.apb-fig .apb-desk-day { fill: #1b1d1d; font: 700 62px var(--apb-head-font); letter-spacing: -.03em; }
.apb-fig .apb-desk-wd { fill: #4a4d4c; font: 700 11px var(--apb-body-font); letter-spacing: .12em; }
.apb-desk-ring { fill: var(--apb-sheet); stroke: rgba(var(--apb-ink), .85); stroke-width: 2px; }
.apb-desk-chip { fill: rgb(var(--apb-pick-rgb)); }
.apb-fig .apb-desk-name { fill: rgba(var(--apb-ink), .95); font: 600 16px var(--apb-head-font); }
.apb-fig .apb-desk-when { fill: rgba(var(--apb-ink), .62); font: 500 12.5px var(--apb-body-font); }
.apb-fig .apb-desk-none { fill: rgba(var(--apb-ink), .62); font: 500 13px var(--apb-body-font); }
/* One list for each of the page's calendars; the one for the tab on show. */
.apb-desk-list:not(.is-on) { display: none; }

/* Yesterday's page, until it is torn off at step 1; then the events, one by one. */
.apb-desk-old { opacity: 0; transform-box: view-box; transform-origin: 157px 28px; transform: translate(14px, -30px) rotate(-12deg); transition: opacity .45s ease, transform .6s cubic-bezier(.4, 0, .6, 1); }
.apb-desk .apb-run[data-step="0"] .apb-desk-old { opacity: 1; transform: none; transition: none; }
.apb-desk-row { transition: opacity .35s ease, transform .45s cubic-bezier(.2, .7, .2, 1); }
.apb-desk-row.is-later { opacity: 0; transform: translateX(10px); transition: none; }

/* ============================================================ motion */

@keyframes apb-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes apb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes apb-drop { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
@keyframes apb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes apb-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(3.2); } }
/* (Each twice over, under two names: a rule that names the same animation on
   two steps running would not start it again.) */
@keyframes apb-press-a { 0% { transform: none; } 34% { transform: translateY(2.6px); } 100% { transform: none; } }
@keyframes apb-press-b { 0% { transform: none; } 34% { transform: translateY(2.6px); } 100% { transform: none; } }
@keyframes apb-crack-a { 0%, 22% { opacity: 0; } 40%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes apb-crack-b { 0%, 22% { opacity: 0; } 40%, 78% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  /* A drawing draws itself once; then its rounds begin (the script). */
  .apb-js:not(.apb-paused) .apb-band .apb-d {
    stroke-dasharray: 1;
    animation: apb-draw var(--t, .62s) cubic-bezier(.45, 0, .2, 1) var(--d, 0s) both;
  }
  .apb-js:not(.apb-paused) .apb-band .apb-f { animation: apb-fade .6s ease var(--d, 0s) both; }
  .apb-js:not(.apb-paused) .apb-band .apb-r { animation: apb-drop .5s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) both; }
  /* (The words come in once, as the page arrives: not again when the script
     is only run long after, nor once the banner has been put away for a
     sitting. The script says either by data-apb-late.) */
  .apb-js:not([data-apb-late]) .apb-band > .apb-text,
  .apb-js:not([data-apb-late]) .apb-band > .ace-prac-head-text { animation: apb-in .55s cubic-bezier(.2, .7, .2, 1) .05s both; }

  /* Until the script has run (it is the last thing on the page), a drawing
     that is going to be worked from its beginning is shown at its beginning:
     no round worked, no member signed. So the reader never sees the finished
     figure flash and go before the work starts. If the script never runs,
     the page's <head> takes apb-js away when the page has loaded, and the
     figure stands whole, as printed. (Nothing moves into this state or out
     of it: the script puts the figure at its beginning first.) The script
     holds a drawing the same way for the moment a banner comes back from a
     sitting, while it sets the drawing at its beginning again. */
  .apb-js:not(.apb-paused):not([data-apb-run]) .apb-fig .apb-run { opacity: 0; transition: none; }
  .apb-js:not(.apb-paused):not([data-apb-run]) .apb-fig .apb-run *,
  .apb-js:not(.apb-paused):not([data-apb-run]) .apb-fig .apb-m * { transition: none; }
  .apb-js:not(.apb-paused):not([data-apb-run]) .apb-fig .apb-m .apb-m-base { stroke: rgba(var(--apb-ink), .42); stroke-width: calc(1.7px * var(--apb-k, 1)); opacity: 1; }
  .apb-js:not(.apb-paused):not([data-apb-run]) .apb-fig .apb-m .apb-m-zero { opacity: 0; }

  /* The joint being solved rings once. (The last joint only when the script
     has just solved it: a finished round is also how a drawing rests.) */
  .apb-js:not(.apb-paused) .apb-truss[data-step="1"] .apb-jr-1,
  .apb-js:not(.apb-paused) .apb-truss[data-step="2"] .apb-jr-2,
  .apb-js:not(.apb-paused) .apb-truss[data-step="3"] .apb-jr-3,
  .apb-js:not(.apb-paused) .apb-truss[data-step="4"] .apb-jr-4,
  .apb-js:not(.apb-paused) .apb-truss[data-step="5"] .apb-jr-5,
  .apb-js:not(.apb-paused) .apb-truss[data-step="6"] .apb-jr-6,
  .apb-js:not(.apb-paused) .apb-truss[data-step="7"].is-stepping .apb-jr-7 { animation: apb-ring .75s cubic-bezier(.2, .7, .2, 1); }

  /* The Syllabus: a station rings once as it is reached. */
  .apb-js:not(.apb-paused) .apb-prof.is-stepping .apb-run[data-step="1"] .apb-k-1 .apb-sta-ring,
  .apb-js:not(.apb-paused) .apb-prof.is-stepping .apb-run[data-step="2"] .apb-k-2 .apb-sta-ring,
  .apb-js:not(.apb-paused) .apb-prof.is-stepping .apb-run[data-step="3"] .apb-k-3 .apb-sta-ring,
  .apb-js:not(.apb-paused) .apb-prof.is-stepping .apb-run[data-step="4"] .apb-k-4 .apb-sta-ring,
  .apb-js:not(.apb-paused) .apb-prof.is-stepping .apb-run[data-step="5"] .apb-k-5 .apb-sta-ring,
  .apb-js:not(.apb-paused) .apb-prof.is-stepping .apb-run[data-step="6"] .apb-k-6 .apb-sta-ring { animation: apb-ring .75s cubic-bezier(.2, .7, .2, 1); }

  /* Each test: the machine presses, the cylinder gives. */
  .apb-js:not(.apb-paused) .apb-tests.is-live[data-step="1"] .apb-ram,
  .apb-js:not(.apb-paused) .apb-tests.is-live[data-step="3"] .apb-ram { animation: apb-press-a .7s ease; }
  .apb-js:not(.apb-paused) .apb-tests.is-live[data-step="2"] .apb-ram { animation: apb-press-b .7s ease; }
  .apb-js:not(.apb-paused) .apb-tests.is-live[data-step="1"] .apb-crack,
  .apb-js:not(.apb-paused) .apb-tests.is-live[data-step="3"] .apb-crack { animation: apb-crack-a .7s ease; }
  .apb-js:not(.apb-paused) .apb-tests.is-live[data-step="2"] .apb-crack { animation: apb-crack-b .7s ease; }
}

/* ============================================================ forced colours */

/* Where the system draws its own colours the band's own are gone. The words
   take the system's; the drawing keeps its ink, on a sheet of its own. */
@media (forced-colors: active) {
  .apb:not(.is-folded) .apb-band { border: 1px solid CanvasText; }
  .apb-art, .apb-fig, .apb-fig text { forced-color-adjust: none; }
  .apb-art { background: #1b1d1d; border-radius: 10px; }
  .apb-motion { border: 1px solid ButtonText; }
}

/* ============================================================ reduced motion */

@media (prefers-reduced-motion: reduce) {
  .apb *, .apb *::before, .apb *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ace-practice-banners: end of file */
