/* Sprint 5A: what the server HTML needs beyond the lab's own rules (parts-5a.css). The
   lab passes some values by inline style, uses photos as CSS backgrounds and moves
   things with React state; here the CSP allows neither inline style nor inline script,
   photos are <img> elements with the editor's alt text, and every part must read and
   work without JavaScript (ARCHITECTURE 6A.1). Values are the lab's tokens
   (design-lab/src/tokens.css, light theme). */

:root {
  --p-hero-height: 750px;
  --p-slide-interval: 6000ms;
  --p-news-interval: 8000ms;
  --p-notice-interval: 5000ms;
  --p-ticker-speed: 60;
  --p-marquee-speed: 40;
  --p-film-speed: 25;
  --p-count-duration: 900ms;
  --p-intro-stagger: 70ms;
  --p-kenburns-duration: 6000ms;
  --p-kenburns-scale: 1.04;
  --p-hero-zoom: 1;
  --p-draw-duration: 1200ms;
  --p-tint-3: #e2cdb0;
  --p-tint-4: #efc97a;
  --p-on-tint: #7a1f2b;
  --p-wash: #dce4ef;
  --p-signup: #d9bfa0;
  --p-hc-bg: #000000;
  --p-hc-accent: #ffd400;
  --p-band-img: none;
  --p-band-img-sm: none;
  --p-nr-cover: none;
}

.p {
  --p-head-h: 9.277em;
}

@container p (max-width: 64em) {
  .p {
    --p-head-h: 11.54em;
  }
}

/* "Pause all animations" (the display options, E6.12) stops everything, as reduced
   motion does */
.p[data-still] {
  --motion-on: 0;
}

/* the lab's base keeps a photo's shape from its width (Tailwind's preflight); every
   class rule that sizes a photo still wins */
:where(.p) img {
  height: auto;
}

/* ── the pause control: Pause while the part moves, Play once paused or still ── */

.p-pp {
  min-inline-size: 24px;
  min-block-size: 24px;
}

.p-pp[data-moving='true'] .p-pp-play,
.p-pp:not([data-moving='true']) .p-pp-pause {
  display: none;
}

/* the control comes first in focus order (6A.1); the lab shows it after the strip */
.p-ticker > .p-pp,
.p-marquee > .p-pp {
  order: 3;
}

.p-news-carousel {
  display: flex;
  flex-direction: column;
}

.p-news-carousel > .p-carousel-controls {
  order: 2;
}

.p-news-carousel > .p-sr {
  order: 3;
}

.p-cycler-head .p-pp {
  flex: none;
}

/* ── the hero: photos are images (the lab's are backgrounds) ───────────────── */

img.p-slide-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 60%;
}

/* Firefox paints a slowly scaling photo in steps: there the hero photo is still (DESIGN.md) */
@supports (-moz-appearance: none) {
  .p-slide-img[data-state='in'],
  .p-slide-img[data-state='out'] {
    animation-name: none, p-wipe;
  }
}

/* without JavaScript the other stories are a short list of links under the first one */
.p-hero-others {
  position: absolute;
  top: 31.2em;
  left: 5.83%;
  width: 28.9em;
  color: var(--p-on-dark);
  z-index: 2;
}

.p-hero-others-title {
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-on-dark-muted);
}

.p-hero-others ul {
  margin-top: 0.4em;
  list-style: none;
}

.p-hero-others a {
  display: inline-block;
  min-height: 24px;
  padding-block: 0.15em;
  color: var(--p-on-dark);
  text-decoration: underline;
}

@container p (max-width: 40em) {
  .p-hero-others {
    position: static;
    width: auto;
    padding: 1em 5%;
    background: var(--p-ground);
  }
}

/* the footer's policy links reach 24 px (ACC-05) */
.p-sf-policies a {
  display: inline-block;
  min-height: 24px;
  padding-block: 0.2em;
}

.p-js .p-hero-others {
  display: none;
}

