/* Kvízotron's look. Pico gives the base; this file gives the colours and the layout.
   Colours come from the palette in `data-palette` (color_palette in the theme's manifest, FR-53).
   The marked blocks are read by tests/test_palettes.py, which checks their contrast. Blocks marked `default` apply when
   the value is unknown, and must equal the default palette. */

/* palette: default light */
:root {
  --kvz-main: #1769e0;
  --kvz-on-main: #ffffff;
  --kvz-page-from: #1769e0;
  --kvz-page-to: #0e7c7c;
  --kvz-on-page: #ffffff;
  --kvz-bar: #0f2a52;
  --kvz-on-bar: #ffffff;
  --kvz-accent: #ffb020;
  --kvz-on-accent: #0f2a52;
  --kvz-card: #ffffff;
  --kvz-text: #0f2a52;
  --kvz-muted: #5a5f73;
  --kvz-tile: #eef3fc;
  --kvz-link: #1769e0;
  --kvz-line: #d6ddea;
  --kvz-surface: #f4f6fb;
}
/* end */

@media (prefers-color-scheme: dark) {
  /* palette: default dark */
  :root {
    --kvz-main: #1769e0;
    --kvz-on-main: #ffffff;
    --kvz-page-from: #0f2a52;
    --kvz-page-to: #1769e0;
    --kvz-on-page: #ffffff;
    --kvz-bar: #0f2a52;
    --kvz-on-bar: #ffffff;
    --kvz-accent: #ffb020;
    --kvz-on-accent: #0f2a52;
    --kvz-card: #16213a;
    --kvz-text: #eef0fa;
    --kvz-muted: #b9bdd0;
    --kvz-tile: #24324f;
    --kvz-link: #8fbcff;
    --kvz-line: #33415f;
    --kvz-surface: #0f1830;
  }
  /* end */
}

/* palette: blue_teal light */
:root[data-palette="blue_teal"] {
  --kvz-main: #1769e0;
  --kvz-on-main: #ffffff;
  --kvz-page-from: #1769e0;
  --kvz-page-to: #0e7c7c;
  --kvz-on-page: #ffffff;
  --kvz-bar: #0f2a52;
  --kvz-on-bar: #ffffff;
  --kvz-accent: #ffb020;
  --kvz-on-accent: #0f2a52;
  --kvz-card: #ffffff;
  --kvz-text: #0f2a52;
  --kvz-muted: #5a5f73;
  --kvz-tile: #eef3fc;
  --kvz-link: #1769e0;
  --kvz-line: #d6ddea;
  --kvz-surface: #f4f6fb;
}
/* end */

@media (prefers-color-scheme: dark) {
  /* palette: blue_teal dark */
  :root[data-palette="blue_teal"] {
    --kvz-main: #1769e0;
    --kvz-on-main: #ffffff;
    --kvz-page-from: #0f2a52;
    --kvz-page-to: #1769e0;
    --kvz-on-page: #ffffff;
    --kvz-bar: #0f2a52;
    --kvz-on-bar: #ffffff;
    --kvz-accent: #ffb020;
    --kvz-on-accent: #0f2a52;
    --kvz-card: #16213a;
    --kvz-text: #eef0fa;
    --kvz-muted: #b9bdd0;
    --kvz-tile: #24324f;
    --kvz-link: #8fbcff;
    --kvz-line: #33415f;
    --kvz-surface: #0f1830;
  }
  /* end */
}

/* palette: indigo_pink light */
:root[data-palette="indigo_pink"] {
  --kvz-main: #4b3fe4;
  --kvz-on-main: #ffffff;
  --kvz-page-from: #4b3fe4;
  --kvz-page-to: #cf2f6e;
  --kvz-on-page: #ffffff;
  --kvz-bar: #1e1b5e;
  --kvz-on-bar: #ffffff;
  --kvz-accent: #ffc400;
  --kvz-on-accent: #1e1b5e;
  --kvz-card: #ffffff;
  --kvz-text: #1e1b5e;
  --kvz-muted: #5a5f73;
  --kvz-tile: #f0effb;
  --kvz-link: #4b3fe4;
  --kvz-line: #dcdbee;
  --kvz-surface: #f5f5fc;
}
/* end */

@media (prefers-color-scheme: dark) {
  /* palette: indigo_pink dark */
  :root[data-palette="indigo_pink"] {
    --kvz-main: #4b3fe4;
    --kvz-on-main: #ffffff;
    --kvz-page-from: #1e1b5e;
    --kvz-page-to: #4b3fe4;
    --kvz-on-page: #ffffff;
    --kvz-bar: #1e1b5e;
    --kvz-on-bar: #ffffff;
    --kvz-accent: #ffc400;
    --kvz-on-accent: #1e1b5e;
    --kvz-card: #1d1c44;
    --kvz-text: #eef0fa;
    --kvz-muted: #b9bdd0;
    --kvz-tile: #2e2c63;
    --kvz-link: #b3aeff;
    --kvz-line: #3b3970;
    --kvz-surface: #141338;
  }
  /* end */
}

/* palette: violet_white light */
:root[data-palette="violet_white"] {
  --kvz-main: #6a2bd9;
  --kvz-on-main: #ffffff;
  --kvz-page-from: #6a2bd9;
  --kvz-page-to: #4a1d9e;
  --kvz-on-page: #ffffff;
  --kvz-bar: #2c1457;
  --kvz-on-bar: #ffffff;
  --kvz-accent: #4a1d9e;
  --kvz-on-accent: #ffffff;
  --kvz-card: #ffffff;
  --kvz-text: #2c1457;
  --kvz-muted: #5a5f73;
  --kvz-tile: #f3eefb;
  --kvz-link: #6a2bd9;
  --kvz-line: #e0d8ee;
  --kvz-surface: #f6f3fc;
}
/* end */

