/* ══════════════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════════════ */

/* Upcoming events / rehearsals summary list */
.events-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.events-summary-list li + li {
  margin-top: 0;
  border-top: 0.5px solid var(--color-border-light);
}

.events-summary-list a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0;
  text-decoration: none;
  color: inherit;
}

.events-summary-list a:hover .events-summary-name {
  color: #60606a;
}

.events-summary-name {
  font-weight: 600;
  color: var(--color-dark);
}

.events-summary-name .badge {
  margin-left: 0.33rem;
  position: relative;
  bottom: 0.1rem;
}

.events-summary-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.events-summary-date,
.events-summary-venue,
.events-summary-city {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.events-summary-empty {
  margin: 0;
  color: var(--color-faint);
  font-size: 0.9rem;
}

.summary-footer {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  border-top: 0.5px solid var(--color-border-light);
  padding-top: 0.6rem;
}

.session-info {
  font-size: 0.75rem;
  text-align: center;
  color: #606069;
  opacity: 0;
  transition: opacity 0.25s;
}

.session-info--visible {
  opacity: 1;
}

/* Passkey setup prompt card */
.passkey-setup-card {
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--color-dark);
}

.passkey-setup-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.passkey-setup-card__text h2 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.passkey-setup-card__text p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.passkey-setup-card__actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════
   EVENTS
   ══════════════════════════════════════════════════════════════════════ */

/* Event notice sent confirmation */
.event-notice-sent {
  color: #27ae60;
  font-size: 0.95rem;
  margin: 0;
}

/* RSVP reminder form */
.request-reminder {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.request-reminder__label {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0 0 0.5rem;
}

.request-reminder__form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.request-reminder__form .input {
  flex: 1;
}

/* Attendee responses list */
.responses-instrument-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  margin: 1.25rem 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 0.5px solid var(--color-border-mid);
}

.responses-instrument-heading:first-child {
  margin-top: 0;
}

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

.responses-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 0.5px solid #f0f0f0;
  font-size: 0.9rem;
}

.responses-list__item:last-child {
  border-bottom: none;
}

.responses-list__name {
  flex: 1;
  color: var(--color-dark);
}

.responses-list__attendance {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #f0f0f4;
  color: var(--color-muted);
  width: 6.75em;
}

