/* BellBoard's palette: Ringing World red on its pale olive cream, with gold rules.
   Light is the default; dark applies when chosen, or when the system prefers it
   and no explicit choice has been made. */
:root {
  --bg: #f6f8e3;
  --surface: #fdfef7;
  --surface-2: #eceed3;
  --hover: #f1f3dc;
  --text: #1e1f1a;
  --muted: #5d5e52;
  --faint: #8b8b7a;
  --line: #e1dec4;
  --gold: #ad9a62;
  --accent: #c40000;
  --accent-strong: #9e0000;
  --accent-soft: #fae0da;
  --on-accent: #fff;
  --danger: #9e0000;
  --shadow: 0 1px 2px rgb(70 60 20 / 8%);
  --radius: 10px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --topbar-h: 52px;
  --tabbar-h: 56px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #121310;
  --surface: #1a1b17;
  --surface-2: #25261f;
  --hover: #20211b;
  --text: #ecede2;
  --muted: #aeae9c;
  --faint: #7c7c6c;
  --line: #2e2f27;
  --gold: #8f8156;
  --accent: #ff6b5d;
  --accent-strong: #ff8e83;
  --accent-soft: #3a1915;
  --on-accent: #1a0806;
  --danger: #ff8e83;
  --shadow: none;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121310;
    --surface: #1a1b17;
    --surface-2: #25261f;
    --hover: #20211b;
    --text: #ecede2;
    --muted: #aeae9c;
    --faint: #7c7c6c;
    --line: #2e2f27;
    --gold: #8f8156;
    --accent: #ff6b5d;
    --accent-strong: #ff8e83;
    --accent-soft: #3a1915;
    --on-accent: #1a0806;
    --danger: #ff8e83;
    --shadow: none;
    color-scheme: dark;
  }
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 8px); }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }

svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { margin: 0; color: var(--muted); font-size: 14px; }
.fine { margin: 0; font-size: 13px; color: var(--muted); }
.fine a, .link { color: var(--accent); text-decoration: none; font-weight: 500; }
.fine a:hover { text-decoration: underline; }

/* ---------- Chrome ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 2px solid var(--gold);
}

.topbar-inner {
  max-width: 960px;
  height: var(--topbar-h);
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--accent);
}

/* The mark's shapes set their own fill/stroke, so turn off the generic icon styling. */
.brand-mark { width: 26px; height: 26px; fill: none; stroke: none; }

.tabs { display: none; gap: 2px; }

.tabs a {
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
}

.tabs a:hover { color: var(--text); background: var(--hover); }
.tabs a[aria-current] { color: var(--accent); background: var(--accent-soft); }

.topbar-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.is-disabled { opacity: 0.3; pointer-events: none; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.avatar-lg { width: 44px; height: 44px; font-size: 16px; flex: none; }

.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
}

.tabbar a {
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
}

.tabbar svg { width: 22px; height: 22px; }
.tabbar a[aria-current] { color: var(--accent); }

main { flex: 1; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); }

@media (min-width: 760px) {
  .tabs { display: flex; }
  .tabbar { display: none; }
  main { padding-bottom: 48px; }
}

/* ---------- Page layout ---------- */

.page { max-width: 760px; margin: 0 auto; padding: 12px 12px 0; }
.page-narrow { max-width: 520px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
}

.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

