/* Waitlist: public application and status pages, plus the admin queue. Uses the tokens and shared patterns in app.css. */

/* Public pages: one calm column */
.wl-public { max-width: 640px; margin: 0 auto; }
.wl-public .card + .card, .wl-public form > .card + .card { margin-top: 0; }
.wl-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; font-size: .95rem; }
/* Home and the garden's page: names wrap rather than clip (a name in another script keeps its own direction) */
.wl-back { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; min-width: 0; flex: 1 1 12rem; }
.wl-back a { overflow-wrap: anywhere; min-height: 44px; display: inline-flex; align-items: center; }
.wl-sep { color: var(--muted); }
.wl-public .subtitle bdi { overflow-wrap: anywhere; }
/* Already on the list: the form folds away under one quiet line */
.wl-fold { margin: 0 0 1.5rem; }
.wl-fold > summary { cursor: pointer; color: var(--tint); font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.wl-fold[open] > summary { margin-bottom: 1rem; }
/* An offer's season, kind, size and fee */
.wl-facts { margin: 0; }
.wl-confirm { margin: 0; flex: 1 1 100%; font-weight: 500; }
.wl-intro { margin-bottom: 1.5rem; max-width: 60ch; }
/* The garden page's hero, smaller: the garden's name in garden green, what this page is for, a watercolor basket. */
.wl-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin: 0 0 1.75rem; }
.wl-hero-text { min-width: 0; }
.wl-hero h1 { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.05; color: var(--tint); margin: 0 0 .35rem; overflow-wrap: anywhere; }
.wl-hero .wl-hero-title { font-size: 1.45rem; font-weight: 700; margin: 0 0 .5rem; }
.wl-hero-line { margin: 0; color: var(--muted); max-width: 52ch; text-wrap: pretty; }
.wl-hero-line .wl-stats { white-space: normal; }
.wl-hero-art { width: 180px; height: 180px; flex: none; margin-block: -.5rem; }
@media (max-width: 520px) {
  .wl-hero { align-items: flex-start; }
  .wl-hero-art { width: 104px; height: 104px; margin: 0; }
}
/* Calm form: cream cards, real section headings, roomy fields */
.wl-form .group + .group { margin-top: 1.75rem; }
.wl-form .card.stack { padding: 1.25rem 1.4rem; }
.wl-form label:not(.check) { font-weight: 500; }
.wl-form input:not([type=checkbox], [type=radio]), .wl-form select { background: var(--surface); box-shadow: inset 0 0 0 1px var(--field-edge); }
.wl-form input:not([type=checkbox], [type=radio]):focus, .wl-form select:focus { box-shadow: inset 0 0 0 1.5px var(--tint), 0 0 0 3px var(--tint-soft); }
.wl-lead { color: var(--muted); margin: 0; }
.wl-submit { margin-top: 1.75rem; }
/* Tick boxes get room to breathe and a comfortable tap area */
.wl-form .card > .check { padding-block: .35rem; }
.wl-form .card > .check + .check { margin-top: .25rem; }
/* Rules and waiver: a readable box that scrolls on its own, not a wall of text */
.wl-scroll { max-height: 18rem; font-size: .95rem; line-height: 1.6; overscroll-behavior: contain; }
.wl-scroll:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.wl-field { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; min-width: 0; }
.wl-field legend { font-size: .875rem; font-weight: 500; color: var(--muted); margin: 0 0 .4rem .1rem; padding: 0; }
.wl-inline { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.wl-inline input[type=radio] { width: 1.2rem; min-height: 0; height: 1.2rem; padding: 0; appearance: auto; -webkit-appearance: radio; accent-color: var(--tint); }
.wl-block { display: block; margin-inline-start: 0; }
.wl-select { user-select: all; }
.wl-offer { box-shadow: inset 0 0 0 2px var(--tint); }
.wl-leave { text-align: center; margin-top: 1.25rem; }
/* "Already applied? Email me my link": a quiet disclosure, never competing with the page's main button */
.wl-lost { margin: 0 0 1.5rem; }
.wl-lost > summary { cursor: pointer; color: var(--tint); font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.wl-lost-form { display: grid; gap: .6rem; margin-top: .25rem; }
.wl-lost-form .help { margin: 0; }
.wl-lost-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.wl-lost-row input { flex: 1 1 14rem; min-width: 0; }
.wl-lost-done:empty { display: none; }
.wl-lost-done { margin: 0; color: var(--muted); }
.wl-already { margin-bottom: 1.5rem; }
.wl-confirmed { color: var(--muted); }
/* Decision 14: place in line by kind of plot, under the overall number */
.wl-kinds h3 { font-size: 1rem; margin: .25rem 0 0; }
.wl-kinds .help { margin: .25rem 0 .5rem; }
.wl-kind-pos { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.wl-waiting { color: var(--ink); font-weight: 500; }
/* Honeypot: off screen for people, still in the form for bots */
.wl-hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Admin: one toolbar row (views on the left, the list's filters and search after them), then the table, then one help line */
.wl-bar .wl-tabs { flex: 0 1 auto; }
.wl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; flex: 1 1 24rem; min-width: 0; }
.wl-tools:empty { display: none; }
.wl-filter { max-width: 12rem; }
.wl-note { margin: .6rem 1.25rem 0; }
/* The queue reads one row per person, two lines at most. Priority and plot kind decide the order, so they show in full
   and wrap to a second line; only the email and status note clip (full text on hover). */
.wl-table td { vertical-align: middle; }
.wl-table .wl-name .wl-clip { max-width: 13rem; }
.wl-table .wl-tier { min-width: 12rem; max-width: 19rem; }
.wl-table .wl-kind { min-width: 8rem; max-width: 13rem; }
.wl-wrap { line-height: 1.35; text-wrap: pretty; }
.wl-table .wl-status .wl-clip { max-width: 10rem; }
.wl-table .wl-nowrap { white-space: nowrap; }
.wl-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-table .wl-status .row-meta { margin-top: .2rem; }
.wl-near { color: var(--tint); font-weight: 500; }
.wl-btns { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
/* Removals waiting for the waitlist keeper's OK sit above the queue, buttons wrapping under the name on a phone */
.wl-removals { margin-bottom: 1rem; }
.wl-removals .row-actions { flex-wrap: wrap; }

/* Rules page */
.wl-copy { display: flex; gap: .5rem; }
.wl-copy input { flex: 1; min-width: 0; }
.wl-q { padding: .9rem 0; border-top: .5px solid var(--sep); }
.wl-q:first-child { border-top: 0; padding-top: 0; }
.wl-q .fields { grid-template-columns: minmax(0, 2fr) minmax(9rem, 1fr); }
.wl-q .wl-q-end { display: flex; align-items: center; gap: 1.25rem; min-height: 44px; }
.wl-addq { padding-top: .9rem; }
#qs:not(:empty) + .wl-addq { border-top: .5px solid var(--sep); }
.wl-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .wl-two, .wl-q .fields { grid-template-columns: minmax(0, 1fr); } }

/* Paper application: a narrower form */
.wl-paper, .wl-rules { max-width: 760px; }
.wl-h { font-size: 1.05rem; font-weight: 650; margin: 0; }
@media (max-width: 560px) {
  .wl-bar .wl-tabs { flex: 1 1 100%; }
  .wl-bar .wl-tabs button { white-space: nowrap; padding-inline: .5rem; font-size: .9rem; }
  .wl-tools select { flex: 1 1 9rem; min-width: 0; max-width: 100%; }
  .wl-tools input[type=search] { flex: 1 1 100%; max-width: none; }
}

/* Filters sit inline on wide screens (the disclosure is held open and its summary hidden); on phones they fold
   behind one "Filter" row that shows how many are in use. */
.wl-filters { min-width: 0; }
.wl-filter-body { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.wl-phone { display: none; }
.wl-also { margin: 0 0 1rem; }
@media (min-width: 601px) { details.wl-filters > summary { display: none; } }

@media (max-width: 600px) {
  /* The view switcher scrolls sideways in one clean line instead of squeezing its labels */
  .wl-bar .wl-tabs { display: flex; flex: 1 1 100%; max-width: 100%; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .wl-bar .wl-tabs::-webkit-scrollbar { display: none; }
  .wl-bar .wl-tabs button { flex: none; white-space: nowrap; min-height: 36px; padding-inline: .85rem; font-size: .9rem; }
  .wl-tools { flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: .5rem; }
  .wl-tools input[type=search] { order: -1; flex: none; width: 100%; max-width: none; min-width: 0; }
  details.wl-filters > summary { min-height: 44px; padding: 0 .85rem; background: var(--fill-strong); border-radius: 10px; }
  details.wl-filters[open] > summary { margin-bottom: .5rem; }
  .wl-filters .value { color: var(--tint); font-weight: 500; }
  details.wl-filters { width: 100%; max-width: 100%; }
  .wl-filter-body select { flex: 1 1 100%; width: 100%; min-width: 0; max-width: none; min-height: 44px; }

  /* Tables become one block per row: name (and place in line) on top, then every column with its own small label */
  .wl-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wl-table, .wl-table tbody { display: block; }
  .wl-table tbody tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .75rem;
    padding: .85rem 1.25rem; border-top: .5px solid var(--sep); }
  .wl-table tbody tr:first-child { border-top: 0; }
  .table.wl-table td { display: block; padding: 0; border: 0; width: auto; min-width: 0; max-width: none; text-align: start; white-space: normal; }
  .wl-table td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); margin-bottom: .05rem; }
  .wl-phone { display: inline; }
  .wl-table .wl-name { grid-column: 1 / -1; padding-inline-end: 4.5rem; }
  .table.wl-table .wl-pos { position: absolute; top: .85rem; inset-inline-end: 1.25rem; color: var(--muted); font-size: .9rem; }
  .wl-table .wl-name .wl-clip, .wl-table .wl-status .wl-clip { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .wl-table .wl-status, .wl-table .wl-acts { grid-column: 1 / -1; }
  .wl-table .wl-acts:empty { display: none; }
  .wl-offers .wl-ostatus { grid-column: 1 / -1; }
  .wl-table .row-actions { justify-content: flex-start; flex-wrap: wrap; gap: .25rem 1.25rem; }

  /* Row buttons are thumb-sized */
  .wl-table .row-actions button, [data-plot].quiet, .wl-q-end .quiet, #addq, #copy, .wl-btns button { min-height: 44px; }
  [data-plot].quiet, .wl-q-end .quiet { display: inline-flex; align-items: center; }
}

/* Decision 13: "Needs accessible bed" - a quiet label beside the name; the order of the list never changes for it */
.wl-flag { display: inline-block; margin-top: .2rem; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem;
  font-weight: 500; color: var(--label); background: var(--fill); white-space: nowrap; }
.wl-acc { color: var(--ink); }
.wl-acc-note { display: block; margin-top: .35rem; }
/* Decisions 2 and 23: the on-hold switch and the next-season reply-by date sit under their fields */
.wl-skip { margin-top: 1rem; }
.wl-replyby { margin-top: 1rem; }

/* Admin Rules tab: section links at the top of the long form */
.wl-jump { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .5rem; margin: 0 0 1.25rem; font-size: .9rem; color: var(--muted); }
.wl-jump button.link { min-height: 32px; font-size: .9rem; }
.wl-rules .group-title[id^="wl-r-"] { scroll-margin-top: 4.5rem; }
.wl-rules .group-title[id^="wl-r-"]:focus { outline: none; }
