/* ------------------------------------------------------------------
   Volunteer UI Refresh
------------------------------------------------------------------ */

/* Reset & global primitives ------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-strong: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #e0f2fe;
  --accent: #f97316;
  --surface: #ffffff;
  --surface-subtle: #f3f6fb;
  --surface-elevated: rgba(255, 255, 255, 0.88);
  --surface-page: #dfe4f3;
  --surface-card: #ffffff;
  --surface-card-tint: #f0f4ff;
  --border-soft: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 20px 38px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 34px 68px rgba(15, 23, 42, 0.22);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --layout-max: 1120px;
  --header-height: 72px;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.28);
  --danger: #dc2626;
  --success: #047857;
  --warning: #d97706;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light only;
}

html, body {
  height: 100%;
}

/* Typography & base body styles ------------------------------------------- */
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-strong);
  background: #fefefe;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(223, 228, 243, 0.9) 0%, #fefefe 45%, #ffffff 100%);
  z-index: -1;
  pointer-events: none;
}

/* Interactive elements ---------------------------------------------------- */
a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  color: var(--brand-strong);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

pre {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout shell ------------------------------------------------------------ */
body.app-shell {
  display: flex;
  flex-direction: column;
}

/* Prevent subtle horizontal scroll on public pages */
.app-shell.is-public {
  overflow-x: hidden;
}

.app-shell.is-admin {
  /* Match public background style to avoid gradient artifacts on long pages */
  background: var(--surface-page);
  /* Prevent tiny horizontal overflow when header layouts wrap */
  overflow-x: hidden;
}

.app-main {
  flex: 1;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3rem, 7vw, 5rem);
}

.page-shell {
  width: min(100% - clamp(32px, 6vw, 108px), var(--layout-max));
  margin-inline: auto;
}

.app-shell.is-public .page-shell {
  width: min(100%, var(--layout-max));
  padding-inline: clamp(20px, 6vw, 108px);
  box-sizing: border-box;
}

.app-shell.is-admin .page-shell,
.app-shell.is-admin .notice-wrapper,
.app-shell.is-admin .site-footer__inner,
.app-shell.is-admin .site-footer__meta {
  width: min(100% - clamp(32px, 5vw, 120px), 1280px);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.75rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.page-header--compact {
  margin-bottom: clamp(1.1rem, 3vw, 1.85rem);
}

.page-header--two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: start;
  justify-content: space-between;
  grid-column-gap: 1.5rem;
  row-gap: 0.75rem;
  margin-bottom: clamp(1.6rem, 3vw, 2.4rem);
}

 .admin-event-header {
   margin-top: -1.1rem;
   padding-top: 0;
 }

.page-header > div:first-child {
  flex: 1 1 360px;
  min-width: 280px;
  max-width: 100%;
}

.page-header__intro--full p,
.page-header__intro--full .page-subtitle {
  max-width: 100%;
}

 .admin-event-header .page-header__back {
   margin-bottom: 0.3rem;
 }

 .page-header--two-col .page-header__back {
   grid-column: 1 / -1;
 }

 .page-header--two-col .page-header__primary {
   grid-column: 1 / 2;
   grid-row: 2 / 3;
 }

 .page-header--two-col .page-header__actions {
   grid-column: 2 / 3;
   grid-row: 2 / 3;
   justify-content: flex-end;
   align-items: center;
   align-self: start;
   justify-self: end;
   text-align: right;
   margin-top: 0;
   width: auto;
 }

 .admin-event-header .page-header__actions {
   display: flex;
   flex-direction: column;
   align-self: start;
   align-items: stretch;
   padding-top: 0.15rem;
   width: min(100%, 360px);
   min-width: 260px;
   text-align: right;
   gap: 0.85rem;
   flex-wrap: nowrap;
 }

 .admin-event-header.page-header--two-col .header-actions__row {
   align-items: center;
   justify-content: space-between;
   width: 100%;
 }

 .admin-event-header .page-header__actions > .header-actions__row,
 .admin-event-header .page-header__actions > .publish-form {
   width: 100%;
 }
 .admin-event-header .page-header__actions > .share-link {
   width: auto;
   align-items: flex-end;
}

@media (max-width: 900px) {
  .page-header--two-col {
    display: flex;
    flex-direction: column;
  }
  .page-header > div:first-child {
    flex: 0 0 auto;
    min-width: 0;
  }
}

.page-header h2 {
  margin: 0;
  font-size: clamp(1.85rem, 2.8vw, 2.45rem);
  letter-spacing: -0.02em;
}
 .page-header h1 {
   display: flex;
   align-items: center;
   margin: 0 0 0.35rem;
   line-height: 1.05;
   padding: 0;
 }
.page-header h1 .preview-chip { margin-right: 0.7rem; }
.page-header h1 .type-icon { margin-right: 0.55rem; }

.page-header p {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  max-width: min(560px, 100%);
}

.page-header .page-subtitle {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  line-height: 1.55;
  hyphens: auto;
}

.page-help {
  margin-top: 0.9rem;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.08);
  overflow: hidden;
}

.page-help__summary {
  cursor: pointer;
  list-style: none;
  margin: 0;
  padding: 0.9rem 1rem;
  padding-right: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
  min-width: 0;
  width: 100%;
}

.page-help__summary::after {
  content: '⌄';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-soft);
}

.page-help__summary::-webkit-details-marker {
  display: none;
}

.page-help__summary-title {
  font-weight: 600;
  color: var(--text-strong);
}

.page-help__summary-meta {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.page-help[open] .page-help__summary::after {
  content: '⌃';
  transform: translateY(-50%);
}

.page-help__body {
  padding: 0 1rem 1rem;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.55;
  word-break: break-word;
  width: 100%;
  box-sizing: border-box;
}

.page-help__body p {
  margin: 0 0 0.55rem;
  max-width: 100%;
}

.page-help__body p:last-child {
  margin-bottom: 0;
}

.page-help__contact {
  font-size: 0.92rem;
}

.page-help__email {
  font-weight: 600;
  word-break: break-word;
}

.event-detail__help {
  margin-top: clamp(0.65rem, 2vw, 1.05rem);
}

.event-slot-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-strong);
  font-weight: 600;
  font-size: 0.92rem;
}

.event-slot-summary__metric strong {
  color: var(--text-strong);
}

.event-slot-summary__slash {
  color: var(--text-soft);
}

.event-slot-summary__pct {
  color: var(--text-soft);
  font-weight: 500;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-left: auto;
  min-width: 260px;
}

.page-header--two-col .page-header__actions {
  margin-left: 0;
  justify-content: flex-end;
  width: auto;
}

.page-header--two-col .page-header__actions .header-actions__row {
  justify-content: flex-end;
}

.page-header__actions--flush-right {
  justify-content: flex-end;
  margin-left: auto;
}