.p-hero-copy .p-rosetta {
  color: var(--p-on-dark-muted);
}

/* ── The sitemap page: its groups in columns, links tall enough to tap ───────── */

.p-sitemap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16em), 1fr));
  gap: 1.5em 2em;
}

.p-sitemap ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-sitemap a {
  display: inline-block;
  padding-block: 0.3em;
}

/* ── "Coming": services that open with a later release ────────────────────── */

.p-coming {
  display: inline-block;
  margin-inline-start: 0.4em;
  padding: 0.05em 0.5em;
  font-size: 0.78em;
  font-weight: 700;
  color: var(--p-ink);
  background: var(--p-saffron-pale);
  border-radius: 0.8em;
  vertical-align: 0.1em;
}

.p-tile .p-coming {
  margin-inline-start: 0;
}

.p-tool-coming {
  display: flex;
  gap: 0.4em;
  align-items: center;
  margin-bottom: 0.9em;
  font-weight: 700;
  color: var(--p-heading);
}

.p-tool-coming a {
  text-decoration: underline;
}

.p-tool-off {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* switched off: the fields show it themselves (labels keep their contrast) */
.p-tool-off:disabled :is(input, select, button) {
  cursor: not-allowed;
}

.p-signup .p-tool-coming {
  margin-top: 0.6em;
}

.p-signup-form .p-tool-off {
  display: flex;
}

/* ── the quick tools: every panel in turn without JavaScript, tabs with it ──── */

.p-tool-title {
  margin-bottom: 0.6em;
  font-size: 1.15em;
  font-weight: 700;
  color: var(--p-heading);
}

[data-tabbed] .p-tool-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.p-tools:not([data-tabbed]) .p-tool-panel + .p-tool-panel {
  margin-top: 1.6em;
  padding-top: 1.6em;
  border-top: 1px solid var(--p-rule);
}

.p-tabs a {
  text-decoration: none;
}

/* how to apply: a list of the steps without JavaScript */
.p-howto-list {
  list-style: none;
}

.p-howto:not([data-stepping]) .p-howto-bar {
  display: none;
}

.p-howto:not([data-stepping]) .p-howto-card + .p-howto-card {
  margin-top: 0.8em;
}

/* ── the audience chips are links ─────────────────────────────────────────── */

.p-aud-chips a {
  text-decoration: none;
}

/* ── Quick Access: a wrapping grid without JavaScript ─────────────────────── */

.p-quick-track {
  --cols: 7;
}

[data-p='quick']:not([data-paged]) .p-quick-track {
  transform: none;
}

[data-p='quick']:not([data-paged]) .p-quick-grid {
  flex: 1 0 100%;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: none;
  grid-auto-rows: auto;
}

@container p (max-width: 69em) {
  [data-p='quick']:not([data-paged]) .p-quick-track {
    --cols: 4;
  }
}

@container p (max-width: 40em) {
  [data-p='quick']:not([data-paged]) .p-quick-track {
    --cols: 2;
  }
}

/* ── latest notices: all of them without JavaScript ───────────────────────── */

.p-cycler:not([data-cycling]) .p-cycler-window {
  height: auto;
  max-height: none;
  overflow: visible;
}

.p-cycler:not([data-cycling]) .p-cycler-track {
  transform: none;
}

.p-cycler:not([data-cycling]) .p-cycler-track > li {
  height: auto;
}

.p-cycler .p-sys-none,
.p-maroon-card .p-sys-none,
.p-upcoming .p-sys-none {
  margin: 1em 0;
  color: inherit;
}

.p-cycler .p-sys-none a,
.p-maroon-card .p-sys-none a {
  color: var(--p-on-dark);
  text-decoration: underline;
}

/* the closing lines without JavaScript show full */
.p-drain > span {
  transform: scaleX(var(--left, 1));
}

/* ── the province calendar: the month arrows are links ────────────────────── */

.p-cal-nav a,
.p-cal-today {
  text-decoration: none;
}

.p .p-cal-nav a,
.p .p-cal-today {
  color: var(--p-on-dark);
}

.p-cal-event a {
  color: inherit;
}

/* the lab's pick and .ics are buttons; here they are links, which the government
   band's "li a" rule would turn into flex rows: keep the lab's boxes. An item with no
   .ics file (a news event) gives its pick the whole row. */
.p .p-gov .p-agenda-pick {
  display: grid;
  text-decoration: none;
  color: inherit;
}

.p .p-gov .p-agenda-pick:only-child {
  grid-column: 1 / -1;
}

.p .p-gov .p-agenda-ics {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  align-self: center;
  text-decoration: none;
}

/* ── the sign-up photo is an image (the lab's is a background) ────────────── */

img.p-signup-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* no picture: the block takes the whole width */
.p-signup-plain {
  grid-template-columns: minmax(0, 1fr);
}

/* ── the districts and tourism cards ──────────────────────────────────────── */

.p-district-ext {
  display: flex;
  gap: 0.3em;
  align-items: center;
}

/* ── Help: its two icons follow the button's state ────────────────────────── */

.p-help-btn[aria-expanded='true'] .p-help-open,
.p-help-btn[aria-expanded='false'] .p-help-shut {
  display: none;
}

/* ── a news item's photos (NWS-06) ────────────────────────────────────────── */

.p-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14em, 1fr));
  gap: 0.8em;
  list-style: none;
}

