/* Derived from the kit's three colours in palette.css (ink #352D3A, ground
   #EEF0F4, guava #FF769E): white is the lightest surface; the dark surface is
   ink lifted a step toward ground; muted and border are ink mixed toward
   ground (light) or ground mixed toward ink (dark); sunk is a panel one step
   below the page (ground pulled toward ink, or ink pulled toward black);
   danger is guava darkened (light) or lightened (dark) until it reads as text.
   All are chosen to clear the contrast tests in tests/test_web_static.py.
   Nothing outside this block names a hex colour. */
:root {
  --derived-surface-light: #FFFFFF;
  --derived-surface-dark: #403846;
  --derived-muted-light: #5C5362;
  --derived-muted-dark: #C9C3CF;
  --derived-border-light: #6E6475;
  --derived-border-dark: #9A90A2;
  --derived-sunk-light: #E1E4EB;
  --derived-sunk-dark: #2B2530;
  --derived-danger-light: #A8133F;
  --derived-danger-dark: #FF9FBA;
}

:root {
  color-scheme: light dark;
  --bg: var(--rooster-ground);
  --fg: var(--rooster-ink);
  --muted: var(--derived-muted-light);
  --surface: var(--derived-surface-light);
  --border: var(--derived-border-light);
  --accent: var(--rooster-guava);
  --on-accent: var(--rooster-ink);
  --focus: var(--rooster-ink);
  --sunk: var(--derived-sunk-light);
  --danger: var(--derived-danger-light);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--rooster-ink);
    --fg: var(--rooster-ground);
    --muted: var(--derived-muted-dark);
    --surface: var(--derived-surface-dark);
    --border: var(--derived-border-dark);
    --accent: var(--rooster-guava);
    --on-accent: var(--rooster-ink);
    --focus: var(--rooster-ground);
    --sunk: var(--derived-sunk-dark);
    --danger: var(--derived-danger-dark);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Spacing scale (one step up each) and the radii. Phone first: the page
   gutter is 1rem and the column grows at 40rem and 48rem. */
:root {
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --action-bar-room: 9rem;
  --r-sm: 0.5rem;
  --r-md: 0.75rem;
  --hairline: color-mix(in srgb, var(--border) 40%, transparent);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--fg);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  z-index: 10;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header-inner,
.site-footer,
main {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem;
}

.site-header {
  --focus: var(--rooster-ink);
  background: var(--accent);
  color: var(--on-accent);
}

.site-header a {
  color: var(--on-accent);
}

/* Logo and sign-out share the first row; the links take the second. */
.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  padding-block: 0.5rem;
}

.site-header img {
  display: block;
  height: 2.25rem;
  width: auto;
}

.site-header-inner nav {
  order: 3;
  flex: 1 0 100%;
  display: flex;
  gap: 0.25rem;
  margin: 0 -0.5rem;
}

.site-header-inner .userbar {
  order: 2;
  display: flex;
  gap: 0.5rem;
}

.site-header nav a,
.site-header .userbar a {
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
}

.site-header .userbar button {
  background: transparent;
  color: var(--on-accent);
  border: 2px solid var(--on-accent);
}

main {
  flex: 1 0 auto;
  padding-bottom: 2rem;
}

h1 {
  font: 800 1.75rem/1.15 ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 0.5rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

p {
  margin: 0 0 1rem;
}

.muted {
  color: var(--muted);
}

.site-footer {
  color: var(--muted);
  font-size: 1rem;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

button, input, select, textarea, .button, nav a, .userbar a, label.inline,
.settings-list a, .tip summary, .tip-btn, .switch, .disclosure > summary {
  min-height: 2.75rem;
}

nav a, .userbar a, .settings-list a {
  display: inline-flex;
  align-items: center;
}

/* Buttons. The bare element and .button are the primary action; one per
   screen region. Modifiers: .button-secondary (an alternative),
   .button-quiet (a low-key action), .button-danger (cannot be undone). */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--fg);
  border-radius: 0.5rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button-secondary {
  background: var(--surface);
  color: var(--fg);
}

.button-quiet {
  background: transparent;
  color: var(--fg);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.button-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}

.button-block {
  width: 100%;
}

input, select, textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--fg);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.error-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* A checkbox keeps its own size; its label is the 44px target beside it. */
input[type=checkbox] {
  width: auto;
  min-height: 0;
  vertical-align: middle;
}

label.inline {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  font-weight: normal;
  margin-bottom: 0;
  padding-left: 0.5rem;
}

/* Hides what is pasted without making the box a password field, which
   password managers offer to save. Non-standard: a browser without it shows
   the values as pasted. */
.masked {
  -webkit-text-security: disc;
}

/* ---- Components (documented in docs/web-spec.md, Web UI) ---------------- */