.header-actions__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-header--two-col .header-actions__row {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .page-header {
    gap: 1rem;
  }
  .page-header__actions {
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 100%;
    margin-left: 0;
  }
  .page-header__actions > * {
    width: 100%;
  }
  .page-header__actions .btn,
  .page-header__actions .btn-link,
  .page-header__actions details.dropdown {
    width: auto;
  }
  .publish-form {
    width: 100%;
    align-items: stretch;
    text-align: left;
  }
  .publish-form__row {
    justify-content: flex-start;
  }
  .publish-form__row button {
    margin-left: 0;
  }
  .publish-form select {
    width: 100%;
    max-width: none;
  }

  .admin-event-header .page-header__back {
    margin-bottom: 0.2rem;
  }
  .admin-event-header .page-header__actions {
    width: auto;
    min-width: 0;
    align-self: flex-end;
    align-items: flex-end;
    text-align: right;
    gap: 0.5rem;
  }
  .admin-event-header .page-header__actions > * {
    width: auto;
  }
  .admin-event-header .header-actions__row {
    justify-content: flex-end;
  }
  .admin-event-header .publish-form {
    width: auto;
    align-items: flex-end;
    text-align: right;
  }
  .admin-event-header .publish-form__row {
    justify-content: flex-end;
    width: auto;
  }
  .admin-event-header .publish-form__row button {
    margin-left: 0;
  }
}

/* Compact dropdown menus (used for Actions/Manage) */
details.dropdown {
  position: relative;
}
details.dropdown > summary {
  list-style: none;
  cursor: pointer;
}
details.dropdown > summary::-webkit-details-marker { display: none; }
details.dropdown[open] > summary { opacity: 0.9; }
.dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  width: 320px; /* stable width prevents over-expansion */
  max-width: min(92vw, 420px);
  padding: 8px 6px;
  background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-card-tint) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm), 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 50;
}

/* When using floating mode, hide the inline menu to avoid layout shift */
.dropdown.dropdown--float[open] > .dropdown__menu { display: none !important; }

/* Portal/floating variant rendered at the root (body) */
.dropdown__menu.is-portal {
  position: fixed !important;
  right: auto !important;
  width: 320px;
  max-width: min(92vw, 420px);
  z-index: 9999;
}
.dropdown__menu::after {
  content: '';
  position: absolute;
  top: -6px;
  right: 16px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--surface);
}
.dropdown__menu--sections {
  padding: 10px 10px 8px;
}
.dropdown__section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dropdown__section + .dropdown__section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.dropdown__section-label {
  margin: 0 0 2px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.dropdown__section--danger .dropdown__section-label {
  color: var(--danger);
}
.dropdown__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0; /* padding applied to inner button/link for proper hit area */
  border-radius: 10px;
  color: var(--text-strong);
  text-decoration: none;
  font: inherit;
}

/* Uniform clickable items inside dropdowns */
.dropdown__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--text-strong);
  background: transparent;
  border: 0;
  white-space: normal;
  font: 500 0.95rem/1.3 var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.dropdown__link:hover,
.dropdown__link:focus-visible,
.dropdown__link:active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--brand-strong);
  text-decoration: none;
  outline: none;
}
.dropdown__link.btn-danger { color: var(--danger); }
.dropdown__link.btn-danger {
  background: transparent !important;
  border: none !important;
  color: var(--danger) !important;
}
.dropdown__link.btn-danger:hover,
.dropdown__link.btn-danger:focus-visible,
.dropdown__link.btn-danger:active {
  background: rgba(220, 38, 38, 0.12) !important;
  color: var(--danger) !important;
}
.dropdown__icon {
  width: 18px;
  height: 18px;
  color: inherit;
}
.dropdown__icon-badge {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.dropdown__icon-badge--primary { background: rgba(37, 99, 235, 0.12); color: var(--brand-strong); }
.dropdown__icon-badge--muted { background: rgba(15, 23, 42, 0.08); color: var(--text-soft); }
.dropdown__icon-badge--success { background: rgba(4, 120, 87, 0.16); color: var(--success); }
.dropdown__icon-badge--warning { background: rgba(217, 119, 6, 0.16); color: var(--warning); }
.dropdown__icon-badge--danger { background: rgba(220, 38, 38, 0.16); color: var(--danger); }
.dropdown__link-text {
  flex: 1;
  min-width: 0;
  font: inherit;
}
.dropdown__item > .btn,
.dropdown__item > button:not(.dropdown__link),
.dropdown__item > a:not(.dropdown__link) {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--text-strong);
}
.dropdown__item-icon {
  display: inline-block;
  width: 18px;
  margin-right: 10px;
  color: var(--brand-strong);
}
.dropdown__item-label {
  vertical-align: middle;
}
.btn.btn-link { padding: 0; }
.btn.btn-danger.btn-link { color: var(--danger); }

.section-header__actions { display: flex; gap: 0.5rem; align-items: center; }
.split-actions .btn { padding: 6px 10px; }

.page-subtitle {
  margin: 0.5rem 0 0;
  color: var(--text-soft);
  font-size: 1rem;
}

.page-section {
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.page-section--compact {
  margin-bottom: clamp(1.2rem, 3vw, 1.85rem);
}

.page-section:last-child {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
}

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

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: 1rem 0;
  align-items: stretch;
}