.p-photo-grid figure {
  margin: 0;
}

.p-photo-grid a {
  position: relative;
  display: block;
}

.p-photo-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.p-photo-grid figcaption {
  margin-top: 0.35em;
  font-size: 0.92em;
  color: var(--p-muted);
}

/* the lightbox's icons are copied from this hidden set */
[data-p='lb-icons'] {
  display: none;
}

/* the parts page (development builds only): the hero on its own ground */
.p-parts-stage {
  position: relative;
  overflow: hidden;
  background: var(--p-ground);
}

.p-parts-stage .p-top-bg {
  height: 100%;
}

.p-parts-feature {
  max-width: 22em;
  background: var(--p-card);
}

/* news cards: the kind of item and the institution */
.p-news-kind {
  display: inline-block;
  margin-inline-end: 0.4em;
  padding: 0 0.45em;
  font-weight: 700;
  color: var(--p-ink);
  background: var(--p-saffron-pale);
  border-radius: 0.3em;
}

.p-news-meta {
  margin-top: 0.3em;
  font-size: 0.92em;
  color: var(--p-muted);
}

/* the ghost steps of "Track a request" keep a readable contrast (WCAG 1.4.3) */
.p-tool-preview {
  opacity: 0.8;
}

.p-steps-ghost .p-step-label {
  color: var(--p-ink);
}

.p-tile .p-coming {
  align-self: flex-start;
  width: auto;
}

/* "Read more" in the hero: a 24 px target (ACC-05), shown at once (its fade-in left it
   below the contrast ratio for a moment) */
.p .p-hero-copy .p-hero-more {
  min-height: 24px;
  animation: none;
}

/* the news list and an institution's news: the home cards in a wrapping grid (no carousel) */
.p-news-row.p-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16em, 1fr));
  gap: 1.2em;
  margin: 0;
  overflow: visible;
  scroll-snap-type: none;
}

.p-news-row.p-news-grid > li {
  width: auto;
  max-width: none;
}

.p-news-years {
  margin-bottom: 1.2em;
}

/* the address and date an item prints at its foot (GEN-10); never on screen */
.p-print-line {
  display: none;
}

/* the hero's pause is first in focus order (6A.1) but shown last, as in the lab */
.p-hero-controls > .p-pp {
  order: 9;
}

/* the same for the news carousel: previous, the dots, next, then the pause (NewsCarousel.tsx) */
.p-carousel-controls > .p-pp {
  order: 9;
}

/* a district card with no photo yet: the body over the photo would stand on nothing (the card is the photo's height), so
   it takes its place in the flow and the card is the maroon band alone, legible and focusable as the lab's */
