/* Public identities keep the image centred against the complete name/club block. */
.public-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.public-identity-text { display: block; min-width: 0; overflow-wrap: anywhere; }
.public-avatar {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: 0 0 36px; overflow: hidden; border-radius: 50%;
  background: var(--color-surface-muted); color: var(--color-text-muted); font-size: 12px; font-weight: 500;
}
.public-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.public-avatar--profile { width: 96px; height: 96px; flex-basis: 96px; font-size: 28px; }
.public-club-logo { width: 48px; height: 48px; object-fit: contain; flex: 0 0 48px; }
.public-club-logo--profile { width: 96px; height: 96px; flex-basis: 96px; }
@media (max-width: 640px) {
  .public-identity { gap: 8px; }
  .public-avatar:not(.public-avatar--profile) { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
  .public-club-logo:not(.public-club-logo--profile) { width: 40px; height: 40px; flex-basis: 40px; }
}

/* === Base === */
html { height: 100%; }
body {
  background-color: var(--color-background);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === Toolbar === */
#main-toolbar {
  position: fixed;
  top: -40px;
  left: 0;
  right: 0;
  z-index: 1030;
  background: transparent;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
#main-toolbar.toolbar-compact .toolbar-icon-bg {
}
#main-toolbar.toolbar-compact .toolbar-label { }
#main-toolbar.toolbar-compact .toolbar-item { }
#main-toolbar.toolbar-compact .toolbar-inner { margin-top: -140px; }
.toolbar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 170px;
  padding: 0 4px;
  background: var(--color-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: var(--radius-toolbar);
  border: 1px solid var(--color-glass-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition: margin-top 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toolbar items */
.toolbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-faint);
  gap: var(--space-sm);
  padding: 9px 15px;
  border-radius: var(--radius-lg);
  transition: color 0.15s;
  padding-top: 50px;
}
.toolbar-item:hover { color: var(--color-text-secondary); }
.toolbar-item.active  { color: var(--color-text-primary); }

.toolbar-icon-bg {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 33px;
  transition: background 0.18s, color 0.18s, transform 0.15s;
}
.toolbar-item:hover .toolbar-icon-bg { transform: scale(1.06); }

.toolbar-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Feed – indigo */
.toolbar-item--feed .toolbar-icon-bg {
  background: var(--color-feed-tint);
  color: var(--color-feed);
}
.toolbar-item--feed.active .toolbar-icon-bg,
.toolbar-item--feed:hover  .toolbar-icon-bg {
  background: var(--color-feed);
  color: var(--color-white);
}

/* Feed list ("Лента") – blue */
.toolbar-item--news .toolbar-icon-bg {
  background: var(--color-tab-blue-tint);
  color: var(--color-tab-blue);
}
.toolbar-item--news.active .toolbar-icon-bg,
.toolbar-item--news:hover  .toolbar-icon-bg {
  background: var(--color-tab-blue);
  color: var(--color-white);
}

/* People («Люди», ATHLETES.md) – blue, as the feed's entry was */
.toolbar-item--athletes .toolbar-icon-bg {
  background: var(--color-tab-blue-tint);
  color: var(--color-tab-blue);
}
.toolbar-item--athletes.active .toolbar-icon-bg,
.toolbar-item--athletes:hover  .toolbar-icon-bg {
  background: var(--color-tab-blue);
  color: var(--color-white);
}

/* Clubs – emerald */
.toolbar-item--clubs .toolbar-icon-bg {
  background: var(--color-clubs-tint);
  color: var(--color-clubs);
}
.toolbar-item--clubs.active .toolbar-icon-bg,
.toolbar-item--clubs:hover  .toolbar-icon-bg {
  background: var(--color-clubs);
  color: var(--color-white);
}

/* Calendar – orange */
.toolbar-item--calendar .toolbar-icon-bg {
  background: var(--color-calendar-tint);
  color: var(--color-calendar);
}
.toolbar-item--calendar.active .toolbar-icon-bg,
.toolbar-item--calendar:hover  .toolbar-icon-bg {
  background: var(--color-calendar);
  color: var(--color-white);
}

/* Cup – amber/gold */
.toolbar-item--cup .toolbar-icon-bg {
  background: var(--color-cup-tint);
  color: var(--color-cup);
}
.toolbar-item--cup.active .toolbar-icon-bg,
.toolbar-item--cup:hover  .toolbar-icon-bg {
  background: var(--color-cup);
  color: var(--color-white);
}

/* Admin – red */
.toolbar-item--admin .toolbar-icon-bg {
  background: var(--color-admin-tint);
  color: var(--color-admin);
}
.toolbar-item--admin.active .toolbar-icon-bg,
.toolbar-item--admin:hover  .toolbar-icon-bg {
  background: var(--color-admin);
  color: var(--color-white);
}

/* Account – violet */
.toolbar-item--account .toolbar-icon-bg {
  background: var(--color-account-tint);
  color: var(--color-account);
}
.toolbar-item--account.active .toolbar-icon-bg,
.toolbar-item--account:hover  .toolbar-icon-bg {
  background: var(--color-account);
  color: var(--color-white);
}

/* === Main content === */
main {
  flex: 1;
  padding-top: 114px;
}

/* === Mobile top bar + off-canvas menu === */
.mobile-topbar { display: none; }
.mobile-nav-item.active { background: var(--color-surface-light); color: var(--color-text-primary); }
.mobile-nav-item:hover, .mobile-nav-item:focus-visible {
  background: var(--color-pill-bg, var(--color-text-primary));
  color: var(--color-pill-text, var(--color-white));
}

@media (max-width: 767.98px) {
  #main-toolbar, [data-theme="classic"] #main-toolbar {
    position: sticky;
    top: 0;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    transition: none;
  }
  #main-toolbar .site-name-banner { display: none; }
  #main-toolbar .toolbar-inner, [data-theme="classic"] #main-toolbar .toolbar-inner {
    display: none;
  }
  .mobile-topbar {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 16px;
  }
  .mobile-topbar-title {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.2px;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
  }
  .mobile-topbar-title:hover,
  .mobile-topbar-title:focus {
    color: var(--color-text-primary);
    text-decoration: none;
  }
  .mobile-menu-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: 20px;
  }
  main { padding-top: 64px; }
}

.mobile-nav-offcanvas { --bs-offcanvas-width: 320px; max-width: 85vw; }
.mobile-nav-list { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-md);
  transition: background 0.15s, color 0.15s;
}
.mobile-nav-item i { font-size: 18px; width: 20px; text-align: center; }
.mobile-nav-footer { border-top: 1px solid var(--color-border); padding-top: 16px; margin-top: 16px; }
.mobile-nav-cta {
  display: block;
  text-align: center;
  background: var(--color-pill-bg, var(--color-text-primary));
  color: var(--color-pill-text, var(--color-white));
  text-decoration: none;
  padding: 12px;
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 12px;
}
.mobile-nav-cta:hover { background: var(--color-pill-hover-bg, #000000); color: var(--color-pill-text, var(--color-white)); }
.mobile-nav-signin {
  display: block;
  text-align: center;
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  padding: 8px;
}
.mobile-nav-account { color: var(--color-text-primary); }
.mobile-nav-account:hover { color: var(--color-pill-text, var(--color-white)); }

/* === Footer === */
footer { margin-top: auto; }
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  border-top: 1px solid var(--color-border);
  padding: 40px 16px 24px;
}
.footer-inner { max-width: 1024px; margin: 0 auto; }
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  justify-content: space-between;
}
.footer-brand-col { flex: 1 1 260px; max-width: 360px; }
.footer-brand {
  display: block;
  font-family: var(--font-family-accent);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-footer-text-strong);
  margin: 0 0 8px;
}
.footer-tagline { font-size: var(--font-size-sm); line-height: 1.6; margin: 0; opacity: 0.85; }
.footer-nav-col { flex: 0 1 200px; }
.footer-col-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-footer-text);
  opacity: 0.6;
  margin: 0 0 14px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.footer-link {
  color: var(--color-footer-text);
  text-decoration: none;
  font-size: var(--font-size-sm);
}
.footer-link:hover { color: var(--color-footer-text-strong); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}
.footer-copyright, .footer-madein {
  font-size: var(--font-size-xs);
  color: var(--color-footer-text);
  opacity: 0.7;
  letter-spacing: 0.03em;
}
.footer-madein { text-transform: uppercase; }

/* === Shared content width === */
.page-col { max-width: 760px; margin-left: auto; margin-right: auto; }

/* === Breadcrumbs ===
   Rendered once here for every page whose handler supplied a trail (see
   Breadcrumb.swift / BaseContext.withCrumbs). Pages carry no back buttons: this
   trail is the way up. Keeps the mono/uppercase recipe the per-page breadcrumbs
   used before they were unified. === */
