/* ==========================================================================
   BSC events dashboard: the pieces the website doesn't have.
   Reads every colour from the tokens in brand.css, so light and dark both work.
   Mobile first: checked at 320px and 390px with no sideways scroll.
   ========================================================================== */

/* ---------- App shell ---------- */
body.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.app-main {
  flex: 1 0 auto;
  padding-block: clamp(20px, 4vw, 40px) 72px;
}
/* Page kickers are small text: Club Red fails AA on the dark grounds, so use the accent text token
   (#ff6b57 at night, still Club Red by day). */
.app .kicker.accent {
  color: var(--accent-text);
}
.app-foot {
  padding-block: 8px 28px;
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.app-header {
  position: relative;
  z-index: 40;
  background: var(--header-bg);
  color: var(--text);
  border-bottom: 2px solid var(--line);
}
@media (min-width: 900px) {
  .app-header {
    position: sticky;
    top: 0;
    -webkit-backdrop-filter: saturate(1.3) blur(10px);
    backdrop-filter: saturate(1.3) blur(10px);
  }
}
.app-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding-block: 10px;
}
.app-brand {
  flex: none;
  display: block;
  width: clamp(118px, 30vw, 168px);
  line-height: 0;
  border-radius: 8px;
}
.app-brand .logo {
  width: 100%;
  height: auto;
}
.logo .lg-l {
  fill: var(--logo-fg);
}
.logo .lg-d1 {
  fill: var(--logo-d1);
}
.logo .lg-d2 {
  fill: var(--logo-d2);
}
.app-tag {
  flex: none;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--sun);
  color: var(--ink);
  font: 800 0.7rem / 1 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(-3deg);
}

/* nav pills: a second row on phones (scrolls inside itself, never the page), inline on desktop */
.app-nav {
  order: 3;
  flex: 1 1 100%;
  min-width: 0;
}
.nav-pills {
  list-style: none;
  margin: -6px;
  padding: 6px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.nav-pills::-webkit-scrollbar {
  display: none;
}
.nav-pills li {
  flex: none;
}
.nav-pills li:last-child {
  padding-inline-end: 22px;
}
.nav-pills a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font: 800 0.8rem / 1 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 2px var(--line);
}
.nav-pills a:hover {
  box-shadow: inset 0 0 0 2px var(--text);
}
.nav-pills a[aria-current="page"] {
  background: var(--text);
  color: var(--surface);
  box-shadow: none;
}
@media (min-width: 900px) {
  .app-nav {
    order: 1;
    flex: 1 1 auto;
  }
  .nav-pills {
    -webkit-mask: none;
    mask: none;
    flex-wrap: wrap;
    overflow: visible;
  }
  .nav-pills li:last-child {
    padding-inline-end: 0;
  }
}

.app-user {
  order: 1;
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 240px;
  padding: 3px 12px 3px 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 2px var(--line);
  font-weight: 700;
  font-size: 0.9rem;
}
.user-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.user-initial {
  display: grid;
  place-items: center;
  background: var(--club-red);
  color: var(--sand);
  font: 800 0.95rem / 1 var(--font-display);
}
.user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  flex: none;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--surface);
  font: 800 0.62rem / 1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (min-width: 900px) {
  .app-user {
    order: 2;
  }
}
.logout-form {
  margin: 0;
}
.btn-logout .icon {
  width: 16px;
  height: 16px;
}
@media (max-width: 560px) {
  .user-name,
  .user-role {
    display: none;
  }
  .user-chip {
    padding: 3px;
  }
  .btn-logout span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .btn-logout {
    width: 40px;
    padding: 0;
  }
}
@media (max-width: 340px) {
  .app-tag {
    display: none;
  }
}