.p-district[data-plain] .p-district-body {
  position: static;
}

/* a banner slide with no photo while others have one: the maroon band in its place, never dropped */
.p-slide-img[data-plain],
.p-hero-media .p-slide-img[data-plain] {
  background: var(--p-ground);
}

/* on a phone the lab stacks photo, story, search, then the controls: the controls come
   first in the markup (focus order), so the stack is ordered here */
@container p (max-width: 40em) {
  .p-hero {
    display: flex;
    flex-direction: column;
  }
  .p-hero-copy {
    order: 1;
  }
  .p-hero-searchwrap {
    order: 2;
  }
  .p-hero-controls {
    order: 3;
  }
  .p-hero-others,
  .p-hero .p-tiles {
    order: 4;
  }
}

/* ── page feedback (GEN-08): the lab has no screen for it; the lab's card, rule and
   button look ─────────────────────────────────────────────────────────────── */

.p-fb {
  max-width: 46em;
  margin: 3em 5% 2.5em;
  padding: 1.4em 1.6em 1.6em;
  background: var(--p-card);
  border-left: 0.25em solid var(--p-saffron);
  box-shadow: 0 0.2em 0.7em color-mix(in srgb, var(--p-ink) 9%, transparent);
}

.p-fb-q {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1.4em;
  margin: 0 0 1em;
  padding: 0;
  border: 0;
}

.p-fb-q legend {
  float: left;
  width: 100%;
  margin-bottom: 0.4em;
  padding: 0;
}

.p-fb-title {
  margin: 0;
  font-size: 1.15em;
  color: var(--p-heading);
}

.p-fb-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 2.75em;
  font-weight: 700;
  cursor: pointer;
}

.p-fb-choice input {
  width: 1.3em;
  height: 1.3em;
  margin: 0;
  accent-color: var(--p-band);
}

.p-fb-label {
  display: block;
  font-weight: 700;
}

.p-fb-note {
  margin: 0.3em 0 0.6em;
  font-size: 0.9em;
  color: var(--p-muted);
}

.p-fb-text {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0.6em 0.8em;
  font: inherit;
  color: var(--p-ink);
  background: var(--p-page);
  border: 1px solid var(--p-ink);
}

.p-fb-send {
  margin: 1em 0 0;
}

.p-fb-trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.p-fb-done {
  display: none;
  margin: 0 0 1em;
  padding: 0.6em 0.9em;
  font-weight: 700;
  color: var(--p-heading);
  background: var(--p-panel);
}