@media (prefers-color-scheme: dark) {
  /* palette: violet_white dark */
  :root[data-palette="violet_white"] {
    --kvz-main: #6a2bd9;
    --kvz-on-main: #ffffff;
    --kvz-page-from: #2c1457;
    --kvz-page-to: #6a2bd9;
    --kvz-on-page: #ffffff;
    --kvz-bar: #2c1457;
    --kvz-on-bar: #ffffff;
    --kvz-accent: #ffffff;
    --kvz-on-accent: #2c1457;
    --kvz-card: #241545;
    --kvz-text: #eef0fa;
    --kvz-muted: #b9bdd0;
    --kvz-tile: #362360;
    --kvz-link: #c9aeff;
    --kvz-line: #463268;
    --kvz-surface: #1a0e34;
  }
  /* end */
}

/* palette: green_blue light */
:root[data-palette="green_blue"] {
  --kvz-main: #0e7c5a;
  --kvz-on-main: #ffffff;
  --kvz-page-from: #0e7c5a;
  --kvz-page-to: #1769a8;
  --kvz-on-page: #ffffff;
  --kvz-bar: #0c2f2a;
  --kvz-on-bar: #ffffff;
  --kvz-accent: #ffc400;
  --kvz-on-accent: #0c2f2a;
  --kvz-card: #ffffff;
  --kvz-text: #0c2f2a;
  --kvz-muted: #5a5f73;
  --kvz-tile: #ebf6f2;
  --kvz-link: #0e7c5a;
  --kvz-line: #d3e4de;
  --kvz-surface: #f2f8f6;
}
/* end */

@media (prefers-color-scheme: dark) {
  /* palette: green_blue dark */
  :root[data-palette="green_blue"] {
    --kvz-main: #0e7c5a;
    --kvz-on-main: #ffffff;
    --kvz-page-from: #0c2f2a;
    --kvz-page-to: #0e7c5a;
    --kvz-on-page: #ffffff;
    --kvz-bar: #0c2f2a;
    --kvz-on-bar: #ffffff;
    --kvz-accent: #ffc400;
    --kvz-on-accent: #0c2f2a;
    --kvz-card: #12302b;
    --kvz-text: #eef0fa;
    --kvz-muted: #b9bdd0;
    --kvz-tile: #1e433c;
    --kvz-link: #7fd8b8;
    --kvz-line: #2c524a;
    --kvz-surface: #0b221e;
  }
  /* end */
}

/* palette: red_plum light */
:root[data-palette="red_plum"] {
  --kvz-main: #c2263f;
  --kvz-on-main: #ffffff;
  --kvz-page-from: #c2263f;
  --kvz-page-to: #6d2a78;
  --kvz-on-page: #ffffff;
  --kvz-bar: #35142f;
  --kvz-on-bar: #ffffff;
  --kvz-accent: #ffc400;
  --kvz-on-accent: #35142f;
  --kvz-card: #ffffff;
  --kvz-text: #35142f;
  --kvz-muted: #5a5f73;
  --kvz-tile: #f9eef1;
  --kvz-link: #c2263f;
  --kvz-line: #eed9df;
  --kvz-surface: #fbf4f6;
}
/* end */

@media (prefers-color-scheme: dark) {
  /* palette: red_plum dark */
  :root[data-palette="red_plum"] {
    --kvz-main: #c2263f;
    --kvz-on-main: #ffffff;
    --kvz-page-from: #35142f;
    --kvz-page-to: #c2263f;
    --kvz-on-page: #ffffff;
    --kvz-bar: #35142f;
    --kvz-on-bar: #ffffff;
    --kvz-accent: #ffc400;
    --kvz-on-accent: #35142f;
    --kvz-card: #2e1428;
    --kvz-text: #eef0fa;
    --kvz-muted: #b9bdd0;
    --kvz-tile: #44213c;
    --kvz-link: #f5a3b4;
    --kvz-line: #563150;
    --kvz-surface: #220e1d;
  }
  /* end */
}

/* Pico's variables, from the tokens above. The selector matches Pico's own specificity. */
:root[data-palette],
:root[data-palette]:not([data-theme]) {
  --pico-background-color: var(--kvz-surface);
  --pico-color: var(--kvz-text);
  --pico-muted-color: var(--kvz-muted);
  --pico-muted-border-color: var(--kvz-line);
  --pico-h1-color: var(--kvz-text);
  --pico-h2-color: var(--kvz-text);
  --pico-h3-color: var(--kvz-text);
  --pico-card-background-color: var(--kvz-card);
  --pico-card-sectioning-background-color: var(--kvz-card);
  --pico-primary: var(--kvz-link);
  --pico-primary-hover: var(--kvz-link);
  --pico-primary-underline: var(--kvz-link);
  --pico-primary-background: var(--kvz-main);
  --pico-primary-hover-background: var(--kvz-main);
  --pico-primary-border: var(--kvz-main);
  --pico-primary-hover-border: var(--kvz-main);
  --pico-primary-inverse: var(--kvz-on-main);
  --pico-secondary: var(--kvz-link);
  --pico-secondary-hover: var(--kvz-link);
  --pico-secondary-border: var(--kvz-link);
  --pico-secondary-hover-border: var(--kvz-link);
  --pico-form-element-background-color: var(--kvz-card);
  --pico-form-element-color: var(--kvz-text);
  --pico-form-element-border-color: var(--kvz-line);
  --pico-dropdown-background-color: var(--kvz-card);
  --pico-dropdown-color: var(--kvz-text);
  --pico-dropdown-hover-background-color: var(--kvz-tile);
  --pico-table-border-color: var(--kvz-line);
}