.responses-list__attendance--yes   { background: var(--color-success-bg); color: #166135; }
.responses-list__attendance--no    { background: var(--color-error-bg);   color: var(--color-error); }
.responses-list__attendance--maybe { background: #fffbf0; color: #d68910; }

.attendance-summary-table {
  margin-bottom: 1.5rem;
}

/* Attendance view tab switcher (Summary / Detail) */
.attendance-view-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

/* Instrument-by-attendance summary table */
.attendance-instrument-table th,
.attendance-instrument-table td {
  padding: 0.45rem 0.75rem;
}

.attendance-instrument-table th:first-child,
.attendance-instrument-table td:first-child {
  text-align: left;
}

.attendance-instrument-table th.attendance-instrument-table__cell,
.attendance-instrument-table td.attendance-instrument-table__cell {
  text-align: right;
  width: 5.5rem;
}

@media (max-width: 767px) {
  .attendance-instrument-table th,
  .attendance-instrument-table td {
    padding: 0.4rem 0.4rem;
  }
  .attendance-instrument-table th.attendance-instrument-table__cell,
  .attendance-instrument-table td.attendance-instrument-table__cell {
    width: 3.25rem;
  }
}

@media (max-width: 599px) {
  .attendance-instrument-table th,
  .attendance-instrument-table td {
    padding: 0.35rem 0.25rem;
  }
  .attendance-instrument-table th.attendance-instrument-table__cell,
  .attendance-instrument-table td.attendance-instrument-table__cell {
    width: 2.5rem;
  }
  .attendance-instrument-table--no-maybe .attendance-instrument-table__cell--maybe,
  .attendance-summary-table--no-maybe .attendance-summary-table__cell--maybe {
    display: none;
  }
}

.attendance-instrument-table__cell--yes   { color: #166135; }
.attendance-instrument-table__cell--no    { color: var(--color-error); }
.attendance-instrument-table__cell--maybe { color: #d68910; }

.attendance-instrument-table thead th {
  border-bottom: 0.5px solid var(--color-muted);
}

.attendance-instrument-table__total-row td {
  border-top: 0.5px solid var(--color-muted);
  font-weight: 600;
}

/* Response notification overlay */
.response-notification {
  position: fixed;
  top: calc(80px + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(25rem, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  z-index: 150;
  animation: response-notification-in 0.2s ease-out;
}

@keyframes response-notification-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-0.5rem); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.response-notification__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.response-notification__title {
  font-weight: 600;
  font-size: 0.9rem;
}

.response-notification__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

.response-notification__close:hover {
  color: var(--text-color);
}

.response-notification__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.response-notification__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.response-notification__item:last-child {
  border-bottom: none;
}

.response-notification__badge--yes         { background: var(--color-success-bg); color: #166135; }
.response-notification__badge--no          { background: var(--color-error-bg);   color: var(--color-error); }
.response-notification__badge--maybe       { background: #fffbf0; color: #d68910; }
.response-notification__badge--no_response { background: #f3f4f6; color: var(--color-muted); }

.attendance-summary-table th.attendance-summary-table__cell,
.attendance-summary-table td.attendance-summary-table__cell {
  text-align: center;
  width: 25%;
}

.attendance-summary-table__cell--yes   { color: #166135; font-weight: 600; }
.attendance-summary-table__cell--no    { color: var(--color-error); font-weight: 600; }
.attendance-summary-table__cell--maybe { color: #d68910; font-weight: 600; }

.attendance-summary-table__no-response-short { display: none; }
.attendance-summary-table__maybe-short { display: none; }

@media (max-width: 767px) {
  .attendance-summary-table__no-response-full  { display: none; }
  .attendance-summary-table__no-response-short { display: inline; }
  .attendance-summary-table__maybe-full  { display: none; }
  .attendance-summary-table__maybe-short { display: inline; }
}

@media (max-width: 399px) {
  .attendance-instrument-table__cell--maybe,
  .attendance-instrument-table__cell--no-response,
  .attendance-summary-table__cell--maybe,
  .attendance-summary-table__cell--no-response {
    display: none;
  }
}

.responses-list__edit {
  font-size: 0.8rem;
  color: #933;
}

/* Invite guests page */
.invite-guests__subtitle {
  color: var(--color-muted);
  margin: -0.5rem 0 1.25rem;
}

.invite-guests__filters {
  display: flex;
  gap: 0.35rem;
}

.invite-guests__list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.invite-guests__item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.invite-guests__item:last-child {
  border-bottom: none;
}

.invite-guests__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
}

.invite-guests__name {
  font-weight: 600;
}

.invite-guests__instruments {
  font-size: 0.875rem;
  color: var(--color-muted);
  flex: 1;
}

/* Communication log (event show page) */
.communications-actions {
  width: 20rem;
  max-width: 100%;
  margin-inline: auto;
}

.communications-actions form,
.communications-actions .btn {
  width: 100%;
  justify-content: center;
}

.welcome-email-dismiss {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.welcome-email-dismiss:hover {
  text-decoration: underline;
}

.communication-log {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.75rem;
}

.communication-log__entry {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.2rem 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.communication-log__action {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

/* Custom question answer table (event response show) */
.response-answers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.response-answers-table th {
  text-align: left;
  font-weight: 600;
  color: var(--color-muted);
  padding: 0.4rem 0.75rem 0.4rem 0;
  border-bottom: 0.5px solid var(--color-border-mid);
}

.response-answers-table td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 0.5px solid var(--color-border-light);
  color: var(--color-dark);
  vertical-align: top;
}

.response-answers-table tbody tr:last-child td {
  border-bottom: none;
}

.response-answers-table td:first-child {
  white-space: nowrap;
  width: 12rem;
}

@media (max-width: 480px) {
  .response-answers-table td:first-child {
    width: auto;
    white-space: normal;
  }

  .response-answers-table {
    font-size: 0.8rem;
  }
}

.response-answers-table__long-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.response-answers-table__long-text p {
  margin: 0 0 0.5em;
}

.response-answers-table__long-text p:last-child {
  margin-bottom: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   MUSICIANS
   ══════════════════════════════════════════════════════════════════════ */

/* Instrument chips on musician cards */
.card-instruments {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
}

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

/* Instrument nested form rows */
.instrument-row {
  display: grid;
  grid-template-columns: 1fr 4rem 5rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 0.5px solid var(--color-border-light);
}

@media (max-width: 480px) {
  .instrument-row {
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
  }
}

.instrument-row--header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  padding-bottom: 0.4rem;
}

.instrument-row--header span:nth-child(2) {
  text-align: center;
}

.instrument-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0 auto;
  display: block;
  cursor: pointer;
}

.instrument-add {
  margin-top: 0.75rem;
}

/* ══════════════════════════════════════════════════════════════════════
   CALENDAR FEED / SUBSCRIBE ACCORDION
   ══════════════════════════════════════════════════════════════════════ */

/* Outer subscribe-to-calendar accordion on the home page */
.cal-subscribe {
  margin-bottom: 1.5rem;
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-light);
}

.cal-subscribe__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-mid);
  cursor: pointer;
  user-select: none;
}

.cal-subscribe__summary::-webkit-details-marker { display: none; }

.cal-subscribe__summary svg {
  flex-shrink: 0;
  transition: transform var(--duration);
}

.cal-subscribe[open] .cal-subscribe__summary svg {
  transform: rotate(180deg);
}

.cal-subscribe__body {
  padding: 0 1rem 1rem;
  border-top: 0.5px solid var(--color-border-light);
}

.calendar-feed-card__intro {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.calendar-feed-url {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-light-silver);
  border: 0.5px solid var(--color-border-mid);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  margin-bottom: 1.25rem;
}

.calendar-feed-url__text {
  flex: 1;
  font-family: monospace;
  font-size: 0.8rem;
  word-break: break-all;
  color: #333;
  background: none;
  padding: 0;
}

.calendar-feed-instructions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.calendar-feed-platform {
  border: 0.5px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-feed-platform[open] {
  border-color: var(--color-border-mid);
}

.calendar-feed-platform__name {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: var(--color-light-silver);
}

.calendar-feed-platform__name::-webkit-details-marker { display: none; }

.calendar-feed-platform__name svg {
  flex-shrink: 0;
  transition: transform var(--duration);
}

.calendar-feed-platform[open] .calendar-feed-platform__name svg {
  transform: rotate(180deg);
}

.calendar-feed-platform__steps {
  margin: 0;
  padding: 0.75rem 1rem 0.75rem 2rem;
  font-size: 0.875rem;
  line-height: 1.6;
  border-top: 0.5px solid var(--color-border-light);
}

.calendar-feed-platform__steps li + li {
  margin-top: 0.25rem;
}

.calendar-feed-platform__tip {
  margin: 0.5rem 1rem 0.75rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.calendar-feed-webcal-link {
  color: #4a6fa5;
}

.calendar-feed-card__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--color-border-light);
  flex-wrap: wrap;
}

.calendar-feed-card__footer-note {
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* ══════════════════════════════════════════════════════════════════════
   REHEARSALS
   ══════════════════════════════════════════════════════════════════════ */

/* Generate rehearsals confirm actions (series form) */
.generate-confirm-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════════════════
   MUSIC LIBRARY / CONDUCTOR'S NOTES
   ══════════════════════════════════════════════════════════════════════ */

/* Library search (public library page) */
.library-search {
  margin-bottom: 1.5rem;
}

.search-results-meta {
  margin-bottom: 1rem;
  color: var(--color-muted);
}

.search-clear-link {
  margin-left: 0.5rem;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.9em;
}

.search-clear-link:hover {
  color: var(--color-dark);
  text-decoration: underline;
}

/* Library title list */
.library-title-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.library-title-card {
  padding: 1rem 1.25rem;
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color var(--duration), box-shadow var(--duration);
}

.library-title-card:hover {
  border-color: var(--color-mid);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.library-title-card__name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-dark);
}

.library-title-card__meta {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.2rem;
}

/* Admin titles table / mobile card toggle */
.titles-card-list {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 860px) {
  .titles-table     { display: none; }
  .titles-card-list { display: block; }
}

/* Title work list (library show page) */
.title-work-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.title-work-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 0.5px solid #e8e5e2;
}

.title-work-row:last-child {
  border-bottom: none;
}

.title-work-row__duration {
  color: #70707a;
  font-size: 0.9em;
  white-space: nowrap;
}

/* Musical symbol toolbar (conductor notes editor) */
.musical-symbol-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
  padding: 0.5rem 0.75rem;
  background: var(--color-light-silver);
  border: 1px solid var(--color-border-mid);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-sizing: border-box;
  width: 100%;
}

.musical-symbol-toolbar__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  margin-right: 0.25rem;
}

.musical-symbol-btn {
  font-family: var(--font-music);
  font-size: 1.1rem;
  line-height: 0;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.musical-symbol-btn:hover {
  background: #e8e8ec;
  border-color: #999;
}

.sym-shift-flat,
.sym-shift-note,
.sym-shift-eighth {
  display: inline-block;
}

.sym-shift-flat   { transform: translateY(0.1em); }
.sym-shift-note   { transform: translateY(0.3em); }
.sym-shift-eighth { transform: translateY(0.3em); }

/* Trix toolbar customisation */
trix-toolbar .trix-button--icon-strike,
trix-toolbar .trix-button--icon-attach {
  display: none;
}

/* Shrink icon buttons by 20% */
trix-toolbar .trix-button--icon {
  width: 2.08em;   /* 2.6em × 0.8 */
  height: 1.28em;  /* 1.6em × 0.8 */
  max-width: calc(0.64em + 3.2vw);
}

/* Allow the toolbar row to wrap instead of scrolling */
trix-toolbar .trix-button-row {
  flex-wrap: wrap;
}

/* Trix editor sizing */
trix-editor.conductor-notes-editor {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: calc(5 * 1.6em + 0.8em);  /* 5 lines + padding */
  max-height: calc(12 * 1.6em + 0.8em); /* 12 lines before scroll */
  overflow-x: hidden;
  overflow-y: auto;
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 1rem;
  line-height: 1.6;
  font-family: var(--font-sans);
}

/* Conductor notes display (show page + public library) */
.conductor-notes__meta {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

/* Musical symbols in notes body — Bravura covers SMuFL codepoints */
.conductor-notes__body {
  line-height: 1.7;
  font-family: "Open Sans", "Bravura", "Noto Music", "FreeSerif", sans-serif;
}

.conductor-notes__body h1,
.conductor-notes__body h2 {
  margin-top: 1.25rem;
}

/* Conductor notes image gallery */
.conductor-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.conductor-image {
  border: 1px solid var(--color-border-mid);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 100%;
}

.conductor-image__img {
  display: block;
  max-width: 100%;
  max-height: 28rem;
  object-fit: contain;
}

/* Version history */
.version-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-light);
  gap: 1rem;
}

.version-item:last-child {
  border-bottom: none;
}

.version-item__meta {
  font-size: 0.9rem;
  color: #444;
}

.version-item__actions {
  display: flex;
  gap: 1rem;
  white-space: nowrap;
  font-size: 0.9rem;
}

.version-item__badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1a6b3c;
  background: #e6f4ec;
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.4rem;
  margin-left: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════════════
   PROGRAMS
   ══════════════════════════════════════════════════════════════════════ */

/* Admin program title ordering (drag-and-drop list) */
.program-title-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.program-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.program-title-row:last-child {
  border-bottom: none;
}

.program-title-row__position {
  font-size: 0.85rem;
  color: var(--color-faint);
  min-width: 1.5rem;
  text-align: right;
}

.program-title-row__name {
  flex: 1;
  font-weight: 600;
}

.program-title-list--plain .program-title-row__name {
  font-weight: normal;
}

@media (max-width: 1023px) {
  .program-title-row__meta { display: none; }
}

.program-title-row__meta {
  font-size: 0.85rem;
  color: #666;
}

.program-title-row__actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.program-title-row__actions form {
  display: contents;
}

/* Add title section */
.program-add-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

.program-add-section h3 {
  margin: 0 0 0.75rem;
}

.program-add-section .add-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.program-add-section .add-form .input {
  flex: 1;
  margin: 0;
}

/* Public program landing page */
.program-title-entry {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.program-title-entry:last-child {
  border-bottom: none;
}

.program-title-entry__num {
  font-size: 0.85rem;
  color: var(--color-faint);
  min-width: 1.5rem;
}

.program-title-entry__name {
  font-weight: 600;
  flex: 1;
}

.program-title-entry__meta {
  font-size: 0.85rem;
  color: #666;
}

.program-pdf-section {
  margin-bottom: 1.5rem;
}

/* ══════════════════════════════════════════════════════════════════════
   ADMIN — COMPOSERS
   ══════════════════════════════════════════════════════════════════════ */

/* Composer / arranger search widget */
.composer-search-wrap {
  position: relative;
}

.composer-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 14rem;
  overflow-y: auto;
}

.composer-results li {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.composer-results li:hover {
  background: #f0f0f5;
}

.composer-results__meta {
  font-size: 0.8rem;
  color: var(--color-faint);
}

.composer-results__add-new {
  border-top: 1px solid var(--color-border-light);
  color: #4a6fa5;
  font-size: 0.9rem;
}

.composer-results__add-new:hover {
  background: #eef2fa;
}

/* Selected composer chips */
.composer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  min-height: 0;
}

.composer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  background: #e8eef7;
  border: 1px solid #c0cfe8;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: #2c4a7c;
}

.composer-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #7a95c2;
  padding: 0 0 0 0.1rem;
}

.composer-chip__remove:hover {
  color: #c00;
}

/* Single-composer selected state */
.composer-selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--radius-md);
  background: #f9f9fb;
  font-size: 0.95rem;
}