.breadcrumbs {
  font-family: var(--font-family-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-text-muted);
  display: flex; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
  padding: 0 4px; /* the page head's inset: the trail starts where the title does (UF7, item 11) */
}
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-text-primary); }
.breadcrumbs .sep { margin: 0 8px; color: var(--color-border-strong); }
.breadcrumbs .current { color: var(--color-text-primary); }
/* A name in the trail (a tour's, a race's) keeps its own case: «ad» is not «AD» (the owner, 2026-11-05). */
.breadcrumbs .crumb-name { text-transform: none; }

/* === Shared page heading ===
   Every top-level page uses .page-head > .page-title so the title lands on the
   same baseline, at the same size, whichever page you are on. Optional trailing
   content (counters, actions) goes in the head next to the title. === */
.page-head {
  display: flex;
  justify-content: space-between;
  /* Trailing content (the clubs counters) is centred against the title */
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  /* main contributes a fixed 48px inset above the head; the negative margin and
     the bottom padding split that band evenly, so the title's cap-height box sits
     centred between the toolbar and the first block of content */
  margin-top: -6px;
  padding: 0 4px 44px;
}
.page-title {
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0;
  color: var(--color-text-primary);
}
/* Wraps the title when the head also carries a subtitle under it */
.page-head-main { min-width: 0; }
@media (max-width: 575.98px) {
  /* Same split at the phone title size (32px), where the ascender overhang
     above the cap line is smaller and the whole band is tighter */
  .page-head { margin-top: -19px; padding-bottom: 29px; }
}

/* === Admin sidebar (unchanged) === */
.sidebar { min-height: calc(100vh - 56px); border-right: 1px solid var(--color-border-strong); background: var(--color-surface); }

/* === Cards — two patterns used app-wide (plain .card-body, and .card-header +
   .card-body), themed via Theme.swift/CardStyle. Beats the pre-existing per-page
   border-0/shadow-sm/bg-white utility classes on specificity so every card in the
   app follows the active theme without touching each template. === */
.card {
  overflow: hidden; /* preserves border-radius with inner tables */
  background-color: var(--color-card-bg);
  border-radius: var(--radius-card);
}
.card.border-0 { border: var(--card-border-width) solid var(--color-card-border) !important; }
.card.shadow-sm, .card.shadow { box-shadow: var(--shadow-card) !important; }
.card-header {
  background-color: var(--color-card-header-bg) !important;
  border-bottom-color: var(--color-card-header-border);
}

/* === Classic theme: dark editorial card header, matching the imported
   Claude Design source (admin-races.html .admin-card-head). Applies to
   every .card-header app-wide — both the "bg-white fw-semibold" (title
   text directly on the header div) and the "span.fw-semibold" (title
   wrapped in a child span) markup patterns in use across admin pages. === */
[data-theme="classic"] .card-header {
  background-color: var(--color-head-bg) !important;
  border-bottom: none;
  color: var(--color-head-text);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}
[data-theme="classic"] .card-header.fw-semibold,
[data-theme="classic"] .card-header .fw-semibold {
  font-size: 20px;
  font-weight: 700 !important;
  letter-spacing: -0.2px;
}
[data-theme="classic"] .card-header .btn-primary {
  background-color: var(--color-head-button-bg) !important;
  border-color: var(--color-head-button-bg) !important;
  color: var(--color-head-button-text) !important;
  padding: 5px 16px !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
}
[data-theme="classic"] .card-header .btn-primary:hover,
[data-theme="classic"] .card-header .btn-primary:focus {
  background-color: var(--color-head-button-hover-bg) !important;
  border-color: var(--color-head-button-hover-bg) !important;
  color: var(--color-head-button-text) !important;
}