.tile-grid > * {
  min-width: 0;
  height: 100%;
  animation: cardFadeIn 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tile-grid > *:nth-child(2) { animation-delay: 80ms; }
.tile-grid > *:nth-child(3) { animation-delay: 160ms; }
.tile-grid > *:nth-child(4) { animation-delay: 240ms; }
.tile-grid > *:nth-child(5) { animation-delay: 320ms; }
.tile-grid > *:nth-child(6) { animation-delay: 400ms; }

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.station-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 1.75rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1440px) {
  .station-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Use single-column station list in admin to avoid large white-space when station heights vary */
.app-shell.is-admin .station-grid {
  grid-template-columns: 1fr !important;
}

/* Station collapse visuals */
.station-card.is-collapsed .admin-block-list,
.station-card.is-collapsed .station-card__summary { display: none; }
.station-card__header-actions { display: flex; gap: 0.5rem; align-items: center; }
.station-card__heading-top { display: flex; align-items: center; gap: 0.5rem; }
.drag-handle { cursor: grab; margin-right: 0.25rem; }

/* Also use single-column station list for the public event page to avoid uneven white-space */
.app-shell.is-public .station-grid {
  grid-template-columns: 1fr !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-elevated);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.topbar__inner {
  width: min(100% - clamp(24px, 5vw, 88px), var(--layout-max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-height);
  position: relative;
}

.app-shell.is-admin .topbar__inner {
  width: min(100% - clamp(32px, 5vw, 120px), 1280px);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-strong);
  text-decoration: none;
}

.topbar__logo-image {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.topbar__text {
  display: flex;
  flex-direction: column;
}

.topbar__title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.topbar__tagline {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.topbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar__menu {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.topbar__menu > li {
  display: flex;
  align-items: center;
}

.topbar__menu a {
  color: var(--text-soft);
  font-weight: 600;
  padding: 0.45rem 0.35rem;
  border-radius: 11px;
  transition: color var(--transition), background var(--transition), text-decoration-color var(--transition);
}

.topbar__menu a:hover {
  color: var(--text-strong);
  background: rgba(37, 99, 235, 0.08);
  text-decoration: underline;
}

.topbar__menu a.is-active {
  color: var(--brand-strong);
}

.topbar__help details {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar__help {
  display: flex;
  align-items: center;
  position: relative;
}
.topbar__help summary {
  list-style: none;
  color: var(--text-soft);
  font-weight: 600;
  padding: 0.45rem 0.35rem;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.topbar__help summary::-webkit-details-marker {
  display: none;
}
.topbar__help summary:hover,
.topbar__help[open] summary {
  color: var(--text-strong);
  background: rgba(37, 99, 235, 0.08);
}
.topbar__help-caret {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}
.topbar__help[open] .topbar__help-caret {
  transform: rotate(180deg);
}
.topbar__help-menu {
  right: auto;
  left: 0;
  min-width: 200px;
  width: 220px;
  padding: 8px 6px;
}
.topbar__help-link {
  padding: 0;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-menu {
  position: relative;
  display: inline-block;
  margin: 0;
}

.account-summary {
  list-style: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  padding: 6px;
  cursor: pointer;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.account-summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.account-summary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.account-initials {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.account-menu__body {
  position: absolute;
  right: 0;
  margin-top: 10px;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 120;
}

.account-menu[open] > .account-summary {
  box-shadow: var(--shadow-sm);
}

.account-menu__name {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.account-menu__name strong {
  font-size: 0.95rem;
  color: var(--text-strong);
}

.account-menu__link {
  font-size: 0.9rem;
  color: var(--brand);
  font-weight: 600;
}

.account-menu__link:hover {
  color: var(--brand-strong);
}

.topbar__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.topbar__toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.16);
}

.topbar__toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.topbar__toggle-icon,
.topbar__toggle-icon::before,
.topbar__toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-strong);
  transition: transform var(--transition), opacity var(--transition);
  content: '';
}

.topbar__toggle-icon::before {
  position: relative;
  top: -6px;
}

.topbar__toggle-icon::after {
  position: relative;
  top: 4px;
}

.topbar__toggle[aria-expanded="true"] .topbar__toggle-icon {
  transform: rotate(45deg);
}

.topbar__toggle[aria-expanded="true"] .topbar__toggle-icon::before {
  transform: rotate(-90deg) translateX(-6px);
}

.topbar__toggle[aria-expanded="true"] .topbar__toggle-icon::after {
  opacity: 0;
}

@media (max-width: 960px) {
  .topbar__toggle {
    display: inline-flex;
  }

  .topbar__nav {
    position: absolute;
    top: calc(var(--header-height) - 10px);
    right: 0;
    left: 0;
    padding: 1.25rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity var(--transition), transform var(--transition);
  }

  .topbar__nav[data-nav-state="open"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .topbar__menu {
    flex-direction: column;
    gap: 0.75rem;
  }

  .topbar__menu a {
    padding: 0.5rem 0;
  }

  .topbar__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar__actions .btn,
  .topbar__actions .account-menu {
    width: 100%;
  }

  .account-menu__body {
    right: 50%;
    transform: translateX(50%);
  }
}

@media (min-width: 961px) {
  .topbar__nav {
    position: static;
    padding: 0;
    border: none;
    box-shadow: none;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition), color var(--transition);
  text-decoration: none;
  min-height: 40px;
  line-height: 1.1;
}

.btn:hover {
  background: var(--surface-subtle);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.small {
  padding: 0.32rem 0.6rem;
  font-size: 0.84rem;
  min-height: 30px;
  border-radius: 999px;
  gap: 0.32rem;
  white-space: nowrap;
  line-height: 1;
}
.btn.small svg { width: 16px; height: 16px; display: block; }
.btn-accent.small { box-shadow: none; }

/* Keep header action buttons tidy and unobtrusive */
.page-header__actions .btn { transform: none; }


.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--brand-strong);
  box-shadow: 0 8px 16px rgba(29, 78, 216, 0.22);
  color: #fff;
}

.btn-primary:focus-visible {
  color: #fff;
}

/* Accent button (uses --accent) */
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 12px rgba(249, 115, 22, 0.2);
}

.btn-accent:hover {
  background: color-mix(in srgb, var(--accent) 85%, black);
  color: #fff;
}

.btn-accent:focus-visible { color: #fff; }


.btn-secondary {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.24);
}

.btn-secondary:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.26);
}

.btn-secondary:focus-visible {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-soft);
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--text-strong);
  background: rgba(15, 23, 42, 0.06);
}

/* Outline button (brand-colored border, subtle hover fill) */
.btn-outline {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand-strong);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(220, 38, 38, 0.28);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  min-height: auto;
  line-height: 1.2;
}

.btn-link:hover {
  color: var(--brand-strong);
}

.btn-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}

.btn.btn-link {
  padding: 0;
  border: none;
  box-shadow: none;
}

.card {
  background-color: var(--surface-card);
  background-image: linear-gradient(155deg, var(--surface-card) 0%, var(--surface-card-tint) 100%);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.18);
}

.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

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

.card--plain > *:first-child {
  margin-top: 0;
}

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

.card--plain:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border-soft);
}

.card--table {
  padding: 0;
  overflow: visible; /* allow dropdowns to overflow the table card */
}

.card--table .table-scroll {
  padding-bottom: 0.75rem;
}

.card--table .card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.past-events {
  margin-top: 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.08);
}

.past-events__summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.85rem 1.2rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.past-events__summary::-webkit-details-marker {
  display: none;
}

.past-events__body {
  padding: 0 0 1rem;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

/* Keep station header actions aligned on one line and prevent wrapping when title is long */
.station-card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.station-card__heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* Allow the heading to actually shrink within the flex header */
  flex: 1 1 0%;
  min-width: 0;
}

.station-card__heading-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.station-card__heading-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.station-card__heading-top h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-card__header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

/* Admin station header: stack safely on small screens to avoid overlap/overflow */
@media (max-width: 720px) {
  .app-shell.is-admin .station-card__header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .app-shell.is-admin .station-card__heading-top { flex-wrap: wrap; }
  .app-shell.is-admin .station-card__heading-top h2 { white-space: normal; }
  .app-shell.is-admin .station-card__header-actions {
    justify-content: stretch;
    gap: 0.5rem;
  }
  .app-shell.is-admin .station-card__header-actions .btn,
  .app-shell.is-admin .station-card__header-actions details { width: 100%; }
  .app-shell.is-admin .station-card__header-actions details > summary.btn { width: 100%; text-align: center; }
}

.event-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 1rem;
  min-height: 200px;
  height: 100%;
  position: relative;
}

.event-card__link {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  z-index: 1;
  display: block;
}

.event-card__link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}


.event-card__hero {
  display: grid;
  grid-template-columns: minmax(48px, 56px) 1fr;
  align-items: flex-start;
  gap: 0.9rem;
  width: 100%;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(135deg, #f5f7fb, #fdfdfe);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  min-height: 124px;
}

.event-card__hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.event-card__hero-icon img {
  width: 32px;
  height: 32px;
  display: block;
}

.event-card__hero-label {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.event-card__hero-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.event-card__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--text-strong);
}

