/* Waitlist composition. Identity, fields, pickers, buttons and dialogs are central SCD components. */
.an-waitlist { min-width:0; }
.an-waitlist-heading, .an-waitlist-actions, .an-waitlist-pagination { display:flex; flex-wrap:wrap; align-items:center; gap:var(--an-space-2); }
.an-waitlist-heading { justify-content:space-between; align-items:flex-start; gap:var(--an-space-4); margin-block:var(--an-space-3) var(--an-space-4); }
.an-waitlist-heading > div:first-child { flex:1; min-width:min(100%, 18em); }
.an-waitlist-title { margin-bottom:var(--an-space-2); }
.an-waitlist > [data-policy] { margin-bottom:var(--an-space-3); }
.an-waitlist-filters { margin-bottom:var(--an-space-3); }
.an-waitlist-days { display:flex; gap:var(--an-space-2); overflow-x:auto; padding-bottom:var(--an-space-3); }
.an-waitlist-days:empty { display:none; }
.an-waitlist-form { display:flex; flex-direction:column; gap:var(--an-space-4); }
.an-waitlist-form > p { margin:0; }
.an-waitlist-dialog .an-dialog__header, .an-waitlist-dialog .an-dialog__footer { flex-wrap:wrap; }
.an-waitlist-dialog .an-dialog__header h2 { flex:1; min-width:0; }
.an-waitlist-dialog .an-dialog__footer .an-button { white-space:normal; }
.an-waitlist .an-table td { vertical-align:top; overflow-wrap:anywhere; }
.an-waitlist .an-table td p + p { margin-top:var(--an-space-1); }
.an-waitlist .an-table strong { font-weight:var(--an-weight-semibold); }
.an-waitlist [data-loading] { padding-block:var(--an-space-2); }
.an-waitlist-pagination { justify-content:flex-end; padding-top:var(--an-space-3); }
.an-waitlist-pagination > :first-child { margin-right:auto; }
.an-waitlist-calendar-day { display:grid; align-content:center; justify-items:center; gap:var(--an-space-1); min-width:0; }
.an-waitlist-calendar-day .an-button { padding-inline:var(--an-space-2); }
.an-waitlist [hidden] { display:none !important; }

.an-dialog.an-waitlist-detail {
  width:min(calc(100vw - var(--an-space-4) * 2),calc(var(--an-control) * 18));
  overflow:hidden;
}
.an-waitlist-detail[open] { display:flex; flex-direction:column; }
.an-waitlist-detail > .an-dialog__header {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:start;
  flex:none;
  margin-bottom:var(--an-space-4);
}
.an-waitlist-detail__heading .an-caption { margin-top:var(--an-space-1); }
.an-waitlist-detail > .an-dialog__header .an-badge { align-self:center; white-space:normal; }
.an-waitlist-detail__body {
  display:grid;
  align-content:start;
  gap:var(--an-space-4);
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  overflow-wrap:anywhere;
}
.an-waitlist-detail__overview {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--an-space-4);
  padding:var(--an-space-3);
  background:var(--an-surface-soft);
  border-radius:var(--an-radius-control);
}
.an-waitlist-detail__identity, .an-waitlist-detail__section, .an-waitlist-detail__list {
  display:grid;
  align-content:start;
  gap:var(--an-space-2);
  min-width:0;
  margin:0;
}
.an-waitlist-detail__field { display:grid; gap:var(--an-space-1); }
.an-waitlist-detail__field :is(dt,dd) { margin:0; }
.an-waitlist-detail__field dt { font-weight:var(--an-weight-medium); }
.an-waitlist-detail__identity .an-waitlist-detail__field:first-child dd { font-weight:var(--an-weight-semibold); }
.an-waitlist-detail__notes { margin:0; white-space:pre-wrap; }
.an-waitlist-detail__list { padding:0; list-style:none; }
.an-waitlist-detail__requested, .an-waitlist-detail__offer-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--an-space-1) var(--an-space-3);
  flex-wrap:wrap;
}
.an-waitlist-detail__requested { padding-block:var(--an-space-1); }
.an-waitlist-detail__requested strong:first-letter { text-transform:uppercase; }
.an-waitlist-detail__offer {
  display:grid;
  gap:var(--an-space-1);
  padding:var(--an-space-2) var(--an-space-3);
  border:1px solid var(--an-border);
  border-radius:var(--an-radius-control);
}
.an-waitlist-detail__offer.is-current { background:var(--an-mint); border-color:var(--an-mint-strong); }
.an-waitlist-detail__offer .an-badge { white-space:normal; }
.an-waitlist-detail > .an-dialog__footer {
  flex:none;
  justify-content:flex-end;
  gap:var(--an-space-2);
  margin-top:var(--an-space-4);
  padding-top:var(--an-space-3);
}
.an-waitlist-detail > .an-dialog__footer > :last-child { margin-left:0; }
.an-waitlist-detail > .an-dialog__footer:empty { display:none; }

