/* Démonstration ark.church */

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100dvh;
}

/* ------------------------------------------------------------ barre latérale */

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: var(--space-5) var(--space-3) var(--space-4);
  background: var(--prune-900);
  color: var(--on-primary);
  overflow: hidden;
}

.sidebar .wordmark {
  padding: var(--space-1) var(--space-3) 0;
}

.church-name {
  margin: var(--space-3) 0 var(--space-3);
  padding: 0 var(--space-3) var(--space-3);
  border-bottom: 1px solid oklch(1 0 0 / 0.12);
  font-size: var(--text-s);
  color: var(--on-dark-muted);
}


.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border-radius: var(--radius-m);
  color: var(--on-dark-muted);
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--on-primary);
  background: oklch(1 0 0 / 0.07);
}

.nav a[aria-current="page"] {
  color: var(--prune-950);
  background: var(--amber);
}

.sidebar :focus-visible {
  outline-color: var(--amber);
}

.mock-note {
  margin-top: auto;
  padding: var(--space-3);
  font-size: var(--text-s);
  color: var(--on-dark-muted);
  border-top: 1px solid oklch(1 0 0 / 0.14);
}

/* ------------------------------------------------------------ barre du haut */

.topbar-logo,
.demo-note-mobile,
.tabbar {
  display: none;
}

.topbar-logo img {
  width: auto;
  height: 30px;
}

.tabbar a,
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 52px;
  padding: 6px 2px;
  border: 0;
  border-radius: var(--radius-m);
  background: none;
  color: var(--on-dark-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease-out, background-color 0.15s ease-out;
}

.tabbar span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabbar [aria-current="page"] {
  color: var(--amber);
  background: oklch(1 0 0 / 0.06);
}

.sheet-nav a {
  color: inherit;
  text-decoration: none;
}

.sheet-nav a[aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
}

.search {
  position: relative;
  flex: 1;
  max-width: 440px;
  margin-right: auto;
}

.search-field {
  position: relative;
  display: block;
}

.search-field .icon {
  position: absolute;
  top: 50%;
  left: var(--space-3);
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-field .input {
  padding-left: 40px;
}

.search-launch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

.search-launch:hover {
  background: var(--bg-sunken);
  border-color: var(--primary);
}

.search-launch .icon {
  flex: none;
  width: 18px;
}

.search-launch kbd {
  margin-inline-start: auto;
}

/* La cloche a le même contour que le champ de recherche : la barre du haut reste équilibrée. */
#bell {
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
}

#bell:hover {
  background: var(--bg-sunken);
}

#bell .bell-count {
  display: none;
}

#bell.has-news .bell-count {
  position: absolute;
  inset: -5px -6px auto auto;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding-inline: 4px;
  border: 2px solid var(--bg-page);
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 600;
}

.user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  min-height: 44px;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--text-primary);
  text-align: start;
  line-height: 1.25;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}

.user:is(:hover, :has(+ :popover-open)) {
  background-color: var(--primary-soft);
  border-color: var(--primary-line);
}

.user > .icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.user-name { max-inline-size: 26ch; overflow-wrap: anywhere; }
.user-short { display: none; }

@media (max-width: 420px) {
  .topbar:has(.user) .search { min-width: 0; }
  .topbar:has(.user) .search-launch { padding-inline: var(--space-2); }
  .topbar:has(.user) .search-launch > span { overflow: hidden; text-overflow: ellipsis; }
  .topbar .user { gap: var(--space-1); padding-inline: var(--space-1); }
  .topbar .user > .icon { width: 12px; height: 12px; }
}

@media (max-width: 380px) {
  .topbar:has(.user) .search-launch { width: 44px; justify-content: center; }
  .topbar:has(.user) .search-launch > span {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
  }
  .topbar .user-short { display: inline; font-size: var(--text-s); }
}

.user small {
  display: block;
  font-size: var(--text-s);
  font-weight: 400;
  color: var(--text-secondary);
}

.user .avatar {
  background: var(--prune-800);
  color: var(--on-primary);
}

/* ------------------------------------------------------------ structure des écrans */

/* Toute la largeur disponible : les tableaux et l'agenda en profitent. */
.screen {
  padding: var(--space-6) var(--space-6) var(--space-8);
  /* Zone qui reçoit le focus après chaque changement d'écran, pour les lecteurs d'écran. */
  outline: none;
}

.screen > * + * {
  margin-top: var(--space-4);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.page-head p {
  margin-top: 2px;
  color: var(--text-secondary);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.panel {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--bg-surface);
}

.panel.flush {
  padding: 0;
  overflow: hidden;
}

.panel h2,
.panel-title h2 {
  font-size: var(--text-l);
  font-weight: 600;
  line-height: 1.3;
}

.panel > h2 {
  margin-bottom: var(--space-3);
}

.panel > h2.spaced {
  margin-top: var(--space-6);
}

.panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}

.panel-title.padded {
  margin: 0;
  padding: var(--space-4) var(--space-5);
}

.panel-title p {
  color: var(--text-secondary);
}

.panel-title p strong {
  color: var(--text-primary);
}

.two-columns,
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.two-columns.rooms-wide {
  grid-template-columns: minmax(0, 1fr);
}

/* Les salles passent à côté des événements seulement sur les très grands écrans. */
@media (min-width: 1680px) {
  .two-columns.rooms-wide {
    grid-template-columns: minmax(420px, 0.8fr) minmax(0, 1.6fr);
  }
}

.hint {
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
}

.hint strong {
  color: var(--text-primary);
}

.empty {
  padding: var(--space-6) var(--space-5);
  color: var(--text-secondary);
  text-align: center;
}

.footnote {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-size: var(--text-s);
  color: var(--text-secondary);
}

.footnote .icon {
  width: 18px;
  height: 18px;
  color: var(--lake);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-s);
  background: var(--prune-900);
  color: var(--amber);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.list > li:has(.date-tile) {
  padding: var(--space-3) 0;
}

.list > li > .icon,
.row-button > .icon:first-child {
  color: var(--primary);
}