/* ---------- Page furniture ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: clamp(18px, 3vw, 30px);
}
.page-head-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 820px;
}
.page-title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
.page-head .lead {
  color: var(--text-muted);
}
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.crumbs {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-bottom: 10px;
}
.crumbs a {
  color: var(--text);
  font-weight: 700;
}

.section-title {
  font-size: clamp(1.35rem, 3.4vw, 1.9rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.panel {
  background: var(--surface-raised);
  color: var(--text);
  border: 2.5px solid var(--text);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3.4vw, 28px);
  min-width: 0;
}
.panel + .panel,
.stat-grid + .panel,
.panel + .save-bar,
.save-bar + .panel,
form + .panel,
.alert + .panel,
.search-wrap + .panel {
  margin-top: clamp(16px, 2.6vw, 24px);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}
.panel-head-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 70ch;
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.panel-danger {
  border-color: var(--accent-text);
  box-shadow: 6px 7px 0 var(--accent-text);
}
.list-empty {
  color: var(--text-muted);
  font-weight: 600;
}
.flash {
  margin-bottom: 20px;
}
.hint code,
.row-meta code,
.audit-target code,
.health-foot code,
.alert-body code {
  font: 600 0.85em / 1 var(--font-mono);
}

details.more {
  margin-top: 16px;
  border-top: 2px solid var(--line);
  padding-top: 12px;
}
details.more > summary {
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
  font-weight: 700;
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  border-radius: 4px;
}
details.more[open] > summary {
  margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 2.5px solid var(--text);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: 800 0.85rem / 1 var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  background: var(--text);
  color: var(--surface);
}
.btn .icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.76rem;
}
.btn-icon {
  width: 40px;
  padding: 0;
}
.btn-solid {
  background: var(--club-red);
  border-color: var(--club-red);
  color: var(--sand);
}
.btn-solid:hover {
  background: var(--club-red-dark);
  border-color: var(--club-red-dark);
  color: var(--sand);
}
.btn-danger {
  border-color: var(--accent-text);
  color: var(--accent-text);
}
.btn-danger:hover {
  background: var(--accent-text);
  color: var(--surface);
}
.btn:disabled,
.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.is-disabled:hover,
.btn:disabled:hover {
  background: transparent;
  color: var(--text);
}
.btn.is-busy {
  cursor: progress;
  opacity: 0.7;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
svg.icon {
  max-width: none;
}
.icon {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Pill tabs (segmented control) ---------- */
.pill-tabs {
  list-style: none;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2.5px var(--text);
  border: 0;
  min-width: 0;
}
.pill-tabs li {
  display: flex;
  min-width: 0;
}
.pill-tabs a,
.pill-tabs button {
  appearance: none;
  border: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: 700 0.92rem / 1.15 var(--font-text);
  text-decoration: none;
  text-align: start;
}
.pill-tabs a:hover,
.pill-tabs button:hover {
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 2px var(--text);
}
.pill-tabs a[aria-current="page"],
.pill-tabs button[aria-selected="true"],
.pill-tabs button[aria-pressed="true"] {
  background: var(--club-red);
  color: var(--sand);
  box-shadow: none;
}
.pill-tabs :focus-visible {
  outline-offset: 1px;
}
.tab-count {
  flex: none;
  min-width: 1.7em;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--surface);
  font: 800 0.72rem / 1 var(--font-display);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
[aria-current="page"] > .tab-count,
[aria-selected="true"] > .tab-count {
  background: var(--sand);
  color: var(--ink);
}
.tabs > .pill-tabs {
  margin-bottom: 14px;
}
.tab-panel:focus-visible {
  outline-offset: 6px;
}

/* events: tabs on wide screens, a select on phones */
.events-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(16px, 2.6vw, 24px);
}
.section-tabs {
  display: none;
}
.section-select .select-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.section-select .select-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
@media (min-width: 900px) {
  .section-tabs {
    display: block;
  }
  .section-select {
    display: none;
  }
}

/* ---------- Inputs the website doesn't use ---------- */
.form input[type="number"],
.form input[type="date"],
.form input[type="datetime-local"],
.form input[type="time"],
.form input[type="search"],
.search-input,
.section-select select,
.chip-add select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 2.5px solid var(--text);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 500 1rem / 1.4 var(--font-text);
}
.section-select select,
.chip-add select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 44px;
}
.panel .form input[type="text"],
.panel .form select,
.panel .form textarea {
  background: var(--surface);
}
.form input[type="number"] {
  font-variant-numeric: tabular-nums;
}
.form input::-webkit-calendar-picker-indicator {
  cursor: pointer;
}
.field-number {
  max-width: 260px;
}
.input-suffix {
  display: flex;
  align-items: center;
  gap: 10px;
}
.input-suffix input {
  max-width: 130px;
}
.suffix {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.char-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.char-count.is-over {
  color: var(--accent-text);
  font-weight: 800;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 18px 22px;
  margin-bottom: 18px;
}
.offset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px 22px;
  margin-bottom: 8px;
}
.add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}
@media (min-width: 640px) {
  .add-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .add-row .btn {
    margin-bottom: 0;
  }
}
.add-row .field .hint {
  order: 3;
}