.event-card__hero-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.event-card__hero-text.rich-text {
  gap: 0.25rem;
}
.event-card__hero-text.rich-text p {
  margin: 0;
}

.event-card__hero--schedule {
  background: #e3ecff;
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: none;
}

.event-card__hero--schedule .event-card__hero-icon {
  background: radial-gradient(circle at 30% 30%, #ffffff, rgba(37, 99, 235, 0.22));
}

.event-card__hero--potluck {
  background: #ffe3cf;
  border-color: rgba(234, 88, 12, 0.24);
  box-shadow: none;
}

.event-card__hero--potluck .event-card__hero-icon {
  background: radial-gradient(circle at 30% 30%, #ffffff, rgba(249, 115, 22, 0.22));
}

.event-card__meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: #e3ecff;
  border: 1px solid rgba(37, 99, 235, 0.24);
  min-height: 118px;
}

.event-card__meta--potluck {
  background: #ffe3cf;
  border-color: rgba(234, 88, 12, 0.24);
}

.event-card__meta-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 30%, #ffffff, rgba(37, 99, 235, 0.15));
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  display: grid;
  place-items: center;
}

.event-card__meta--potluck .event-card__meta-icon {
  background: radial-gradient(circle at 30% 30%, #ffffff, rgba(234, 88, 12, 0.18));
}

.event-card__meta-icon img {
  width: 32px;
  height: 32px;
  display: block;
}

.event-card__date,
.event-card__time {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.event-card__date {
  font-weight: 700;
  color: #0f172a;
}

.event-card__time {
  color: #1d4ed8;
  font-weight: 600;
  margin-top: 0.2rem;
}

.event-card__meta--multiday .event-card__time {
  margin-top: 0;
}

.event-card__copy {
  color: var(--text-soft);
  margin: 0;
}

.event-card .card-actions {
  margin-top: auto;
  position: relative;
  z-index: 2;
}

@media (max-width: 640px) {
  .event-card__hero {
    grid-template-columns: 1fr;
  }
  .event-card__hero-icon {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 961px) {
  .event-card__hero {
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.12);
  }
.event-card__hero--schedule {
  background: #e3ecff;
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: none;
}
  .event-card__hero--potluck {
    background: #ffe3cf;
    border-color: rgba(234, 88, 12, 0.3);
    box-shadow: none;
  }
  .event-card__meta {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 30px rgba(15, 23, 42, 0.08);
  }
  .event-card__meta:not(.event-card__meta--potluck) {
    background: #e3ecff;
    border-color: rgba(37, 99, 235, 0.3);
  }
  .event-card__meta--potluck {
    background: #ffe3cf;
    border-color: rgba(234, 88, 12, 0.3);
  }
}

.signup-panel {
  max-width: 620px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (min-width: 900px) {
  .signup-panel { max-width: 820px; }
  #selected-slots-container li { grid-template-columns: minmax(0, 1fr) minmax(0, 360px) auto; }
  .selected-slot__note input[type="text"] { max-width: 420px; }
}

/* Step indicator ---------------------------------------------------------- */
/* deprecated: old inline step indicator removed */

.station-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.station-card__heading-meta {
  display: none;
  margin-left: 0.5rem;
}

.station-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.station-card__badge strong {
  color: var(--text-strong);
}

.station-card.is-collapsed .station-card__heading-meta {
  display: inline-flex;
}

.station-card--flash {
  animation: station-card-flash 1.4s ease-out;
}

@keyframes station-card-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.24);
  }
  32% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.18);
  }
  100% {
    box-shadow: var(--shadow-sm);
  }
}

.station-card[draggable="true"] {
  cursor: grab;
}

.station-card.dragging {
  opacity: 0.6;
  transform: scale(0.995);
  box-shadow: 0 10px 30px rgba(15,23,42,0.12);
}

.admin-block.dragging {
  opacity: 0.6;
  box-shadow: 0 10px 30px rgba(15,23,42,0.12);
}

.drag-handle {
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: grab;
}

.block-drag-handle {
  display: inline-block;
  margin-right: 0.35rem;
  color: var(--text-soft);
  font-size: 0.85rem;
  cursor: grab;
}

.item-reorder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.item-reorder-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: #fff;
}

.item-reorder-row .item-reorder-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.station-card__summary {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0.5rem 0 0;
}

.station-card__summary-item {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.04);
}

.station-card__summary-item h3 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.station-card__summary-item p {
  margin: 0;
  color: var(--text-strong);
}

.station-card__title {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.station-card__title h2 {
  margin: 0;
}

.station-quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
  width: 100%;
}

.station-quick-fact {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.08);
  flex: 1 1 260px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.station-quick-facts--single {
  display: block;
  width: 100%;
}
.station-quick-facts--single .station-quick-fact {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  max-width: none;
}

.debug-layout [data-debug] {
  outline: 2px dashed rgba(220, 38, 38, 0.6);
  position: relative;
}
.debug-layout [data-debug]::after {
  content: attr(data-debug);
  position: absolute;
  top: -10px;
  right: 6px;
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
}

@media (min-width: 768px) {
  .station-quick-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }
  .station-quick-facts--single {
    display: block !important;
    grid-template-columns: none !important;
  }
}

.station-quick-fact h3 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

.station-quick-fact p {
  margin: 0;
  color: var(--text-strong);
}

.rich-text {
  font-size: 0.95rem;
  color: var(--text-strong);
}

.rich-text p {
  margin: 0 0 0.5rem;
}

.rich-text ul {
  margin: 0 0 0.5rem 1.25rem;
  padding: 0;
}

.rich-text li {
  margin: 0.15rem 0;
}

.station-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.station-toggle[aria-pressed="true"] {
  background: rgba(15,23,42,0.06);
}

.station-toggle .icon-chev {
  width: 20px;
  height: 20px;
  display: inline-block;
  transition: transform 180ms ease, color 180ms ease;
}

.station-toggle .icon-chev path {
  transition: stroke 180ms ease;
}

.station-toggle[aria-expanded="false"] .icon-chev {
  transform: rotate(-90deg);
}

/* Ensure the chevron is visible (don't inherit white from btn-ghost). */
.station-toggle,
.station-toggle,
.station-toggle .icon-chev {
  color: var(--text-strong) !important;
}
.station-toggle .icon-chev { fill: currentColor !important; }

/* Ensure stroke uses currentColor as well */
.station-toggle .icon-chev path {
  stroke: currentColor !important;
  fill: none !important;
}

.station-toggle:hover .icon-chev,
.station-toggle:focus .icon-chev {
  color: var(--brand-strong) !important;
}

.chev-fallback {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: var(--text-strong);
  transition: transform 180ms ease, color 180ms ease;
}

.station-toggle[aria-expanded="false"] .chev-fallback {
  transform: rotate(-90deg);
}