h1 {
  font-size: clamp(1.75rem, 1.4rem + 2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

:focus-visible {
  outline: 0.1875rem solid var(--kvz-accent);
  outline-offset: 0.125rem;
}

.skip-link {
  position: absolute;
  left: -100vw;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--kvz-accent);
  color: var(--kvz-on-accent);
}

.flag {
  display: inline-block;
  width: 1.5rem;
  height: 1rem;
  vertical-align: -0.125rem;
  border-radius: 2px;
}

/* The bar: name on the left; on a phone the menu opens under it. */
.site-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--kvz-on-bar);
}

.admin .site-bar {
  background: var(--kvz-bar);
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: auto;
  color: inherit;
  font-size: 1.125rem;
  font-weight: 800;
  text-decoration: none;
}

/* The mark can be any aspect ratio; the bar tile stays a square. */
.site-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.about-logo {
  display: block;
  width: auto;
  height: 8rem;
  margin-bottom: 1rem;
}

.about-logo-centered {
  margin-left: auto;
  margin-right: auto;
}

/* The built-in hero logo is one line of text with the icons under it, on a transparent background. */
.about-logo-builtin {
  height: auto;
  max-width: 100%;
  aspect-ratio: 1120 / 390;
  width: 18rem;
}

.about-logo-builtin.about-logo-full {
  aspect-ratio: 1100 / 760;
  width: 16rem;
}

/* The settings pages show the bar logo beside the line that says which one applies. */
.logo-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.logo-row img {
  flex: none;
  object-fit: contain;
}

.logo-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--kvz-muted);
  font-size: 0.9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.logo-row button {
  width: auto;
  margin: 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
}

.logo-preview img {
  margin-right: 0.5rem;
  vertical-align: middle;
}

.about-logo[width="240"] {
  height: 10rem;
}

.site-bar {
  --pico-accordion-close-summary-color: currentcolor;
  --pico-accordion-open-summary-color: currentcolor;
  --pico-accordion-active-summary-color: currentcolor;
}

.site-bar a:not(.site-name) {
  color: inherit;
}

.site-nav {
  margin: 0;
}

.site-nav > summary {
  list-style: none;
  padding: 0.125rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1.4;
  cursor: pointer;
}

.site-nav > summary::-webkit-details-marker,
.site-nav > summary::after {
  display: none;
}

/* Without JavaScript the menu stays open, so it is part of the page and covers nothing. */
:root:not(.js) .site-bar {
  flex-wrap: wrap;
}

:root:not(.js) .site-nav {
  order: 3;
  flex-basis: 100%;
}

.js .site-nav[open] > nav {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0.5rem;
  right: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: var(--kvz-card);
  color: var(--kvz-text);
  box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 25%);
}

.site-nav nav ul,
.site-nav nav ul:first-of-type,
.site-nav nav ul:last-of-type {
  display: block;
  margin: 0;
  padding: 0;
  color: inherit; /* Pico colours every list */
}

.site-nav li {
  display: block;
  padding: 0.5rem 0;
  list-style: none;
}

.site-nav nav > ul > li > a {
  margin: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.site-nav form {
  margin: 0;
}

.site-nav button {
  width: auto;
  margin: 0;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

.site-nav nav > ul > li > a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Dropdowns: Pico's details.dropdown, made compact. */
details.dropdown {
  position: relative;
  display: inline-block;
  margin: 0;
}

details.dropdown > summary:not([role]) {
  width: auto;
  height: auto;
  padding: 0.25rem 1.75rem 0.25rem 0.5rem;
  border-color: var(--kvz-line);
  background-color: transparent;
  color: inherit;
  line-height: 1.4;
}

details.dropdown > summary + ul {
  position: absolute;
  z-index: 30;
  width: auto;
  min-width: max-content;
  margin: 0.25rem 0 0;
  padding: 0.25rem 0;
  list-style: none;
}

details.dropdown > summary + ul li {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

details.dropdown > summary + ul li a,
details.dropdown > summary + ul li button {
  display: block;
  overflow: visible;
  width: 100%;
  white-space: nowrap;
  text-overflow: clip;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--kvz-text);
  font-size: 1rem;
  text-align: left;
  text-decoration: none;
}

details.dropdown > summary + ul li a[aria-current] {
  font-weight: 700;
  background: var(--kvz-tile);
}

details.dropdown > summary + ul li a:hover,
details.dropdown > summary + ul li button:hover {
  background: var(--kvz-tile);
}

details.dropdown > summary + ul form {
  margin: 0;
}

.language {
  flex: none;
}

details.language > summary + ul {
  right: 0;
  left: auto;
  width: auto;
}

.site-nav details.language > summary + ul {
  right: auto;
  left: 0;
}

/* The arrow of the main button and the menu of a row. */
details.more > summary:not([role]) {
  padding: 0.25rem 0.625rem;
}

details.more > summary:not([role])::after {
  display: none;
}

details.more > summary + ul {
  right: 0;
  left: auto;
  width: auto;
}

/* Public side: colour across the whole page, content on a card. */
body.public {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--kvz-page-from), var(--kvz-page-to)) fixed;
  color: var(--kvz-text);
}

.public .site-bar {
  color: var(--kvz-on-page);
}

.public .site-bar > .language > summary:not([role]) {
  border-color: var(--kvz-on-page);
}

.page {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  padding: 0.5rem 0.75rem 2rem;
}

.hero {
  padding: 0.5rem 0.25rem 1rem;
  color: var(--kvz-on-page);
}

.hero h1 {
  margin-bottom: 0.5rem;
  color: inherit;
}

/* The motto of two sentences is set as two lines, the first to the right and the second to the left. */
.motto-first,
.motto-rest {
  display: block;
}