/* Page: a heading and at most one short line, then cards. */
.page-lead {
  color: var(--muted);
  margin: 0 0 var(--s4);
}

/* A line that holds a tip is a div, since a details closes a paragraph. */
.line {
  display: flex;
  align-items: flex-start;
  gap: var(--s1);
  margin: 0 0 var(--s4);
}

.line > .tip {
  flex: none;
}

.stack > * + * {
  margin-top: var(--s4);
}

/* Card: one thing, lifted off the page. .card-head holds a heading and,
   at the right, a badge or tip. */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--s4);
  margin: 0 0 var(--s4);
  box-shadow: 0 1px 0 var(--hairline);
}

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.card-head h2,
.card-head h3,
.card-head p {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The accent edge marks the card that wants attention. */
.card-notice {
  border-left: 0.375rem solid var(--accent);
}

/* Sunk panel: a region inside a card, one step below it. */
.sunk {
  background: var(--sunk);
  border-radius: var(--r-sm);
  padding: var(--s3);
  margin: var(--s3) 0;
}

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

/* Badge: a state in a word. Colour never carries it alone: Connected fills and
   Needs reconnecting is dashed. Modifiers: .badge-on, .badge-off, .badge-stale,
   .badge-info. */
.badge {
  display: inline-block;
  padding: 0 var(--s2);
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5rem;
  white-space: nowrap;
}

.badge-on {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--on-accent);
}

.badge-off {
  color: var(--muted);
}

.badge-stale {
  border-style: dashed;
  color: var(--danger);
}

.badge-info {
  background: var(--sunk);
  color: var(--fg);
  border-color: transparent;
}

/* Field: a label, the control and an optional .field-hint. */
.field {
  margin: 0 0 var(--s4);
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: var(--s1);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* Switch: a checkbox drawn as a track and knob. On is the knob at the right,
   a tick in it and a track filled with the text colour; off is the knob at
   the left on a sunk track. Knob against track and track against card each
   clear 3:1 on the fills alone (tests/test_web_static.py). The label
   text is the switch's name. */
.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-weight: 600;
  margin: 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  flex: none;
  position: relative;
  width: 3rem;
  height: 1.75rem;
  background: var(--sunk);
  border: 2px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--border);
  color: var(--on-accent);
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: center;
  transition: transform 0.15s;
}

.switch input:checked + .switch-track {
  background: var(--fg);
  border-color: var(--fg);
}

.switch input:checked + .switch-track::after {
  content: "\2713";
  transform: translateX(1.25rem);
  background: var(--surface);
  color: var(--fg);
  font-weight: 800;
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.switch input:disabled + .switch-track {
  opacity: 0.5;
}

.switch-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Disclosure: <details class="disclosure"><summary>...</summary>...</details>.
   The chevron turns when open. */
.disclosure {
  border-top: 1px solid var(--hairline);
}

.disclosure > summary {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.disclosure > summary::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.disclosure[open] > summary::before {
  transform: rotate(45deg);
}

.disclosure-body {
  padding: 0 0 var(--s3) calc(0.5rem + var(--s3));
}

/* Sticky action bar: pinned to the bottom of the phone screen, with a status
   slot at the left ("Unsaved changes") and the primary action at the right. */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin: var(--s4) calc(-1 * var(--s4)) calc(-2rem);
  padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 2px solid var(--border);
}

/* On a page with the bar, the browser scrolls a control that takes focus
   clear of it: the room is the tallest bar (the plan page's, stacked on a
   narrow phone) and a gap. */
html:has(.action-bar) {
  scroll-padding-bottom: var(--action-bar-room);
}

html:has(.action-bar) :is(a[href], button, input, select, textarea, summary, [tabindex]) {
  scroll-margin-bottom: var(--s3);
}

.action-bar-status {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.action-bar-status:empty {
  display: none;
}

/* Tip: the question-mark help. The server renders <details class="tip">;
   app.js swaps it for .tip-btn and a .tip-pop popover. The ring is drawn
   inside a 44px target. */
.tip {
  display: inline-block;
  vertical-align: middle;
  margin-block: -0.625rem;
}

.tip summary,
.tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  margin: 0 -0.5rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--fg);
  font-size: 0;
  list-style: none;
  cursor: pointer;
}

.tip summary::-webkit-details-marker {
  display: none;
}