.station-toggle svg[aria-hidden="true"] { display: inline-block !important; }
.station-toggle svg[aria-hidden="false"] { display: none !important; }

/* Put the toggle to the far left of the card header */
.station-card .card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Collapsed station card: only show header */
.station-card.is-collapsed {
  max-height: none;
}
.station-card.is-collapsed .admin-block-list,
.station-card.is-collapsed .admin-reservations,
.station-card.is-collapsed .card-actions:not(.always-visible) {
  display: none !important;
}

/* Inline capacity edit styles */
.btn-small {
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
  line-height: 1.1;
  min-height: auto;
  border-radius: 999px;
  vertical-align: baseline;
}
.capacity-edit-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.capacity-edit-form input[type="number"] {
  width: 5.5rem;
  margin-right: 0.5rem;
}
.capacity-display strong { font-weight: 700; }

.empty-state {
  text-align: center;
  padding: clamp(2rem, 6vw, 3.25rem);
}

.empty-state h2 {
  margin-bottom: 0.85rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table thead th {
  text-align: left;
  font-weight: 700;
  color: var(--text-soft);
  padding: 1rem 1.25rem;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-soft);
}
.table-heading-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.table-heading-hint {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: opacity var(--transition), box-shadow var(--transition);
}
.table-heading-hint:hover {
  opacity: 0.85;
}
.table-heading-hint svg {
  width: 12px;
  height: 12px;
}
.table-heading-hint:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.05);
}

/* Highlight past events on desktop: darker row background */
.table tbody tr.event-row.event-row--past td {
  background-color: rgba(148, 163, 184, 0.16);
}
.table tbody tr.event-row.event-row--past:hover td {
  background-color: rgba(148, 163, 184, 0.22);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible; /* prevent vertical clipping of floating menus */
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

.table-scroll table {
  min-width: 640px;
}

.table-scroll::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.24);
  border-radius: 999px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Responsive tables: stack rows on small screens to avoid horizontal scrolling */
@media (max-width: 720px) {
  .table-scroll {
    overflow-x: visible;
    padding: 0.5rem 0.75rem 0.75rem;
    background: var(--surface-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .table-scroll table { min-width: 0; width: 100%; }
  .table thead { display: none; }
  .table tbody { display: block; }
  .table tbody tr {
    display: block;
    margin: 0 0 16px 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
  }
  .table tbody td {
    display: grid;
    grid-template-columns: minmax(4.5rem, 28%) minmax(0, 1fr);
    gap: 0.35rem;
    align-items: flex-start;
    padding: 0.6rem 0.9rem;
    border: 0;
  }
  /* Place all real content in the value column (col 2); the label comes from ::before in col 1 */
  .table tbody td > * { grid-column: 2; }
  .table tbody td + td { border-top: 1px solid rgba(15, 23, 42, 0.06); }
  .table tbody td::before {
    content: attr(data-th);
    color: var(--text-soft);
    font-weight: 600;
  }

  /* Align the Type label with other labels instead of centering */
  .col-type,
  .table tbody td.col-type {
    width: auto;
    text-align: left;
  }

  .row-actions { justify-content: flex-start; }

  /* Add a subtle colored accent bar so each event feels like a distinct card */
  .table tbody tr.event-row {
    position: relative;
    cursor: pointer;
  }

  .row-actions,
  .row-actions * {
    cursor: pointer;
  }

  .table tbody tr.event-row:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
  }

  .event-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.6), rgba(148, 163, 184, 0.05));
  }
  .event-row.event-row--published::before {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.9), rgba(52, 211, 153, 0.25));
  }
  .event-row.event-row--draft::before {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.95), rgba(252, 211, 77, 0.3));
  }
  .event-row.event-row--past::before {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.9), rgba(148, 163, 184, 0.35));
  }
  .table tbody tr.event-row.event-row--past td {
    background-color: rgba(148, 163, 184, 0.18);
  }
  .table tbody tr.event-row.event-row--past:hover td {
    background-color: rgba(148, 163, 184, 0.22);
  }
  /* Make action buttons uniform in size and alignment on mobile
     (the Actions cell itself has the row-actions class). */
  .table tbody td[data-th="Actions"].row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    align-items: stretch;
  }
  .table tbody td[data-th="Actions"].row-actions > * {
    width: 100%;
  }
  .table tbody td[data-th="Actions"].row-actions a.btn {
    width: 100%;
    text-align: center;
  }
  .table tbody td[data-th="Actions"].row-actions details {
    margin-left: 0 !important;
    display: block;
    width: 100%;
  }
  .table tbody td[data-th="Actions"].row-actions details > summary.btn {
    width: 100%;
    display: flex;
    justify-content: center;
  }
}

.inline-form {
  display: inline;
}

.formatting-help-inline {
  margin-top: 0.35rem;
}
.formatting-help-inline details {
  display: inline-block;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
}
.formatting-help-inline summary {
  list-style: none;
  font-weight: 600;
  color: var(--brand-strong);
}
.formatting-help-inline summary::-webkit-details-marker {
  display: none;
}
.formatting-help-inline__body {
  padding: 0.35rem 0 0;
}

.notice-wrapper {
  width: min(100% - clamp(32px, 6vw, 108px), var(--layout-max));
  margin: 0 auto;
}

.notice {
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  border: 1px solid transparent;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.notice + .notice {
  margin-top: 0.75rem;
}

.notice--error {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.18);
  color: #991b1b;
}

.notice--success {
  background: #ecfdf5;
  border-color: rgba(5, 150, 105, 0.18);
  color: #047857;
}

.notice--info {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--brand-strong);
}

.notice__title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.notice__list {
  margin: 0;
  padding-left: 1.1rem;
}

.notice__list li {
  margin-bottom: 0.3rem;
}

.notice__list li:last-child {
  margin-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.16);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.28);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.slot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
}

.slot-toolbar__group {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.slot-toolbar__label {
  font-weight: 600;
  color: var(--text-strong);
}

.slot-toolbar__select {
  min-width: 11rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: #fff;
  font-size: 0.95rem;
}

.slot-view {
  display: block;
}

.slot-view[hidden] {
  display: none !important;
}

.slot-view--station {
  margin-top: 1rem;
}

/* Compact, icon-only indicator for event type */
.type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: var(--text-soft);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  vertical-align: middle;
}
.type-icon svg { width: 20px; height: 20px; display: block; }

/* Preview indicator (admin-only) */
.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.72rem;
  font-size: 0.92rem;
  font-weight: 800;
  border-radius: 999px;
  border: 1px solid rgba(217, 119, 6, 0.36);
  background: rgba(217, 119, 6, 0.16);
  color: #92400e;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.preview-chip svg { width: 18px; height: 18px; display: block; }
.type-icon--schedule {
  background: rgba(29, 78, 216, 0.08);
  border-color: rgba(29, 78, 216, 0.22);
  color: #1d4ed8;
}
.type-icon--potluck {
  background: rgba(4, 120, 87, 0.10);
  border-color: rgba(4, 120, 87, 0.22);
  color: #047857;
}