.section { margin-top: 20px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Performance rows ---------- */

.rows {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.row {
  display: grid;
  gap: 1px;
  padding: 8px 12px;
  text-decoration: none;
  border-top: 1px solid var(--line);
}

.row:first-child { border-top: 0; }
.row:hover { background: var(--hover); }
.row:active { background: var(--surface-2); }

.row-l1, .row-l2 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }

.row-where {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.row-where strong { font-weight: 600; }
.row-ded { color: var(--muted); }
.row-date { flex: none; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.row-l3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--muted);
}

.changes { font-variant-numeric: tabular-nums; }

.tag {
  flex: none;
  align-self: center;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

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

.day-head {
  position: sticky;
  top: calc(var(--topbar-h) + 2px + env(safe-area-inset-top));
  z-index: 5;
  margin: 0 -12px;
  padding: 12px 12px 6px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Featured ---------- */

.page-wide { max-width: 1040px; }

.feature-grid { display: grid; gap: 12px; }

@media (min-width: 900px) {
  .feature-grid { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }
}

/* The whole featured card is one link. */
.hero {
  display: block;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}

.hero:hover { border-color: var(--gold); }
.hero:hover .board-place { text-decoration: underline; text-underline-offset: 3px; }

.hero-media { display: block; background: var(--surface-2); }
.hero-media img { width: 100%; height: auto; max-height: 560px; object-fit: cover; image-orientation: from-image; }

.hero-body { display: block; padding: 14px 16px; }

.band-line { display: block; margin: 8px 0 0; font-size: 14px; line-height: 1.65; }
.band-member { white-space: nowrap; }
.band-member b { font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.band-sep { color: var(--faint); }

.hero-footnote { display: block; margin-top: 8px; font-size: 14px; }

.stats { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.stats span { display: inline-flex; align-items: center; gap: 4px; }
.stats svg { width: 15px; height: 15px; }
.stats span:first-child svg { color: var(--accent); }

/* ---------- Loading, empty and error states ---------- */

.skeleton { display: grid; gap: 6px; padding: 10px 12px; }

.skeleton i {
  display: block;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton i:nth-child(1) { width: 55%; height: 12px; }
.skeleton i:nth-child(2) { width: 40%; }
.skeleton i:nth-child(3) { width: 70%; }

.hero-skeleton { min-height: 150px; align-content: end; padding: 14px; }

@keyframes shimmer { to { background-position: -200% 0; } }

.load-more { display: flex; justify-content: center; padding: 14px 0 4px; min-height: 32px; }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-color: currentColor; border-top-color: transparent; }

@keyframes spin { to { transform: rotate(360deg); } }

.end-mark { font-size: 12px; color: var(--faint); }

.notice {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.notice p { margin: 0; }
.notice-error strong { color: var(--danger); }
.notice .btn { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition: none !important; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover { background: var(--hover); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* ---------- Forms ---------- */

input:not([type]), input[type='search'], input[type='date'], input[type='text'],
input[type='email'], input[type='password'], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 16px; /* stops iOS zooming on focus */
  appearance: none;
  -webkit-appearance: none;
}

textarea { resize: vertical; line-height: 1.4; }

select {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b7a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.fields { display: grid; gap: 10px; }

@media (min-width: 560px) {
  .fields { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: 1 / -1; }
}

.field { display: grid; gap: 3px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; color: var(--faint); }

.field-check { display: flex; align-items: center; gap: 8px; min-height: 40px; align-self: end; cursor: pointer; }
.field-check > span { font-size: 14px; font-weight: 500; color: var(--text); }
.field-check input { width: 18px; height: 18px; accent-color: var(--accent); }

.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.form-panel { display: grid; gap: 12px; padding: 14px; }

.form-error, .form-warning { padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.form-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.form-warning { background: var(--accent-soft); color: var(--accent-strong); }
.form-error p, .form-warning p { margin: 0; }
.form-error p + p, .form-warning p + p { margin-top: 4px; }
.submit-form > .form-error { margin-top: 10px; }

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
}

.segmented button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.segmented button svg { width: 16px; height: 16px; }
.segmented button[aria-checked='true'] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); }

/* Autocomplete. The input is wrapped so the list can sit directly under it. */
.has-suggest { position: relative; }

.suggest {
  position: absolute;
  z-index: 30;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  max-height: 280px;
  margin: 0;
  padding: 3px;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 14%);
}

.suggest:empty { display: none; }
.suggest li { padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.suggest li small { display: block; color: var(--muted); font-size: 12px; }
.suggest li:hover, .suggest li[aria-selected='true'] { background: var(--accent-soft); }

/* ---------- Browse ---------- */

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 4px;
}

.toolbar select { min-height: 34px; padding: 4px 26px 4px 9px; font-size: 13.5px; background-position: right 6px center; }
.week-nav { grid-column: 1 / -1; }

.week-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.week-nav .icon-btn { width: 32px; height: 30px; }

.week-label {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 30px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.week-label:hover { background: var(--hover); }

/* The native date input sits invisibly over the label so tapping opens the picker. */
.week-label input { position: absolute; inset: 0; opacity: 0; min-height: 0; cursor: pointer; }

@media (min-width: 640px) {
  .toolbar { grid-template-columns: minmax(220px, auto) repeat(3, minmax(0, 1fr)); }
  .week-nav { grid-column: auto; }
  .toolbar:not(:has(.week-nav)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Search ---------- */

.search-panel { margin-bottom: 10px; }

.search-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 12px; }
.search-summary + .search-form:not([hidden]) { border-top: 1px solid var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; font-weight: 500; }

.search-form { padding: 12px; }

.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn .btn { min-height: 40px; }

.advanced { margin-top: 12px; border-top: 1px solid var(--line); }

.advanced summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}

.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: '+'; display: inline-grid; place-items: center; width: 16px; font-weight: 700; }
.advanced[open] summary::before { content: '\2212'; }

.checks { display: grid; margin-top: 6px; }

@media (min-width: 560px) {
  .checks { grid-template-columns: 1fr 1fr; column-gap: 12px; }
}

.checks .field-check { min-height: 34px; }

/* Two fields per row even on phones, to keep the form short. */
.search-form .fields { grid-template-columns: 1fr 1fr; }
.search-form .field-wide { grid-column: 1 / -1; }

/* ---------- Account ---------- */

.profile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.profile-text { flex: 1; display: grid; min-width: 0; }
.profile-text small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }

.link-list { display: grid; margin-top: 10px; overflow: hidden; }

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  border-top: 1px solid var(--line);
}

.link-list a:first-child { border-top: 0; }
.link-list a:hover { background: var(--hover); }
.link-list svg { width: 15px; height: 15px; color: var(--faint); }

.panel > .segmented { margin: 10px; }


/* ---------- Submit ---------- */

.form-card { display: grid; gap: 10px; padding: 12px 14px; }
.form-card + .form-card, .segmented + .form-card { margin-top: 10px; }

.card-title { font-size: 15px; font-weight: 600; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.stepper { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.stepper strong { color: var(--text); font-variant-numeric: tabular-nums; }
.stepper .btn { width: 32px; min-height: 32px; padding: 0; font-size: 18px; }

.ringer-rows { display: grid; gap: 6px; }

@media (min-width: 640px) {
  .ringer-rows { grid-template-columns: 1fr 1fr; column-gap: 12px; }
}

.ringer-row { display: flex; align-items: center; gap: 8px; }
.ringer-row .has-suggest, .ringer-row > input { flex: 1; min-width: 0; }
.ringer-row .bell-no { min-width: 30px; }
.ringer-row input { min-height: 36px; }

.cond-toggle {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px dashed var(--line);
  background: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
  cursor: pointer;
}

.cond-toggle[aria-pressed='true'] { border: 0; background: var(--accent); color: var(--on-accent); }

.cond-toggle.is-inline {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 10px;
  vertical-align: middle;
  border-style: solid;
}

.submit-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.submit-form .submit-bar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 6px);
  z-index: 10;
  padding: 6px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (min-width: 760px) {
  .submit-form .submit-bar { bottom: 12px; }
}

.submit-bar-center { justify-content: center; flex-wrap: wrap; }

.preview-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.eyebrow { font-size: 12.5px; color: var(--muted); }
.eyebrow-accent { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11.5px; }
.eyebrow-accent svg { width: 14px; height: 14px; }
.preview-card .perf-place { font-size: 20px; font-weight: 700; }
.perf-dedication, .preview-when, .perf-composer, .perf-details { margin: 0; color: var(--muted); font-size: 14px; }
.preview-card .ringers { margin: 8px 0 4px; }
.preview-card .footnotes { margin-top: 6px; }

.success-card { padding: 32px 16px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.success-card h1 { margin: 10px 0 2px; font-size: 22px; }
.success-card p { margin: 0; color: var(--muted); }

.success-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.success-icon svg { width: 26px; height: 26px; }

/* ---------- Performance ---------- */

.perf-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: -6px;
  padding: 4px 8px 4px 2px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.back:hover { background: var(--hover); color: var(--text); }
.perf-actions { display: flex; gap: 6px; }

/* The performance itself, laid out like BellBoard's peal-board display.
   Shared by the performance page and the featured card. */
.board {
  display: grid;
  gap: 1px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.board a { text-decoration: none; }
.board a:hover { text-decoration: underline; text-underline-offset: 2px; }

.board-assoc, .board-place, .board-line, .board-title { display: block; }
.board-assoc { font-weight: 700; }
.board-place { margin: 2px 0 0; font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.board-county { font-size: 15px; font-weight: 400; color: var(--muted); }
.board-title { margin: 3px 0 1px; font-size: 16px; font-weight: 700; color: var(--accent); }

.board-ringers { list-style: none; margin: 8px 0 2px; padding: 0; }
.board-ringers li { display: flex; align-items: baseline; gap: 10px; padding: 1px 0; }
.board-ringers .bell-no { min-width: 22px; text-align: right; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.board-ringers.is-hand .bell-no { min-width: 40px; }

.board-footnote { margin: 8px 0 0; }
.board-footnote a { color: var(--accent); overflow-wrap: anywhere; }
.board .stats { margin-top: 10px; }

.photos { display: grid; gap: 10px; margin-bottom: 12px; }
.photos figure { margin: 0; }
.photos figcaption { margin-top: 4px; font-size: 13px; color: var(--muted); }

.photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
}

.photo img { width: 100%; height: auto; max-height: 75vh; object-fit: contain; image-orientation: from-image; }

/* Submit's preview shows the band with these. */
.ringers { list-style: none; margin: 0; padding: 0; display: grid; }
.ringers li { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 14.5px; }

.bell-no { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 22px; }
.is-hand .bell-no { min-width: 40px; }

.ringer { text-decoration: none; }
.ringer:hover { color: var(--accent); }

.cond {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 700;
}

.perf-title { margin: 6px 0 0; font-size: 17px; font-weight: 600; color: var(--accent); }

.footnotes { padding: 2px 0 2px 12px; border-left: 2px solid var(--gold); font-size: 14.5px; }
.footnotes p { margin: 0 0 6px; }
.footnotes p:last-child { margin: 0; }


.lightbox {
  max-width: min(96vw, 1100px);
  max-height: 94dvh;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #000;
  color: #eee;
  overflow: hidden;
}

.lightbox::backdrop { background: rgb(0 0 0 / 82%); }
.lightbox img { max-height: calc(94dvh - 48px); margin: 0 auto; object-fit: contain; image-orientation: from-image; }
.lightbox p { margin: 0; padding: 10px 14px; font-size: 13px; }
.lightbox-close { position: absolute; top: 6px; right: 6px; background: rgb(0 0 0 / 55%); color: #fff; }