.motto-first {
  text-align: right;
}

.motto-rest {
  text-align: left;
}

.hero p {
  margin: 0;
  color: inherit;
}

.card {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--kvz-card);
  color: var(--kvz-text);
  box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 15%);
}

.card > :last-child {
  margin-bottom: 0;
}

.prose li {
  margin-bottom: 0.5rem;
}

.quiz-list {
  margin: 0;
  padding: 0;
}

.quiz-list li {
  margin: 0 0 0.5rem;
  list-style: none;
  border-radius: 0.5rem;
  border: 2px solid transparent;
  background: var(--kvz-tile);
}

.quiz-list li:last-child {
  margin-bottom: 0;
}

.quiz-list a {
  display: block;
  padding: 0.75rem 1rem;
  color: inherit;
  text-decoration: none;
}

.quiz-list strong {
  display: block;
  font-size: 1.125rem;
}

/* The organisation of a quiz that has its own: one line above the title, cut off rather than wrapped. */
.quiz-org {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
  overflow: hidden;
  color: var(--kvz-muted);
  font-size: 0.85rem;
}

.quiz-org img {
  flex: none;
  object-fit: contain;
}

.quiz-org-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.quiz-list span {
  color: var(--kvz-muted);
}

.quiz-list li:hover {
  border-color: var(--kvz-link);
}

.is-featured,
.quiz-list li.is-featured {
  border-color: var(--kvz-main);
}

#play button[type="submit"] {
  width: 100%;
  margin-bottom: 0;
}

#play fieldset {
  margin-bottom: 1.5rem;
}

#play legend {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}

#play fieldset label:has(input[type="checkbox"]),
#play fieldset label:has(input[type="radio"]) {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  margin: 0 0 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: var(--kvz-tile);
  font-weight: 600;
  cursor: pointer;
}

#play fieldset label:has(input[type="checkbox"]) input,
#play fieldset label:has(input[type="radio"]) input {
  flex: none;
  margin: 0;
}

#play fieldset label:has(input:checked) {
  background: var(--kvz-accent);
  color: var(--kvz-on-accent);
}

#play fieldset label:has(input:focus-visible) {
  outline: 0.1875rem solid var(--kvz-link);
  outline-offset: 0.125rem;
}

.admin-link {
  margin-top: 1rem;
  text-align: center;
}

.admin-link a {
  color: var(--kvz-on-page);
}

/* The motto under a quiz's title, when its branding sets one. */
.motto {
  font-style: italic;
}

/* The footer sits on the page background, like the admin link, so it uses the colour of text on the page. */
.site-footer {
  padding: 1.5rem 1rem 2rem;
  color: var(--kvz-on-page);
  text-align: center;
  font-size: 0.875rem;
}

/* Pico colours every <p> with --kvz-text, which is dark on the page gradient. */
.site-footer-line {
  color: var(--kvz-on-page);
  margin: 0 auto 0.25rem;
}

/* A part moves to the next line whole, so a line wraps at a " · " between parts. Only a part
   wider than the screen (a long footer text or e-mail) breaks inside itself. */
.site-footer-part {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.site-footer-badges {
  display: inline-flex;
  gap: 0.25rem;
  vertical-align: middle;
}

.site-footer-badges img {
  display: block;
  height: 20px;
  width: auto;
}

.site-footer a {
  color: var(--kvz-on-page);
}

/* Administration has no page gradient behind the footer. */
.admin .site-footer,
.admin .site-footer-line,
.admin .site-footer a {
  color: var(--kvz-muted);
}

.sources {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--kvz-line);
}

.sources-question {
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.sources li {
  overflow-wrap: anywhere;
}

.rewards-held {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--kvz-line);
}

.rewards li,
.winners li {
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.draw-wrap {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.question-image {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
}

.option-image {
  flex: none;
  width: 6rem;
  height: 6rem;
  border-radius: 0.25rem;
  background: var(--kvz-surface, transparent);
  object-fit: contain;
}

.image-preview {
  display: block;
  max-width: 10rem;
  max-height: 10rem;
  margin-bottom: 0.5rem;
}

.image-fields {
  margin-top: 0.5rem;
}

#play .match-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

#play .match-row select {
  margin-bottom: 0;
}

@media (min-width: 48rem) {
  #play .match-row {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.match-direction {
  margin-bottom: 0.5rem;
}

.sortable {
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.sortable li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--kvz-tile);
  font-weight: 600;
  list-style: none;
}

