.site-scroll:has(.benevoles-page) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body:has(.benevoles-page) {
  background: #fff8f0;
}

.benevoles-page {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1rem;
  font-family: Quicksand, sans-serif;
  color: #4a4a4a;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.benevoles-page > p {
  flex: 0 0 auto;
}

.benevoles-page h1,
.benevoles-page h2 {
  font-family: "Amatic SC", cursive;
  color: #8b0000;
  margin: 0 0 0.5rem;
}

.benevoles-page h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  flex: 0 0 auto;
}

.benevoles-page h2 {
  font-size: 2rem;
}

.bv-note,
.bv-status {
  background: #f7ecd7;
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.bv-status[data-kind="warn"] {
  background: #f8e6c8;
  color: #6b3a00;
}

.benevoles-page.is-readonly .bv-form-fold {
  display: none;
}

.benevoles-page.is-readonly [data-edit],
.benevoles-page.is-readonly [data-delete] {
  display: none;
}

.benevoles-page.is-readonly .bv-cell[data-t] {
  cursor: default;
}

.benevoles-page.is-outage .bv-layout,
.benevoles-page.is-outage .bv-fold,
.benevoles-page.is-outage .lbm-loader {
  display: none;
}

.benevoles-page.is-loading .bv-layout {
  display: none;
}

.benevoles-page:not(.is-loading) > .lbm-loader {
  display: none;
}

#bv-loader {
  align-items: flex-start;
}

#bv-loader .lbm-loader-copy {
  min-width: 0;
}

#bv-loader .lbm-loader-title {
  margin: 0;
}

#bv-loader .lbm-loader-quote {
  margin: 0.4rem 0 0;
  font-weight: 500;
  font-style: italic;
  color: #6a5c52;
  line-height: 1.45;
}

.bv-status[data-kind="pending"] {
  background: #f7ecd7;
  color: #5a4e44;
}

.bv-status[data-kind="ok"] {
  background: #e4f0d8;
  color: #3f5c3a;
}

.bv-fold,
.bv-form-fold {
  border: 1px solid rgba(139, 0, 0, 0.12);
  border-radius: 12px;
  background: #fff;
  margin: 0 0 0.75rem;
}

.bv-fold > summary,
.bv-form-summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  padding: 0.7rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-family: Quicksand, sans-serif;
  color: #8b0000;
}

.bv-form-summary {
  font-family: "Amatic SC", cursive;
  font-size: 1.7rem;
  font-weight: 400;
}

.bv-fold > summary::-webkit-details-marker,
.bv-form-summary::-webkit-details-marker {
  display: none;
}

.bv-fold > summary::after,
.bv-form-summary::after {
  content: "▾";
  font-family: Quicksand, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #8b0000;
}

.bv-fold:not([open]) > summary::after,
.bv-form-fold:not([open]) > .bv-form-summary::after {
  content: "▸";
}

.bv-fold > *:not(summary) {
  padding: 0 0.9rem 0.85rem;
}

.bv-fold .bv-hint {
  margin: 0;
}

.bv-fold-hint {
  display: none;
}

@media (min-width: 861px) {
  #bv-help,
  #bv-legend {
    border: 0;
    background: transparent;
    box-shadow: none;
    margin-bottom: 0.7rem;
  }

  #bv-help > summary,
  #bv-legend > summary {
    display: none;
  }

  #bv-help > *:not(summary),
  #bv-legend > *:not(summary) {
    padding: 0;
  }

  .bv-form-fold > summary {
    pointer-events: none;
  }

  .bv-form-fold > summary::after {
    display: none;
  }
}

.bv-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.bv-form-fold {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(139, 0, 0, 0.06);
}

.bv-form-fold > summary {
  flex: 0 0 auto;
}

.bv-form {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 1.1rem 1.2rem;
  box-shadow: none;
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

.bv-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.bv-times > div:first-child label {
  margin-top: 0.65rem;
}

.bv-hint {
  font-size: 0.85rem;
  color: #5a4e44;
  margin: 0.4rem 0 0.6rem;
}

.bv-board-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bv-board-panel {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e0d3c2;
  border-radius: 16px;
}

.bv-filters {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #e0d3c2;
  background: #fffaf3;
}

.bv-filters-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b0000;
}