.p-fb-done:target {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

/* ── clean A4 print (GEN-10, E6.8): the content, its address and the date ── */

@page {
  size: A4;
  margin: 15mm 15mm 18mm;
}

@media print {
  .p-skip,
  .p-ribbon,
  .p-header,
  .p-top-bg,
  .p-scroll-bar,
  .p-footer,
  .p-totop-rail,
  .p-fb,
  .p-pp,
  .p-hero-controls,
  .p-carousel-controls,
  .p-preview-bar,
  .p-ti-report,
  .p-in-langnote,
  [data-p='lb-icons'] {
    display: none !important;
  }
  .p {
    color: #000;
    background: #fff;
  }
  .p-stage,
  .p-main {
    background: none;
  }
  .p-main a {
    color: inherit;
  }
  .p-main img {
    max-width: 100%;
  }
  .p-main figure,
  .p-main img,
  .p-main table,
  .p-main tr {
    break-inside: avoid;
  }
  .p-main h2,
  .p-main h3 {
    break-after: avoid;
  }
  /* the page hero prints as plain black text on white, without its band */
  .p-ph {
    padding: 0 0 1em;
    background: none !important;
    box-shadow: none;
  }
  .p-ph,
  .p-ph * {
    color: #000 !important;
  }
  .p-ph::before,
  .p-ph::after {
    display: none;
  }
  .p-in-crumbs {
    display: none;
  }
  .p-print-line {
    display: block;
    margin: 2em 5% 0;
    padding-top: 0.6em;
    font-size: 0.85em;
    border-top: 1px solid #000;
    overflow-wrap: anywhere;
  }
}

/* "Which system do I need?": the systems that fit the task get the lab's saffron ring;
   the lab also dims the others, which here keep their contrast (WCAG 1.4.3) */
.p-sp [data-match='true'] {
  box-shadow:
    0 0 0 0.2em var(--p-saffron),
    0 0.8em 1.8em color-mix(in srgb, var(--p-ink) 15%, transparent) !important;
}

/* the hero's story ends where the lab's does, just above the search, and a longer one
   (Sinhala and Tamil, a machine translation line) grows upwards instead of running
   under the search */
.p-hero-copy {
  top: auto;
  bottom: calc(100% - 24.1em);
}

/* a story's words, held unseen, for the height only (partial heroSizers) */
.p-hero-sizer {
  display: none;
}

/* from the lab's stack (40em, 521 px, as .p is 13 px) up, the story stays beside the photo in its own column, and the hero's
   height follows the copy, keeping the tallest story's (partial heroSizers), so a long story pushes the search, the controls and
   the tiles down, and neither runs up under the header nor down under the tiles. The photo is the hero's own band, as its height
   has to follow too; the header's strips have always covered the part of it above. */
@container p (min-width: 40.01em) {
  .p-hero-image {
    display: none;
  }

  .p-top-bg {
    height: var(--p-head-h);
  }

  .p-hero {
    display: flex;
    flex-direction: column;
    gap: 1.4em;
    height: auto;
    background: var(--p-ground);
  }

  .p-hero-media {
    position: absolute;
    display: block;
    height: auto;
    overflow: hidden;
  }

  .p-hero-copy,
  .p-hero-searchwrap,
  .p-hero-controls,
  .p-hero-others {
    position: static;
    width: var(--p-hero-col);
    margin-left: 5.83%;
  }

  .p-hero-copy {
    display: grid;
    order: 1;
    overflow-wrap: anywhere;
  }

  .p-hero-story,
  .p-hero-sizer {
    grid-area: 1 / 1;
    min-width: 0;
  }

  .p-hero-sizer {
    display: block;
    visibility: hidden;
  }

  .p-hero-searchwrap {
    order: 2;
  }

  .p-hero-controls {
    order: 3;
  }

  .p-hero-others {
    order: 4;
  }

  .p-hero .p-tiles {
    position: relative;
    order: 5;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: auto;
  }
}

/* a tablet and a small laptop: a column that shrinks with the page, and the title in steps, so a long Tamil word fits */
@container p (min-width: 40.01em) and (max-width: 1100px) {
  .p-hero {
    --p-hero-col: clamp(17em, 38%, 28.9em);
    min-height: 34em;
    padding-block: 2em 2.54em;
  }

  .p-hero-media {
    inset: 0 0 0 calc(5.83% + var(--p-hero-col) + 1.5em);
  }

  .p-hero .p-tiles {
    padding-inline: 5.83%;
  }

  .p-hero-title {
    font-size: 1.75em;
  }

  .p-tile {
    height: auto;
    min-height: 9.5em;
  }
}

@container p (min-width: 40.01em) and (max-width: 760px) {
  .p-hero-title {
    font-size: 1.4em;
  }
}

@container p (min-width: 900.01px) and (max-width: 1100px) {
  .p-hero-title {
    font-size: 1.923em;
  }
}

/* wider, the lab's places for a story that fits them: the copy ends at 24.1em, as a box that grows with a longer one */
@container p (min-width: 1100.01px) {
  .p-hero {
    --p-hero-col: 28.9em;
    min-height: var(--p-hero-height);
    padding-block: 1em 2.54em;
  }

  .p-hero-media {
    inset: 0 0 0 41.5%;
  }

  .p-hero-copy {
    min-height: 23.1em;
    align-content: end;
  }

  .p-hero-controls,
  .p-hero-others {
    margin-top: 0.7em;
    margin-bottom: 1.5em;
  }

  .p-hero .p-tiles {
    margin-left: 7.08%;
  }

  .p-tile {
    height: auto;
    min-height: 10.92em;
  }
}

/* "Province at a glance" (client, 31 Oct): four live figures, each tile one link to the
   list it counts; the lab's look, with the link's focus ring around the whole tile */
.p-glance-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.p .p-glance-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35em;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.p-glance-link:hover .p-glance-label,
.p-glance-link:focus-visible .p-glance-label {
  color: var(--p-heading);
  text-decoration: underline;
}

.p-glance-link:hover .p-icon {
  transform: translateX(calc(0.25em * var(--motion-on))) rotate(calc(-6deg * var(--motion-on)));
}

.p-glance-link:focus-visible {
  outline: 3px solid var(--p-focus, var(--p-heading));
  outline-offset: 0.3em;
}

@container p (max-width: 56em) {
  .p-glance-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p-glance-row li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
  .p-glance-row li:nth-child(4) {
    padding-left: 1.8em;
    border-left: 1px solid var(--p-rule);
  }
}

@container p (max-width: 40em) {
  .p-glance-row li:nth-child(4) {
    padding-left: 1em;
  }
}

/* the province calendar feed: the address to copy, under the subscribe link */
.p-agenda-copy {
  margin-top: 0.4em;
  font-size: 0.85em;
  color: var(--p-muted);
  overflow-wrap: anywhere;
}

/* 6a-A: the machine-text line in the footer bar (partial uiMachineLine), in the marks
   key style (p-in-key) on its own row, so the policies and the language switch keep
   their places; 0.9em of the body size, as the key on the institution page */
.p-sf-bottom .p-in-key.p-sf-mt {
  flex-basis: 100%;
  margin: 0;
  font-size: calc(0.9em / 0.875);
  color: var(--p-on-dark-muted);
}

/* the exam results lookup (partials/psc.html): a field's hint and error, the summary box, the year's
   own form, and the result as one printed sheet (PSC-08). The lab has the grid and the result band;
   these are the parts it does not have, in its words. */

.p-tool-fieldhint,
.p-tool-err {
  display: block;
  font-size: 0.92em;
}

.p-tool-fieldhint {
  color: var(--p-muted);
}

.p-tool-err {
  font-weight: 700;
  color: var(--p-band);
}

.p-tool-grid [aria-invalid='true'] {
  border-color: var(--p-band);
  border-width: 2px;
}

.p-errsum {
  margin-bottom: 1.2em;
  padding: 0.8em 1em;
  background: var(--p-card);
  border: 2px solid var(--p-band);
}

.p-errsum-title {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--p-heading);
}