.sortable-text {
  flex: 1 1 8rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sortable li select {
  width: auto;
  margin: 0;
}

.sortable-handle {
  flex: none;
  padding: 0.25rem 0.5rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.sortable-move {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
}

.sortable-dragged {
  outline: 0.1875rem solid var(--kvz-link);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.editor:has(input[name="allow_multiple"]:not(:checked)) .several-only,
.editor:has(input[name="mode"][value="pairs"]:checked) .order-only,
.editor:has(input[name="mode"][value="order"]:checked) .pairs-only {
  display: none;
}

@media (min-width: 48rem) {
  .editor:has(input[name="mode"][value="pairs"]:checked) .match-admin-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

#play-message:not(:empty) {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--kvz-card);
  color: var(--pico-del-color);
}

#identity-error:not(:empty),
#revision-notice:not(:empty),
.notice {
  padding: 0.75rem 1rem;
  border-left: 0.375rem solid var(--kvz-accent);
  background: var(--kvz-tile);
  color: var(--kvz-text);
}

.identity-form {
  margin: 1rem 0;
}

.identity-fields label {
  display: block;
  margin-bottom: 0.75rem;
}

.identity-fields input {
  display: block;
  width: 100%;
  max-width: 24rem;
}

.score strong {
  display: block;
  font-size: clamp(3rem, 2rem + 8vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
}

.score span {
  color: var(--kvz-muted);
  font-size: 1.25rem;
}

/* Administration */
.admin-main,
main:not(.page) {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding: 0 1rem 3rem;
}

.admin main.page {
  max-width: 76rem;
  padding: 1rem 1rem 3rem;
}

.narrow {
  max-width: 24rem;
  margin-inline: auto;
}

/* The shared board pick on the Runs page: two small inputs, so the table still fits (AC-118). */
th.board-pick,
td.board-pick {
  padding-inline: 0.5rem;
  white-space: nowrap;
}

td.board-pick input {
  margin-inline-end: 0.25rem;
}

td.board-pick input:last-child {
  margin-inline-end: 0;
}

.page-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.page-title h1 {
  margin: 0;
}

/* The bar above a list (AC-170): name and count, then managing the list as buttons, a line below. */
.list-bar {
  margin: 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color, #d0d7de);
}

.list-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.list-bar-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.list-bar-count {
  color: var(--kvz-muted);
  font-weight: 400;
}

.list-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.list-bar-actions [role="button"] {
  margin: 0;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.list-bar-note {
  display: block;
  margin-top: 0.25rem;
  color: var(--kvz-muted);
}

/* Copy and archive of a quiz: a plain bar above the settings, not a tinted section. */
.quiz-copy {
  margin-bottom: 1.25rem;
}

.quiz-copy form,
.quiz-copy button,
.quiz-copy [role="button"] {
  margin: 0;
}

.quiz-copy small {
  flex-basis: 100%;
  color: var(--kvz-muted);
}

/* The quiz type above the settings (ADR-0062): its name and deviations, then the actions. */
.quiz-type-bar {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--pico-muted-border-color, #d0d7de);
  border-radius: 0.5rem;
}

.quiz-type-name {
  margin-bottom: 0.5rem;
}

.quiz-type-actions,
.quiz-type-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}

.quiz-type-actions form,
.quiz-type-bar button,
.quiz-type-bar [role="button"],
.quiz-type-pick label,
.quiz-type-pick select {
  margin: 0;
}

.quiz-type-bar button,
.quiz-type-bar [role="button"],
.quiz-type-pick select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 2.75rem;
  padding-top: 0;
  padding-bottom: 0;
}

.quiz-type-pick label {
  align-self: center;
}

.quiz-type-bar small {
  display: block;
  margin-top: 0.5rem;
  color: var(--kvz-muted);
}

/* "▲ type: 30 min" beside a setting that differs from the quiz type. */
.type-mark {
  display: block;
  margin-top: 0.25rem;
  color: var(--kvz-muted);
}

.notice + h2,
.notice + section {
  margin-top: 1.5rem;
}

.type-changes li {
  margin-bottom: 0.25rem;
}

/* The list of types on the new-quiz form, closed until the admin opens it. */
.quiz-type-choice {
  margin-bottom: 1.25rem;
}

.quiz-type-option {
  margin-bottom: 0.75rem;
}

.quiz-type-option small {
  display: block;
  margin-left: 1.75rem;
  color: var(--kvz-muted);
}

.crumb {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.quiz-head {
  margin-bottom: 1.5rem;
}

.quiz-fold {
  margin: 0;
  border: 0;
}

.quiz-fold > summary {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--kvz-tile);
  color: var(--kvz-text);
  list-style: none;
}

.quiz-fold > summary::-webkit-details-marker {
  display: none;
}

.quiz-fold > summary::after {
  float: none;
  flex: none;
  margin: 0;
}

.quiz-fold > summary span {
  margin-left: auto;
  white-space: nowrap;
}

.quiz-title,
.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.main-action {
  display: inline-flex;
  align-items: stretch;
  gap: 0.25rem;
}

.main-action form {
  margin: 0;
}

.main-action button,
.main-action [role="button"] {
  width: auto;
  margin: 0;
  padding: 0.375rem 0.875rem;
}

.status-area {
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  background: var(--kvz-line);
  color: var(--kvz-text);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
}

.chip,
.chips li.chip {
  display: inline-block;
  margin: 0;
  padding: 0.0625rem 0.625rem;
  border-radius: 1rem;
  background: var(--kvz-line);
  color: var(--kvz-text);
  font-size: 0.8125rem;
  list-style: none;
}

.chip-live,
.chips li.chip-live {
  background: var(--kvz-tile);
  box-shadow: inset 0 0 0 1px var(--kvz-link);
}

/* Export file names are long: one per line, broken anywhere on a phone. */
.export-files {
  margin: 0;
  padding: 0;
}

.export-files li {
  list-style: none;
  overflow-wrap: anywhere;
}

.chip-draft,
.chips li.chip-draft {
  background: var(--kvz-accent);
  color: var(--kvz-on-accent);
}

.chip a {
  color: inherit;
}

.tabs {
  margin-top: 0.75rem;
  border-bottom: 2px solid var(--kvz-line);
  overflow: auto hidden;
  scrollbar-width: none;
}

.tabs ul,
.tabs ul:first-of-type,
.tabs ul:last-of-type {
  display: flex;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
}

.tabs li {
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.tabs a {
  display: block;
  margin: 0;
  padding: 0.5rem 0.875rem;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--kvz-muted);
  text-decoration: none;
}

.tabs a[aria-current] {
  border-bottom-color: var(--kvz-link);
  color: var(--kvz-link);
  font-weight: 700;
}
/* "More" opens in the row: the tab bar scrolls sideways, so a dropdown would be cut off */
.tab-more[open] {
  display: flex;
}
.tab-more {
  margin: 0;
}
.tab-more > summary {
  margin: 0;
  white-space: nowrap;
  line-height: inherit;
  padding: 0.5rem 0.875rem;
  border-bottom: 2px solid transparent;
  color: var(--kvz-muted);
  cursor: pointer;
}
.tab-more[open] > summary {
  margin-bottom: 0;
}
/* Closed, the arrow points down: "More" opens. Open, the list is to its right, so the arrow
   points there. Pico has it the other way round. */
.tab-more:not([open]) > summary::after {
  transform: rotate(0deg);
}
.tab-more[open] > summary::after {
  transform: rotate(-90deg);
}
.tab-more > summary[aria-current],
.tab-more[open] > summary[aria-current]:not([role]):not(:focus) {
  border-bottom-color: var(--kvz-link);
  color: var(--kvz-link);
  font-weight: 700;
}
.tab-more > ul {
  display: flex;
  margin: 0;
  padding: 0;
}

.rows {
  margin: 0 0 1rem;
  padding: 0;
}

.rows > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--kvz-line);
  list-style-position: inside;
}

ul.rows > li,
ul.rows-plain > li {
  list-style: none;
}

.rows > li > input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}