.bv-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

#bv-board {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.7rem 0.75rem 0.85rem;
}

.bv-form label {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  margin: 0.65rem 0 0.25rem;
}

.bv-form input,
.bv-form select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 16px;
  padding: 0.45rem 0.55rem;
  border: 1px solid #d7c7b4;
  border-radius: 8px;
  background: #fffaf3;
}

.bv-hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.bv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.bv-form .bv-status {
  margin: 0.85rem 0 0.65rem;
}

.bv-actions button:disabled {
  background: #b5a89c;
  border-color: #b5a89c;
  color: #fff;
  opacity: 0.7;
  cursor: not-allowed;
}

#bv-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 10.5rem;
}

#bv-save .lbm-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.bv-wait {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgba(44, 36, 30, 0.48);
  -webkit-tap-highlight-color: transparent;
}

.bv-wait[hidden] {
  display: none;
}

.bv-wait-card {
  width: min(22.5rem, 100%);
  max-height: min(28rem, calc(100dvh - 2rem));
  overflow: auto;
  background: #fffaf3;
  border-radius: 18px;
  padding: 1.35rem 1.2rem 1.15rem;
  text-align: center;
  box-shadow: 0 18px 44px rgba(44, 36, 30, 0.28);
}

.bv-wait .lbm-spinner {
  display: none;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0 auto 0.9rem;
  border-width: 3px;
}

.bv-wait.is-pending .lbm-spinner {
  display: block;
}

.bv-wait-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #8b0000;
  line-height: 1.35;
}

.bv-wait.is-ok .bv-wait-title {
  color: #3f5c3a;
}

.bv-wait.is-error .bv-wait-title {
  color: #8b0000;
}

.bv-wait-quote {
  margin: 0.65rem 0 0;
  font-size: 1rem;
  font-style: italic;
  font-weight: 500;
  color: #5a4e44;
  line-height: 1.45;
}

.bv-wait-quote:empty,
.bv-wait:not(.is-pending) .bv-wait-quote {
  display: none;
}

.bv-wait-ok {
  display: none;
  width: 100%;
  margin-top: 1.05rem;
  min-height: 48px;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: #8b0000;
  color: #fff;
  cursor: pointer;
}

.bv-wait:not(.is-pending) .bv-wait-ok {
  display: block;
}

body.bv-wait-lock,
body.bv-wait-lock .site-scroll {
  overflow: hidden;
  touch-action: none;
}

.bv-form.is-busy {
  pointer-events: none;
}

.bv-actions button,
.bv-toggle button {
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  border: 1px solid #8b0000;
  background: #8b0000;
  color: #fff;
}

.bv-actions .ghost,
.bv-toggle button {
  background: #fff;
  color: #8b0000;
}

.bv-toggle button[aria-pressed="true"] {
  background: #8b0000;
  color: #fff;
}

.bv-group {
  border: 1px solid #e0d3c2;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 0.55rem;
  overflow: hidden;
}

.bv-group > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 0.85rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem 0.7rem;
  flex-wrap: wrap;
}

.bv-group > summary::-webkit-details-marker,
.bv-group > summary::marker {
  display: none;
  content: "";
}

.bv-group > summary::before {
  content: "▸";
  flex: 0 0 auto;
  font-family: Quicksand, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #8b0000;
  line-height: 1;
}

.bv-group[open] > summary::before {
  content: "▾";
}

.bv-group > summary > span:first-of-type {
  flex: 1 1 8rem;
  min-width: 0;
  color: #8b0000;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
}

.bv-group > summary > span:last-of-type {
  font-size: 0.82rem;
  font-weight: 600;
  color: #5a4e44;
}

.bv-group.is-staffed {
  background: #f3eee6;
  border-color: #ddd3c4;
  opacity: 0.58;
}