.apl-waitlist-editor {
  max-width:calc(var(--apl-ui-size-full) - var(--apl-ui-space-4) * 2);
}
.apl-waitlist-editor > form {
  display:flex;
  flex-direction:column;
  margin:var(--apl-ui-space-0);
  min-height:var(--apl-ui-space-0);
}
.apl-waitlist-editor__body { overscroll-behavior:contain; }
.apl-waitlist-editor__step {
  display:grid;
  gap:var(--apl-ui-space-3);
  min-width:var(--apl-ui-space-0);
}
.apl-waitlist-editor__step h3 {
  color:var(--apl-ui-color-text-strong);
  font:var(--apl-ui-font-weight-semibold) var(--apl-ui-font-size-label-lg)/var(--apl-ui-line-normal) var(--apl-ui-font-family);
  margin:var(--apl-ui-space-0);
}
.apl-waitlist-editor__step p { margin:var(--apl-ui-space-0); }
.apl-waitlist-editor__choices {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(var(--apl-ui-size-full),var(--apl-ui-waitlist-field-min)),1fr));
  gap:var(--apl-ui-space-2);
}
.apl-waitlist-editor__choices > .apl-btn {
  justify-content:flex-start;
  line-height:var(--apl-ui-line-normal);
  margin:var(--apl-ui-space-0);
  overflow-wrap:anywhere;
  padding-block:var(--apl-ui-space-1);
  text-align:start;
}
.apl-waitlist-editor__choices .apl-icon-frame {
  flex:none;
  width:var(--apl-ui-waitlist-choice-image-size);
  height:var(--apl-ui-waitlist-choice-image-size);
}
.apl-waitlist-editor__choices .apl-icon-frame > img {
  width:var(--apl-ui-size-full);
  height:var(--apl-ui-size-full);
  object-fit:cover;
}
.apl-waitlist-editor__choices input[type="checkbox"] {
  accent-color:var(--apl-ui-color-brand);
  flex:none;
  margin:var(--apl-ui-space-0);
}
.apl-waitlist-editor__choices .apl-btn:has(input:focus-visible) { outline:var(--apl-ui-border-width) solid var(--apl-ui-color-brand); }
.apl-waitlist-editor .apl-btn[aria-pressed="true"],
.apl-waitlist-editor__choices .apl-btn:has(input:checked) {
  background:var(--apl-ui-color-surface-hover);
  border-color:var(--apl-ui-color-brand);
  color:var(--apl-ui-color-brand-dark);
}
.apl-waitlist-editor__modes { display:flex; flex-wrap:wrap; gap:var(--apl-ui-space-2); }
.apl-waitlist-editor__preference {
  align-items:end;
  border-bottom:var(--apl-ui-border-width) solid var(--apl-ui-color-row-divider);
  display:grid;
  grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(0,1fr)) auto;
  gap:var(--apl-ui-space-2);
  padding-bottom:var(--apl-ui-space-2);
}
.apl-waitlist-editor__preference .apl-btn,
.apl-waitlist-editor [data-add-date] { justify-self:start; }
.apl-waitlist-editor summary { cursor:pointer; width:fit-content; color:var(--apl-ui-color-text-body); }
.apl-waitlist-editor details > .apl-field { margin-top:var(--apl-ui-space-2); }
.apl-waitlist-editor [data-form-error] { flex-basis:var(--apl-ui-size-full); margin:var(--apl-ui-space-0); }
.apl-waitlist-editor [data-editor-back] { margin-right:auto; }
.apl-waitlist-editor .apl-dialog__footer:not(:has(> :not([hidden]))) { display:none; }

@media(max-width:700px) {
  .an-waitlist-heading, .an-waitlist-heading > .an-waitlist-actions { width:100%; }
  .an-waitlist-collection { padding:var(--an-space-3); }
  .an-waitlist .an-table thead { display:none; }
  .an-waitlist .an-table, .an-waitlist .an-table tbody { display:block; }
  .an-waitlist .an-table tr { display:grid; gap:var(--an-space-2); padding-block:var(--an-space-3); border-bottom:1px solid var(--an-border); }
  .an-waitlist .an-table td { display:block; width:auto; padding:0; border:0; }
  .an-waitlist .an-table td:last-child { justify-self:end; }
}
@media(max-width:480px) {
  .an-waitlist-detail > .an-dialog__header { grid-template-columns:minmax(0,1fr) auto; }
  .an-waitlist-detail > .an-dialog__header [data-detail-status] { grid-row:2; justify-self:start; }
  .an-waitlist-detail__overview { grid-template-columns:1fr; gap:var(--an-space-3); }
  .an-waitlist-detail__contact { padding-top:var(--an-space-3); border-top:1px solid var(--an-border); }
  .an-waitlist-detail__contact .an-waitlist-detail__field {
    grid-template-columns:minmax(0,calc(var(--an-control) * 1.25)) minmax(0,1fr);
    align-items:baseline;
  }
  .apl-waitlist-editor [data-range] .apl-field-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .apl-waitlist-editor__preference { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .apl-waitlist-editor__preference > :first-child { grid-column:1 / -1; }
  .apl-waitlist-editor__preference > .apl-btn { grid-column:1 / -1; }
  .apl-waitlist-editor__choices { grid-template-columns:1fr; }
  .apl-waitlist-editor__choices .apl-icon-frame {
    width:var(--apl-ui-waitlist-choice-image-size-compact);
    height:var(--apl-ui-waitlist-choice-image-size-compact);
  }
}