/* Table alignment for the Type column */
.col-type {
  width: 64px;
  text-align: center;
}

.slot-view--time {
  margin-top: 1rem;
}

.slot-view--station [data-role="station-chip"] {
  display: none;
}

.slot-view--time [data-role="station-chip"] {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 999px;
  font-weight: 600;
  text-transform: none;
}

.slot-view--time .time-block-item {
  cursor: pointer;
}

.time-block-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.time-block-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  cursor: pointer;
  position: relative;
  border-left: 4px solid transparent;
}

/* Potluck cards: align columns (info | others bringing | action) */
.time-block-item.is-potluck {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px) 96px; /* fixed action column for consistent alignment */
  align-items: start;
}
.time-block-item__action { text-align: right; }
.time-block-item__others { padding-left: 0.5rem; }

.time-block-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.25);
  border-left-color: var(--brand);
}

.time-block-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.time-block-item strong {
  color: var(--text-strong);
}

.time-block-item span {
  color: var(--text-soft);
}

.time-block-item__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--brand-strong);
  margin-top: 0.25rem;
}
.time-block-item__hint svg {
  width: 16px;
  height: 16px;
}

.time-block-item__action .select-slot-btn {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-strong);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.time-block-item__action .select-slot-btn:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}
.time-block-item__action .select-slot-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.time-block-item.selected {
  border-color: rgba(37, 99, 235, 0.85);
  box-shadow: 0 22px 36px rgba(37, 99, 235, 0.28);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.84));
  color: #fff;
}

.time-block-item.selected strong,
.time-block-item.selected span,
.time-block-item.selected .muted {
  color: rgba(255, 255, 255, 0.95);
}
.time-block-item.selected .dish-notes-inline .info-icon,
.time-block-item.selected .dish-notes-inline strong {
  color: rgba(255, 255, 255, 0.95);
}
.time-block-item.selected .dish-notes-list,
.time-block-item.selected .dish-notes-list li {
  color: rgba(255, 255, 255, 0.92);
}

.time-block-item.selected .btn {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.time-block-item.selected .btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.time-block-item.is-full {
  opacity: 0.65;
  background: rgba(241, 245, 249, 0.85);
  cursor: not-allowed;
}

.time-block-item.disabled-overlap {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.slot-conflict-note {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #b91c1c;
}

#selected-slots-container {
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.1rem;
  border: 1px solid rgba(37, 99, 235, 0.15);
  overflow-x: hidden; /* Prevent horizontal scroll when selections render */
}

#selected-slots-container h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.selection-fab {
  position: fixed;
  right: clamp(1rem, 4vw, 2rem);
  bottom: clamp(1rem, 4vw, 2rem);
  z-index: 1100;
  display: none;
}

.selection-fab.is-visible {
  display: block;
  animation: selectionFabFade 160ms ease-in;
}

.selection-fab__button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(59, 130, 246, 0.9));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28), 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.selection-fab__button:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.45);
  outline-offset: 2px;
}

.selection-fab__button:hover {
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.32);
}

@keyframes selectionFabFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtle attention pulse (desktop-biased) */
@keyframes selectionFabPulse {
  0%, 100% {
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28), 0 0 0 3px rgba(37, 99, 235, 0.15);
  }
  50% {
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.35), 0 0 0 5px rgba(37, 99, 235, 0.22);
  }
}

@media (min-width: 641px) {
  .selection-fab.is-visible .selection-fab__button {
    animation: selectionFabPulse 2200ms ease-in-out infinite;
  }
}

@media (max-width: 640px) {
  /* Avoid overflow in the view selector */
  .slot-toolbar__group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 100%;
  }
  .slot-toolbar__select { min-width: 0; width: 100%; }

  .selection-fab {
    left: clamp(1rem, 4vw, 2rem);
    right: clamp(1rem, 4vw, 2rem);
  }

  .selection-fab__button {
    justify-content: center;
    width: 100%;
  }
}

#selected-slots-container ul {
  margin: 0;
  padding-left: 0;
  color: var(--text-strong);
  list-style: none;
}

#selected-slots-container li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px) auto; /* Avoid forcing container wider than viewport */
  align-items: center;
  column-gap: 0.35rem;
  row-gap: 0.2rem;
  margin-bottom: 0.45rem;
  padding: 0.12rem 0.6rem; /* symmetric padding so Remove isn't flush */
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

#selected-slots-container li:nth-child(odd) {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.selected-slot__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
}

.selected-slot__station {
  font-weight: 600;
  color: var(--text-strong);
  word-break: break-word;
}
.selected-slot__station--inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  width: 100%;
}
.selected-slot__item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.24);
  white-space: nowrap;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.selected-slot__time {
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-word;
}

.selected-slot__note label {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.selected-slot__note input[type="text"] {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(37,99,235,0.26);
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.selected-slot__note input[type="text"]::placeholder {
  color: #4f67a3;
  opacity: 0.88;
}

/* Inline dish input for tighter alignment */
.selected-slot__note { display: flex; align-items: center; gap: 0.35rem; }
.selected-slot__note input[type="text"] { max-width: 300px; }

#selected-slots-container li:last-child {
  margin-bottom: 0;
}

/* deprecated: .selected-hint removed */

.selected-slot-remove {
  border: none;
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  justify-self: end;
  margin-right: 0.6rem; /* keep away from container edge */
}

.selected-slot-remove:hover {
  background: rgba(220, 38, 38, 0.24);
}

.selected-slot-remove:focus-visible {
  outline: 2px solid rgba(220, 38, 38, 0.45);
  outline-offset: 1px;
}

/* Toast / Snackbar -------------------------------------------------------- */
#toast-root { padding: 0 12px; }
.toast {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(92vw, 560px);
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(15,23,42,0.18);
  border: 1px solid rgba(15,23,42,0.08);
  background: #fff;
  color: var(--text-strong);
  font-weight: 600;
  pointer-events: auto;
}
.toast--success {
  border-color: rgba(16,185,129,0.24);
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
  color: #065f46;
}
.toast__icon { width: 18px; height: 18px; flex: 0 0 auto; }
.toast__close { margin-left: 0.5rem; border: none; background: transparent; cursor: pointer; color: inherit; }

/* Helper: inline info with icon for dish notes */
.dish-notes-inline { display: inline-flex; align-items: center; gap: 0.4rem; }
.dish-notes-inline .info-icon { width: 16px; height: 16px; color: var(--brand-strong); flex: 0 0 auto; cursor: help; }
.dish-notes-inline[title] { cursor: help; }
.dish-notes-list {
  margin: 4px 0 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
}
.dish-notes-list li { margin: 0.1rem 0; }

/* Potluck dish notes as list under item */
/* Inline disclosure link (top reminder) ---------------------------------- */
.disclosure { padding: 0; margin: 0; }
.disclosure__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.2;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.disclosure__summary::-webkit-details-marker { display: none; }
.disclosure__summary:hover { color: var(--brand-strong); }
.disclosure__icon { width: 16px; height: 16px; color: var(--brand-strong); }
.disclosure__panel {
  margin-top: 0.5rem;
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  max-width: min(100%, 760px);
}
.disclosure__form { display: flex; align-items: center; gap: 0.5rem; }
.disclosure__form .input-inline {
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 420px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #fff;
}
.disclosure__help { margin: 0.4rem 0 0; color: var(--text-soft); font-size: 0.9rem; }
@media (max-width: 640px) {
  .disclosure__form { flex-direction: column; align-items: stretch; }
  .disclosure__form .btn { width: 100%; }
}

/* Make selected items layout vertical on tablets/phones */
@media (max-width: 1024px) { .selected-slots__grid-header { display: none; } }

@media (max-width: 900px) {
  #selected-slots-container li {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .selected-slot__text { grid-column: 1 / -1; }
  .selected-slot__note { grid-column: 1 / -1; width: 100%; }
  .selected-slot__note input[type="text"] { width: 100%; max-width: none; }
  .selected-slot-remove { grid-column: 1 / -1; justify-self: start; margin-right: 0; margin-top: 0.35rem; }
  .selected-slot__station--inline { flex-wrap: wrap; gap: 0.35rem; }
  .selected-slot__item { white-space: normal; }

  /* Potluck card columns collapse to single column */
  .time-block-item.is-potluck { grid-template-columns: 1fr; }
  .time-block-item__others { padding-left: 0; }
}

@media (max-width: 720px) {
  #selected-slots-container li {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .selected-slot-remove {
    justify-self: start;
  }
  .selected-slot__note { flex-direction: column; align-items: start; }
}