.row-button > .icon:last-child {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ tableaux */

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: var(--space-2) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: var(--space-2) var(--space-5);
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.table .amount {
  text-align: right;
}

/* Tablette : cellules resserrées, et la langue (visible dans la fiche) cède sa place dans l'annuaire,
   pour que le tableau tienne sans défilement horizontal. */
@media (min-width: 761px) and (max-width: 1100px) {
  .table :is(th, td) {
    padding-inline: var(--space-3);
  }

  .people-table :is(th, td):nth-child(4) {
    display: none;
  }
}

.lang {
  padding: 2px 7px;
  border-radius: var(--radius-s);
  background: var(--bg-sunken);
  font-size: var(--text-s);
  font-weight: 500;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

.pager span {
  margin-right: var(--space-2);
}

.pager button:disabled {
  color: var(--border-strong);
  cursor: not-allowed;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-surface);
  cursor: pointer;
}

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

.filter[aria-pressed="true"] {
  border-color: var(--prune-900);
  background: var(--prune-900);
  color: var(--on-primary);
}

.filter[aria-pressed="true"] span {
  color: var(--amber);
}

.screen > .search-field {
  max-width: 360px;
}

/* ------------------------------------------------------------ accueil */

.sunday {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-5) 0 var(--space-6);
  border-radius: var(--radius-l);
  background: var(--prune-900);
  color: var(--on-primary);
  overflow: hidden;
}

.sunday-text {
  padding-bottom: var(--space-5);
}

.sunday-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sunday h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
}

.sunday p,
.sunday-foot span {
  color: var(--on-dark-muted);
}

.sunday .date-tile {
  background: var(--amber);
  color: var(--prune-950);
}

.team-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-5);
  margin: var(--space-5) 0;
  padding: 0;
  list-style: none;
}

.team-summary li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border-top: 1px solid oklch(1 0 0 / 0.14);
}

.sunday-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.sunday-window {
  align-self: end;
}

/* Histogrammes : la dernière barre porte la couleur de marque. */
.bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--space-2);
  height: 168px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bars li {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: var(--text-s);
}

.bars i {
  width: 100%;
  height: calc(var(--h) * 0.68);
  min-height: 4px;
  border-radius: 5px 5px 0 0;
  background: var(--primary-line);
}

.bars li:last-child i {
  background: var(--primary);
}

.bars small {
  color: var(--text-muted);
  white-space: nowrap;
}

.bars.compact {
  height: 140px;
}

/* ------------------------------------------------------------ fiche d'une personne */

.drawer-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-sunken);
}

.drawer-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.2;
}

.drawer-head p {
  color: var(--text-secondary);
}

.drawer > section {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}

.drawer h3,
.split h3,
.team h3 {
  margin-bottom: var(--space-2);
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--text-secondary);
}

.facts {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}

.facts dt {
  color: var(--text-secondary);
}

.facts dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-m);
  color: var(--text-muted);
  background: var(--bg-sunken);
}

.steps li.done {
  color: var(--color-success);
  background: var(--color-success-soft);
}

.steps li.current {
  color: var(--on-primary);
  background: var(--prune-800);
  font-weight: 500;
}

.locked {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.list.plain > li {
  min-height: 40px;
  border-top: 0;
  padding: 0;
}

/* ------------------------------------------------------------ groupes */

.rate {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.rate .meter {
  width: 96px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
}

.scroll-list {
  max-height: 320px;
  overflow-y: auto;
}

/* ------------------------------------------------------------ culte */

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

.plan-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.plan-item:first-child {
  border-top: 0;
}

.plan-item.preparation {
  color: var(--text-secondary);
}

.plan-time {
  font-family: var(--font-display);
  font-size: var(--text-l);
  line-height: 1.3;
}

.plan-item small {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-s);
  color: var(--text-secondary);
}

.songs {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}

.songs li + li {
  border-top: 1px solid var(--border);
}

.song {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 64px 18px;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  background: none;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.song .grow {
  color: var(--text-primary);
  font-weight: 500;
}

.song:hover .grow {
  color: var(--primary);
}

.song .icon {
  width: 18px;
  height: 18px;
}

blockquote {
  margin: var(--space-2) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  background: var(--lake-soft);
  font-family: var(--font-display);
  line-height: 1.45;
}

blockquote cite {
  display: block;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: var(--text-s);
  font-style: normal;
  color: var(--text-secondary);
}

.team + .team {
  margin-top: var(--space-5);
}

.team .list > li {
  flex-wrap: wrap;
}

.team .list > li > .grow {
  flex-basis: 55%;
}

.candidate.unavailable .avatar,
.candidate.unavailable strong {
  opacity: 0.55;
}

.candidate .check {
  min-height: 44px;
  cursor: pointer;
}

.modal form > .field {
  margin-top: var(--space-4);
}

/* ------------------------------------------------------------ enfants */

.rooms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.room + .room {
  padding-left: var(--space-5);
  border-left: 1px solid var(--border);
}

.room h2 {
  margin-bottom: 2px;
}

.room p {
  color: var(--text-secondary);
}

.room p strong {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text-primary);
}

.room .meter {
  margin: var(--space-2) 0;
}

.room small {
  font-size: var(--text-s);
  color: var(--text-secondary);
}

.labels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-3);
}

.label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-m);
}

.label strong {
  font-size: var(--text-l);
}

.label .code {
  margin-top: var(--space-2);
  font-size: var(--text-l);
}

.label.stub {
  background: var(--bg-sunken);
}

/* ------------------------------------------------------------ agenda */

.signup {
  width: 150px;
  flex: none;
}

.signup small {
  margin-top: 4px;
}

.booking-grid {
  overflow-x: auto;
}

.agenda-room-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.agenda-room-heading h2 {
  margin: 0;
}

.agenda-rental-requests {
  margin-bottom: var(--space-4);
}

.agenda-rental-requests .agenda-rental-request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  overflow-wrap: anywhere;
}

.agenda-rental-request p {
  margin-block: 4px 0;
  color: var(--text-secondary);
}

.agenda-rental-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.agenda-booking-cell {
  display: grid;
  gap: 4px;
}

.agenda-booking-cell .booking strong {
  overflow-wrap: anywhere;
}

.booking-row {
  display: grid;
  grid-template-columns: 104px repeat(7, minmax(0, 1fr));
  gap: 4px;
  min-width: 720px;
  margin-bottom: 4px;
}

.booking-head span {
  padding: 4px 0;
  font-size: var(--text-s);
  color: var(--text-secondary);
  text-align: center;
}

.booking-head .today {
  border-radius: var(--radius-s);
  background: var(--prune-900);
  color: var(--on-primary);
}

.booking-room {
  align-self: center;
  font-size: var(--text-s);
  font-weight: 500;
}

.booking,
.free {
  min-height: 56px;
  border-radius: var(--radius-s);
}