/* A folder's menu moves from a select; a phone gets links to a page instead of a menu with a select. */
details.dropdown > summary + ul li.move-links {
  display: none;
}

details.dropdown > summary + ul li.move-inline select {
  margin: 0.25rem 1rem;
  width: auto;
}

@media (max-width: 48rem) {
  details.dropdown > summary + ul li.move-inline {
    display: none;
  }

  details.dropdown > summary + ul li.move-links {
    display: block;
  }
}

.issues-toggle {
  margin: 0 0 0.5rem;
}

/* About 15 rows of the issues table; the rest scrolls, and the header stays. */
.issues-scroll {
  max-height: 41rem;
  overflow-y: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--kvz-line);
  border-radius: 0.375rem;
}

.issues-scroll table {
  margin: 0;
}

.issues-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--kvz-card);
}

.bank-search,
.folder-new,
.bulk-move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.bank-search input,
.folder-new input,
.bulk-move select {
  flex: 1 1 12rem;
  min-width: 0;
  width: auto;
  margin: 0;
}

.bank-search button,
.folder-new button,
.bulk-move button {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.folder-crumbs {
  display: block;
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
}

.row-main {
  flex: 1 1 14rem;
  min-width: 0;
}

.row-main small {
  display: block;
  color: var(--kvz-muted);
}

.form-section {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

/* "Basic / All" in the section panel (ADR-0052) */
.view-switch {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0;
}

/* Section panel: a sticky side panel on a wide screen, a floating list on a narrow one */
.with-panel {
  display: block;
}

.section-panel {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--kvz-card);
  color: var(--kvz-text);
  border: 1px solid var(--kvz-line);
  border-radius: 0.5rem;
}

.section-list {
  margin: 0;
}

.section-panel summary {
  font-weight: 600;
  cursor: pointer;
}

.section-panel nav ul {
  margin: 0.5rem 0;
  margin-inline: 0;
  padding: 0;
  list-style: none;
}

.section-panel li {
  margin: 0;
  padding: 0;
}

/* Pico gives `nav li a` a negative vertical margin; without resetting it the marked item
   is taller than its row and covers the neighbours. */
.section-panel a {
  display: block;
  margin: 0;
  padding: 0.125rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.section-panel a[aria-current] {
  border: 1px solid var(--kvz-line);
  border: 1px solid color-mix(in srgb, var(--kvz-main) 30%, transparent);
  background: var(--kvz-tile);
  background: color-mix(in srgb, var(--kvz-main) 7%, transparent);
  font-weight: 700;
  text-decoration: underline;
}

.section-panel .view-switch {
  margin-top: 0.5rem;
}

.panel-main {
  min-width: 0;
}

@media (min-width: 64rem) {
  .with-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14rem;
    gap: 2rem;
    align-items: start;
  }

  .with-panel .section-panel {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 1rem;
  }

  .with-panel .panel-main {
    grid-column: 1;
    grid-row: 1;
  }

  .section-panel summary {
    pointer-events: none;
    cursor: default;
  }
}

@media (max-width: 63.99rem) {
  .js .section-panel {
    position: fixed;
    right: 1rem;
    bottom: 4.5rem;
    z-index: 20;
    max-width: calc(100vw - 2rem);
    max-height: 70vh;
    overflow-y: auto;
    margin: 0;
    box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 0.25);
  }
}

/* A group of settings is tinted with the main colour of the palette, so that it is clear what belongs together. */
.setting-group,
.with-panel .form-section[id] {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--kvz-tile);
  background: color-mix(in srgb, var(--kvz-main) 7%, transparent);
  scroll-margin-top: 1rem;
}

/* One setting; a dependant is indented under the setting it follows (AC-168).
   A wide screen puts the label left and the control right; a narrow one keeps them stacked. */
.form-section.settings-form {
  max-width: 56rem;
}

.setting-row {
  margin-bottom: 0.75rem;
}