/* search */
search.search-wrap {
  display: block;
}
.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.search-box {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}
.search-box .icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-box .search-input {
  padding-inline-start: 42px;
}
.search-input::-webkit-search-cancel-button {
  cursor: pointer;
}
.search-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.search-note {
  margin-bottom: 14px;
  color: var(--text-muted);
}

/* file picker that looks like a button */
.import-form {
  position: relative;
  margin: 0;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-input:focus-visible + .file-btn,
.import-form:focus-within .file-btn {
  outline: 3px solid var(--focus-color);
  outline-offset: 3px;
}
.backup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Toggle switches ---------- */
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 6px 24px;
  margin-bottom: 8px;
}
.toggle-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.toggle-row .hint {
  padding-inline-start: 66px;
}
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.3;
}
.toggle input {
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 52px;
  height: 30px;
  margin: -15px 0 0;
  opacity: 0;
  cursor: pointer;
}
.toggle-track {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 2.5px var(--text);
  transition: background-color 0.15s ease;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition:
    transform 0.15s ease,
    background-color 0.15s ease;
}
.toggle input:checked + .toggle-track {
  background: var(--gulf-teal);
}
.toggle input:checked + .toggle-track::after {
  transform: translateX(22px);
  background: var(--sand);
  box-shadow: 0 0 0 2px var(--ink);
}
.toggle input:focus-visible + .toggle-track {
  outline: 3px solid var(--focus-color);
  outline-offset: 3px;
}
.toggle-label {
  min-width: 0;
}

/* ---------- Role picker (chip list + add select) ---------- */
.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  min-height: 36px;
  padding: 0 3px 0 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
  font-weight: 700;
  font-size: 0.92rem;
}
.chip-at {
  color: var(--text-muted);
}
.chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-inline-start: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.chip-x .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}
.chip-x:hover {
  background: var(--text);
  color: var(--surface);
}
.chip.is-unknown {
  color: var(--accent-text);
  box-shadow: inset 0 0 0 2px var(--accent-text);
  border-style: dashed;
}
.chip.is-unknown .chip-at {
  color: inherit;
}
.chip-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.chip-add {
  margin-top: 10px;
  max-width: 320px;
}
.chip-add select {
  min-height: 42px;
  font-size: 0.95rem;
}

.cap-list {
  display: grid;
}
.cap-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 28px;
  padding: 16px 0;
  border-top: 2px solid var(--line);
}
.cap-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.cap-label {
  font: 800 1.02rem / 1.2 var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
@media (min-width: 820px) {
  .cap-row {
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  }
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.channel-card,
.type-card {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  background: var(--surface);
}
.channel-legend {
  padding: 0 6px;
  font: 800 0.85rem / 1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}
.type-legend {
  padding: 0 4px;
}
.type-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 380px) {
  .type-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
.type-color {
  position: relative;
}
.type-swatch {
  position: absolute;
  inset-inline-end: 44px;
  bottom: 15px;
  pointer-events: none;
}
.type-card input[type="text"],
.type-card textarea,
.type-card select,
.channel-card select {
  background: var(--surface-raised) !important;
}
.type-card textarea {
  min-height: 76px;
}

.swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px var(--ink),
    0 0 0 2px var(--surface);
  vertical-align: middle;
}
.swatch-club_red {
  background: var(--club-red);
}
.swatch-gulf_teal {
  background: var(--gulf-teal);
}
.swatch-sun {
  background: var(--sun);
}
.swatch-flamingo {
  background: var(--flamingo);
}
.swatch-sand {
  background: var(--sand);
}
.swatch-ink {
  background: var(--ink);
  box-shadow:
    inset 0 0 0 2px var(--text),
    0 0 0 2px var(--surface);
}
.swatch-white {
  background: #ffffff;
}

/* sticky save bar at the bottom of long forms */
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 18px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--header-bg);
  border-top: 2px solid var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.save-hint {
  font-weight: 700;
  color: var(--text);
}