.p-psc-year {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.3em 0.8em;
  margin-bottom: 1.2em;
}

.p-psc-year label {
  display: block;
  width: 100%;
  font-weight: 700;
}

.p-tool-panel .p-psc-year select {
  flex: none;
  width: 8em;
}

.p-errsum li {
  padding: 0.3em 0;
}

.p-errsum a {
  display: inline-block;
  min-height: 24px;
}

/* the page's form has the year in its own form above: the exam takes the grid's first place */
.p-psc .p-tool-grid {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

@container p (max-width: 56em) {
  .p-psc .p-tool-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@container p (max-width: 40em) {
  .p-psc .p-tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.p-psc-sheet {
  margin-bottom: 1.6em;
}

.p-psc-sheet .p-result {
  display: flex;
  margin: 0 0 1em;
}

.p-psc-sheet .p-result-exam {
  font-weight: 400;
}

.p-psc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14em, 1fr));
  gap: 0.6em 1.2em;
  margin-bottom: 1em;
}

.p-psc-facts dt {
  font-size: 0.92em;
  color: var(--p-muted);
}

.p-psc-facts dd {
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media print {
  .p-psc-noprint,
  .p-light .p-ph {
    display: none !important;
  }
  .p-psc-sheet .p-result {
    color: #000;
    background: none;
    border: 1px solid #000;
  }
  .p-psc-sheet .p-result-label,
  .p-psc-sheet .p-result-exam {
    color: #000;
  }
  .p-psc-sheet .p-lt-wrap {
    overflow: visible;
  }
  .p-psc-sheet {
    break-inside: avoid;
  }
}

/* latestResults on the PPSC hub */

.p-psc-latest li {
  padding: 0.5em 0;
  border-bottom: 1px solid var(--p-rule);
}

.p-psc-latest .p-pr-meta {
  display: block;
  font-size: 0.92em;
  color: var(--p-muted);
}

/* a light page names its council and the languages in the three scripts at weight 400: at 700 the other
   two scripts' bold faces would be fetched for those few words, over PSC-11's 100 KB of fonts */
.p-light [lang] {
  font-weight: 400 !important;
}

/* The case forms (8.6): the lab's p-tool-form, one question to a page (REQUIREMENTS CAS-02). A question's text
   is its label; the lab's fields keep their look. */

.p-case {
  max-width: 46em;
}

.p-case .p-track {
  margin-bottom: 1.4em;
}

.p-case-step {
  margin-bottom: 0.6em;
  font-weight: 700;
  color: var(--p-muted);
}

.p-case-q {
  min-width: 0;
  margin: 0 0 1.2em;
  padding: 0;
  border: 0;
}

.p-case-label {
  display: block;
  margin-bottom: 0.4em;
  padding: 0;
  font-size: 1.25em;
  font-weight: 700;
  color: var(--p-heading);
}

.p-case-form label.p-case-field {
  margin-top: 0.9em;
}

.p-case-form input[type='text'],
.p-case-form input[type='email'],
.p-case-form input[type='tel'],
.p-case-form select,
.p-case-form textarea {
  width: 100%;
  max-width: 36em;
  min-height: 2.9em;
  padding: 0.5em 0.8em;
  font: inherit;
  color: var(--p-ink);
  background: var(--p-card);
  border: 1px solid var(--p-muted);
}

.p-case-form [aria-invalid='true'] {
  border-color: var(--p-band);
  border-width: 2px;
}

.p-case-choice {
  display: flex;
  gap: 0.6em;
  align-items: flex-start;
  margin: 0.6em 0;
}

.p-case-choice input {
  flex: none;
  width: 1.3em;
  height: 1.3em;
  margin: 0.15em 0 0;
}

.p-case-form .p-case-choice label {
  margin: 0;
  font-weight: 400;
}

.p-case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em 1.4em;
  align-items: center;
}