.composer-selected__change {
  margin-left: auto;
  font-size: 0.8rem;
  color: #4a6fa5;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* Inline new composer form */
.composer-new-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.composer-new-inline .input {
  flex: 1;
}

.composer-new-inline__cancel {
  font-size: 0.8rem;
  color: var(--color-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.25rem;
  white-space: nowrap;
  text-decoration: underline;
}

/* Composer birth/death year fields */
.composer-years {
  display: flex;
  gap: 1.5rem;
}

.composer-years .field {
  flex: 1;
}

/* ══════════════════════════════════════════════════════════════════════
   ADMIN — USERS
   ══════════════════════════════════════════════════════════════════════ */

/* Permission toggle rows */
.permission-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 0.5px solid var(--color-border-light);
}

.permission-row:last-child {
  border-bottom: none;
}

.permission-row__checkbox {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.permission-row__checkbox--locked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.8rem;
  color: #aaa;
}

.permission-row__label {
  font-size: 0.9rem;
  color: var(--color-dark);
}

.permission-row__label--locked {
  color: #aaa;
}

.permission-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.permission-row__checkbox-wrap {
  display: contents;
}

.permission-row__implied-check {
  font-size: 0.9rem;
  line-height: 1;
}

.user-permission-cell {
  text-align: left;
  color: #27ae60;
  font-weight: 600;
}

td.user-permission-cell--implied,
.detail-list dd.permission--implied {
  color: #aaa;
}

/* Users table: desktop-only / mobile card toggle */
.users-table--desktop {
  display: table;
  table-layout: auto;
}

/* Name and email columns: never wrap, size to content */
.users-table--desktop td:nth-child(1),
.users-table--desktop td:nth-child(2) {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

/* Permission columns: shrink to minimum; headers must not wrap */
.users-table--desktop th:nth-child(n+3) {
  white-space: nowrap;
  width: 1px;
}

.users-table--desktop td:nth-child(n+3) {
  width: 1px;
}

.users-card-list--mobile {
  display: none;
}

@media (max-width: 1023px) {
  .users-table--desktop    { display: none; }
  .users-card-list--mobile { display: block; }
}

/* Mobile user card */
a.user-card {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration), box-shadow var(--duration);
}

a.user-card:hover {
  border-color: var(--color-mid);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.5rem;
}

.user-card__name {
  font-weight: 600;
  font-size: 1rem;
}

.user-card__email {
  font-size: 0.875rem;
  color: #666;
}

.user-card__permissions {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.user-card__permissions li {
  background: #eef7f1;
  color: #1a7a3a;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.15rem 0.5rem;
}

.user-card__permissions li + li {
  margin-top: 0;
}

.user-card__no-permissions {
  font-size: 0.875rem;
  color: #aaa;
  margin: 0 0 0.5rem;
}

.user-card__actions {
  margin-top: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════════════
   ADMIN — VENUES
   ══════════════════════════════════════════════════════════════════════ */

/* Venues table: desktop-only / mobile card toggle */
.venues-table--desktop {
  display: table;
}

.venues-card-list--mobile {
  display: none;
}

/* col 4 = State: just wide enough for the header + padding */
.venues-table--desktop th:nth-child(4),
.venues-table--desktop td:nth-child(4) {
  width: 4rem;
}

/* col 5 = ZIP: wide enough for ~12 characters */
.venues-table--desktop th:nth-child(5),
.venues-table--desktop td:nth-child(5) {
  width: 7rem;
}

@media (max-width: 767px) {
  .venues-table--desktop    { display: none; }
  .venues-card-list--mobile { display: block; }
}

/* Mobile venue card */
a.venue-card {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration), box-shadow var(--duration);
}

a.venue-card:hover {
  border-color: var(--color-mid);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.venue-card__name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.venue-card__address {
  font-size: 0.875rem;
  color: #666;
}

/* Custom questions nested form (event form) */
.custom-question-row {
  border: 0.5px solid var(--color-border-mid);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #fafafc;
}

.custom-question-row__fields {
  display: grid;
  grid-template-columns: 1fr 10rem;
  gap: 0.75rem;
  align-items: start;
}

@media (max-width: 480px) {
  .custom-question-row__fields {
    grid-template-columns: 1fr;
  }
}

.custom-question-row__remove {
  margin-top: 0.75rem;
  text-align: right;
}

.custom-question-choices {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 0.5px solid var(--color-border-mid);
}

.custom-question-choices__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.choice-row .input {
  margin: 0;
}

.custom-question-choices__add {
  margin-top: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════════════
   ADMIN — EMAIL
   ══════════════════════════════════════════════════════════════════════ */

/*
 * Consolidated responsive table/card toggle (639px breakpoint).
 * All three email sections (complaints, bounces, deliveries) share
 * the same pattern, so they're grouped here to avoid repetition.
 */
.email-complaints-table--desktop,
.email-bounces-table--desktop,
.email-deliveries-table--desktop {
  display: table;
}

.email-complaints-list--mobile,
.email-bounces-list--mobile,
.email-deliveries-list--mobile {
  display: none;
}

@media (max-width: 639px) {
  .email-complaints-table--desktop,
  .email-bounces-table--desktop,
  .email-deliveries-table--desktop {
    display: none;
  }

  .email-complaints-list--mobile,
  .email-bounces-list--mobile,
  .email-deliveries-list--mobile {
    display: block;
  }
}

.email-delivery-card {
  cursor: pointer;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.email-delivery-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.email-delivery-card__recipient {
  font-weight: 600;
  font-size: 0.95rem;
}

.email-delivery-card__date {
  font-size: 0.85rem;
  color: #666;
}

.email-delivery-card__detail {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
}

/* ══════════════════════════════════════════════════════════════════════
   ACCOUNT / PASSKEY
   ══════════════════════════════════════════════════════════════════════ */

/* Passkey setup re-authentication notice (account page) */
.passkey-reauth-notice {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.passkey-reauth-link {
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════════
   HOMEPAGE CALENDAR
   ══════════════════════════════════════════════════════════════════════ */

.cal-wrapper {
  margin-bottom: 1.75rem;
}

/* Navigation bar: ‹  Month YYYY  › */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.cal-nav-title {
  flex: 1;
  text-align: center;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-dark);
  /* Reset the h2 defaults that add uppercase and letter-spacing */
  text-transform: none;
  letter-spacing: 0;
}

.cal-nav-btn {
  flex-shrink: 0;
  font-size: 1.75rem;
  line-height: 1;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0 0 0.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Colour legend */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Outer border / clip container */
.cal-grid-container {
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ── Grid rendered by Stimulus ─────────────────────────────────────── */

.cal-grid {
  width: 100%;
}

/* Row of day-of-week headers */
.cal-day-headers {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #f5f5f8;
  border-bottom: 0.5px solid var(--color-border);
}

.cal-day-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-muted);
  padding: 0.3rem 0.05rem;
  user-select: none;
}

/* Single-letter labels by default; switch to abbreviated at wider sizes */
.cal-dh-full { display: none; }
.cal-dh-min  { display: inline; }

@media (min-width: 380px) {
  .cal-dh-min  { display: none; }
  .cal-dh-full { display: inline; }
}

/* Grid of day cells */
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-day {
  box-sizing: border-box;
  min-width: 0;
  min-height: 3.3rem;
  padding: 0.2rem 0.1rem 0.1rem;
  border-right: 0.5px solid var(--color-border-light);
  border-bottom: 0.5px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  cursor: default;
  outline-offset: -2px; /* keep focus ring inside cell */
}

/* Suppress the right border on every 7th cell (last column) */
.cal-day:nth-child(7n) {
  border-right: none;
}

.cal-day--has-items {
  cursor: pointer;
}

.cal-day--has-items:hover,
.cal-day--has-items:focus-visible {
  background: #f0f0f7;
}

.cal-day--other-month {
  background: var(--color-light-silver);
}

.cal-day--past {
  background: var(--color-light-silver);
}

.cal-day--other-month .cal-day-num {
  color: #ccc;
}

.cal-day--outside-range {
  background: var(--color-light-silver);
}

.cal-day--outside-range .cal-day-num {
  color: #ddd;
}

/* Today: border on cell, filled circle around the day number */
.cal-day--today {
  box-shadow: inset 0 0 0 1px var(--color-dark);
  border-radius: 3%;
}

.cal-day--today .cal-day-num {
  background: var(--color-dark);
  color: #fff;
  border-radius: 10%;
  width:  1.5em;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cal-day--selected {
  background: #eff6ff;
}

.cal-day--selected .cal-day-num {
  color: #1d4ed8;
}

.cal-day--today.cal-day--selected .cal-day-num {
  background: #1d4ed8;
  color: #fff;
}

.cal-day-num {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-dark);
  min-width: 1.5em;
  line-height: 1.5em;
  text-align: center;
}

/* Event / rehearsal items — dot row on small screens, named chips on large */
.cal-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1px;
  max-width: 100%;
}

/* At small sizes each item is just its dot */
.cal-item {
  display: flex;
  align-items: center;
}

/* Name hidden until ≥1024 px */
.cal-item-name {
  display: none;
}

.cal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-dot--rehearsal              { background: #3b82f6; }
.cal-dot--rehearsal-canceled    { background: #dc2626; }
.cal-dot--rehearsal-completed   { background: #9ca3af; }
.cal-dot--rehearsal-no_rehearsal { background: #d97706; }
.cal-dot--event                { background: #059669; } /* fallback */
.cal-dot--event-firm           { background: #059669; }
.cal-dot--event-tentative      { background: #d97706; }
.cal-dot--event-canceled       { background: #dc2626; }
.cal-dot--event-past           { background: #9ca3af; }

/* ── Large-screen calendar: named chips inside day cells ────────────── */

/* Narrow (column) variant: wrapping chips between 1024px and 2047px */
@media (min-width: 1024px) and (max-width: 2047px) {
  .cal-wrapper--narrow .cal-item {
    overflow: hidden;
  }

  .cal-wrapper--narrow .cal-item-name {
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
  }
}

@media (min-width: 1024px) {
  /* Taller cells with top-aligned content */
  .cal-day {
    min-height: 5rem;
    align-items: flex-start;
    padding: 0.25rem 0.2rem 0.15rem;
    gap: 0.2rem;
  }

  /* Stack items vertically, full width */
  .cal-items {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    gap: 1px;
  }

  /* Chip: hide the dot (background colour replaces it) and show the name */
  .cal-item {
    border-radius: 2px;
    padding: 1px 3px;
    overflow: hidden;
    min-width: 0;
  }

  .cal-item .cal-dot {
    display: none;
  }

  .cal-item-name {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    line-height: 1.4;
  }

  /* Chip background / text colours by type */
  .cal-item--rehearsal                { background: #eff6ff; color: #1e40af; }
  .cal-item--rehearsal-canceled       { background: #fee2e2; color: #991b1b; }
  .cal-item--rehearsal-completed      { background: #f3f4f6; color: #6b7280; }
  .cal-item--rehearsal-no_rehearsal   { background: #fef3c7; color: #92400e; }
  .cal-item--event-firm,
  .cal-item--event                    { background: #d1fae5; color: #065f46; }
  .cal-item--event-tentative          { background: #fef3c7; color: #92400e; }
  .cal-item--event-canceled           { background: #fee2e2; color: #991b1b; }
  .cal-item--event-past               { background: #f3f4f6; color: #6b7280; }
}

/* ── Calendar card action buttons ──────────────────────────────────── */

.cal-card-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.cal-card-action-btn {
  width: 15rem;
  max-width: 100%;
  text-align: center;
}

@media (max-width: 480px) {
  .cal-card-actions {
    flex-direction: column;
  }

  .cal-card-action-btn {
    width: 100%;
  }
}

/* ── Selected-day detail panel ──────────────────────────────────────── */

.cal-detail-panel {
  margin-top: 0.5rem;
  padding: 0.65rem 0.9rem;
  background: var(--color-light);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
}

.cal-detail-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 0.45rem;
  padding-bottom: 0.4rem;
  border-bottom: 0.5px solid var(--color-border-light);
}

.cal-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.35rem 0 0.35rem 0.6rem;
  margin-bottom: 0.35rem;
  border-left: 2px solid var(--color-border-mid);
  border-bottom: 0.5px solid var(--color-border-light);
  text-decoration: none;
  color: inherit;
}

.cal-detail-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.cal-detail-item:hover .cal-detail-item-name,
.cal-detail-item:focus-visible .cal-detail-item-name {
  color: var(--color-mid);
}

.cal-detail-item--rehearsal          { border-left-color: #3b82f6; }
.cal-detail-item--event              { border-left-color: #059669; } /* fallback */
.cal-detail-item--event-firm         { border-left-color: #059669; }
.cal-detail-item--event-tentative    { border-left-color: #d97706; }
.cal-detail-item--event-canceled     { border-left-color: #dc2626; }
.cal-detail-item--event-past         { border-left-color: #9ca3af; }

.cal-detail-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-dark);
  transition: color var(--duration);
}

.cal-detail-item-meta {
  font-size: 0.8rem;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

/* ── Compact overrides for very narrow viewports (≤ 360px) ─────────── */

@media (max-width: 360px) {
  .cal-nav-title          { font-size: 0.8rem; }
  .cal-nav-btn            { min-width: 1.75rem; font-size: 1rem; }
  .cal-legend             { font-size: 0.7rem; gap: 0.2rem 0.6rem; }
  .cal-day                { min-height: 2.52rem; padding: 0.12rem 0.04rem; }
  .cal-day-num            { font-size: 0.65rem; }
  .cal-dot                { width: 8px; height: 8px; }
  .cal-detail-date        { font-size: 0.7rem; }
  .cal-detail-item-name   { font-size: 0.8rem; }
  .cal-detail-item-meta   { font-size: 0.7rem; }
}

/* Refresh spinner — sits in the header, shown during background polls */
.refresh-spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--color-light);
  border-top-color: var(--color-error);
  margin-left: auto;
  margin-right: 0.75rem;
  opacity: 0;
  pointer-events: none;
}

.refresh-spinner.is-active {
  animation:
    refresh-spinner-spin  0.7s linear infinite,
    refresh-spinner-show  1s   ease   forwards;
}

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

@keyframes refresh-spinner-show {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