.admin-block-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.admin-block {
  display: flex;
  flex-wrap: wrap;
  /* Use explicit row/column gaps so row spacing can be tuned when collapsed */
  column-gap: 1.5rem;
  row-gap: 1rem;
  justify-content: flex-start; /* pack items; avoid large gap between rows */
  align-items: flex-start; /* align actions to the top on desktop */
  min-width: 0;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-block__main {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1 1 320px;
  min-width: 0;
}

.admin-block__times {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: center;
}

.admin-block__times--potluck {
  align-items: flex-start;
}

.admin-block__pill {
  min-width: 140px;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

.admin-block__pill--item {
  flex: 1 1 min(260px, 100%);
}

.admin-block__pill--feeds {
  min-width: 120px;
}

.admin-block__item-name {
  word-break: break-word; /* keep long item names from pushing pills offscreen */
}

.admin-block__pill span {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}

.admin-block__pill strong {
  font-size: 1rem;
  color: var(--text-strong);
}

.admin-block__item-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.admin-block__pill--item .admin-block__item-name {
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-strong);
}

.admin-block__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline; /* align labels, numbers, and controls */
  gap: 0.9rem;
  color: var(--text-soft);
}

.admin-block__metric {
  display: inline-flex;
  align-items: baseline; /* align numbers with labels */
  gap: 0.4rem;
  flex-wrap: wrap;
}

.admin-block__metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1; /* keep baseline consistent with adjacent numbers */
  display: inline-block;
}

.admin-block__metric .capacity-display {
  display: inline-flex;
  align-items: baseline; /* align number baseline with label */
  gap: 0.2rem;
  line-height: 1;
}

.admin-block__metric .capacity-display strong {
  font-size: 1rem;
  color: var(--text-strong);
  line-height: 1;
}

.admin-block__reserved {
  font-size: 0.95rem;
  color: var(--text-strong);
  display: inline-flex;
  align-items: baseline; /* keep numerator with label baseline */
  line-height: 1;
}

.admin-block__reserved strong {
  font-weight: 700;
  color: var(--brand-strong);
  line-height: 1;
}

/* Ensure tiny buttons in metrics align on the baseline */
.admin-block__metric .btn-small { align-self: baseline; }

.admin-block__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  /* Let actions sit on same row on wide screens; push to the right */
  margin-left: auto;
  max-width: 100%;
  /* Default: tight spacing when volunteers list is collapsed */
  border-top: 0;
  margin-top: 0.25rem;
  padding-top: 0;
}

/* When the volunteers list is open, add visual separation above actions */
.admin-block.has-open-reservations .admin-block__actions,
.admin-block__main:has(details.admin-reservations[open]) + .admin-block__actions {
  border-top: 1px solid var(--border-soft);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

/* On wider screens, keep actions aligned to the top without extra spacing */
@media (min-width: 721px) {
  .admin-block.has-open-reservations .admin-block__actions,
  .admin-block__main:has(details.admin-reservations[open]) + .admin-block__actions {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
  }

  .admin-block.has-open-reservations {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-block.has-open-reservations .admin-block__main,
  .admin-block.has-open-reservations .admin-block__actions,
  .admin-block__main:has(details.admin-reservations[open]) + .admin-block__actions {
    width: 100%;
  }

  .admin-block.has-open-reservations .admin-block__actions,
  .admin-block__main:has(details.admin-reservations[open]) + .admin-block__actions {
    justify-content: flex-start;
    margin-left: 0;
  }
}

/* When volunteers are collapsed, provide modest spacing to actions */
.admin-block:not(.has-open-reservations) {
  row-gap: 0.4rem;
}

.admin-reservations {
  /* Reset UA default margins that add unwanted whitespace when collapsed */
  margin: 0;
  padding: 0;
  width: 100%;
  /* Create a new formatting context to avoid margin-collapsing quirks on Android */
  display: flow-root;
}

.admin-reservations summary {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-strong);
  /* Keep collapsed state compact; expanded gets extra space below */
  margin: 0;
  padding: 0;
  line-height: 1.2;
  list-style: none;
}

.admin-reservations[open] summary { margin-bottom: 0.5rem; }

/* When volunteers are collapsed, remove any extra bottom margin from the summary */
.admin-block:not(.has-open-reservations) .admin-reservations summary { margin-bottom: 0; }

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

.admin-reservations summary::before {
  content: '\25BA';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform var(--transition);
}

.admin-reservations[open] summary::before {
  transform: rotate(90deg);
}

.admin-reservation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(0.9rem, 1.5vw, 1.25rem);
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  grid-auto-rows: auto;
  align-items: stretch;
}

.admin-reservation {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  box-sizing: border-box;
}

.admin-reservation__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 0.75rem;
}

.admin-reservation__info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.admin-reservation__info span {
  display: block;
  min-width: 0;
  word-break: break-word;
}

.admin-reservation__note {
  word-break: break-word;
  color: var(--text-strong);
}

.admin-reservation__info strong {
  font-size: 0.95rem;
  color: var(--text-strong);
}

.admin-reservation__info strong::before { content: none; }

.admin-reservation__name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}
.icon { width: 16px; height: 16px; display: inline-block; }
.icon-person { color: var(--brand-strong); }

.admin-reservation__info span {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.admin-reservation__name strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}