.bv-group.is-staffed > summary > span:first-of-type {
  color: #7a6c60;
  font-weight: 600;
}

.bv-group.is-staffed[open] {
  opacity: 0.82;
}

.bv-timeline {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 0 0.7rem 0.55rem;
}

.bv-heat,
.bv-scale {
  display: grid;
  grid-template-columns: repeat(var(--bv-slots, 68), minmax(14px, 1fr));
  gap: 1px;
  min-width: calc(var(--bv-slots, 68) * 15px);
}

.bv-scale {
  font-size: 0.7rem;
  font-weight: 700;
  color: #8b0000;
  padding-bottom: 0.45rem;
}

.bv-scale span {
  grid-column: span var(--bv-slot-span, 4);
}

.bv-cell {
  height: 18px;
  min-height: 18px;
  border-radius: 2px;
  background: #eee4d6;
  cursor: pointer;
  padding: 0;
  border: 0;
}

.bv-cell.is-ok { background: #c8e0b4; }
.bv-cell.is-mid { background: #f0d48a; }
.bv-cell.is-full { background: #e8a090; cursor: default; }
.bv-cell.is-out { background: #f3eee6; cursor: default; opacity: 0.45; }
.bv-cell:disabled {
  cursor: default;
}
.bv-cell.is-pick { outline: 2px solid #8b0000; outline-offset: -1px; }

.bv-task-desc {
  margin: 0 0.85rem 0.7rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.45;
  color: #2c4a5e;
  background: #e7f2fa;
  border: 1px solid #c5dff0;
  border-radius: 8px;
  white-space: pre-wrap;
}

.bv-form .bv-task-desc {
  margin: 0.35rem 0 0.15rem;
}

.bv-people {
  padding: 0 0.85rem 0.75rem;
  font-size: 0.9rem;
}

.bv-person-slot {
  margin-bottom: 0.65rem;
}

.bv-person-slot:last-child {
  margin-bottom: 0;
}

.bv-people .bv-task-desc {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.bv-people button,
.bv-ics {
  font: inherit;
  border: 0;
  background: none;
  color: #007BFF;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.bv-ics {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.bv-group summary .bv-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .site-scroll:has(.benevoles-page) {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .benevoles-page {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0.85rem 0.85rem 2rem;
  }

  .benevoles-page h1 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
  }

  .bv-form-summary {
    font-family: Quicksand, sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    min-height: 48px;
    letter-spacing: 0.01em;
  }

  .bv-layout {
    display: block;
    min-height: 0;
  }

  .bv-form-fold {
    position: sticky;
    top: 0;
    z-index: 6;
    max-height: none;
    overflow: visible;
    display: block;
    margin-bottom: 0.75rem;
    border: 2px solid #8b0000;
    box-shadow: 0 8px 20px rgba(139, 0, 0, 0.12);
  }

  .bv-form-fold[open] {
    position: relative;
  }

  .bv-form {
    max-height: none;
    overflow: visible;
    flex: none;
  }

  .bv-board-col {
    overflow: visible;
    display: block;
    min-height: 0;
  }

  .bv-board-panel {
    overflow: visible;
    display: block;
  }

  #bv-board {
    overflow: visible;
    flex: none;
    min-height: 0;
  }

  .bv-actions button,
  .bv-toggle button {
    min-height: 44px;
    padding: 0.55rem 0.95rem;
  }

  .bv-cell {
    height: 28px;
    min-height: 28px;
  }

  .bv-wait {
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }

  .bv-wait-card {
    width: min(22.5rem, calc(100% - 0.25rem));
    padding: 1.2rem 1rem 1rem;
  }

  .bv-wait-title {
    font-size: 1.2rem;
  }

  .bv-wait-quote {
    font-size: 1.05rem;
  }

  .bv-wait-ok {
    min-height: 52px;
    font-size: 1.05rem;
  }
}

@media (pointer: coarse) {
  .bv-cell {
    height: 26px;
    min-height: 26px;
  }
}