.booking {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 8px;
  background: var(--primary-soft);
  color: var(--prune-800);
  font-size: 12px;
  line-height: 1.25;
  hyphens: manual;
  overflow-wrap: normal;
  text-wrap: balance;
}

.booking small {
  color: var(--text-secondary);
}

.free {
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  background: none;
  color: transparent;
  cursor: pointer;
}

.free:hover,
.free:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

/* ------------------------------------------------------------ dons */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.stats div + div {
  padding-left: var(--space-5);
  border-left: 1px solid var(--border);
}

.stats small,
.stats span {
  display: block;
  font-size: var(--text-s);
  color: var(--text-secondary);
}

.stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.3;
}

.shares {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.shares li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 48px;
  align-items: center;
  gap: var(--space-3);
}

.shares strong {
  font-weight: 500;
  text-align: right;
}

.shares .meter {
  height: 10px;
  border-radius: 5px;
}

.panel > .button {
  margin-top: var(--space-4);
}

/* ------------------------------------------------------------ messages */

.channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin: 0;
  padding: 0;
  border: 0;
}

.channels legend {
  padding: 0;
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--text-secondary);
}

form.stack > .button {
  align-self: flex-start;
}

/* ------------------------------------------------------------ app des membres */

.member-layout {
  display: grid;
  grid-template-columns: 328px minmax(0, 440px);
  gap: var(--space-7);
  align-items: start;
}

/* ------------------------------------------------------------ aperçu intégré et impression */

.is-embedded {
  overflow: hidden;
}

/* ------------------------------------------------------------ petits écrans */

@media (max-width: 1080px) {
  .two-columns,
  .two-columns.rooms-wide,
  .home-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Mobile : la barre latérale laisse la place au logo en haut et aux onglets en bas. */
  .sidebar {
    display: none;
  }

  .topbar {
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
  }

  .topbar-logo {
    display: flex;
    flex: none;
  }

  .demo-note-mobile {
    display: block;
    padding: var(--space-2) var(--space-4);
    color: var(--text-secondary);
    font-size: var(--text-s);
  }

  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 6;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 6px var(--space-2) calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid oklch(1 0 0 / 0.1);
    background: var(--prune-900);
  }

  .app-body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .user .user-name {
    display: none;
  }

  .screen {
    padding: var(--space-5) var(--space-4) var(--space-7);
  }

  .sunday {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-5);
  }

  .sunday-text {
    padding-bottom: 0;
  }

  .sunday-window {
    display: none;
  }

  .team-summary,
  .rooms,
  .stats,
  .split,
  .member-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .room + .room,
  .stats div + div {
    padding: var(--space-4) 0 0;
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .member-layout {
    justify-items: center;
  }

  .signup {
    display: none;
  }
}

/* ------------------------------------------------------------ micro-interactions */

.nav a {
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.nav a .icon {
  transition: transform 0.18s ease-out;
}

@media (hover: hover) {
  .nav a:hover .icon {
    transform: translateX(2px);
  }

  .table tbody tr:hover,
  .list > li:has(> .row-button):hover,
  .candidate:hover {
    background-color: var(--bg-sunken);
  }

  .filter:hover {
    border-color: var(--primary);
  }

  .free:hover {
    background-color: var(--primary-soft);
  }
}

.table tbody tr,
.list > li,
.filter,
.free {
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}

.list > li:has(> .row-button) {
  margin-inline: calc(var(--space-2) * -1);
  padding-inline: var(--space-2);
  border-radius: var(--radius-s);
}

/* Seulement au changement d'écran : un rafraîchissement après une action ne rejoue pas l'entrée. */
.screen.is-entering > * {
  animation: screen-in 0.2s ease-out both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* ------------------------------------------------------------ louange */

a.song {
  color: inherit;
  text-decoration: none;
}

.sent-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  background: var(--color-success-soft);
  color: var(--color-success);
}

.sent-note.waiting {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

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

.setlist-item {
  border-top: 1px solid var(--border);
}

.setlist-item:first-child {
  border-top: 0;
}

.setlist-item small {
  display: block;
  color: var(--text-secondary);
}

.setlist-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--prune-900);
  color: var(--amber);
  font-family: var(--font-display);
}

.key-select {
  width: auto;
  min-width: 128px;
}

.setlist-tools {
  display: flex;
}

.setlist-tools .icon-button:disabled {
  color: var(--border-strong);
  cursor: default;
}

.library {
  margin-top: var(--space-3);
}

.library > li {
  gap: var(--space-3);
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out;
}

.option-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.option-card input {
  margin-top: 4px;
  accent-color: var(--primary);
}

.option-card small {
  display: block;
  color: var(--text-secondary);
}

/* vue des musiciens : pupitre plein écran pour iPad, sombre par défaut sur scène */
dialog.stage,
dialog.projector {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  display: flex;
  flex-direction: column;
}

dialog.stage {
  --stage-bg: var(--bg-page);
  --stage-text: var(--text-primary);
  --stage-muted: var(--text-secondary);
  --stage-line: var(--border);
  --stage-hover: oklch(0.3 0.05 335 / 0.06);
  --stage-chord: var(--prune-800);
  --stage-chorus: var(--amber-soft);
  --stage-accent: var(--prune-900);
  --stage-on-accent: var(--on-primary);
  background: var(--stage-bg);
  color: var(--stage-text);
}

dialog.stage.is-dark {
  --stage-bg: oklch(0.155 0.025 335);
  --stage-text: oklch(0.96 0.012 85);
  --stage-muted: oklch(0.74 0.025 335);
  --stage-line: oklch(1 0 0 / 0.1);
  --stage-hover: oklch(1 0 0 / 0.06);
  --stage-chord: var(--amber);
  --stage-chorus: oklch(0.8 0.13 80 / 0.07);
  --stage-accent: var(--amber);
  --stage-on-accent: var(--prune-950);
}

.stage-head,
.projector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
}

dialog.stage .stage-head {
  border-color: var(--stage-line);
}

dialog.stage .icon-button {
  color: var(--stage-text);
}

dialog.stage .icon-button:hover:not(:disabled) {
  background: var(--stage-hover);
}

dialog.stage .icon-button:disabled {
  opacity: 0.35;
}

.stage-tabs {
  display: flex;
  flex: 1;
  gap: var(--space-2);
  overflow-x: auto;
}

.stage-tabs button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3) 0 var(--space-2);
  border: 1px solid var(--stage-line);
  border-radius: 999px;
  background: none;
  color: var(--stage-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}

.stage-tabs button:hover {
  background: var(--stage-hover);
  color: var(--stage-text);
}