/* === Admin tables === */
.admin-table thead th {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
  border-bottom-width: 1px;
}
.admin-table tbody td {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr.admin-table-row-clickable { cursor: pointer; }
[data-theme="classic"] .table-light {
  --bs-table-bg: var(--color-table-head-bg);
  --bs-table-color: var(--color-ink-muted);
}
[data-theme="classic"] .admin-table thead th {
  color: var(--color-ink-muted);
  font-family: var(--font-family-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
[data-theme="classic"] .admin-table tbody td.fw-semibold {
  color: var(--color-ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 700 !important;
  letter-spacing: -0.15px;
}
[data-theme="classic"] .admin-table .badge.text-success {
  color: var(--color-badge-success-text) !important;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

/* === Admin picker list + settings form (cup, rating) ===
   Shared by the cup and rating admin dashboards: a row-per-item picker list
   replacing a <select>, a labeled settings form, a race checkbox grid, and
   the save bar that anchors cross-cutting actions (set active / delete / save). */
.cup-group-label {
  padding: 11px 20px;
  background: var(--color-surface-light);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-family-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
/* A group label directly under the card header already has the header's rule
   above it; one that follows a list needs its own separator. */
.cup-list + .cup-group-label { border-top: 1px solid var(--color-border); }
.cup-list { display: flex; flex-direction: column; }
.cup-list-scroll { max-height: 452px; overflow-y: auto; }
/* Two rows, three columns: radio | name / meta | badge. The name and meta are
   grid items in their own right so the badge can share the meta's row on mobile. */
.cup-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.cup-row:last-child { border-bottom: none; }
.cup-row:hover { background: var(--color-surface-light); color: inherit; }
/* Selection is carried by the filled radio alone: a tinted row would match the
   group-label strip and read as part of the header band rather than as a row. */
.cup-radio {
  grid-column: 1; grid-row: 1 / 3; align-self: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--color-border-input);
  display: grid; place-items: center;
}
.cup-row.sel .cup-radio { border-color: var(--color-text-primary); }
.cup-radio i { width: 9px; height: 9px; border-radius: 50%; background: var(--color-text-primary); display: none; }
.cup-row.sel .cup-radio i { display: block; }
/* Both lines clip rather than wrap, so every row is the same height. */
.cup-name {
  grid-column: 2; grid-row: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cup-meta {
  grid-column: 2; grid-row: 2;
  min-width: 0;
  font-family: var(--font-family-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cup-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  background: var(--color-success-tint); color: var(--color-success);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  /* Spans both rows so it centres against the whole name + meta block. */
  grid-column: 3; grid-row: 1 / 3; align-self: center;
}
.cup-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); }
.cup-list-more {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-light);
}
.cup-list-more .cup-meta { margin-top: 0; text-transform: uppercase; }

/* ── Settings form ── */
.cup-field { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.cup-field-label {
  font-family: var(--font-family-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}
.cup-sec-split {
  margin: 24px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.cup-sec-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.cup-sec-count {
  font-family: var(--font-family-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Race picker: a checkbox per race, rendered as a card that also shows the
   race date and style so items can be assembled without cross-referencing the calendar. */
.cup-check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cup-check {
  display: grid; grid-template-columns: 20px 1fr; gap: 11px; align-items: start;
  padding: 11px 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  margin: 0;
  position: relative; /* anchors the visually-hidden checkbox */
}
.cup-check:hover { border-color: var(--color-border-strong); }
.cup-check:has(.cup-check-input:checked) {
  border-color: var(--color-text-primary);
  background: var(--color-surface-light);
}
.cup-check:has(.cup-check-input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.cup-check-input { position: absolute; opacity: 0; width: 0; height: 0; }
.cup-check-box {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--color-border-input);
  display: grid; place-items: center;
  color: transparent; background: var(--color-checkbox-bg, var(--color-white));
  font-size: 12px; line-height: 1;
}
.cup-check:has(.cup-check-input:checked) .cup-check-box {
  background: var(--color-pill-bg, var(--color-text-primary));
  border-color: var(--color-pill-bg, var(--color-text-primary));
  color: var(--color-pill-text, var(--color-white));
}
.cup-check-body { min-width: 0; }
.cup-check-body > span { display: block; }
.cup-check-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
/* Marks a race that is one leg of a tour, so multi-day series read as a group. */
.cup-check-tour {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-tab-blue-tint);
  color: var(--color-tab-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  vertical-align: 1px;
}
.cup-check-sub {
  font-family: var(--font-family-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.cup-save-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--color-surface-light);
  border-top: 1px solid var(--color-border);
}
.cup-save-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (max-width: 575.98px) {
  /* Phone width: the name takes the full row and the badge moves down beside the
     meta, right-aligned, rather than narrowing the name across both lines. */
  .cup-name { grid-column: 2 / 4; }
  .cup-pill { grid-row: 2; align-self: center; justify-self: end; }
  .cup-check-list { grid-template-columns: 1fr; }
  .cup-save-bar { flex-direction: column; align-items: stretch; }
}
[data-theme="classic"] .pill-count {
  display: inline-flex;
  align-items: center;
  column-gap: 7px;
  row-gap: 7px;
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  background: transparent;
  color: var(--color-ink-soft);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

/* === Reorderable list (data-sortable, default-layout.js) === */
.sortable-controls { display: inline-flex; gap: 4px; align-items: center; flex-shrink: 0; }
.sortable-handle { cursor: grab; touch-action: none; }
.sortable-dragging { opacity: 0.7; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.sortable-dragging .sortable-handle { cursor: grabbing; }

/* === iOS-style toggle === */
.ios-toggle { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.ios-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ios-toggle-track {
  position: absolute; inset: 0;
  background: var(--color-neutral-track);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}
.ios-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: var(--color-white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform 0.2s;
}
.ios-toggle input:checked + .ios-toggle-track { background: var(--color-primary); }
.ios-toggle input:checked + .ios-toggle-track::after { transform: translateX(18px); }

/* ============================================================
   === Classic theme (editorial redesign) — see Site Settings ===
   Everything below is scoped under [data-theme="classic"] and has
   no effect while the modern theme is active.
   ============================================================ */
.site-name-banner { display: none; }
[data-theme="classic"] .site-name-banner {
  display: block;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--color-border);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.4px;
  color: var(--color-ink);
  background: var(--color-background);
}
[data-theme="classic"] .site-name-banner a {
  color: inherit;
  text-decoration: none;
}

/* Headline font on page titles only (h1/h2 — card/section headers stay put) */
[data-theme="classic"] h1,
[data-theme="classic"] h2 {
  font-family: var(--font-family-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--color-text-primary);
}

/* Rounder, pill-leaning corners via Bootstrap 5.3's own CSS variables */
[data-theme="classic"] {
  --bs-border-radius: var(--radius-md);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-border-radius-xl: var(--radius-xl);
}
[data-theme="classic"] .btn {
  --bs-btn-border-radius: var(--radius-pill);
  font-weight: var(--font-weight-semibold);
}
[data-theme="classic"] .btn-primary {
  --bs-btn-bg: var(--color-pill-bg);
  --bs-btn-border-color: var(--color-pill-bg);
  --bs-btn-hover-bg: var(--color-pill-hover-bg);
  --bs-btn-hover-border-color: var(--color-pill-hover-bg);
  --bs-btn-active-bg: var(--color-pill-hover-bg);
  --bs-btn-active-border-color: var(--color-pill-hover-bg);
  --bs-btn-color: var(--color-pill-text);
  --bs-btn-hover-color: var(--color-pill-text);
  --bs-btn-active-color: var(--color-pill-text);
}

/* Plain top nav instead of the floating glass toolbar */
[data-theme="classic"] #main-toolbar {
  position: static;
  background: var(--color-background);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: none;
}
[data-theme="classic"] #main-toolbar.toolbar-compact .toolbar-inner { margin-top: 0; }
[data-theme="classic"] .toolbar-inner {
  max-width: 760px;
  height: auto;
  padding: 12px 0 24px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
[data-theme="classic"] .toolbar-item {
  flex-direction: row;
  height: 37px;
  padding: 0 14px;
  gap: 8px;
  border-radius: var(--radius-pill);
  color: var(--color-ink-soft);
}
[data-theme="classic"] .toolbar-icon-bg {
  width: auto;
  height: auto;
  font-size: 18px;
  background: transparent !important;
  color: inherit !important;
}
[data-theme="classic"] .toolbar-label {
  max-width: none;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
}
[data-theme="classic"] .toolbar-item.active,
[data-theme="classic"] .toolbar-item:hover {
  background: var(--color-pill-bg);
  color: var(--color-pill-text);
}
[data-theme="classic"] main { padding-top: 24px; }
/* On a phone the top bar is in the flow: the page (its breadcrumbs first) starts just below it.
   After the classic rule above, which would otherwise win. */
@media (max-width: 767.98px) {
  main, [data-theme="classic"] main { padding-top: 0; }
  main.layout-main { margin-top: 12px !important; }
}
/* On a wide screen too, a page that has breadcrumbs starts 12px under the menu band (the owner,
   2026-10-24); a page without them (the home page, sign-in) keeps its inset. */
@media (min-width: 768px) {
  [data-theme="classic"] main.layout-main:has(> .breadcrumbs) { padding-top: 0; margin-top: 12px !important; }
}
[data-theme="classic"] body { background-color: var(--color-page-bg); }

/* Signed-out nav: solid "sign in" pill, instead of the icon tile */
.classic-auth-cta { display: none; }
[data-theme="classic"] .toolbar-item--account.classic-hide { display: none; }
[data-theme="classic"] .classic-auth-cta {
  display: flex;
  align-items: center;
  gap: 18px;
}
.classic-auth-btn {
  display: inline-block;
  background: var(--color-pill-bg);
  color: var(--color-pill-text);
  text-decoration: none;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  transition: background 0.15s;
}
.classic-auth-btn:hover { background: var(--color-pill-hover-bg); color: var(--color-pill-text); }

/* Dark footer band */
[data-theme="classic"] .site-footer {
  background: var(--color-footer-bg);
  /* Bootstrap's .text-muted sets color with !important — match it to win here. */
  color: var(--color-footer-text) !important;
  border-top: none;
  padding: 28px 16px;
}
[data-theme="classic"] .footer-brand {
  font-family: var(--font-family-accent);
  font-style: italic;
  color: var(--color-footer-text-strong);
}
[data-theme="classic"] .footer-bottom { border-top-color: rgba(250, 249, 245, 0.12); }

/* Classic theme: icon-tab-bar component (.race-tabs-pill/.race-tab-btn/
   .race-tab-icon-wrap/.race-tab-icon-bg/.race-tab-label/.race-tab-badge —
   the same reused markup across races, tours, cup, calendar, clubs,
   payments, feed, import/export). Matches the imported Claude Design
   source (race.html .race-tabs/.race-tab/.race-tab-icon/.race-tab-badge):
   a row of separate flat cards (no wrapping pill), plain icons with no
   background tile, and the count badge pinned to the card's own corner —
   .race-tab-icon-wrap is de-positioned so the badge (still its DOM child)
   anchors to the now-positioned .race-tab-btn card instead. */
[data-theme="classic"] .race-tabs-pill {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
[data-theme="classic"] .race-tabs-pill .nav {
  gap: 16px;
}
[data-theme="classic"] .race-tab-btn {
  position: relative;
  padding: 26px 16px;
  gap: 10px;
  border-radius: 16px;
  border: 1px solid var(--color-panel-border);
  background: var(--color-panel);
  color: var(--color-ink-soft);
}
[data-theme="classic"] .race-tab-btn:hover {
  background: var(--color-panel);
  color: var(--color-ink);
}
/* The selected card is the grayed-out one: it reads as spent, so the
   still-clickable tabs are the ones that stand out. */
[data-theme="classic"] .race-tab-btn.active {
  background: var(--color-tab-active-bg);
  border-color: transparent;
  color: var(--color-ink-muted);
  box-shadow: none;
}
[data-theme="classic"] .race-tab-icon-wrap {
  position: static;
}
[data-theme="classic"] .race-tab-icon-bg {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent !important;
  color: inherit !important;
  font-size: 22px;
}
[data-theme="classic"] .race-tab-btn:hover .race-tab-icon-bg,
[data-theme="classic"] .race-tab-btn.active .race-tab-icon-bg {
  background: transparent !important;
  color: inherit !important;
  transform: none;
}
[data-theme="classic"] .race-tab-label {
  color: inherit;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}
[data-theme="classic"] .race-tab-btn.active .race-tab-label {
  color: inherit;
  font-weight: 600;
}
[data-theme="classic"] .race-tab-badge {
  top: 10px;
  right: 10px;
  min-width: 0;
  height: auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  background: var(--color-danger);
  border: none;
  box-shadow: none;
}
/* One height per row (UF7, item 9): the nav-item fills its cell and the card fills the nav-item,
   with the content centred. Below 760 px the row layout further down takes over. */
[data-theme="classic"] .race-tabs-pill .nav-item { display: flex; }
[data-theme="classic"] .race-tab-btn { flex: 1 1 auto; justify-content: center; }
/* Narrow screens: the tab cards stack, and each one turns into a row —
   icon and label on the left, count badge pinned to the far right. */
@media (max-width: 760px) {
  [data-theme="classic"] .race-tabs-pill .nav {
    flex-direction: column;
    gap: 12px;
  }
  [data-theme="classic"] .race-tab-btn {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
  }
  [data-theme="classic"] .race-tab-icon-wrap {
    display: contents;
  }
  [data-theme="classic"] .race-tab-label {
    font-size: 16px;
    text-align: left;
  }
  [data-theme="classic"] .race-tab-badge {
    position: static;
    order: 3;
    margin-left: auto;
  }
}

/* === Inline styles moved out of the template === */
img.toolbar-avatar { width: 20px; height: 20px; object-fit: cover; border-radius: 50%; }
main.container.layout-main { max-width: 1024px; }
/* Utilities for what were inline styles (an inline style beat every rule, hence !important). */
.cursor-pointer { cursor: pointer !important; }
.w-1pct { width: 1% !important; }

/* === Theme modes (T1; only where `settings.defaultLayout.themeModes` is on) ===
   The switch is a menu button (moon in light, sun in dark); the dark set of the tokens is the
   theme's (`[data-theme-mode="dark"]`), and Bootstrap follows through `data-bs-theme="dark"`,
   set next to it. The menu and the content keep their 760 px in both modes. */
.theme-toggle { background: none; border: 0; font: inherit; cursor: pointer; }
.theme-toggle .theme-icon-sun { display: none; }
[data-theme-mode="dark"] .theme-toggle .theme-icon-moon { display: none; }
[data-theme-mode="dark"] .theme-toggle .theme-icon-sun { display: inline; }
.mobile-theme-toggle { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; margin-bottom: 8px; }
.mobile-theme-toggle:hover, .mobile-theme-toggle:focus-visible {
  background: var(--color-pill-bg, var(--color-text-primary));
  color: var(--color-pill-text, var(--color-white));
}
.theme-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
[data-theme-mode="dark"] .bg-white:not(.card-header) { background-color: var(--color-surface) !important; }
[data-theme-mode="dark"] .bg-light { background-color: var(--color-surface-light) !important; }
[data-theme-mode="dark"] .text-dark { color: var(--color-text-primary) !important; }
[data-theme-mode="dark"] .table-light { --bs-table-border-color: var(--color-border); }

/* === Lists loaded page by page (data-list-paging, ListPaging) === */
.list-more { text-align: center; margin: 1rem 0 0; }
.list-more[hidden] { display: none; }
.list-more a[aria-busy="true"] { opacity: .6; pointer-events: none; }
/* The viewer's own row behind the page: a gap marked "…" before it. */
[data-pinned-divider] { text-align: center; color: var(--color-text-faint); letter-spacing: .3em; list-style: none; }

/* === The amount beside a pay button (fix 3 of 2026-10-21, variant C; partial
   `defaultLayout/payNear`): the amount in bold to the left of a solid yellow button, no icon. The
   plain size for a page's head and a card, `.pay-near-sm` for a list's rows. === */
.pay-near { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; vertical-align: middle; }
.pay-near form { margin: 0; }
.pay-near .amt { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; color: var(--color-text-primary); }
.pay-near-sm .amt { font-size: 15px; }

/* === A price on a public page (PRICE-DISPLAY.md; partial `defaultLayout/price`, from `ShownPrice`):
   with a discount the price before it struck through and muted, then the amount; the size and weight
   are the place's own. === */
.price { white-space: nowrap; }
.price-was { text-decoration: line-through; color: var(--color-text-muted); font-weight: 400; font-size: .85em; margin-right: .35em; }

/* === Registration pages (fixes 4, 6, 7 of 2026-10-21): one frame for the race's and the tour's,
   inside `.reg-frame` — the head, the key facts (a card of their own above the form, the owner),
   the form card with its fields and price footer, «Моя регистрация» (state, facts, actions), the
   tour's races. Each page keeps its own template and strings. The facts sit 3 across, or 2 across
   with `.reg-info-cols-2` (two facts, or four as 2 × 2) and one with `.reg-info-cols-1`; on a
   phone they stack. === */
.reg-frame {
  --reg-due-bg: rgba(255, 193, 7, .16);
  --reg-due-text: #8a6100;
}
[data-theme-mode="dark"] .reg-frame { --reg-due-bg: rgba(255, 193, 7, .14); --reg-due-text: #f0c24b; }
.reg-frame .reg-head { margin: 24px 0 14px; }
.reg-frame .reg-head .kicker { font-family: var(--font-family-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-text-muted); }
.reg-frame .reg-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 6px; }
.reg-frame .reg-head .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--color-text-muted); font-size: 14px; }
.reg-frame .reg-head .meta i { margin-right: 4px; }

/* The key facts: start or dates, place, registration or cancellation deadline, a tour's races. */
.reg-frame .reg-info { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 14px;
  background: var(--color-surface); border: var(--card-border-width) solid var(--color-card-border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.reg-frame .reg-info-cols-2 { grid-template-columns: repeat(2, 1fr); }
.reg-frame .reg-info-cols-1 { grid-template-columns: 1fr; }
.reg-frame .reg-info-item { display: flex; align-items: center; gap: 12px; padding: 16px 20px; min-width: 0; }
.reg-frame .reg-info-item + .reg-info-item { border-left: 1px solid var(--color-border); }
.reg-frame .reg-info-cols-2 .reg-info-item:nth-child(3) { border-left: 0; }
.reg-frame .reg-info-cols-2 .reg-info-item:nth-child(n+3) { border-top: 1px solid var(--color-border); }
.reg-frame .reg-info-item .ic { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; background: var(--color-surface-light); color: var(--color-text-secondary); font-size: 17px; }
.reg-frame .reg-info-item .k { font-size: 12px; color: var(--color-text-muted); }
.reg-frame .reg-info-item .v { font-weight: 700; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.reg-frame .reg-info-item.is-deadline .ic { background: var(--reg-due-bg); color: var(--reg-due-text); }
.reg-frame .reg-info-item.is-deadline .v { color: var(--reg-due-text); }

/* The form card: fields, then the price footer. */
.reg-frame .reg-card { background: var(--color-surface); border: var(--card-border-width) solid var(--color-card-border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.reg-frame .reg-card + .reg-card { margin-top: 14px; }
.reg-frame .reg-body { padding: 22px 24px; }
.reg-frame .reg-field + .reg-field { margin-top: 16px; }
.reg-frame .reg-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.reg-frame .reg-field .form-text { margin-top: 5px; }
.reg-frame .reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reg-frame .reg-consents { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--color-border); }
.reg-frame .reg-consents .form-check { font-size: 13px; margin-bottom: 6px; }
/* The consent partial's labels are `small` elsewhere (sign-up); here the frame sets the size (mock 6b). */
.reg-frame .reg-consents .form-check-label.small { font-size: inherit; }
.reg-frame .reg-consents .form-text { font-size: 12px; color: var(--color-text-faint); }
.reg-frame .reg-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px;
  border-top: 1px solid var(--color-border); background: var(--color-surface-light);
  border-radius: 0 0 var(--radius-card) var(--radius-card); }
.reg-frame .reg-price { line-height: 1.2; }
.reg-frame .reg-price .val { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.reg-frame .reg-price .next { font-size: 12px; color: var(--color-text-muted); }
.reg-frame .reg-price .free { font-size: 18px; font-weight: 700; color: var(--color-success); }
/* A price with automatic discounts (DISCOUNTS.md, mock 4): the tier's price struck through, the discounts' names. */
.reg-frame .reg-price .was { font-size: 14px; color: var(--color-text-muted); text-decoration: line-through; margin-left: 6px; font-weight: 500; }
.reg-frame .reg-price .why { font-size: 12px; color: var(--color-success); }

/* The tour's races, following the chosen category. */
.reg-frame .reg-races { margin-top: 18px; border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; }
.reg-frame .reg-races-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--color-surface-light);
  font-size: 13px; color: var(--color-text-secondary); }
.reg-frame .reg-races-head i { color: var(--color-success); }
.reg-frame .reg-race { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--color-border);
  font-size: 14px; }
.reg-frame .reg-race .d { width: 44px; text-align: center; font-family: var(--font-family-mono); line-height: 1.1; flex-shrink: 0; }
.reg-frame .reg-race .d b { display: block; font-size: 17px; }
.reg-frame .reg-race .d span { font-size: 10px; color: var(--color-text-muted); text-transform: uppercase; }
.reg-frame .reg-race .n { flex: 1; min-width: 0; font-weight: 600; }
.reg-frame .reg-race .n small { display: block; font-weight: 400; color: var(--color-text-muted); }
.reg-frame .reg-race .s { flex-shrink: 0; font-size: 13px; color: var(--color-text-muted); }
.reg-frame .reg-race .s.ok { color: var(--color-success); }

/* «Моя регистрация»: the state, the registration's facts, its actions. */
.reg-frame .reg-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reg-frame .reg-top .t { font-weight: 700; font-size: 18px; }
.reg-frame .reg-top .sub { color: var(--color-text-muted); font-size: 14px; }
.reg-frame .reg-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px;
  font-weight: 600; white-space: nowrap; }
.reg-frame .reg-state.is-unpaid { background: var(--reg-due-bg); color: var(--reg-due-text); }
.reg-frame .reg-state.is-paid { background: var(--color-success-tint); color: var(--color-success); }
.reg-frame .reg-state.is-tour { background: var(--color-cup-tint); color: var(--color-cup); }
.reg-frame .reg-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.reg-frame .reg-fact { background: var(--color-surface-light); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.reg-frame .reg-fact .k { font-size: 12px; color: var(--color-text-muted); }
.reg-frame .reg-fact .v { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.reg-frame .reg-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.reg-frame .reg-actions .reg-cancel-link { color: var(--color-danger); font-size: 14px; text-decoration: none; margin-left: auto; }
.reg-frame .reg-note { font-size: 12px; color: var(--color-text-muted); margin-top: 10px; }
.reg-frame .reg-tour-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--color-cup-tint-light, var(--color-surface-light)); border: 1px solid var(--color-border); margin-top: 16px;
  text-decoration: none; color: inherit; }
.reg-frame .reg-tour-link .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--color-cup-tint); color: var(--color-cup);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* A cancel's confirmation: the money back to the wallet, or why none comes back (mock `6h`). */
.reg-frame .reg-refund { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--color-success-tint); margin-top: 14px; }
.reg-frame .reg-refund .ic { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; background: var(--color-surface);
  color: var(--color-success); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.reg-frame .reg-refund b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reg-frame .reg-money-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px;
  border-radius: 10px; font-size: 13px; background: var(--color-surface-light); color: var(--color-text-secondary); }

/* A change: what the new choice does to the money (mock `6f`); a transfer's receiver (mock `6g`). */
.reg-frame .diff-line { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; border-radius: 12px;
  font-size: 14px; }
.reg-frame .diff-line.more { background: var(--reg-due-bg); color: var(--reg-due-text); }
.reg-frame .diff-line.less { background: var(--color-success-tint); color: var(--color-success); }
.reg-frame .diff-line b { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reg-frame .pay-near .amt.lg { font-size: 22px; }
.reg-frame .person-pick { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--color-border);
  border-radius: 12px; margin-top: 8px; }
.reg-frame .person-pick .av { width: 36px; height: 36px; border-radius: 50%; background: var(--color-surface-light); display: flex;
  align-items: center; justify-content: center; font-weight: 700; color: var(--color-text-secondary); flex-shrink: 0; }
.reg-frame .person-pick .ok { margin-left: auto; color: var(--color-success); font-size: 13px; }
.reg-frame .person-pick .no { margin-left: auto; color: var(--color-danger); font-size: 13px; }
/* On a phone the verdict goes under the name, the full width (not a narrow column beside it). */
@media (max-width: 575.98px) {
  .reg-frame .person-pick { flex-wrap: wrap; }
  .reg-frame .person-pick .ok, .reg-frame .person-pick .no { margin-left: 48px; flex-basis: calc(100% - 48px); }
}

/* A phone: the facts stack, the footer's button takes the width. */
@media (max-width: 560px) {
  .reg-frame .reg-head h1 { font-size: 24px; }
  .reg-frame .reg-info, .reg-frame .reg-info-cols-2 { grid-template-columns: 1fr; }
  .reg-frame .reg-info-item { padding: 12px 16px; }
  .reg-frame .reg-info-item + .reg-info-item,
  .reg-frame .reg-info-cols-2 .reg-info-item:nth-child(3) { border-left: 0; border-top: 1px solid var(--color-border); }
  .reg-frame .reg-body { padding: 18px; }
  .reg-frame .reg-grid { grid-template-columns: 1fr; }
  .reg-frame .reg-foot { flex-direction: column; align-items: stretch; padding: 16px 18px; }
  .reg-frame .reg-foot > .btn, .reg-frame .reg-actions > .btn { width: 100%; }
  .reg-frame .reg-foot .btn-lg { font-size: 17px; white-space: nowrap; padding-left: 12px; padding-right: 12px; }
  .reg-frame .reg-facts { gap: 6px; }
  .reg-frame .reg-fact { padding: 8px 10px; }
  .reg-frame .reg-top .t { font-size: 16px; }
}

/* ── An admin table's row menu, its payment column and the windows of its actions (fix 2 of 2026-10-21) ── */
.td-actions { position: relative; width: 44px; }
.row-menu-wrap { display: inline-block; }
.row-menu-btn { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid transparent; color: var(--color-text-muted); background: transparent; }
.row-menu-btn:hover, .row-menu-btn.is-open { background: var(--color-surface-light); border-color: var(--color-border); color: var(--color-text-primary); }
.row-menu { position: absolute; right: 12px; top: 100%; z-index: 1030; min-width: 250px; padding: 6px; white-space: nowrap; margin-top: 2px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.12); text-align: left; }
.row-menu[hidden] { display: none; }
.row-menu .item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent;
  font-size: 14px; color: var(--color-text-primary); text-align: left; text-decoration: none; cursor: pointer; }
.row-menu .item:hover { background: var(--color-surface-light); }
.row-menu .item i { width: 16px; color: var(--color-text-muted); }
.row-menu .item.danger, .row-menu .item.danger i { color: var(--color-danger); }
.row-menu .item.disabled, .row-menu .item.disabled i { color: var(--color-text-faint); cursor: default; }
.row-menu .item.disabled:hover { background: transparent; }
.row-menu .item .hint { margin-left: auto; font-size: 12px; color: var(--color-text-faint); }
.row-menu form { margin: 0; }
.row-menu hr { margin: 4px 2px; }
.athlete-sub { font-size: 12px; color: var(--color-text-muted); font-weight: 400; }
.paid-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.paid-cell b { font-variant-numeric: tabular-nums; }
.pay-kind { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pay-kind.card, .pay-kind.wallet { background: var(--color-success-tint); color: var(--color-success); }
.pay-kind.manual { background: rgba(255, 193, 7, .16); color: #6b4c00; }
.unpaid { color: var(--color-text-faint); }
.money-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.money-note[hidden] { display: none; }
.money-note.back { background: var(--color-success-tint); color: var(--color-success); }
.money-note.none { background: var(--color-surface-light); color: var(--color-text-secondary); }
.app-dialog { border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 0;
  width: min(420px, calc(100vw - 32px)); background: var(--color-surface); color: var(--color-text-primary); }
.app-dialog::backdrop { background: rgba(0,0,0,.35); }
.dialog-card { max-width: 420px; margin: 24px auto; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.dialog-form { padding: 18px 20px; font-size: 14px; }
.dialog-title { font-weight: 700; margin-bottom: 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
/* A `data-dialog-url` window on a phone is a bottom sheet (RACE-WINORIENT.md, 15): docked, full width, rounded
   top, a grab handle, scrolling inside; the buttons stacked full width, «Отмена» (first in the markup) on top. */
@media (max-width: 575.98px) {
  .app-dialog { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 88vh; max-height: 88dvh; overflow-y: auto;
    border-width: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.18); }
  .app-dialog::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px;
    background: var(--color-border); margin: 8px auto 0; }
  .app-dialog .dialog-form { padding-bottom: 22px; }
  .app-dialog .dialog-actions { flex-direction: column; gap: 10px; }
  .app-dialog .dialog-actions .btn { width: 100%; padding: .6rem .75rem; font-size: 15px; }
}

/* A list's filter answered without leaving the page (`data-list-filter`, default-layout.js; CLUB-SEARCH.md): the
   swapped part dims while its answer is on the way (after a moment: a quick answer does not flicker), and the
   form's spinner (`[data-list-filter-busy]`) stands where its search icon (`[data-list-filter-idle]`) was. */
.is-filtering { opacity: .45; pointer-events: none; transition: opacity .15s ease .12s; }
.flt-search .flt-busy { position: absolute; left: 14px; top: 50%; width: 1rem; height: 1rem; margin-top: -.5rem;
  border-width: .15em; color: var(--color-text-muted); }

/* The filter bar of a long list (LIST-FILTERS.md; one bar everywhere): a GET form `.flt-bar` holding a search
   field (`.flt-search`: its icon and an input), unlabelled selects (`select.form-select.flt-select`, `.is-set`
   outlined when one is chosen; `data-submit-on-change`), a date range (`.flt-dates` with two `.flt-date`), a person
   picker (`.flt-person` around a `data-person-search` select) and «Сбросить» (`.flt-reset`) when anything is set.
   On a phone the search takes its row, the selects two a row, the dates their own. `.flt-head` is the list's
   title with its count («112 из 1 344»). */
.flt-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 0; flex-wrap: wrap; }
.flt-head .flt-title { font-family: var(--font-family-display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin: 0; }
.flt-head .flt-count { font-size: 15px; color: var(--color-text-muted); }
.flt-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 16px; }
.flt-search { position: relative; flex: 1 1 240px; max-width: 360px; }
.flt-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.flt-search input { width: 100%; padding: 9px 14px 9px 38px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); font-size: 15px; color: var(--color-text-primary); }
.flt-bar .flt-select { width: auto; min-width: 150px; max-width: 280px; padding: 9px 40px 9px 16px; border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); background-color: var(--color-surface); font-size: 15px; font-weight: 600; text-overflow: ellipsis; }
.flt-bar .flt-select.is-set { border-color: var(--color-text-primary); }
.flt-dates { display: flex; align-items: center; gap: 8px; }
.flt-date { width: 150px; padding: 8px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); font-size: 15px; color: var(--color-text-primary); }
.flt-date.is-set { border-color: var(--color-text-primary); }
.flt-person { display: flex; flex-direction: column; gap: 6px; }
.flt-reset { font-size: 14px; color: var(--color-text-muted); }
/* A bar answered in place keeps «Сбросить» in a span it swaps (`data-list-filter`): its link, and nothing when unset. */
.flt-reset a { color: inherit; }
.flt-reset:empty { display: none; }
.flt-note { font-size: 13px; color: var(--color-text-muted); margin: -6px 0 12px; }

/* `.flt-bar.is-wide` (CUP-NAME-SEARCH.md, the owner's «B, stretched»): the bar spans its list — the search takes what
   the selects and «Сбросить» leave, all of one height. On a phone it is the same grid as any bar. */
.flt-bar.is-wide { flex-wrap: nowrap; align-items: stretch; }
.flt-bar.is-wide .flt-search { flex: 1 1 auto; max-width: none; min-width: 0; }
.flt-bar.is-wide > select { flex: none; }
.flt-bar.is-wide .flt-reset { flex: none; align-self: center; white-space: nowrap; }

@media (max-width: 575.98px) {
  .flt-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .flt-search { grid-column: 1 / -1; max-width: none; }
  .flt-bar .flt-select { min-width: 0; max-width: none; width: 100%; }
  .flt-bar > .flt-select:last-of-type:nth-child(even) { grid-column: 1 / -1; }
  .flt-dates { grid-column: 1 / -1; }
  .flt-dates .flt-date { flex: 1; width: auto; min-width: 0; }
  .flt-person { grid-column: 1 / -1; }
  .flt-reset { grid-column: 1 / -1; }
}

/* === The phone fixes of MOBILE-PUBLIC.md (3.2) — the layout's own pieces; the fixes that belong to one
   plugin's page are in that plugin's stylesheet. All inside phone media queries: the desktop is unchanged
   (D10 apart, which is the dark card header's count on every width). === */
:root { --text-min: 12px; --text-min-caps: 11px; }

/* A2: the frame's links are 40 px tap targets on a phone and a tablet (padding, not margin). */
@media (max-width: 767.98px) {
  .mobile-topbar-title { display: inline-flex; align-items: center; min-height: 44px; }
  .breadcrumbs { margin-bottom: 6px; }
  .breadcrumbs a, .breadcrumbs .current { display: inline-flex; align-items: center; min-height: 40px; }
  .footer-links { gap: 0; }
  .footer-link { display: inline-flex; align-items: center; min-height: 40px; min-width: 44px; }
}

/* A3: a floor for small text on a phone — 12 px, and 11 px for the upper-case mono heads of tables. */
@media (max-width: 575.98px) {
  .breadcrumbs { font-size: var(--text-min); }
  .footer-col-title, .footer-copyright, .footer-madein { font-size: var(--text-min); }
  .badge { font-size: max(var(--text-min), 0.75em); }
}

/* A4: text fields and selects at 16 px on a phone and a tablet, so iOS does not zoom the page in on focus;
   the `-sm` classes stay in the templates (the desktop keeps its compact admin forms). */
@media (max-width: 767.98px) {
  input.form-control, input.form-control-sm,
  select.form-select, select.form-select-sm,
  textarea.form-control, textarea.form-control-sm,
  .input-group-sm > .form-control, .input-group-sm > .form-select {
    font-size: 16px;
  }
  .form-control-sm, .form-select-sm, .input-group-sm > .form-control, .input-group-sm > .form-select {
    min-height: 40px;
  }
  /* the lists' filter bars (`.flt-bar`: search, selects, dates, person) have their own 14-15 px */
  .flt-bar .flt-search input, .flt-bar .flt-select, .flt-bar .flt-date, .flt-bar .flt-person input, .flt-bar .flt-person select {
    font-size: 16px;
  }
}

/* A5: the rich-text editor's toolbar (Quill) with 40 x 40 px buttons, wrapping into rows. The vendor file
   (loaded after this one by the editor pages) stays as it is: these selectors are one class stronger. */
@media (max-width: 767.98px) {
  .ql-toolbar.ql-snow { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 6px; }
  .ql-toolbar.ql-snow .ql-formats { display: inline-flex; flex-wrap: wrap; margin-right: 0; }
  .ql-toolbar.ql-snow .ql-formats button { width: 40px; height: 40px; padding: 9px 10px; }
  .ql-toolbar.ql-snow .ql-picker { height: 40px; }
  .ql-toolbar.ql-snow .ql-picker-label { display: flex; align-items: center; }
  .ql-toolbar.ql-snow .ql-picker.ql-header { width: 120px; }
}

/* A7: on a phone the breadcrumbs stay on one line — a long crumb is cut with an ellipsis (a parent at most
   30 % of the line, the current page takes the rest) — and the page title no longer touches the line (the
   phone rule above pulls `.page-head` up by 19 px for pages without breadcrumbs). A crumb is a block here, its
   40 px tap height a line height: an ellipsis does not work in a flex box (A2's `inline-flex`), which cut the
   text bare. The current page gives way first (down to 4em), a parent only after it, so a short parent
   («Главная») stays whole beside a long name. */
@media (max-width: 575.98px) {
  .breadcrumbs { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
  .breadcrumbs > .sep { flex: 0 0 auto; }
  .breadcrumbs > a, .breadcrumbs > .current { display: block; line-height: 40px; min-height: 40px; overflow: hidden; text-overflow: ellipsis; }
  .breadcrumbs > a { flex: 0 1 auto; min-width: 2.5em; max-width: 30%; }
  .breadcrumbs > .current { flex: 0 1000 auto; min-width: 4em; }
  .breadcrumbs ~ * .page-head:first-child,
  .breadcrumbs ~ .page-head { margin-top: 0; }
}

/* A8: the list controls are 40 px tap targets on a phone and a tablet: «Show more» (a full-width
   button-sized link, the only way to the rest of a list) and the sort links in table heads. */
@media (max-width: 767.98px) {
  a[data-list-more] {
    display: flex; align-items: center; justify-content: center;
    min-height: 44px; width: 100%; padding: 8px 16px;
  }
  .list-more { padding-left: 12px; padding-right: 12px; }
  th[aria-sort] > a { display: inline-flex; align-items: center; min-height: 40px; }
}

/* D5 (variant 3): a wide table's minor columns behind «Show columns» (`data-optional-columns` on the
   scrolling box, `col-optional` on the minor <th> and <td>; the button is made by default-layout.js, and
   without it nothing is hidden). */
.cols-toggle-bar { display: none; }
@media (max-width: 575.98px) {
  .cols-toggle-bar {
    display: flex; justify-content: flex-end; padding: 4px 8px;
    border-bottom: 1px solid var(--color-border);
  }
  .cols-toggle-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 8px;
    border: 0; background: none; font-size: 14px; color: var(--color-text-secondary); cursor: pointer;
  }
  [data-optional-columns].cols-ready:not(.show-optional) .col-optional { display: none; }
  /* with the minor columns gone the rest should fit: tighter cell padding than the desktop's */
  [data-optional-columns].cols-ready:not(.show-optional) table :is(th, td) { padding-left: 10px !important; padding-right: 10px !important; }
}

/* D8: an admin list's header on a phone — the title on its line, the «New …» button under it (one line of
   text, 40 px tall) instead of both squeezed into one row. */
@media (max-width: 575.98px) {
  .admin-list-head { flex-wrap: wrap; row-gap: 12px; }
  .admin-list-head > :first-child { flex: 1 1 100%; }
  .admin-list-head > .btn { margin-left: 1.5rem; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
}

/* D10: a count in a dark card header (the classic theme paints `.card-header` dark) is light, not the page's
   muted grey: «Заявленные спортсмены 781». */
[data-theme="classic"] .card-header .text-muted {
  color: var(--color-head-text, #faf9f5) !important;
  opacity: 0.65;
}

/* Stacked rows (`table-stack` on the table; D1): below 576 px each row of the table is a small card, its first
   cell the title and every other cell a line «label — value» (the label from the cell's `data-label`, the
   column's header string the template already has). A cell marked `cell-empty` (a field not filled in) is left
   out. The desktop keeps its table. */
@media (max-width: 575.98px) {
  .table-stack > thead { display: none; }
  .table-stack, .table-stack > tbody, .table-stack > tbody > tr, .table-stack > tbody > tr > td { display: block; width: 100%; }
  .table-stack > tbody > tr { padding: 10px 14px; border-bottom: 1px solid var(--color-border); }
  .table-stack > tbody > tr > td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 3px 0; border: 0; background: none; box-shadow: none; text-align: right;
  }
  .table-stack > tbody > tr > td::before {
    content: attr(data-label); flex: 0 0 auto; font-size: var(--text-min); color: var(--color-text-muted); text-align: left;
  }
  .table-stack > tbody > tr > td:first-child { display: block; font-weight: 600; font-size: 16px; text-align: left; padding-bottom: 6px; }
  .table-stack > tbody > tr > td:first-child::before { content: none; }
  .table-stack > tbody > tr > td.cell-empty { display: none; }
  .table-stack .cell-value { text-align: right; }
}

/* D6: the admin tables' row controls are 40 px tap targets on a phone — the «⋯» menu button and the icon
   buttons (edit, delete, toggle) with a gap between them. The inline fields (a bib number, a distance, a club) are
   16 px and 40 px tall (A4) in their plugins' stylesheets. */
@media (max-width: 575.98px) {
  .row-menu-btn { min-width: 40px; min-height: 40px; }
  table .btn-sm:has(> i.bi:only-child):not(.race-apply-btn) { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  table td > .btn-sm + .btn-sm, table td > form + form, table td > a.btn-sm + form, table td > form + a.btn-sm { margin-left: 8px; }
}

/* D4: the admin cup's personal standings and the rating's points as rows like the public cup standings (`rank-table`
   on the table; `rank-place`, `rank-name`, `rank-num` and `rank-sub` on the cells, a `data-label` on the sub cell):
   a place tile (gold, silver, bronze for `top-1…3`), the name on two lines at most with «Гонки 11» under it, the
   points large on the right. Below 576 px only. */
@media (max-width: 575.98px) {
  .rank-table thead tr,
  .rank-table tbody tr {
    display: grid; grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-areas: "place name num" "place sub num"; column-gap: 12px; align-items: center;
    padding: 10px 16px; border-bottom: 1px solid var(--color-border);
  }
  .rank-table thead tr { grid-template-areas: "place name num"; padding-top: 12px; padding-bottom: 10px; }
  .rank-table tbody tr:last-child { border-bottom: 0; }
  .rank-table th, .rank-table td { display: block; padding: 0 !important; border: 0 !important; background: none !important; }
  .rank-table thead th.rank-sub { display: none; }
  .rank-table .rank-place { grid-area: place; }
  .rank-table .rank-name { grid-area: name; min-width: 0; font-size: 16px; line-height: 1.25; }
  .rank-table .rank-sub { grid-area: sub; font-size: 13px; color: var(--color-text-muted) !important; }
  .rank-table td.rank-sub::before { content: attr(data-label) " "; }
  .rank-table .rank-num { grid-area: num; text-align: right; }
  .rank-table td.rank-num { font-family: var(--font-family-mono); font-size: 17px; font-weight: 700; }
  .rank-table td.rank-place {
    width: 32px; height: 32px; border-radius: 9px; display: flex !important; align-items: center; justify-content: center;
    background: var(--color-surface-light) !important; font-size: 15px;
  }
  .rank-table td.rank-place.top-1 { background: var(--color-rank-gold-tint) !important; color: var(--color-rank-gold) !important; }
  .rank-table td.rank-place.top-2 { background: var(--color-rank-silver-tint) !important; color: var(--color-rank-silver) !important; }
  .rank-table td.rank-place.top-3 { background: var(--color-rank-bronze-tint) !important; color: var(--color-rank-bronze) !important; }
  .rank-table .rank-name .small { display: block; font-size: 13px; }
}

/* D4: a card header's «Recalculate» (`recalc-btn`, its words in `.recalc-text`, the name also in `title` and `aria-label`)
   shows only its icon where the words do not fit on the header's line: `recalc-icon` — on a phone at once (the header
   carries a long name); otherwise when the header is narrower than 330 px. */
.card-header:has(> form .recalc-btn) { container-type: inline-size; }
.recalc-btn { white-space: nowrap; }
@container (max-width: 329.98px) {
  .recalc-btn .recalc-text { display: none; }
  .recalc-btn { min-width: 40px; min-height: 40px; }
}
@media (max-width: 575.98px) {
  .recalc-icon .recalc-text { display: none; }
  .recalc-icon { min-width: 40px; min-height: 40px; }
}

/* E2: an admin list's header stays on one line on a phone (`list-head-compact`): the title a size smaller (22 px), the
   button a compact 40 px pill (14 px text) that does not wrap. */
@media (max-width: 575.98px) {
  .list-head-compact { gap: 10px; }
  .list-head-compact > h2 { font-size: 22px; min-width: 0; }
  .list-head-compact .btn {
    white-space: nowrap; min-height: 40px; padding: 6px 14px; font-size: 14px;
    display: inline-flex; align-items: center;
  }
}

/* data-pick-list (DISCOUNTS.md, mocks 2, 5, 6): the chosen clubs, objects and people, each with «×»,
   and the search that adds more. */
.pick-count { font-size: .875rem; font-weight: 600; margin-bottom: .5rem; }
.pick-list { border: 1px solid var(--color-border, #dee2e6); border-radius: .5rem; background: var(--color-surface, #fff); margin-bottom: 1rem; }
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .85rem; }
.pick-row + .pick-row { border-top: 1px solid var(--color-border-subtle, #f0f0f0); }
.pick-row .btn { padding: .1rem .45rem; }
.pick-list i.kind, .pick-suggestions i.kind { color: var(--color-text-muted); margin-right: .4rem; }
.pick-detail { color: var(--color-text-muted); font-size: .875em; }
.pick-search-wrap { position: relative; }
.pick-search-wrap .form-control { padding-right: 2.25rem; }
.pick-search-wrap > .bi-search { position: absolute; right: .75rem; top: 1.2rem; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.pick-suggestions { position: absolute; z-index: 20; width: 100%; max-height: 18rem; overflow-y: auto; box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .1); }
/* An open list is drawn over the card holding it (a card clips its overflow, for its tables' corners). */
.card:has(.pick-suggestions:not([hidden])) { overflow: visible; }
.pick-option { display: flex; justify-content: space-between; gap: .75rem; cursor: pointer; }

/* The person combobox (`data-person-search`, person-picker variant A; the script builds it): one text field in place of
   the select (`.person-combo-native`, hidden but still what submits), a chevron or a magnifier and «×» at its right,
   an inherited value (`.person-combo-inherited`, the note small and muted, then the name) laid over the empty field,
   and a list (`.person-combo-list`) under it as wide as the field: up to 8 rows (`.person-combo-rows` scrolls), the
   e-mail only beside namesakes, last the empty option (`.person-combo-none`). The field takes the select's classes. */
.person-combo { position: relative; }
.person-combo-native { display: none !important; }
.person-combo > input { padding-right: 2.25rem; text-overflow: ellipsis; }
.person-combo.has-value:not(.is-typing) > input { padding-right: 4.25rem; }
.person-combo-tools { position: absolute; right: .75rem; top: 0; bottom: 0; display: flex; align-items: center; gap: .5rem;
  color: var(--color-text-muted); pointer-events: none; }
.person-combo-tools .bi { font-size: .9rem; }
.person-combo-clear { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; padding: .25rem;
  border: 0; background: transparent; color: inherit; cursor: pointer; line-height: 1; border-radius: 50%; }
.person-combo-clear:hover, .person-combo-clear:focus-visible { color: var(--color-text-primary); }
.person-combo-clear[hidden], .person-combo-inherited[hidden], .person-combo-list[hidden] { display: none; }
/* The note and the value stand on one baseline (the owner, 2026-11-03), the line centred in the field: a grid row
   aligned by baseline, the row itself centred. */
.person-combo-inherited, .field-inherited { position: absolute; left: 0; right: 2.25rem; top: 0; bottom: 0; display: grid;
  grid-auto-flow: column; grid-template-columns: auto minmax(0, 1fr); align-content: center; align-items: baseline;
  column-gap: .5rem; overflow: hidden; white-space: nowrap; pointer-events: none; color: var(--color-text-primary); }
/* Any other select or input taking its value from elsewhere (`data-inherited-note`, UI-FIXES-2026-11-03.md, item 3): the
   same note and value laid over the empty field, whose own text (the empty option's, the placeholder, a date's mask)
   is hidden under them. */
.field-inherited-wrap { position: relative; }
.field-inherited[hidden] { display: none; }
/* An input has no chevron: only a date keeps room for its calendar button. */
.field-inherited-wrap > input:not([type="datetime-local"]) + .field-inherited { right: .75rem; }
.field-inherited-value { overflow: hidden; text-overflow: ellipsis; }
.shows-inherited { color: transparent !important; }
.shows-inherited option { color: var(--color-text-primary); }
.shows-inherited::placeholder { color: transparent; }
.shows-inherited::-webkit-datetime-edit { color: transparent; }
/* A line under the field that only says what the empty field takes: not needed once the field shows it. */
.field-inherited-wrap + .form-text-inherited { display: none; }
.person-combo-note { font-size: .875em; font-weight: 400; color: var(--color-text-muted); }
.person-combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; padding: .25rem 0;
  background: var(--color-surface, #fff); border: 1px solid var(--color-border-strong, #dee2e6); border-radius: .5rem;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08); font-size: 1rem; font-weight: 400; text-align: left; }
.person-combo-rows { max-height: 20rem; overflow-y: auto; }
.person-combo-row { display: flex; align-items: baseline; gap: 1rem; padding: .5rem .85rem; cursor: pointer;
  color: var(--color-text-primary); line-height: 1.5; }
.person-combo-row.active { background: var(--color-primary-tint, #eef3ff); }
.person-combo-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-combo-email { flex: 0 99 auto; min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .875rem; color: var(--color-text-muted); }
.person-combo-none { margin-top: .25rem; border-top: 1px solid var(--color-border); padding-top: .75rem; color: var(--color-text-muted); }
.person-combo-list mark { padding: 0; background: #fff3bf; color: inherit; }
/* An open list is drawn over the card holding it (a card clips its overflow, for its tables' corners). */
.card:has(.person-combo-list:not([hidden])) { overflow: visible; }
/* The people of a role that holds several (`data-person-chips`, JUDGE-ACCESS.md, mock 5): one field, the chosen people as
   chips with «×», the search typed in the same field, a magnifier at its right, the people's list under it as the
   combobox's. Without the script each chip is a checked box (unticking it drops the person). An empty field laid over
   with what it takes from elsewhere (`.person-chips-inherited`), as the combobox. */
.person-chips { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; height: auto;
  min-height: calc(1.5em + .75rem + 2px); padding: .3rem 2.25rem .3rem .45rem; cursor: text; }
.person-chips:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 .2rem var(--color-primary-tint, rgba(13, 110, 253, .2)); }
.person-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; margin: 0; padding: .12rem .3rem .12rem .65rem;
  background: var(--color-surface-light, #f1f1ef); border: 1px solid var(--color-border, #ddd); border-radius: 999px;
  font-size: .9rem; line-height: 1.4; white-space: nowrap; cursor: default; }
label.person-chip { padding-left: .45rem; cursor: pointer; }
.person-chip .form-check-input { margin: 0; }
.person-chip-name { overflow: hidden; text-overflow: ellipsis; }
.person-chip-remove { display: inline-flex; align-items: center; padding: .1rem .2rem; border: 0; background: none; line-height: 1;
  color: var(--color-text-muted); cursor: pointer; border-radius: 50%; }
.person-chip-remove .bi { font-size: .8rem; }
.person-chip-remove:hover, .person-chip-remove:focus-visible { color: var(--color-text-primary); }
.person-chips-input { flex: 1 1 8rem; min-width: 8rem; padding: .15rem .2rem; border: 0; outline: 0; background: transparent; color: inherit; }
.person-chips-input[hidden], .person-chips-inherited[hidden] { display: none; }
.person-chips-empty { padding: 0 .3rem; }
.person-chips-icon { position: absolute; right: .85rem; top: calc(.3rem + 1px + .9rem); transform: translateY(-50%); font-size: .9rem;
  color: var(--color-text-muted); pointer-events: none; }
.person-chips-inherited { position: absolute; left: 0; right: 2.25rem; top: 0; bottom: 0; display: grid; grid-auto-flow: column;
  grid-template-columns: auto minmax(0, 1fr); align-content: center; align-items: baseline; column-gap: .5rem; padding-left: .75rem;
  overflow: hidden; white-space: nowrap; pointer-events: none; color: var(--color-text-primary); }
.person-chips-inherited-value { overflow: hidden; text-overflow: ellipsis; }
/* A person chosen who lacks the access the role needs (`data-access-warnings`, JUDGE-ACCESS.md, decision 8): a line each
   under the field, the icon and text in the warning colour, the link to their roles; the person's chip tinted alike. */
.person-access-warnings { display: grid; gap: .2rem; margin-top: .35rem; }
.person-access-warnings:empty { display: none; }
.person-access-warning { font-size: .875rem; color: var(--bs-warning-text-emphasis, #664d03); }
.person-access-warning .bi { margin-right: .15rem; }
.person-access-name { font-weight: 600; }
.person-chip.lacks-access { background: var(--bs-warning-bg-subtle, #fff3cd); border-color: var(--bs-warning-border-subtle, #ffe69c); }
/* In a list's filter bar the field is the pill of its selects, and its list is wide enough for a name and an e-mail. */
.flt-person .person-combo { width: 100%; }
@media (min-width: 576px) { .flt-person .person-combo-list { min-width: 22rem; } }

/* === A creation wizard (CREATE-WIZARDS.md; partials `defaultLayout/wizardSteps` and
   `defaultLayout/wizardFoot`, from `WizardSteps`): the steps as numbered pills above the step's
   card — a done one with a tick and a link back, the current one outlined — and on a phone
   «Шаг 2 из 5 · Оплата» over a bar. The card's foot («Назад», «Далее» / «Готово», «Пропустить»
   on the right) is the card's last child, outside its body: its top line runs the card's full width. === */
.wiz-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; }
.wiz-step { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid var(--color-border); font-size: 13px; font-weight: 600; color: var(--color-text-muted);
  background: var(--color-surface, #fff); text-decoration: none; }
.wiz-step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  background: var(--color-surface-subtle, #f1f1f1); color: var(--color-text-muted); }
a.wiz-step:hover { border-color: var(--color-text-muted); }
.wiz-step.is-done { color: var(--color-text-primary); }
.wiz-step.is-done .wiz-step-n { background: var(--color-text-primary); color: var(--color-surface, #fff); }
.wiz-step.is-current { border-color: var(--color-text-primary); color: var(--color-text-primary); }
.wiz-step.is-current .wiz-step-n { background: var(--bs-danger, #dc3545); color: #fff; }
.wiz-phone { display: none; font-size: 13px; color: var(--color-text-muted); margin-bottom: 12px; }
.wiz-phone b { color: var(--color-text-primary); }
.wiz-bar { display: block; width: 100%; height: 4px; margin-top: 6px; border: 0; border-radius: 2px; overflow: hidden;
  appearance: none; background: var(--color-border); color: var(--bs-danger, #dc3545); }
.wiz-bar::-webkit-progress-bar { background: var(--color-border); }
.wiz-bar::-webkit-progress-value { background: var(--bs-danger, #dc3545); }
.wiz-bar::-moz-progress-bar { background: var(--bs-danger, #dc3545); }
.wiz-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--color-border);
  padding: 16px var(--bs-card-spacer-x, 1rem) var(--bs-card-spacer-y, 1rem); }
.wiz-foot .wiz-skip { margin-left: auto; }
@media (max-width: 575.98px) { .wiz-steps { display: none; } .wiz-phone { display: block; } }
/* A step's groups (the judges, the points) under a small heading; every field on its own line (the owner,
   2026-11-04): a half-width column of a part takes the line, a coefficient beside its algorithm (`col-sm-6`) stays. */
.wiz-sub { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted);
  margin: 18px 0 8px; }
.wiz-lines .row > .col-md-6 { flex: 0 0 auto; width: 100%; }
/* A row of a step's list (the distances, the check's summaries): what it is, and its link on the right. */
.wiz-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--color-border); }
.wiz-row:last-of-type { border-bottom: 0; }