.tip summary::before,
.tip-btn::before {
  content: "?";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.tip[open] summary::before,
.tip-btn[aria-expanded=true]::before {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.tip p,
.tip-pop {
  background: var(--surface);
  color: var(--fg);
  border: 2px solid var(--fg);
  border-radius: var(--r-sm);
  padding: var(--s3);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 12px var(--hairline);
}

/* Without JavaScript the open note floats across the column under its
   question mark. */
main {
  position: relative;
}

.tip p {
  position: absolute;
  left: var(--s4);
  right: var(--s4);
  max-width: 24rem;
  margin: 0;
  z-index: 6;
}

/* The popover scrolls inside itself, so no part of a long note is out of
   reach; below 600px, or where it fits neither under nor over its button, it
   is a sheet along the bottom with a Close button that stays in view. */
.tip-pop {
  position: fixed;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  max-width: 22rem;
  max-height: 60vh;
  max-height: 60dvh;
  overflow: hidden;
}

.tip-text {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.tip-close {
  flex: none;
  align-self: flex-end;
}

.tip-sheet {
  left: var(--s2);
  right: var(--s2);
  bottom: var(--s2);
  max-width: none;
  box-shadow: 0 -4px 16px var(--hairline);
}

.tip-pop[hidden] {
  display: none;
}

/* ---- Pages --------------------------------------------------------------- */

.connect-result {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 0.375rem solid var(--accent);
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  margin: 0 0 var(--s4);
}

.connect-result h2 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.connect-result p {
  margin: 0;
}

.admin-note {
  font-weight: 600;
}

.member-line {
  margin: 0.25rem 0;
}

/* An address has no spaces to break at, and a long one must not push the
   page sideways at phone width. */
.member h3,
.member-line,
.action-log li,
.settings-line {
  overflow-wrap: anywhere;
}

.member form {
  margin-top: 0.75rem;
}

.action-log {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.action-log li {
  padding: var(--s2) 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

.action-log li:first-child {
  border-top: 0;
}

.settings-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.settings-list li {
  position: relative;
  margin: 0 0 var(--s3);
  padding: var(--s3) 2.5rem var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}

/* The whole card is the link: the anchor's box is stretched over it. */
.settings-list li > a {
  min-height: 0;
  font-weight: 700;
  text-decoration: none;
}

.settings-list li > a::before {
  content: "";
  position: absolute;
  inset: 0;
}

.settings-list li::after {
  content: "\203A";
  position: absolute;
  right: var(--s4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  line-height: 1;
}

.settings-line {
  margin: 0;
  color: var(--muted);
}

.welcome-hero {
  padding: var(--s6) 0 var(--s4);
}

.welcome-hero h1 {
  font-size: 2.5rem;
}

/* The link to the page being shown, or to the section it is in: heavier and
   with a thicker underline, so it is marked without relying on colour. */
nav a[aria-current] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 0.2em;
}

@media (min-width: 40rem) {
  main {
    padding-inline: var(--s5);
  }

  .site-header-inner nav {
    order: 1;
    flex: 1;
    margin: 0 0 0 var(--s3);
  }

  .site-header-inner nav {
    justify-content: flex-start;
  }
}

/* ---- Plan and Fluro settings pages ------------------------------------- */

.plan-list,
.plan-pool {
  list-style: none;
  padding-left: 0;
}

.plan-item {
  margin: 0.75rem 0;
}

.plan-pool li {
  margin: 0.25rem 0 0.25rem 1.5rem;
}

/* A switch on the plan pages: a box big enough to see and hit, and a label
   that is a 44px target beside it. */
.plan-switch {
  display: flex;
  align-items: center;
}

.plan-switch input[type=checkbox] {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}

.plan-switch label.inline {
  flex: 1;
  min-height: 44px;
}

/* One team on the Fluro settings page, with the rosters it is matched with
   and the form that changes them. */
.match-team {
  margin: 1.5rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid currentColor;
}

.match-choices summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.match-label {
  flex-wrap: wrap;
  column-gap: 0.5rem;
}

.match-badge {
  display: inline-block;
  padding: 0 0.5rem;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.match-accept {
  margin-top: 0.75rem;
}

.plan-name {
  font-weight: 600;
  margin: 0.25rem 0;
}

/* A title comes from Fluro and may have no spaces to break at, or spaces
   that tell it apart from another title, so every space is kept. */
.plan-line,
.plan-name,
.plan-switch label,
.plan-pool li,
.plan-series h3 {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.plan-line {
  margin: 0.25rem 0;
}

.plan-finish {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* A part of a page below a form, set apart from the form's buttons. */
.plan-section {
  margin-top: var(--s6);
}

/* The link to the page being shown, or to the section it is in: heavier and
   with a thicker underline, so it is marked without relying on colour. */

/* ---- Plan page: services, their teams, and each team's positions -------- */

/* A service is a card that opens to its teams; its summary is the whole
   width, with the name and how many of its teams are on. */
.plan-service {
  padding: 0;
}

.plan-service > summary {
  padding: var(--s3) var(--s4);
}

.plan-service[open] > summary {
  border-bottom: 1px solid var(--hairline);
}

.plan-service-name {
  flex: 1;
  min-width: 0;
  font-size: 1.125rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.plan-service-body {
  padding: var(--s2) var(--s4) var(--s3);
}

.plan-teams,
.plan-position-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* A team: its switch, then its lines lined up under the switch's name. */
.plan-team {
  margin: 0;
  padding: var(--s3) 0;
}

.plan-team + .plan-team {
  border-top: 1px solid var(--hairline);
}

.plan-team > .plan-line,
.plan-team > .plan-positions {
  margin-left: calc(3rem + var(--s3));
}

.plan-count {
  font-weight: 600;
}

/* A team listed again under a later service: a dashed edge says it is the
   same switch as the one it names. */
.plan-mirror {
  border-left: 3px dashed var(--border);
  padding-left: var(--s3);
}

.plan-positions {
  margin-top: var(--s2);
}

.plan-positions > .disclosure-body {
  margin: 0 0 var(--s2);
  padding: var(--s1) var(--s3);
}

.plan-position {
  margin: 0;
  padding: var(--s2) 0;
}

.plan-position + .plan-position {
  border-top: 1px solid var(--hairline);
}

.plan-position > .plan-line {
  margin: 0 0 0 calc(3rem + var(--s3));
}

/* The save bar sits at the end of the form, with more after it. */
.plan-bar {
  flex-wrap: wrap;
  margin: var(--s4) calc(-1 * var(--s4)) var(--s4);
}

.plan-bar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.plan-bar > .action-bar-status {
  flex: 1 1 8rem;
}

/* On a narrow phone the status sits above the buttons, never beside them. */
@media (max-width: 22.5rem) {
  .plan-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-bar > .action-bar-status {
    flex: none;
  }

  .plan-bar-buttons {
    justify-content: flex-end;
  }
}

/* A team listed again without its switch links to the switch, so its lines
   sit under its name. */
.plan-pointer > .plan-line {
  margin-left: 0;
}

/* A link on its own line is a whole tap target tall. */
.plan-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---- Subsplash page: team matches, rosters ------------------------------ */

.match-list {
  display: grid;
  gap: var(--s2);
}

.match-team {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  margin: 0;
  padding: 0;
  scroll-margin-top: var(--s3);
}

.match-team[open] {
  border-color: var(--border);
  box-shadow: 0 0 0 1px var(--border);
}

.match-team.muted {
  background: transparent;
}

.match-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  min-height: 44px;
  padding: var(--s2) var(--s3);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.match-summary::-webkit-details-marker {
  display: none;
}

.match-summary::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

details[open] > .match-summary::before {
  transform: rotate(45deg);
}

.match-name {
  flex: 1 1 10rem;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.match-sub {
  order: 3;
  flex: 1 0 100%;
  margin-left: calc(0.5rem + var(--s3));
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.match-cues {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-left: calc(0.5rem + var(--s3));
}

.match-body {
  padding: 0 var(--s3) var(--s3);
}

.match-body > :first-child {
  margin-top: 0;
}

.match-idle {
  margin-top: var(--s3);
  padding-top: var(--s2);
}

.match-idle > .match-list {
  margin-top: var(--s2);
}

.roster-item > .match-summary {
  padding-left: 0;
  padding-right: 0;
}

.roster-item > .match-body {
  padding-left: calc(0.5rem + var(--s3));
  padding-right: 0;
}

.match-choose {
  font-size: 1rem;
  margin: var(--s3) 0 var(--s1);
}

.match-choices .switch {
  min-height: 44px;
}

.match-choices .switch-label .badge {
  margin-left: var(--s1);
}

/* The one Save for every team: the bar bleeds to the card's edges and
   rounds with its bottom corners. */
.match-form > .match-bar {
  margin: var(--s4) calc(-1 * var(--s4)) calc(-1 * var(--s4));
  border-radius: 0 0 var(--r-md) var(--r-md);
}

.match-form[data-dirty="true"] > .match-bar {
  border-top-color: var(--accent);
}

.match-accept {
  margin: var(--s3) 0;
}

.match-suggest {
  margin: 0 0 var(--s3);
}

.match-tick {
  margin: var(--s3) 0;
}

.match-tick[hidden] {
  display: none;
}

.match-filter {
  margin: 0 0 var(--s3);
}

.match-filter label {
  display: block;
  font-weight: 600;
}

.match-filter-row {
  display: flex;
  gap: var(--s2);
}

.match-filter-row input {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
}

.match-filter [hidden] {
  display: none;
}

.match-summary .match-name {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.match-filter-row .button-quiet {
  flex: none;
  min-height: 44px;
}

.match-filter p {
  margin: var(--s1) 0 0;
}