.stage-tabs button[aria-pressed="true"] {
  border-color: var(--stage-accent);
  background: var(--stage-accent);
  color: var(--stage-on-accent);
}

.stage-tab-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--stage-hover);
  font-size: var(--text-s);
  font-weight: 600;
}

.stage-tab-title {
  font-weight: 500;
}

.stage-tab-key {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
}

.stage-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--stage-line);
}

.stage-tool {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-s);
  color: var(--stage-muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-m);
}

.stepper .icon-button {
  width: 36px;
  height: 36px;
}

.stepper output {
  min-width: 4ch;
  font-weight: 600;
  text-align: center;
  color: var(--stage-text);
}

dialog.stage.is-dark .segmented {
  background: oklch(1 0 0 / 0.06);
}

dialog.stage.is-dark .segmented button {
  color: var(--stage-muted);
}

dialog.stage.is-dark .segmented button[aria-pressed="true"] {
  background: oklch(1 0 0 / 0.14);
  color: var(--stage-text);
  box-shadow: none;
}

.stage-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.stage-sheet {
  padding: var(--space-6) clamp(20px, 4vw, 64px) var(--space-8, 96px);
  font-size: calc(var(--text-l) * var(--zoom));
}

.stage-song {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}

.stage-song h2 {
  font-family: var(--font-display);
  font-size: calc(44px * var(--zoom));
  font-weight: 400;
  line-height: 1.1;
}

.stage-credit {
  margin-top: var(--space-2);
  font-size: var(--text-s);
  color: var(--stage-muted);
}

.stage-facts {
  display: flex;
  gap: var(--space-2);
  margin: 0;
}

.stage-facts div {
  min-width: 120px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-m);
}

.stage-facts dt {
  font-size: 12px;
  color: var(--stage-muted);
}

.stage-facts dd {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 2px 0 0;
  font-size: var(--text-l);
  font-weight: 600;
}

.stage-facts small {
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--stage-chord);
}

/* Pulsation au tempo du chant. */
.metronome {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--stage-chord);
  animation: beat var(--beat) ease-out infinite;
}

@keyframes beat {
  from {
    transform: scale(1.35);
    opacity: 1;
  }
  to {
    transform: scale(0.75);
    opacity: 0.35;
  }
}

.stage-map {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-5) 0 var(--space-4);
}

.stage-map button {
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--stage-line);
  border-radius: 999px;
  background: none;
  color: var(--stage-text);
  font-size: var(--text-s);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease-out;
}

.stage-map button:hover {
  background: var(--stage-hover);
}

.stage-map button.is-chorus {
  border-color: transparent;
  background: var(--stage-chorus);
  color: var(--stage-chord);
}

.has-columns .stage-sections {
  column-gap: var(--space-6);
}

@media (min-width: 1100px) {
  .has-columns .stage-sections {
    columns: 2;
    column-rule: 1px solid var(--stage-line);
  }
}

.chord-section {
  break-inside: avoid;
  margin-bottom: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-l);
  scroll-margin-top: var(--space-4);
}

.chord-section.is-chorus {
  background: var(--stage-chorus);
}

.chord-section h3 {
  margin-bottom: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stage-muted);
}

.chord-section.is-chorus h3 {
  color: var(--stage-chord);
}

.chord-line {
  display: flex;
  flex-wrap: wrap;
  white-space: pre;
  line-height: 1.3;
}

.chord-line + .chord-line {
  margin-top: 0.6em;
}

.chord-line span {
  display: inline-flex;
  flex-direction: column;
}

.chord-line b {
  padding-right: 0.5em;
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--stage-chord);
}

.lyric-line {
  margin: 0;
  line-height: 1.55;
}

.stage-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--stage-line);
}

.stage-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  justify-self: start;
  max-width: 100%;
  min-height: 52px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-m);
  background: none;
  color: var(--stage-text);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease-out;
}

.stage-nav.is-next {
  justify-self: end;
  text-align: right;
}

.stage-nav:hover {
  background: var(--stage-hover);
}

.stage-nav span {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-nav small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--stage-muted);
}

.stage-autoscroll {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--stage-line);
  border-radius: 999px;
  background: none;
  color: var(--stage-text);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.stage-autoscroll:hover {
  background: var(--stage-hover);
}

.stage-autoscroll[aria-pressed="true"] {
  border-color: var(--stage-accent);
  background: var(--stage-accent);
  color: var(--stage-on-accent);
}

.stage-tools-toggle {
  display: none;
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--stage-line);
  border-radius: 999px;
  background: none;
  color: var(--stage-text);
  font-weight: 500;
  cursor: pointer;
}

.stage-tools-toggle[aria-expanded="true"] {
  background: var(--stage-hover);
}

@media (max-width: 700px) {
  .stage-tab-title {
    display: none;
  }

  .stage-tools-toggle {
    display: inline-flex;
    align-items: center;
  }

  .stage-tools {
    display: none;
  }

  .stage-tools.is-open {
    display: flex;
  }

  .stage-sheet {
    padding-top: var(--space-5);
  }

  .stage-song h2 {
    font-size: calc(34px * var(--zoom));
  }

  .projector-main {
    overflow-y: auto;
    padding: var(--space-4);
  }

  .projector-head {
    padding: var(--space-3) var(--space-4);
  }

  .projector-keys {
    display: none;
  }

  .projector-controls {
    flex-wrap: wrap;
  }

  .projector-controls .button {
    flex: 1 1 40%;
  }

  .projector-strip {
    padding: var(--space-3) var(--space-4);
  }

  .stage-nav span {
    display: none;
  }
}


/* projection : régie sombre, écran 16:9 avec fond animé */
dialog.projector {
  background: oklch(0.15 0.03 335);
  color: var(--on-primary);
}

.projector-head {
  border-color: oklch(1 0 0 / 0.1);
  padding: var(--space-4) var(--space-6);
}

.projector-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
}

.projector-head p {
  font-size: var(--text-s);
  color: var(--on-dark-muted);
}

.projector-keys {
  margin-left: auto;
  font-size: var(--text-s);
  color: var(--on-dark-muted);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-right: 2px;
  padding: 0 5px;
  border: 1px solid oklch(1 0 0 / 0.25);
  border-bottom-width: 2px;
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  color: var(--on-primary);
}

.projector-head .icon-button:hover {
  background: oklch(1 0 0 / 0.08);
}

.projector-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 26vw, 380px);
  gap: var(--space-6);
  flex: 1;
  min-height: 0;
  padding: var(--space-5) var(--space-6);
}