.setting-label,
.setting-label label,
.setting-legend {
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.setting-label label,
.setting-legend {
  display: block;
}

.setting-control .logo-row,
.setting-control .logo-preview {
  margin: 0;
}

.setting-control > select,
.setting-control > input {
  margin-bottom: 0.25rem;
}

.setting-control .helptext {
  color: var(--kvz-muted);
  font-size: 0.875rem;
}

/* Radio buttons of a short choice sit in a row and wrap. */
[role="radiogroup"] .setting-control > div[id]:not(.helptext) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

[role="radiogroup"] .setting-control > div[id]:not(.helptext) label {
  margin: 0;
}

/* A search draws what does not match `hidden`; a grid row must not show it again. */
.setting-row[hidden],
.setting-columns[hidden],
.setting-group[hidden] {
  display: none;
}

.search-state {
  margin: -0.5rem 0 1rem;
}

.setting-columns {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem 0;
  border: 1px solid var(--kvz-line);
  border-radius: 0.375rem;
}

.setting-columns legend {
  padding: 0 0.25rem;
  font-weight: 600;
}

@media (min-width: 48rem) {
  .setting-row {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: 0 1rem;
    align-items: start;
  }

  .setting-label {
    padding-top: 0.5rem;
  }

  .setting-child .setting-label {
    padding-inline-end: 0;
  }
}

.setting-child {
  margin-inline-start: 1.25rem;
  padding-inline-start: 0.75rem;
  border-inline-start: 2px solid var(--kvz-line);
}

details.setting-group > summary {
  font-weight: 700;
}

.group-hidden {
  color: var(--kvz-muted);
  font-size: 0.875rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.actions form {
  margin: 0;
}

.actions button,
.actions [role="button"] {
  width: auto;
  margin: 0;
}

.panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--kvz-tile);
}

.panel h2 {
  margin-bottom: 0.5rem;
}

.panel a {
  overflow-wrap: anywhere;
}

.qr-code {
  width: 10rem;
  max-width: 100%;
  background: #fff;
}

.editor {
  max-width: 44rem;
}

.editor article {
  box-shadow: none;
  border: 1px solid var(--kvz-line);
  background: transparent;
}

/* A table is rows of label and value on a phone. */
@media (max-width: 47.99rem) {
  table.stack thead {
    display: none;
  }

  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td {
    display: block;
    width: 100%;
  }

  table.stack tr {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--kvz-line);
  }

  table.stack td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.125rem 0;
    border: 0;
    background: transparent;
  }

  table.stack td[data-label]::before {
    content: attr(data-label);
    color: var(--kvz-muted);
  }
}

/* Compact tables (scoreboard rows) stay one line per row on a phone, which
   matters with 50 participants: place, name (grows, ellipsis), score and
   percent share the line without labels. Optional extra columns (submitted
   time, duration) each take a small line below that keeps its label. The
   modifier is only for tables whose columns vary; other .stack tables keep the
   label/value layout. */
@media (max-width: 47.99rem) {
  table.stack.compact tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.5rem;
  }

  table.stack.compact td {
    width: auto;
    flex: 0 0 auto;
  }

  table.stack.compact td[data-label]::before {
    content: none;
  }

  table.stack.compact td.who {
    flex: 1 1 0;
    min-width: 0;
  }

  table.stack.compact .who-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  table.stack.compact td.who strong {
    flex: 0 0 auto;
    margin-left: 0.25rem;
  }

  table.stack.compact td.extra {
    flex: 0 0 100%;
    font-size: 0.8125rem;
    color: var(--kvz-muted);
    justify-content: flex-start;
  }

  table.stack.compact td.extra[data-label]::before {
    content: attr(data-label) ":";
  }

  table.stack.compact td.row-score {
    font-variant-numeric: tabular-nums;
  }

  table.stack.compact td.rank {
    min-width: 2.25rem;
  }

  /* Own row: highlight the whole flex row, not just the cells. */
  table.stack.compact tr[data-mine] {
    background: var(--pico-primary-focus);
  }
}