.admin-reservation__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.admin-reservation {
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.admin-reservation:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.copy-hint {
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

@media (max-width: 720px) {
  .admin-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-block__times--potluck {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0.35rem 0.75rem;
    width: 100%;
  }

  .admin-block__pill--item,
  .admin-block__pill--feeds {
    min-width: 0;
  }

  .admin-block__pill--feeds {
    justify-self: end;
    text-align: right;
  }

  .admin-block__actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0; /* override desktop push-right on mobile */
  }

  /* Reset main column flex-basis so it doesn't reserve 320px height */
  .admin-block__main { flex: 1 1 auto; min-height: 0; }

  /* Volunteers list: stack and wrap safely to prevent horizontal scroll */
  .admin-reservation-list { grid-template-columns: 1fr; }
  .admin-reservation__top { display: flex; flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .admin-reservation__actions { width: 100%; justify-content: stretch; margin-left: 0; }
  .admin-reservation__actions .btn { flex: 1 1 auto; width: 100%; text-align: center; }
  .admin-reservation__actions form { width: 100%; }
  .admin-reservation__actions form .btn { width: 100%; }

  /* Spacing handled globally; no extra margin needed here */
}

form {
  display: block;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
  grid-column: 1 / -1;
}

label {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="password"],
textarea,
select {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: var(--focus-ring);
  background: #fff;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

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

@media (max-width: 780px) {
  .form-grid.two {
    grid-template-columns: 1fr;
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  width: min(720px, 94vw);
  max-height: 90vh;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  animation: modal-in 220ms ease forwards;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 1.4rem 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.85);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.visibility-help {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.visibility-help__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.visibility-help__card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: linear-gradient(180deg, #fff 0%, rgba(248, 250, 252, 0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.visibility-help__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.visibility-help__badge::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
}

.visibility-help__badge--draft {
  color: #92400e;
  background: rgba(250, 204, 21, 0.18);
}

.visibility-help__badge--private {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.15);
}

.visibility-help__badge--public {
  color: #047857;
  background: rgba(16, 185, 129, 0.18);
}

.visibility-help__title {
  margin: 0;
  font-weight: 600;
  color: var(--text-strong);
}

.visibility-help__note {
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: var(--text-strong);
}

.close-btn {
  appearance: none;
  background: rgba(15, 23, 42, 0.05);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.close-btn:hover {
  background: rgba(15, 23, 42, 0.12);
  color: var(--text-strong);
  transform: rotate(4deg);
}

.site-footer {
  background: rgba(15, 23, 42, 0.93);
  color: rgba(255, 255, 255, 0.82);
  padding: 2.75rem 0 2.25rem;
}

.site-footer__inner {
  width: min(100% - clamp(32px, 6vw, 108px), var(--layout-max));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}

.site-footer__title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}

.site-footer__links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.site-footer__links a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer__meta {
  width: min(100% - clamp(32px, 6vw, 108px), var(--layout-max));
  margin: 1.75rem auto 0;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.7);
  text-align: center;
}

@media (max-width: 640px) {
  .page-header .page-subtitle {
    max-width: 100%;
    font-size: 0.98rem;
  }

  .page-help__summary {
    padding: 0.8rem 0.85rem;
  }

  .page-help__body {
    padding: 0 0.85rem 0.85rem;
    font-size: 0.9rem;
  }

  .page-header h1,
  .page-header h2 {
    font-size: clamp(1.6rem, 6vw, 2.1rem);
  }

  .app-main {
    padding: 2.2rem 0 3.5rem;
  }
}

/* -------------------------------------------------------------
   Debug: spacing outlines (enable with ?debug=spacing)
------------------------------------------------------------- */
.debug-spacing .admin-block { outline: 2px solid rgba(255, 0, 0, 0.6); }
.debug-spacing .admin-block__main { outline: 2px dashed rgba(255, 165, 0, 0.8); }
.debug-spacing .admin-block__times { outline: 1px dashed rgba(255, 200, 0, 0.9); }
.debug-spacing .admin-block__stats { outline: 1px dashed rgba(0, 128, 0, 0.8); }
.debug-spacing .admin-reservations { outline: 2px dotted rgba(128, 0, 128, 0.8); background: rgba(128, 0, 128, 0.06); }
.debug-spacing .admin-reservations summary { outline: 2px solid rgba(255, 0, 255, 0.8); background: rgba(255, 0, 255, 0.06); }
.debug-spacing .admin-block__actions { outline: 2px solid rgba(0, 128, 255, 0.8); background: rgba(0, 128, 255, 0.06); }
.debug-spacing .admin-reservation-list { outline: 2px dashed rgba(0, 0, 255, 0.6); background: rgba(0, 0, 255, 0.04); }
.debug-spacing .admin-reservation { outline: 2px dashed rgba(255, 0, 0, 0.6); background: rgba(255, 0, 0, 0.05); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
  .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
  }

  .status-pill--live {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.22);
    color: #047857;
  }

  .status-pill--draft {
    background: rgba(250, 204, 21, 0.14);
    border-color: rgba(250, 204, 21, 0.28);
    color: #92400e;
  }

  .status-pill--private {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.24);
    color: #1d4ed8;
  }
  
.publish-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: auto;
  min-width: 0;
  align-items: stretch;
  text-align: right;
}

.publish-form__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

.publish-form__row button {
  flex-shrink: 0;
  margin-left: auto;
}

.publish-form select {
  min-width: 150px;
  flex: 0 1 auto;
  width: auto;
  max-width: 220px;
  cursor: pointer;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23222F43' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.85rem auto;
}

.share-link__copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.share-link__copy-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.share-link__copy-btn.is-copied .share-link__copy-label {
  color: var(--accent, var(--brand-strong));
  font-weight: 600;
}

.share-link__copy-btn--minimal {
  padding: 0.05rem 0.25rem;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.share-link__icon {
  width: 0.9rem;
  height: 0.9rem;
}
  
.selected-slot__note .input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.field-error {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--danger);
}

#selected-slots-container li:hover {
  background: rgba(37, 99, 235, 0.06);
}
#selected-slots-container .notice {
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
}
#selected-slots-container .notice__list { margin: 0; padding-left: 1.1rem; }
.step-heading { margin: 1rem 0 0.9rem; font-size: 1.1rem; letter-spacing: -0.01em; }
/* First step heading (above selection area) should be tighter */
.slot-view--station > .step-heading { margin-top: 0.25rem; }
/* Ensure consistent space between selected panel and next heading */
.signup-panel + .step-heading { margin-top: 1.25rem; }

.selection-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(37,99,235,0.12);
  color: var(--brand-strong);
  font-size: 0.9rem;
}

/* Email preference controls ------------------------------------------------- */
.email-pref-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.email-pref-status {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status-pill--on {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

.status-pill--off {
  background: rgba(248, 113, 113, 0.2);
  color: #b91c1c;
}

.email-pref-form textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 0.9rem;
  padding: 0.75rem 0.9rem;
  font: inherit;
  resize: vertical;
  min-height: 96px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.email-pref-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.email-pref-form .card-actions {
  justify-content: flex-start;
  margin-top: 0.5rem;
}

.email-pref-section .muted.small {
  color: var(--text-soft);
}