.screen-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-s);
  color: var(--on-dark-muted);
}

.projector-side .screen-label:not(:first-child) {
  margin-top: var(--space-6);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(0.65 0.2 25);
  box-shadow: 0 0 0 4px oklch(0.65 0.2 25 / 0.25);
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  50% {
    box-shadow: 0 0 0 7px oklch(0.65 0.2 25 / 0);
  }
}

.screen-live .beamer {
  max-height: calc(100dvh - 330px);
  margin-inline: auto;
}

.beamer {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-m);
  background: #07040a;
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.1), 0 30px 60px -30px #000;
  overflow: hidden;
  isolation: isolate;
}

.beamer-text {
  position: relative;
  z-index: 2;
  height: 100%;
}

.beamer.is-black .beamer-bg {
  opacity: 0;
}

.slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 6cqw 8cqw;
  color: #fff;
  text-align: center;
  font-size: 4.2cqw;
  font-weight: 500;
  line-height: 1.4;
  text-wrap: balance;
  text-shadow: 0 2px 18px oklch(0.1 0.05 335 / 0.6);
  animation: slide-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.slide p {
  margin: 0;
}

.slide.is-title {
  font-family: var(--font-display);
  font-size: 6.4cqw;
  font-weight: 400;
}

.slide-credit {
  margin-top: 1.8cqw;
  font-family: var(--font-sans);
  font-size: 1.7cqw;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.slide-rule {
  width: 5cqw;
  height: 0.22cqw;
  margin-top: 2.6cqw;
  border-radius: 1px;
  background: var(--amber);
}

.slide-end {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  font-size: 5cqw;
  color: var(--on-dark-muted);
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(1.5cqw);
    filter: blur(4px);
  }
}

/* fonds animés : shaders WebGL (motion.js), grain compris dans le rendu */
.beamer-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  /* Secours sans WebGL : un dégradé prune avec le grain standard. */
  background: var(--ark-decorative-grain), radial-gradient(120% 90% at 30% 20%, oklch(0.32 0.09 335), oklch(0.12 0.04 320) 70%);
  transition: opacity 0.5s ease-out;
}

.beamer:fullscreen {
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.projector-controls {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.projector-controls .button.secondary {
  background: oklch(1 0 0 / 0.06);
  border-color: oklch(1 0 0 / 0.16);
  color: var(--on-primary);
}

.projector-controls .button.secondary:hover {
  background: oklch(1 0 0 / 0.12);
}

.projector-controls .button.secondary[aria-pressed="true"] {
  background: var(--on-primary);
  color: var(--prune-950);
}

.bg-swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.bg-swatch {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-m);
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transition: border-color 0.15s ease-out, transform 0.15s ease-out;
}

.bg-swatch:hover {
  transform: translateY(-2px);
}

.bg-swatch[aria-pressed="true"] {
  border-color: var(--amber);
}

.bg-swatch b {
  position: absolute;
  left: var(--space-2);
  bottom: 6px;
  z-index: 2;
  font-size: var(--text-s);
  font-weight: 500;
  color: #fff;
}

.projector-strip {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-4) var(--space-6) var(--space-5);
  list-style: none;
  overflow-x: auto;
  border-top: 1px solid oklch(1 0 0 / 0.1);
}

.projector-strip button {
  width: 168px;
  min-height: 64px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid oklch(1 0 0 / 0.12);
  border-radius: var(--radius-m);
  background: oklch(1 0 0 / 0.04);
  color: var(--on-dark-muted);
  text-align: left;
  font-size: var(--text-s);
  cursor: pointer;
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out;
}

.projector-strip button:hover {
  border-color: oklch(1 0 0 / 0.35);
}

.projector-strip button[aria-current="true"] {
  border-color: var(--amber);
  background: oklch(0.8 0.13 80 / 0.14);
  color: var(--on-primary);
}

.projector-strip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-song {
  align-self: center;
  padding: 0 var(--space-2) 0 var(--space-4);
  font-family: var(--font-display);
  white-space: nowrap;
  color: var(--amber);
}

.strip-song:first-child {
  padding-left: 0;
}

@media (max-width: 900px) {
  .projector-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------ louange : mise en page */

.worship-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.setlist-item {
  display: grid;
  grid-template-columns: 32px minmax(200px, 1fr) 136px auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
}

.setlist-item strong {
  font-size: var(--text-l);
  font-weight: 500;
}

.key-select {
  width: 100%;
}

@media (max-width: 1080px) {
  .worship-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .setlist-item {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    row-gap: var(--space-3);
  }

  .setlist-tools {
    grid-row: 1;
    grid-column: 3;
  }

  .key-select {
    grid-row: 2;
    grid-column: 2;
  }

  .setlist-item > .button {
    grid-row: 2;
    grid-column: 3;
    justify-self: end;
  }

  .plan-item {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }

  .plan-time {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
  }

  .song {
    grid-template-columns: minmax(0, 1fr) auto auto 18px;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }
}

/* ------------------------------------------------------------ documents A4 */

.paper-stage {
  padding: var(--space-5);
  border-radius: var(--radius-m);
  background: var(--bg-sunken);
  overflow-x: auto;
}

.a4 {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 640px;
  min-height: 905px;
  margin: 0 auto;
  padding: 52px 56px 40px;
  background: #fff;
  color: #231c22;
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow: 0 1px 2px oklch(0.2 0.03 335 / 0.18), 0 18px 40px -24px oklch(0.2 0.05 335 / 0.5);
}

.doc-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--prune-900);
}

.doc-head span,
.doc-sender {
  display: block;
  font-size: 10px;
  color: #6b5d68;
}

.doc-church {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--prune-900);
}

.a4 .doc-kind {
  align-self: flex-start;
  padding: 3px 8px;
  border: 1px solid var(--prune-900);
  border-radius: 3px;
  color: var(--prune-900);
  font-weight: 600;
}

.doc-sender {
  text-align: right;
  line-height: 1.5;
}

.doc-title {
  margin: 26px 0 14px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--prune-900);
}

.doc-subtitle {
  margin: 22px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--prune-900);
}

.doc-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 12px;
  background: #f6f1f4;
  border-radius: 4px;
}

.doc-meta dt {
  font-size: 9.5px;
  color: #6b5d68;
}

.doc-meta dd {
  margin: 0;
  font-weight: 600;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
}