/* Wide screens: menus are open and their buttons are hidden. */
@media (min-width: 48rem) {
  .site-nav > summary,
  .quiz-fold > summary {
    display: none;
  }

  :root:not(.js) .site-nav {
    order: 0;
    flex-basis: auto;
  }

  .js .site-nav[open] > nav {
    position: static;
    padding: 0;
    background: transparent;
    color: var(--kvz-on-bar);
    box-shadow: none;
  }

  .site-nav nav ul,
  .site-nav nav ul:first-of-type,
  .site-nav nav ul:last-of-type {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .site-nav li {
    display: block;
    padding: 0;
  }

  .site-nav button {
    --pico-color: var(--kvz-on-bar);
    border-color: var(--kvz-on-bar);
    color: var(--kvz-on-bar);
  }

  .site-nav details.language > summary + ul {
    right: 0;
    left: auto;
  }

  .quiz-title {
    margin-top: 0;
  }

  .quiz-title .inline-name {
    flex: 1 1 auto;
  }

  .quiz-meta {
    justify-content: space-between;
  }
}

.flow-progress:not([hidden]) {
  display: block;
  margin-bottom: 1rem;
}

.flow-progress progress {
  margin: 0.25rem 0 0;
}

.flow-question:focus {
  outline: none;
}

.flow-nav:not([hidden]) {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.flow-nav button {
  width: auto;
}

.flow-nav [data-flow-next] {
  margin-left: auto;
}

.reveal-list h3 {
  margin-top: 1.5rem;
}

.reveal {
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border-left: 0.25rem solid var(--pico-muted-border-color);
}

.reveal-right {
  border-left-color: var(--pico-ins-color);
}

.reveal-wrong,
.reveal-partial {
  border-left-color: var(--pico-del-color);
}

.reveal-prompt,
.reveal-state {
  margin-bottom: 0.25rem;
}

.solution {
  margin-bottom: 0.5rem;
}

.solution small {
  margin-left: 0.25rem;
  color: var(--pico-muted-color);
}

.solution .reveal-correct {
  font-weight: 600;
}

.explanation {
  margin-bottom: 0;
  white-space: pre-line;
}

.flow-question [data-flow-check-button] {
  width: auto;
  margin-bottom: 1rem;
}

.flow-reveal:focus {
  outline: none;
}

.flow-locked .sortable-handle {
  visibility: hidden;
}

/* Blanks inside a sentence (question type text) */
.fill-text { line-height: 2.6; }
.fill-text input { display: inline-block; width: 11rem; max-width: 100%; margin: 0 .25rem; height: auto; padding: .15rem .5rem; }

/* Question type image answer: a quiz asks for points, a bank for a share */
.editor-quiz .bank-only, .editor-bank .quiz-only { display: none; }
.photo-thumb { max-width: 100%; height: auto; border-radius: .25rem; }

/* Grading */
.grading-gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.grading-photo { margin: 0 0 1rem; }
.grading-run { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.grading-run label { flex: 1 1 14rem; margin: 0; }
.grading-run button { width: auto; }
.chip-count { margin-left: .25rem; }

/* Public walkthrough */
.walkthrough-counts { padding-left: 1.25rem; }
.walkthrough-hidden { opacity: .55; text-decoration: line-through; }
.inline-form { display: inline; }
.inline-form button { display: inline-block; width: auto; padding: .1rem .5rem; margin: 0 0 0 .5rem; font-size: .85em; }
.grading-photo .photo-thumb { display: block; max-height: 26rem; width: auto; }

.countdown {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 0.25rem 0.75rem;
  background: var(--pico-background-color);
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.countdown strong {
  font-variant-numeric: tabular-nums;
}

.countdown-note {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.875em;
  text-align: right;
}

.countdown-note:empty {
  display: none;
}

.number-note {
  margin: 0.25em 0 0;
  font-size: 0.875em;
}

.number-note:empty {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[data-resume-offer] form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

[data-resume-offer] form button {
  width: auto;
}

[data-resume-device] {
  margin-top: 0.75rem;
}

/* Scoreboard (C4). The projector view is read from the back of a room. */
.scoreboard [data-mine] td {
  font-weight: 700;
  background: var(--pico-primary-focus);
}

.scoreboard-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.projector {
  font-size: clamp(1.25rem, 2.5vw, 2.5rem);
}

.projector table td,
.projector table th {
  padding: 0.4em 0.6em;
}

.scoreboard-tools,
.scoreboard-tools a {
  color: var(--kvz-on-page);
}

/* A date close to its end. On its own background, so it stays readable in every palette. */
.deletion-soon {
  display: inline-block;
  max-width: 100%;
  padding: 0.0625rem 0.5rem;
  white-space: normal;
  border-radius: 0.25rem;
  background: var(--kvz-accent);
  color: var(--kvz-on-accent);
}

/* A name with a pencil: the text and the pencil flow as one text, so a long name wraps and the
   pencil stays right after its last word. Only the field with its buttons is a flex row. */
.inline-name {
  display: inline;
  max-width: 100%;
}

div.inline-name {
  display: block;
}

.inline-name-text {
  display: inline;
  margin: 0;
  overflow-wrap: anywhere;
}

.inline-name-pencil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  margin-inline-start: 0.25rem;
  vertical-align: middle;
  text-decoration: none;
}

div.inline-name .inline-name-note,
div.inline-name .inline-name-saved {
  display: block;
}

.inline-name-note,
.inline-name-saved {
  color: var(--kvz-muted);
}

.inline-name-form {
  display: flex;
  flex: 1 1 20rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.inline-name-form input {
  flex: 1 1 12rem;
  min-width: 0;
  width: auto;
  margin: 0;
}

.inline-name-form button,
.inline-name-form .inline-name-cancel {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

/* The address of a test link: a block like a paragraph, as its field is a form. */
.link-address {
  margin-bottom: var(--pico-typography-spacing-vertical, 1rem);
  overflow-wrap: anywhere;
}

/* The fixed part of an address beside its field: the token path, which cannot be changed. */
.inline-name-suffix {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--kvz-muted);
  overflow-wrap: anywhere;
}

/* Admins page (AC-169): one card per account, the login with its pencil on top. */
.admin-accounts {
  padding: 0;
  list-style: none;
}

.admin-accounts > li {
  list-style: none;
}

.admin-account-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.admin-blocked {
  padding: 0 0.4rem;
  border-radius: var(--pico-border-radius, 0.25rem);
}

.admin-password {
  margin-top: var(--pico-typography-spacing-vertical, 1rem);
}

.admin-password button {
  white-space: nowrap;
}

.admin-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-account-actions form,
.admin-account-actions button,
.admin-account-actions [role="button"] {
  margin: 0;
}

.inline-name-error {
  flex: 1 0 100%;
  margin: 0;
  color: var(--pico-del-color);
}

@media (max-width: 48rem) {
  .inline-name-pencil {
    min-width: 2.75rem;
    min-height: 2.75rem;
    margin-block: -0.5rem;
  }

  .inline-name-form button,
  .inline-name-form .inline-name-cancel {
    min-height: 2.75rem;
  }
}

/* A reward: its details with the pencil of the name beside them. */
.reward-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.25rem 0.5rem;
}

.reward-row details {
  flex: 1 1 16rem;
  min-width: 0;
}

/* The language the texts of a bank are shown in. */
.chips > li {
  margin: 0;
  list-style: none;
}

.chips a.chip {
  text-decoration: none;
}

.chips a.chip[aria-current="true"] {
  background: var(--kvz-tile);
  box-shadow: inset 0 0 0 1px var(--kvz-link);
  font-weight: 600;
}

.chips + p {
  margin-top: 0.5rem;
}

/* The scoreboard button of the quiz page spans the card (AC-176). */
.boards [role="button"].wide {
  display: block;
  width: 100%;
  text-align: center;
}

.boards p {
  margin: 1rem 0 0.25rem;
}

.boards > p:first-child {
  margin-top: 0;
}

.boards ul {
  margin-bottom: 0;
}