.p-case-back {
  display: inline-block;
  min-height: 24px;
}

.p-case-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1em;
  margin-top: 1em;
}

.p-case-lang {
  min-height: 24px;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
}

.p-case-delete {
  margin-top: 1.2em;
}

.p-case-go {
  display: inline-block;
  min-height: 24px;
}

.p-case-answers {
  margin-bottom: 1.4em;
}

.p-case-answers dd {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.p-case .p-case-change {
  font-weight: 400;
  white-space: normal;
}

.p-case-files {
  margin: 0.8em 0 1.2em;
  padding: 0;
  list-style: none;
}

.p-case-files li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em 0.8em;
  align-items: baseline;
  padding: 0.5em 0;
  border-bottom: 1px solid var(--p-rule);
}

.p-case-file-name {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.p-case-form input.p-case-file {
  max-width: 100%;
  margin-bottom: 0.8em;
}

.p-case .p-case-change a {
  display: inline-block;
  min-height: 24px;
}

/* a narrow phone: the strip's square keeps its size (WCAG 2.5.8); the social links stay in the footer, as the strip
   holds no more at 320 px */
.p .p-search-square {
  flex: none;
  min-width: 24px;
  min-height: 24px;
}

@container p (max-width: 25em) {
  .p-utility .p-social {
    display: none;
  }
}