.doc-table th {
  padding: 6px 8px;
  border-bottom: 1px solid #231c22;
  font-size: 9.5px;
  font-weight: 600;
  text-align: left;
  text-transform: none;
  color: #6b5d68;
}

.doc-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e3dae0;
  vertical-align: top;
}

.doc-table tfoot td {
  border-bottom: 0;
  border-top: 1.5px solid #231c22;
  font-weight: 600;
}

.doc-table tr.is-prep {
  color: #6b5d68;
}

.doc-time {
  font-family: var(--font-display);
  font-size: 13px;
  white-space: nowrap;
}

.doc-amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.doc-songs {
  margin: 4px 0 0;
  padding-left: 14px;
}

.doc-songs span {
  color: #6b5d68;
}

.doc-quote.doc-announcements {
  white-space: pre-line;
}

.doc-quote {
  margin-top: 4px;
  font-family: var(--font-display);
  color: #4d3f4a;
}

.doc-teams {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}

.doc-teams h4 {
  margin: 0 0 4px;
  font-size: 10.5px;
}

.doc-teams ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-teams li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px dotted #d6cbd2;
}

.doc-teams li span {
  color: #6b5d68;
}

.doc-teams em {
  color: #a3541f;
  font-style: normal;
  font-weight: 600;
}

.doc-notes {
  flex: 1;
  min-height: 70px;
  background: repeating-linear-gradient(transparent 0 21px, #e3dae0 21px 22px);
}

.doc-recipient {
  margin: 40px 0 0 52%;
  font-style: normal;
  line-height: 1.55;
}

.doc-place {
  margin-top: 36px;
}

.doc-letter p + p {
  margin-top: 10px;
}

.doc-letter .doc-table {
  margin: 14px 0 18px;
}

.doc-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 34px 0 0;
}

.doc-sign {
  display: block;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #231c22;
  font-family: "Brush Script MT", cursive;
  font-size: 20px;
  color: var(--prune-800);
}

.doc-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e3dae0;
  font-size: 9px;
  color: #6b5d68;
}

.doc-letter .doc-foot {
  margin-top: 40px;
}

.booking-days {
  display: none;
}

@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

.import-heading {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-m);
  font-weight: 600;
}

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

.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

/* Zone tactile de 44 px autour de l'interrupteur. */
.switch::before {
  content: "";
  position: absolute;
  inset: -8px 0;
}

.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-surface);
  box-shadow: 0 1px 3px oklch(0.2 0.03 335 / 0.3);
  transition: transform 0.2s ease-out;
}

.switch[aria-checked="true"] {
  background: var(--primary);
}

.switch[aria-checked="true"] span {
  transform: translateX(18px);
}

/* ------------------------------------------------------------ mobile : écrans de gestion */

@media (max-width: 760px) {
  .page-head {
    align-items: stretch;
    gap: var(--space-3);
  }

  .page-head h1 {
    font-size: var(--text-xl);
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .button {
    flex: 1 1 auto;
  }

  .panel {
    padding: var(--space-4);
  }

  .panel-title {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .filters,
  .segmented {
    flex-wrap: wrap;
  }

  /* Tableaux : une fiche par ligne, chaque valeur sous le titre de sa colonne. */
  .table-scroll {
    overflow: visible;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody {
    display: block;
  }

  .table tr {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
  }

  .table td {
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .table td:not(:first-child) {
    font-size: var(--text-s);
  }

  .table td:first-child {
    grid-column: 1 / -1;
  }

  .table td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
  }

  .table td[data-label=""]::before {
    content: none;
  }

  .table td[data-empty] {
    display: none;
  }

  .table .chip {
    max-width: 100%;
    white-space: normal;
  }

  .table .amount {
    text-align: left;
  }

  .bars {
    gap: 4px;
  }

  .drawer {
    width: 100vw;
    max-width: none;
  }

  .bars small {
    font-size: 10px;
  }
}

@media (max-width: 820px) {
  .booking-grid {
    display: none;
  }

  .booking-days {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .booking-day {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border);
  }

  .booking-day:first-child {
    border-top: 0;
  }

  .booking-day-name {
    padding-top: 2px;
    font-weight: 600;
  }

  .booking-day.is-today .booking-day-name {
    color: var(--primary);
  }

  .booking-day > .muted {
    padding-top: 2px;
    font-size: var(--text-s);
  }

  .booking-day-list {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .booking-day-list li {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-s);
    background: var(--primary-soft);
    font-size: var(--text-s);
  }

  .booking-day-list small {
    display: block;
    color: var(--text-secondary);
  }
}


@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body * {
    visibility: hidden;
  }

  .a4,
  .a4 * {
    visibility: visible;
  }

  .a4 {
    position: fixed;
    inset: 0;
    width: 210mm;
    min-height: 297mm;
    padding: 18mm 18mm 14mm;
    box-shadow: none;
  }
}

/* ------------------------------------------------------------ tâches avec action directe */

.task-go {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.task-go .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease-out;
}

@media (hover: hover) {
  .row-button:hover .task-go .icon {
    transform: translateX(3px);
  }
}

.row-button.notice {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-m);
  background: var(--primary-soft);
}

.row-button.notice > .icon:first-child {
  color: var(--primary);
}

/* ------------------------------------------------------------ cartes de contact */

.contact-cards {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.contact-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--bg-surface);
}

.contact-card > p {
  color: var(--text-secondary);
}

.contact-card > .chip {
  justify-self: start;
}

.contact-assign {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: var(--space-2);
}

.contact-assign > .field {
  flex: 1 1 190px;
  min-width: 0;
}

/* ------------------------------------------------------------ aperçu de la reprise */

.import-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-5) var(--space-6);
}

.import-counts {
  width: 100%;
  border-collapse: collapse;
}

.import-counts th,
.import-counts td {
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
  text-align: right;
}

.import-counts thead th {
  border-top: 0;
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--text-secondary);
}

.import-counts tbody th {
  font-weight: 500;
  text-align: left;
}

.import-counts td {
  font-weight: 600;
}

.choice-pair {
  display: inline-flex;
  flex: none;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.choice-pair .filter {
  min-height: 32px;
  font-size: var(--text-s);
}

.import-fields .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* Le choix passe sous le nom quand la colonne est étroite. */
.import-preview .list > li:has(.choice-pair) {
  flex-wrap: wrap;
}

.import-preview .list > li:has(.choice-pair) > .grow {
  flex-basis: 170px;
}

/* ------------------------------------------------------------ menu groupé et mentions */

/* Le menu occupe la hauteur disponible : chaque entrée s'étire jusqu'à 42 px sur un grand écran et se
   resserre jusqu'à 30 px sur un petit, pour ne pas défiler aux hauteurs courantes. */
.sidebar .nav {
  flex: 1 1 auto;
  min-height: 0;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--prune-800) transparent;
  padding: 3px;
}