/* ---------- Stat tiles ---------- */
.stat-grid {
  list-style: none;
  margin: 0 0 clamp(18px, 3vw, 28px);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 820px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
}
.stat-grid > li {
  display: flex;
  min-width: 0;
}
.stat {
  --st: var(--club-red);
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 14px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  border: 2.5px solid var(--text);
  box-shadow: 5px 6px 0 var(--st);
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 11px;
  background: var(--st);
  border-bottom: 2.5px solid var(--text);
}
a.stat:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 8px 0 var(--st);
}
.stat-num {
  font: 800 clamp(2.4rem, 9vw, 3.6rem) / 0.85 var(--font-display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 96;
}
.stat-label {
  font: 800 0.78rem / 1.15 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-hint {
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--text-muted);
}
.stat-value {
  font: 800 clamp(1.15rem, 3.6vw, 1.5rem) / 1.05 var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.st-sun {
  --st: var(--sun);
}
.st-teal {
  --st: var(--gulf-teal);
}
.st-pink {
  --st: var(--flamingo);
}
.st-red {
  --st: var(--club-red);
}
.stat-status.is-ok {
  --st: var(--gulf-teal);
}
.stat-status.is-warn {
  --st: var(--sun);
}
.stat-status.is-error {
  --st: var(--club-red);
}
.stat-status.is-info {
  --st: var(--line);
}
@media (max-width: 360px) {
  .stat {
    padding-inline: 10px;
  }
  .stat-hint {
    font-size: 0.8rem;
  }
}

/* ---------- Series tags (all six types) and audience format tags ---------- */
.series-dinners {
  --s-bg: var(--club-red);
  --s-fg: var(--sand);
  --s-edge: transparent;
}
.series-game_night {
  --s-bg: var(--gulf-teal);
  --s-fg: var(--sand);
  --s-edge: transparent;
}
.series-get_moving {
  --s-bg: var(--sun);
  --s-fg: var(--ink);
  --s-edge: transparent;
}
.series-hangouts {
  --s-bg: #ffffff;
  --s-fg: var(--ink);
  --s-edge: var(--ink);
}
.series-big_nights {
  --s-bg: var(--ink);
  --s-fg: var(--sand);
  --s-edge: var(--text);
}
.series-online_nights {
  --s-bg: var(--surface-raised);
  --s-fg: var(--text);
  --s-edge: var(--text);
  --s-stripe: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(14, 116, 112, 0.16) 6px 8px);
}
.series-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--s-bg);
  background-image: var(--s-stripe, none);
  color: var(--s-fg);
  box-shadow: inset 0 0 0 2px var(--s-edge);
  font: 800 0.72rem / 1.1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.series-tag.series-online_nights::before,