.nav-group {
  flex: none;
  margin: var(--space-2) var(--space-3) 0;
  color: var(--on-dark-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.sidebar .nav a {
  flex: 1 1 38px;
  min-height: 30px;
  max-height: 42px;
  white-space: nowrap;
  transition: color 180ms ease-out, background-color 180ms ease-out;
}

/* « Réglages » reste en bas du menu, toujours visible, séparé des écrans du quotidien par un filet. */
.sidebar .nav a.nav-settings {
  position: sticky;
  bottom: 0;
  flex: none;
  min-height: 38px;
  margin-top: auto;
}

.sidebar .nav a.nav-settings:not([aria-current="page"]) {
  background-color: var(--prune-900);
}

.sidebar .nav a.nav-settings:not([aria-current="page"]):hover {
  background-color: var(--prune-800);
}

/* Écran peu haut : le menu se resserre pour tenir sans défiler. */
@media (max-height: 860px) {
  .sidebar .nav { gap: 2px; }
  .sidebar .nav a { min-height: 28px; }
  .sidebar .nav a.nav-settings { min-height: 34px; }
  .nav-group { margin-top: var(--space-1); }
}

.sidebar .nav a.nav-settings::before {
  content: "";
  position: absolute;
  inset: -3px var(--space-1) auto;
  border-top: 1px solid oklch(1 0 0 / 0.14);
}

.settings-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-s);
  font-weight: 500;
  text-decoration: none;
}

.settings-back:hover { color: var(--primary); }
.settings-back svg { width: 16px; height: 16px; }

.settings-grid {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "icon text arrow" "icon state arrow";
  align-items: center;
  gap: var(--space-2) var(--space-4);
  height: 100%;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background-color: var(--bg-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease-out, transform 160ms ease-out;
}

.settings-card:hover { border-color: var(--primary-line); transform: translateY(-1px); }
.settings-card > svg { grid-area: arrow; width: 18px; height: 18px; color: var(--text-muted); transition: transform 160ms ease-out; }
.settings-card:hover > svg { transform: translateX(3px); color: var(--primary); }
.settings-card-icon { grid-area: icon; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-m); background-color: var(--primary-soft); color: var(--primary); }
.settings-card-icon svg { width: 22px; height: 22px; }
.settings-card-text { grid-area: text; display: grid; gap: var(--space-1); }
.settings-card-text strong { font: 400 var(--text-xl) var(--font-display); }
.settings-card-text span { color: var(--text-secondary); }
.settings-card-state { grid-area: state; color: var(--primary); font-size: var(--text-s); font-weight: 600; }

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

@media (max-width: 560px) {
  .settings-card { align-items: start; padding: var(--space-4); gap: var(--space-2) var(--space-3); }
  .settings-card-icon { width: 36px; height: 36px; }
  .settings-card > svg { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .settings-card, .settings-card > svg { transition: none; }
  .settings-card:hover, .settings-card:hover > svg { transform: none; }
}

.sheet-nav {
  display: grid;
  gap: 3px;
}

.sheet-nav .row-button[aria-current="page"] {
  background-color: var(--primary-soft);
  border-radius: var(--radius-m);
}

/* La feuille « Plus » grandit avec les sections accessibles. */
.modal.sheet {
  inset: auto 0 0;
  width: min(100%, 640px);
  height: auto;
  max-height: 88dvh;
  margin: 0 auto;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}

.modal.sheet[open] {
  animation: sheet-in 220ms ease-out;
}

.modal.sheet .modal-head .icon-button {
  min-width: 44px;
  min-height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  .user,
  .sidebar .nav a,
  .sidebar .nav a .icon {
    transition: none;
  }
  .modal.sheet[open] {
    animation: none;
  }
}

.mock-note {
  flex: none;
  padding-block: var(--space-2) 0;
  font-size: 12px;
  line-height: 1.4;
}

.mock-note a {
  display: flex;
  align-items: center;
  width: max-content;
  min-height: 28px;
  color: inherit;
  text-underline-offset: 3px;
}

@media (max-height: 480px) {
  .sidebar {
    overflow-y: auto;
  }

  .sidebar .nav {
    flex-shrink: 0;
    overflow: visible;
  }
}

/* ------------------------------------------------------------ cartes de synthèse */

.bento-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-4);
}

.bento-row > * {
  min-width: 0;
}

.bento-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.bento-row .panel h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  text-wrap: balance;
}

.bento-row .panel h2 .icon {
  margin-inline-end: var(--space-1);
  color: var(--primary);
  vertical-align: -0.15em;
}

.bento-metric {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

.bento-metric strong {
  margin-inline-end: var(--space-1);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.3vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
}

.bento-card > .bento-action {
  align-self: flex-start;
  margin-top: auto;
}

.bento-card:has(.bento-action) > :nth-last-child(2) {
  margin-bottom: var(--space-4);
}

.bento-card .shares li {
  grid-template-columns: minmax(90px, 1fr) minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.bento-card .empty {
  border-radius: var(--radius-m);
  background: var(--bg-sunken);
}

.bento-row .home-sunday {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
}

.home-sunday .sunday-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0;
}

.home-sunday .sunday-head {
  align-items: flex-start;
}

.home-sunday .sunday-head h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  line-height: 1.15;
  margin-bottom: var(--space-2);
}

.home-sunday .sunday-photo {
  margin-top: var(--space-4);
  overflow: hidden;
  border-radius: var(--radius-m);
}

.home-sunday .sunday-image {
  display: block;
  width: 100%;
  height: auto;
}

.home-sunday .team-summary {
  gap: 0 var(--space-4);
  margin-block: var(--space-4);
}

.home-sunday .team-summary li {
  gap: var(--space-2);
}

.home-sunday .sunday-foot {
  margin-top: auto;
}

.home-tasks .task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-1) var(--space-3);
  padding-block: var(--space-2);
}

.home-tasks .task > .icon {
  align-self: start;
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: var(--space-2);
  border-radius: var(--radius-m);
  background: var(--primary-soft);
}

.home-tasks .task-go {
  grid-column: 2;
}

.home-tasks .list > li {
  padding: var(--space-2) 0;
}