.cal-chip.series-online_nights::before {
  content: "";
  flex: none;
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  background: var(--flamingo);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.format-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
  font: 700 0.78rem / 1.1 var(--font-text);
  white-space: nowrap;
}
.format-tag::before {
  content: "";
  flex: none;
  width: 0.95em;
  height: 0.95em;
  border-radius: 50%;
  background: var(--fmt);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* ---------- Status badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: 2px solid currentColor;
  background: transparent;
  color: var(--text);
  font: 800 0.7rem / 1.1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-pending {
  background: var(--sun);
  color: var(--ink);
  border-color: var(--sun);
}
.badge-approved {
  background: var(--gulf-teal);
  color: var(--sand);
  border-color: var(--gulf-teal);
}
.badge-sending,
.badge-sent {
  background: var(--club-red);
  color: var(--sand);
  border-color: var(--club-red);
}
.badge-sending {
  border-style: dashed;
  border-color: var(--sand);
}
.badge-finished,
.badge-ended {
  color: var(--text);
}
.badge-declined {
  color: var(--accent-text);
}
.badge-withdrawn,
.badge-expired {
  color: var(--text-muted);
  border-style: dashed;
}
.badge-cancelled,
.badge-date-cancelled {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.badge-date-cancelled {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.badge-live {
  background: var(--flamingo);
  color: var(--ink);
  border-color: var(--ink);
}
.badge-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 0 rgba(42, 23, 18, 0.5);
}
@media (prefers-reduced-motion: no-preference) {
  .badge-live::before {
    animation: bsc-pulse 1.6s ease-out infinite;
  }
}
@keyframes bsc-pulse {
  70% {
    box-shadow: 0 0 0 6px rgba(42, 23, 18, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(42, 23, 18, 0);
  }
}
.badge-projected {
  color: var(--text-muted);
  border-style: dashed;
}
.badge-unsent {
  color: var(--text);
  border-style: dashed;
}
.badge-missing {
  background: var(--sun);
  color: var(--ink);
  border-color: var(--ink);
}
.web-tag {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1.5px var(--text-muted);
  color: var(--text-muted);
  font: 800 0.62rem / 1.2 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Row cards (instead of tables) ---------- */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 2px var(--line);
  overflow: hidden;
  min-width: 0;
}
.row-card:hover {
  box-shadow: inset 0 0 0 2px var(--text);
}
.row-date {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 14px;
  background-color: var(--s-bg);
  background-image: var(--s-stripe, none);
  color: var(--s-fg);
  box-shadow: inset 0 -2px 0 var(--s-edge);
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-variation-settings: "opsz" 48;
}
.row-date .d-wd {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.row-date .d-day {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.row-date .d-mon {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.row-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px 10px;
}
.row-title {
  font-size: clamp(1.12rem, 2.4vw, 1.3rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.row-title a {
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
}
.row-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.row-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.row-card {
  position: relative;
}
.row-card a:not(.row-title a),
.row-card button {
  position: relative;
  z-index: 1;
}
.row-when {
  font-weight: 700;
}
.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.row-id {
  font: 600 0.85rem / 1 var(--font-mono);
}
.row-reason {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(210, 38, 25, 0.08);
  border-inline-start: 4px solid var(--accent-text);
  font-size: 0.95rem;
  display: grid;
  gap: 4px;
}
.row-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 8px 14px 12px;
  border-top: 2px solid var(--line);
}
.row-side:empty {
  display: none;
}
.row-count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.row-count-num {
  font: 800 1.25rem / 1 var(--font-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.row-count-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.row-card.is-projected {
  box-shadow: none;
  border: 2px dashed var(--text-muted);
}
.row-card.is-projected:hover {
  border-color: var(--text);
}
@media (min-width: 700px) {
  .row-card {
    grid-template-columns: 86px minmax(0, 1fr) auto;
  }
  .row-date {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 6px;
    box-shadow: inset -2px 0 0 var(--s-edge);
  }
  .row-date .d-day {
    font-size: 2.1rem;
    line-height: 0.9;
  }
  .row-main {
    padding: 14px 0 14px 4px;
  }
  .row-side {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding: 14px 16px;
    border-top: 0;
    text-align: end;
  }
  .row-count {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }
  .row-count-num {
    font-size: 1.5rem;
  }
}

/* overview: upcoming grouped by Bahrain day */
.day-groups {
  display: grid;
  gap: 22px;
}
.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 10px;
  font-size: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.day-rel {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--sun);
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.view-toggle {
  flex: none;
}

/* ---------- Month calendar (agenda list on phones) ---------- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.cal-title {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
}
.cal-nav {
  display: flex;
  gap: 8px;
}
.cal-weekdays {
  display: none;
}
.cal-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.cal-day {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
}
.cal-day.is-pad,
.cal-day.is-empty:not(.is-today) {
  display: none;
}
.cal-date {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font: 800 0.95rem / 1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.cal-day.is-past .cal-date {
  color: var(--text-muted);
}
.cal-day.is-today {
  box-shadow: inset 0 0 0 3px var(--club-red);
}
.cal-today {
  margin-inline-start: auto;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--club-red);
  color: var(--sand);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}
.cal-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
}
.cal-chips > li {
  min-width: 0;
}
.cal-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background-color: var(--s-bg);
  background-image: var(--s-stripe, none);
  color: var(--s-fg);
  box-shadow: inset 0 0 0 1.5px var(--s-edge);
  font: 700 0.9rem / 1.2 var(--font-text);
  text-decoration: none;
}
.cal-chip:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.cal-time {
  flex: none;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cal-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-chip.is-projected,
.cal-key-chip.is-projected {
  outline: 2px dashed var(--text);
  outline-offset: -4px;
}
.cal-chip.is-projected {
  padding-inline: 12px;
}
.cal-key-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 800;
  color: var(--text);
  background: var(--surface);
}
.cal-chip.is-live {
  box-shadow:
    inset 0 0 0 2px var(--ink),
    0 0 0 2px var(--flamingo);
}
.cal-none {
  margin-top: 10px;
  color: var(--text-muted);
  font-weight: 600;
}
.cal-key {
  margin-top: 12px;
}
@media (min-width: 700px) {
  .cal-weekdays {
    list-style: none;
    margin: 0 0 6px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    font: 800 0.72rem / 1 var(--font-display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-muted);
  }
  .cal-weekdays abbr {
    text-decoration: none;
  }
  .cal-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }
  .cal-day,
  .cal-day.is-empty:not(.is-today) {
    display: flex;
    min-height: 104px;
    padding: 6px;
    gap: 4px;
  }
  .cal-day.is-pad {
    display: block;
    background: transparent;
    box-shadow: none;
  }
  .cal-wd,
  .cal-mon {
    display: none;
  }
  .cal-date {
    font-size: 0.9rem;
    padding: 2px 2px 0;
  }
  .cal-today {
    padding: 2px 5px;
    font-size: 0.6rem;
  }
  .cal-chip {
    display: block;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cal-chip.series-online_nights::before {
    margin-inline-end: 4px;
    vertical-align: -1px;
  }
  .cal-chip.is-projected {
    padding-inline: 7px;
    outline-offset: -3px;
    outline-width: 1.5px;
  }
  .cal-time {
    font-weight: 800;
  }
  .cal-name {
    display: inline;
  }
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid;
  color: var(--text);
  line-height: 1.45;
}
.alert + .alert,
.detail-tags + .alert {
  margin-top: 12px;
}
.alert-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.alert-title {
  font: 800 1rem / 1.2 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.alert-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin-top: -1px;
}
.alert-icon .icon {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}
.alert-ok {
  background: rgba(14, 116, 112, 0.1);
  border-color: var(--gulf-teal);
}
.alert-ok .alert-icon {
  background: var(--gulf-teal);
  color: var(--sand);
}
.alert-warn {
  background: rgba(255, 200, 61, 0.2);
  border-color: var(--sun);
}
.alert-warn .alert-icon {
  background: var(--sun);
  color: var(--ink);
}
.alert-error {
  background: rgba(210, 38, 25, 0.09);
  border-color: var(--accent-text);
}
.alert-error .alert-icon {
  background: var(--accent-text);
  color: var(--surface);
}
.alert-info {
  background: var(--surface);
  border-color: var(--line);
}
.alert-info .alert-icon {
  background: var(--text);
  color: var(--surface);
}
.panel > .alert {
  margin-bottom: 16px;
}
.page-head + .alert,
.alert + .stat-grid {
  margin-bottom: 18px;
}

/* ---------- Pager ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}
.pager-info {
  font-weight: 700;
}
.pager-links {
  display: flex;
  gap: 8px;
}

/* ---------- Event detail ---------- */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 18px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2.6vw, 24px);
  margin-top: 18px;
  align-items: start;
}
.detail-main,
.detail-side {
  display: grid;
  gap: clamp(16px, 2.6vw, 24px);
  min-width: 0;
}
.detail-main > .panel + .panel,
.detail-side > .panel + .panel {
  margin-top: 0;
}
@media (min-width: 980px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }
}
.cover {
  margin: 0 0 18px;
  border-radius: var(--radius-md);
  border: 2.5px solid var(--text);
  overflow: hidden;
  aspect-ratio: 5 / 2;
  background: var(--surface);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 18px;
}
.facts dt {
  font: 800 0.72rem / 1.4 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 10px;
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.facts dd .arrow-link {
  font-size: 0.95rem;
}
@media (min-width: 560px) {
  .facts {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px 22px;
  }
  .facts dt {
    padding-top: 3px;
  }
}
.fact-line {
  display: block;
}
.fact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.description {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}
.fact-head {
  font: 800 0.72rem / 1.4 var(--font-display);
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.description-text {
  white-space: pre-line;
  max-width: 68ch;
}
.action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.date-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.date-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
}
.date-item a {
  color: var(--text);
  font-weight: 700;
}
.date-item.is-current {
  box-shadow: inset 0 0 0 2.5px var(--text);
}
.date-item.is-projected {
  box-shadow: none;
  border: 2px dashed var(--line);
  color: var(--text-muted);
  font-weight: 600;
}
.rsvp-list .staff-row {
  padding: 10px 0;
}
.rsvp-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.rsvp-pos {
  font: 800 0.85rem / 1 var(--font-display);
  color: var(--accent-text);
}
.inline-form {
  margin-top: 4px;
  gap: 14px;
}
.inline-form .field {
  max-width: 360px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.timeline li {
  position: relative;
  padding: 0 0 16px 26px;
}
.timeline li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  background: var(--accent-text);
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.7 7 17 11.3 24 12C17 12.7 12.7 17 12 24C11.3 17 7 12.7 0 12C7 11.3 11.3 7 12 0Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.7 7 17 11.3 24 12C17 12.7 12.7 17 12 24C11.3 17 7 12.7 0 12C7 11.3 11.3 7 12 0Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.timeline li::after {
  content: "";
  position: absolute;
  inset-inline-start: 6px;
  top: 22px;
  bottom: 2px;
  width: 2px;
  background: var(--line);
}
.timeline li:last-child {
  padding-bottom: 0;
}
.timeline li:last-child::after {
  display: none;
}
.tl-extra {
  font-size: 0.9rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* ---------- Settings: check setup ---------- */
.check-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
}
.check-copy {
  min-width: 0;
}
.check-title {
  font-weight: 700;
}
.check-level {
  flex: none;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  font: 800 0.68rem / 1.1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.level-ok {
  background: var(--gulf-teal);
  color: var(--sand);
}
.level-warn {
  background: var(--sun);
  color: var(--ink);
}
.level-error {
  background: var(--club-red);
  color: var(--sand);
}
.check-error {
  box-shadow: inset 0 0 0 2px var(--accent-text);
}

/* ---------- Health and audit ---------- */
.health-grid .stat {
  padding-top: 24px;
}
.code {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  max-width: 100%;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
  font: 500 0.82rem / 1.45 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.dead-list .staff-who {
  flex: 1 1 320px;
}
.health-foot {
  margin-top: 18px;
}
.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 20px;
  padding: 12px 0;
  border-top: 2px solid var(--line);
}
.audit-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.audit-when {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.audit-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.audit-what strong {
  font-weight: 800;
}
.audit-code {
  font-family: var(--font-mono);
  font-size: 0.8em;
}
.audit-extra {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
@media (min-width: 720px) {
  .audit-row {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

/* ---------- Login and error ---------- */
body.is-login .app-main,
body.is-error .app-main {
  display: grid;
  place-items: center;
}
.login-card,
.error-card {
  width: 100%;
  max-width: 560px;
  display: grid;
  gap: 18px;
  justify-items: start;
}
.login-card .page-title {
  font-size: clamp(2.2rem, 9vw, 3.6rem);
}
.login-note {
  color: var(--accent-text);
  font-size: 1.15rem;
  transform: rotate(-2deg);
}
.error-card {
  padding-block: clamp(20px, 6vw, 60px);
}
.error-code {
  font: 400 clamp(4.5rem, 20vw, 8rem) / 0.8 var(--font-scribble);
  color: var(--accent-text);
}

/* ---------- Dialogs ---------- */
.modal-confirm {
  width: min(460px, calc(100% - 32px));
}
.confirm-body {
  display: grid;
  gap: 14px;
}
.confirm-title {
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.confirm-text {
  overflow-wrap: anywhere;
}
.confirm-actions {
  justify-content: flex-end;
  margin-top: 4px;
}
.modal .form {
  gap: 18px;
}
.modal .form textarea,
.modal .form input {
  background: var(--surface);
}
.modal .btn-row {
  justify-content: flex-end;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  a.stat:hover {
    transform: none;
  }
  .toggle-track,
  .toggle-track::after {
    transition: none;
  }
}
@media (forced-colors: active) {
  .toggle-track {
    border: 2px solid CanvasText;
  }
  .badge,
  .series-tag,
  .format-tag,
  .chip {
    border: 1px solid CanvasText;
  }
}

/* keep toasts clear of the sticky save bar */
body:has(.save-bar) .toast {
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