@media (hover: hover) {
  .home-tasks .task:hover .grow {
    color: var(--primary);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .home-tasks .task .grow {
    transition: color 180ms ease-out;
  }

  .home-sunday .sunday-image {
    animation: sunday-photo-in 240ms ease-out;
  }
}

@keyframes sunday-photo-in {
  from {
    opacity: 0.85;
  }
}

.home-giving {
  background: var(--amber-soft);
}

.home-live {
  background: var(--lake-soft);
}

.home-previous {
  color: var(--text-secondary);
  font-size: var(--text-s);
}

.home-funds {
  margin: var(--space-3) 0;
  padding: 0;
  font-size: var(--text-s);
}

.home-funds {
  display: grid;
  gap: var(--space-2);
  list-style: none;
}

.home-funds li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-2);
  align-items: baseline;
}

.home-funds .meter {
  grid-column: 1 / -1;
  height: var(--space-1);
  background: var(--color-warning-soft);
}

.home-funds .meter span {
  background: var(--color-warning);
}

.home-live-title {
  font-weight: 600;
}

.home-grid {
  align-items: stretch;
}

.home-grid h2,
.home-grid .button {
  text-wrap: balance;
}

.home-grid .button {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.home-card-heading,
.home-lines > :is(li, div),
.home-response {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.home-card-heading {
  align-items: flex-start;
}

.home-card-heading h2,
.home-card-heading p {
  margin: 0;
}

.home-card-heading p,
.home-lines small {
  color: var(--text-secondary);
  text-wrap: pretty;
}

.home-lines {
  margin: var(--space-3) 0;
  padding: 0;
  list-style: none;
}

.home-lines > :is(li, div) {
  justify-content: space-between;
  min-height: 44px;
  padding-block: var(--space-2);
  border-top: 1px solid var(--border);
}

.home-lines small {
  display: block;
}

.home-room-next h3 {
  margin: var(--space-3) 0 0;
  font-size: var(--text-s);
}

.home-room-next .home-lines { margin-bottom: 0; }
.home-room-next .home-lines li > :last-child {
  color: var(--text-secondary);
  font-size: var(--text-s);
  text-align: right;
  text-wrap: pretty;
}

.home-facts dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.home-lines .chip {
  max-width: 100%;
  white-space: normal;
}

.home-checks > li {
  justify-content: flex-start;
}

.home-check-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--color-warning);
}

.home-check-mark.is-ready {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.bento-row .home-service { gap: var(--space-3); }

.home-service .home-lines > li {
  flex-wrap: wrap;
  border-color: oklch(1 0 0 / 0.14);
}

.home-service .home-response {
  flex: 1 0 100%;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.home-service > .button {
  align-self: flex-start;
  margin-top: auto;
}

.home-service :is(.home-service-rehearsal, .home-lines) { margin: 0; }

.home-camp { background: var(--amber-soft); }
.home-kiosk { background: var(--lake-soft); }

.home-attendance .bars { margin-bottom: 0; }

.people-directory > .search-field {
  display: block;
  margin: var(--space-4) var(--space-5) 0;
}

.service-teams {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}

.service-teams > .team {
  min-width: 0;
  margin: 0;
}

.kids-room-card > small {
  margin-top: var(--space-3);
  color: var(--text-secondary);
}

.metric-feature {
  background: var(--prune-900);
  color: var(--on-primary);
  border-color: var(--prune-900);
}

.metric-feature .bento-metric strong {
  color: var(--amber);
}

.giving-history .bars.months {
  margin-top: auto;
}

.payment-panel > .payment-panel-copy h2 {
  margin-bottom: var(--space-1);
}

.payment-panel .hint {
  margin-bottom: 0;
  text-wrap: pretty;
}

.pending-gifts > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-block: var(--space-3);
}

.pending-gifts > li button:last-child {
  grid-column: 2;
}

.pending-gifts .numeric {
  white-space: nowrap;
}

@media (min-width: 700px) {
  .home-grid,
  .giving-history {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .giving-payment .payment-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-4);
  }

  .payment-panel > .payment-panel-copy {
    margin-bottom: 0;
  }

  .payment-panel > .bento-action {
    align-self: center;
    margin: 0;
  }

  .pending-gifts > li {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--space-3);
  }

  .pending-gifts > li button:last-child {
    grid-column: auto;
  }

  .home-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }

  .kids-rooms,
  .giving-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .service-bento {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  .home-tasks .task {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .home-tasks .task-go {
    grid-column: 3;
  }

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

@media (min-width: 1536px) {
  .service-bento {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  }

  .agenda-bento {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  }
}

@media (max-width: 699px) {
  .bento-row .panel {
    padding: var(--space-4);
  }

  .bento-row .home-sunday {
    padding: var(--space-4);
  }

  .home-sunday .team-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-sunday .team-summary li {
    flex-wrap: wrap;
    align-content: center;
    min-height: 48px;
    gap: var(--space-1);
  }

  .bento-row .bars {
    gap: var(--space-1);
  }

  .people-directory > .search-field {
    margin-inline: var(--space-4);
  }

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

  .giving-totals .metric-feature {
    grid-column: 1 / -1;
  }

  .giving-totals .bento-card:not(.metric-feature) h2 {
    font-size: var(--text-l);
  }

  .giving-totals .bento-card:not(.metric-feature) .bento-metric strong {
    font-size: var(--text-xl);
  }

  .pending-gifts > li {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2);
  }

  .pending-gifts > li .row-button {
    grid-column: 1 / -1;
  }

  .pending-gifts > li .numeric {
    padding-inline-start: var(--space-2);
  }
}

@media (max-width: 400px) {
  .topbar {
    gap: var(--space-2);
  }

  .topbar .search-field .icon {
    left: var(--space-2);
    width: 16px;
  }

  .topbar .search-field .input {
    padding-inline: var(--space-6) var(--space-2);
  }
}

.plan-edit {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  text-align: start;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.plan-edit:hover {
  background: var(--primary-soft);
}

.plan-edit > .icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.guided-candidates > li {
  flex-wrap: wrap;
}

.guided-candidates > li > .grow {
  flex-basis: 185px;
}

.guided-child-list .chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bank-line-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.bank-line-header h4 {
  margin: 0;
  font-size: var(--text-m);
  overflow-wrap: anywhere;
}

.bank-line-header small {
  color: var(--text-secondary);
}

.modal-foot .bank-total {
  color: var(--primary);
}

@media (max-width: 600px) {
  .contact-assign .button {
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .modal-foot .bank-total {
    flex-basis: 100%;
  }
}
