/* ── admin — the desk the party is run from ──────────────────────────────
   Deliberately not the party's visual language: this is a work tool, used
   standing up, outdoors, on a phone, often with one thumb. Everything here
   optimises for reading fast and hitting what you meant to hit.

   Two shapes from one markup (see the comment in any admin page): a sidebar
   from 960px up, a top bar plus a bottom tab bar below. Tables become cards
   under 700px — the width app.js also asks matchMedia about, so keep the
   two in step.

   Standalone: it loads neither the teaser's fonts nor /rsvp/app.css. */

:root{
  /* surfaces */
  --bg:#f4f5f7;
  --card:#ffffff;
  --well:#f8f9fb;              /* a sunk area inside a card */
  --line:#e7e9ee;
  --line-strong:#d2d6de;

  /* ink — every step is ≥4.5:1 on white and on --well */
  --ink:#111827;
  --muted:#4b5563;
  --faint:#6b7280;

  /* one accent, used for "this is where you are" and "this is the action" */
  --accent:#3347c9;
  --accent-ink:#ffffff;
  --accent-soft:#eceefc;
  --accent-line:#c7cdf5;

  --good:#067647;  --good-bg:#ecfdf3;  --good-line:#abefc6;
  --warn:#b54708;  --warn-bg:#fffaeb;  --warn-line:#fedf89;
  --bad:#b42318;   --bad-bg:#fef3f2;   --bad-line:#fecdca;

  --r-lg:16px; --r:12px; --r-sm:9px;
  --shadow:0 1px 2px rgba(17,24,39,.05), 0 1px 1px rgba(17,24,39,.03);
  --shadow-pop:0 12px 32px rgba(17,24,39,.16), 0 2px 6px rgba(17,24,39,.08);

  --side-w:15rem;
  --tab-h:calc(3.6rem + env(safe-area-inset-bottom));
  --control:2.5rem;            /* the height of a button or an input */
  --pad:clamp(1rem, 2.5vw, 1.5rem);
}

*,*::before,*::after{ box-sizing:border-box; margin:0; padding:0 }

html{ background:var(--bg); -webkit-text-size-adjust:100% }
body{
  min-height:100dvh;
  background:var(--bg);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,
              "Helvetica Neue",Arial,sans-serif;
  font-size:14.5px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  font-variant-numeric:tabular-nums;
}
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:6px }
svg{ flex:none }

/* ═══════════════════════════════════════════════════════════════════════
   THE SHELL
   ═══════════════════════════════════════════════════════════════════════ */

.mark{
  display:inline-flex; align-items:center; justify-content:center;
  font-size:.74rem; font-weight:800; letter-spacing:.08em;
  color:var(--accent-ink);
  background:linear-gradient(135deg, #4a5ee6 0%, var(--accent) 55%, #2735a8 100%);
  box-shadow:0 2px 6px rgba(51,71,201,.35), inset 0 1px 0 rgba(255,255,255,.18);
  height:2rem; padding:0 .55rem; border-radius:8px; text-decoration:none;
  flex:none;
}

/* ── sidebar (desktop) ────────────────────────────────────────────── */

.side{
  position:fixed; inset:0 auto 0 0; width:var(--side-w); z-index:6;
  display:flex; flex-direction:column;
  background:var(--card); border-right:1px solid var(--line);
  padding:1rem .75rem calc(.75rem + env(safe-area-inset-bottom));
}
.side-brand{
  display:flex; align-items:center; gap:.65rem;
  padding:.35rem .5rem .35rem; margin-bottom:1rem;
  text-decoration:none; color:inherit; min-width:0;
}
.brand-text{ display:flex; flex-direction:column; min-width:0; line-height:1.2 }
.brand-text b{ font-size:.8rem; font-weight:650; line-height:1.15 }
.brand-text small{ font-size:.72rem; color:var(--faint) }

.adm-nav{ display:flex; flex-direction:column; gap:2px; flex:1 }
.adm-nav a{
  display:flex; align-items:center; gap:.7rem;
  min-height:2.5rem; padding:.45rem .7rem; border-radius:10px;
  font-size:.9rem; font-weight:500; color:var(--muted);
  text-decoration:none;
  transition:background .12s, color .12s;
}
.adm-nav a svg{ width:20px; height:20px; color:var(--faint) }
.adm-nav a:hover{ background:var(--bg); color:var(--ink) }
.adm-nav a:hover svg{ color:var(--ink) }
.adm-nav a{ position:relative }
.adm-nav a::before{
  content:''; position:absolute; left:-.75rem; top:50%; width:3px; height:0;
  border-radius:0 3px 3px 0; background:var(--accent);
  transform:translateY(-50%); transition:height .18s cubic-bezier(.2,.8,.3,1);
}
.adm-nav a.on{ background:var(--accent-soft); color:var(--accent); font-weight:600 }
.adm-nav a.on::before{ height:1.4rem }
.adm-nav a.on svg{ color:var(--accent) }

.side-foot{
  display:flex; flex-direction:column; gap:2px;
  border-top:1px solid var(--line); padding-top:.6rem; margin-top:.6rem;
}
.side-foot a,.side-foot button{
  display:flex; align-items:center; gap:.7rem;
  min-height:2.4rem; padding:.4rem .7rem; border-radius:10px;
  font:inherit; font-size:.86rem; font-weight:500; color:var(--muted);
  background:none; border:0; cursor:pointer; text-decoration:none; text-align:left;
}
.side-foot svg{ width:18px; height:18px; color:var(--faint) }
.side-foot a:hover,.side-foot button:hover{ background:var(--bg); color:var(--ink) }

/* ── top bar + tab bar (phone) ────────────────────────────────────── */

.topbar{
  display:none; position:sticky; top:0; z-index:5;
  align-items:center; gap:.75rem;
  min-height:3.25rem; padding:.4rem var(--pad);
  padding-top:calc(.4rem + env(safe-area-inset-top));
  background:rgba(255,255,255,.92);
  -webkit-backdrop-filter:saturate(1.4) blur(10px); backdrop-filter:saturate(1.4) blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar-title{
  flex:1; min-width:0; font-size:1.02rem; font-weight:650; letter-spacing:-.01em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.topbar-link{
  font-size:.82rem; font-weight:500; color:var(--muted); text-decoration:none;
  padding:.5rem .6rem; margin-right:-.6rem; border-radius:8px; white-space:nowrap;
}

.tabbar{
  display:none; position:fixed; left:0; right:0; bottom:0; z-index:6;
  height:var(--tab-h); padding-bottom:env(safe-area-inset-bottom);
  background:rgba(255,255,255,.94);
  -webkit-backdrop-filter:saturate(1.4) blur(12px); backdrop-filter:saturate(1.4) blur(12px);
  border-top:1px solid var(--line);
}
.tabbar a,.tabbar button{
  flex:1 1 0; min-width:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  font:inherit; font-size:.66rem; font-weight:550; letter-spacing:.01em;
  color:var(--faint); background:none; border:0; text-decoration:none; cursor:pointer;
  padding:.35rem .2rem;
}
.tabbar span{ max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.tabbar svg{ width:24px; height:24px; transition:transform .22s cubic-bezier(.2,.8,.3,1) }
.tabbar a:active svg,.tabbar button:active svg{ transform:scale(.88) }
.tabbar .on{ color:var(--accent) }
.tabbar .on svg{ color:var(--accent); transform:translateY(-1px) scale(1.08) }

/* the "Més" sheet: the three sections that are not day-to-day, the RSVP
   link and Surt. A card that rises from the tab bar, not a page. */
.sheet{
  position:fixed; inset:0; z-index:7;
  background:rgba(17,24,39,.32);
  display:flex; align-items:flex-end;
  animation:sheet-in .16s ease-out;
}
.sheet[hidden]{ display:none }
.sheet-card{
  width:100%; background:var(--card);
  border-radius:var(--r-lg) var(--r-lg) 0 0;
  padding:.6rem .6rem calc(var(--tab-h) + .4rem);
  box-shadow:var(--shadow-pop);
  animation:sheet-rise .2s cubic-bezier(.2,.8,.3,1);
}
.sheet-card a,.sheet-card button{
  display:flex; align-items:center; gap:.85rem; width:100%;
  min-height:3rem; padding:.6rem .8rem; border-radius:10px;
  font:inherit; font-size:.98rem; font-weight:500; color:var(--ink);
  background:none; border:0; text-decoration:none; cursor:pointer; text-align:left;
}
.sheet-card svg{ width:22px; height:22px; color:var(--faint) }
.sheet-card a.on{ background:var(--accent-soft); color:var(--accent); font-weight:600 }
.sheet-card a.on svg{ color:var(--accent) }
.sheet-card hr{ border:0; border-top:1px solid var(--line); margin:.4rem .3rem }
@keyframes sheet-in{ from{ opacity:0 } }
@keyframes sheet-rise{ from{ transform:translateY(100%) } }
.sheet-card{ animation:sheet-rise .32s cubic-bezier(.2,.9,.25,1.05) }

/* ── the content column ───────────────────────────────────────────── */

.content{ margin-left:var(--side-w); min-height:100dvh }
.wrap{ padding:1.5rem var(--pad) 4rem; max-width:82rem }

@media (max-width:959px){
  .side{ display:none }
  .topbar,.tabbar{ display:flex }
  .content{ margin-left:0 }
  .wrap{ padding:.75rem .75rem calc(var(--tab-h) + 1.25rem) }
  .panel{ padding:.85rem; margin-bottom:.75rem }
  .panel-head{ margin-bottom:.75rem }
}

/* ── before we know who this is ───────────────────────────────────────
   The frame is not furniture, it is the panel: seven sections named out
   loud. /admin is shut to anyone without a session before the page is
   ever served (middleware.js), so what is left here is the guest who has
   one and is not an admin — and the half second any of us spends waiting
   for /api/auth/me to answer. Both get the page with no frame around it.
   app.js opens the shutter with .is-in once the answer is yes. */
body:not(.is-in) :is(.side,.topbar,.tabbar){ display:none }
body:not(.is-in) .content{ margin-left:0 }

.loading{ color:var(--faint); text-align:center; padding:4rem 0 }
.skeleton{ animation:sheet-in .3s }
.sk{
  border-radius:12px;
  background:linear-gradient(100deg, #e9ebf0 30%, #f4f5f8 50%, #e9ebf0 70%);
  background-size:200% 100%; animation:shimmer 1.4s linear infinite;
}
.sk-strip{ height:2.6rem; margin-bottom:1rem }
.sk-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:.75rem; margin-bottom:1rem }
.sk-tile{ height:5.2rem }
.sk-block{ height:18rem; border-radius:var(--r-lg) }
@keyframes shimmer{ to{ background-position:-200% 0 } }
@media (max-width:640px){ .sk-grid{ grid-template-columns:1fr 1fr } }
/* the page itself arrives once the app has painted it */
#view > .panel:first-child,#view > .stats:first-child,#view > .subnav{ animation:rise .3s cubic-bezier(.2,.8,.3,1) both }

/* ── tabs inside a section ─────────────────────────────────────────
   One thing at a time. On a phone the strip sticks under the top bar, so
   the other tabs are a thumb away from anywhere on the page. */

.subnav{
  display:flex; gap:2px; padding:3px; margin-bottom:1rem;
  border:1px solid var(--line); border-radius:12px; background:var(--card);
  box-shadow:var(--shadow);
  overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.subnav::-webkit-scrollbar{ display:none }
.subnav button{
  flex:0 0 auto; min-height:2.35rem; padding:.4rem 1.1rem;
  font:inherit; font-size:.86rem; font-weight:550; color:var(--muted);
  background:none; border:0; border-radius:9px; cursor:pointer; white-space:nowrap;
  transition:background .12s, color .12s;
}
.subnav button:hover{ color:var(--ink); background:var(--bg) }
.subnav{ position:relative }
.subnav button{ position:relative; z-index:1 }
.subnav button.on{ color:var(--accent); font-weight:650 }
/* the one highlight that slides between tabs (shell.js sizes it) */
.subnav-glider{
  position:absolute; top:3px; bottom:3px; left:0; width:0;
  border-radius:9px; background:var(--accent-soft);
  pointer-events:none;
}
.subnav.is-live .subnav-glider{ transition:transform .28s cubic-bezier(.2,.8,.3,1), width .28s cubic-bezier(.2,.8,.3,1) }
/* a pane comes in from just below, and its cards a beat behind each other */
.pane-in{ animation:pane-in .28s cubic-bezier(.2,.8,.3,1) both }
.pane-in > .panel{ animation:rise .36s cubic-bezier(.2,.8,.3,1) both }
.pane-in > .panel:nth-child(2){ animation-delay:.06s }
.pane-in > .panel:nth-child(3){ animation-delay:.12s }
@keyframes pane-in{ from{ opacity:0; transform:translateY(6px) } }
@keyframes rise{ from{ opacity:0; transform:translateY(10px) } }
[data-pane][hidden]{ display:none }
/* the page's one status line, above the panes so it reads from any tab */
.note.status{ margin:-.4rem 0 .8rem .25rem }
.note.status:empty{ margin:0 }
@media (min-width:960px){ .subnav{ display:inline-flex; min-width:0; max-width:100% } }
@media (max-width:959px){
  .subnav{
    position:sticky; top:calc(3.25rem + env(safe-area-inset-top)); z-index:4;
    margin:0 0 .75rem; border-radius:12px;
  }
  .subnav button{ flex:1 0 auto; font-size:.82rem; padding:.4rem .6rem; min-height:2.5rem }
}

/* a share of something, under its number */
.bar{
  display:block; height:.4rem; margin-top:.6rem; border-radius:2rem;
  background:var(--bg); overflow:hidden;
}
.bar span{
  display:block; height:100%; width:0; border-radius:2rem;
  background:linear-gradient(90deg, var(--accent), #6d7ff0);
  transition:width .9s cubic-bezier(.2,.8,.3,1);
  position:relative; overflow:hidden;
}
.bar span::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(90deg, transparent 0, rgba(255,255,255,.45) 50%, transparent 100%);
  transform:translateX(-100%); animation:sheen 2.4s 1s ease-in-out 2;
}
@keyframes sheen{ to{ transform:translateX(100%) } }

/* a panel that folds — the summary is its title */
.panel.fold > summary{
  list-style:none; cursor:pointer; display:flex; align-items:center; gap:.6rem;
  margin:calc(var(--pad) * -1); padding:var(--pad); min-height:44px;
}
.panel.fold > summary::-webkit-details-marker{ display:none }
.panel.fold > summary::before{ content:'\25B8'; color:var(--faint); transition:transform .15s }
.panel.fold[open] > summary::before{ transform:rotate(90deg) }
.panel.fold > summary h2{ margin:0 }
.panel.fold[open] > summary{ margin-bottom:0 }

/* ═══════════════════════════════════════════════════════════════════════
   PANELS AND TYPE
   ═══════════════════════════════════════════════════════════════════════ */

.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow);
  padding:var(--pad);
  margin-bottom:1rem;
}
.panel-head{
  display:flex; justify-content:space-between; align-items:center;
  gap:.75rem 1rem; flex-wrap:wrap; margin-bottom:1rem;
}
.panel-head h2{ margin:0 }
/* a badge next to a title sits with it, not across the row */
.panel-head h2 + .badge{ margin-right:auto }

h1{ font-size:1.3rem; font-weight:700; letter-spacing:-.015em; margin-bottom:.6rem }
h2{ font-size:1.08rem; font-weight:650; letter-spacing:-.01em; margin-bottom:.8rem }
h3{
  font-size:.72rem; font-weight:650; letter-spacing:.08em; text-transform:uppercase;
  color:var(--faint); margin:1.6rem 0 .6rem;
}
.panel > h3:first-child,.panel-head + h3{ margin-top:.2rem }

.lede{ color:var(--muted); margin-bottom:1rem; max-width:52ch }
.hint{ font-size:.85rem; color:var(--muted); margin-bottom:.9rem; max-width:64ch }
.note{ font-size:.85rem; color:var(--muted); margin-top:.7rem }
.note:empty{ margin:0 }
.note.bad{ color:var(--bad) }
.note.good{ color:var(--good) }
/* an open gate before the launch is the one state worth shouting about */
.hint.gate-open{ color:var(--bad); font-weight:600 }
.muted{ font-size:.85rem; color:var(--faint) }

/* ── stats ─────────────────────────────────────────────────────────── */

.stats{
  display:grid; grid-template-columns:repeat(4,1fr); gap:.75rem;
  margin-bottom:1rem;
}
.stat{
  background:var(--card); border:1px solid var(--line);
  border-radius:var(--r); box-shadow:var(--shadow);
  padding:.9rem 1rem .85rem; min-width:0;
  transition:transform .22s cubic-bezier(.2,.8,.3,1), box-shadow .22s;
}
@media (hover:hover){ .stat:hover{ transform:translateY(-2px); box-shadow:var(--shadow-pop) } }
/* a number that changed and could not count (a "20 / 26") pops instead */
.stat b.pop,.split-item b.pop{ animation:pop .36s cubic-bezier(.2,.8,.3,1) }
@keyframes pop{ 40%{ transform:scale(1.12) } }
.stat b{
  display:block; font-size:1.7rem; font-weight:700; line-height:1.1;
  letter-spacing:-.02em;
}
.stat small,.stat span{ display:block; margin-top:.3rem; font-size:.78rem; color:var(--muted) }
/* stats inside a panel are wells, not more cards */
.panel .stats .stat{ background:var(--well); box-shadow:none }
.fin-stats{ grid-template-columns:repeat(3,1fr); margin-bottom:.4rem }
.fin-stats .stat b{ font-size:1.25rem }
a.stat{ display:block; color:inherit; text-decoration:none }
.fin-stats .stat span{ margin-top:.1rem }
@media (max-width:640px){
  .stats,.fin-stats{ grid-template-columns:repeat(2,1fr); gap:.5rem }
  .stat{ padding:.75rem .85rem }
  .stat b{ font-size:1.45rem }
}

/* ── badges, pills, tags ───────────────────────────────────────────── */

.badge,.pill{
  display:inline-flex; align-items:center; gap:.3em;
  font-size:.72rem; font-weight:600; line-height:1;
  padding:.36rem .6rem; border-radius:2rem; white-space:nowrap;
  border:1px solid var(--line-strong); color:var(--muted); background:var(--card);
}
.badge,.pill{ transition:background .18s, color .18s, border-color .18s }
/* the display above would otherwise beat the hidden attribute */
.badge[hidden]{ display:none }
.badge.on,.pill.yes{ color:var(--good); border-color:var(--good-line); background:var(--good-bg) }
.pill.mid{ color:var(--warn); border-color:var(--warn-line); background:var(--warn-bg) }
.pill.no{ color:var(--faint); background:var(--well) }
/* somebody you can actually chase: they said yes and nothing has started */
.pill.bad,.badge.off{ color:var(--bad); border-color:var(--bad-line); background:var(--bad-bg) }

.tag{
  display:inline-block; vertical-align:middle;
  font-size:.6rem; font-weight:700; letter-spacing:.07em; text-transform:uppercase;
  line-height:1; padding:.22rem .42rem; border-radius:2rem;
  color:var(--accent); border:1px solid var(--accent-line); background:var(--accent-soft);
  margin-left:.4rem;
}
.tag.declined{ color:var(--bad); border-color:var(--bad-line); background:var(--bad-bg) }
/* the invitation has left — a fact about the row, not a state to act on */
.tag.sent{ color:var(--faint); border-color:var(--line); background:var(--well) }
/* invited, mailed, and never on the site */
.tag.never{ color:#7a3d00; border-color:#f4d3a4; background:#fff4e5 }
/* who collects money, marked right on their row */
.tag.collects{ color:#9a4a04; border-color:#f4d3a4; background:#fff4e5 }

/* ── buttons ───────────────────────────────────────────────────────── */

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.45em;
  min-height:var(--control); padding:.45rem 1rem;
  font:inherit; font-size:.86rem; font-weight:600; color:var(--ink);
  background:var(--card); border:1px solid var(--line-strong);
  border-radius:10px; cursor:pointer; text-decoration:none; white-space:nowrap;
  box-shadow:0 1px 1px rgba(17,24,39,.04);
  transition:background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover:not(:disabled){ background:var(--bg); border-color:#bfc5cf }
.btn:active:not(:disabled){ box-shadow:none; transform:scale(.97) }
.btn{ transition:background .12s, border-color .12s, box-shadow .12s, transform .12s cubic-bezier(.2,.8,.3,1) }
/* The display above beats the browser's own [hidden] rule, so a button
   the script hides (no filters to clear, nobody left to ask, no money to
   hand back) went on showing. The hidden attribute is the script's word. */
.btn[hidden]{ display:none }
.btn.primary{
  color:var(--accent-ink); background:var(--accent); border-color:var(--accent);
  box-shadow:0 1px 2px rgba(51,71,201,.3);
}
.btn.primary:hover:not(:disabled){ background:#2b3db0; border-color:#2b3db0 }
.btn.ghost{ background:none; box-shadow:none; border-color:transparent; color:var(--muted) }
.btn.ghost:hover:not(:disabled){ background:var(--bg); border-color:transparent; color:var(--ink) }
.btn.small{ min-height:2.1rem; font-size:.78rem; padding:.3rem .75rem; border-radius:8px }
.btn:disabled{ opacity:.5; cursor:default }

/* the round "+" and "⋮" on a row */
.more{
  display:inline-flex; align-items:center; justify-content:center;
  width:2rem; height:2rem; border-radius:8px;
  font:inherit; font-size:1rem; line-height:1;
  color:var(--muted); background:var(--card);
  border:1px solid var(--line-strong); cursor:pointer;
}
.more:hover{ background:var(--bg); color:var(--ink) }
.more{ transition:background .12s, color .12s, transform .12s }
.more:active{ transform:scale(.92) }
.more.danger:hover{ color:var(--bad); border-color:var(--bad-line); background:var(--bad-bg) }

/* ═══════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════ */

.field{ display:block; min-width:0 }
.field > span{
  display:block; font-size:.78rem; font-weight:550; color:var(--muted);
  margin-bottom:.3rem;
}

input,select,textarea{
  width:100%; min-height:var(--control);
  font:inherit; font-size:.9rem; color:var(--ink);
  background:var(--card); border:1px solid var(--line-strong);
  border-radius:10px; padding:.45rem .75rem;
  transition:border-color .12s, box-shadow .12s;
}
textarea{ min-height:5rem; line-height:1.5 }
input:hover,select:hover,textarea:hover{ border-color:#bfc5cf }
input:focus,select:focus,textarea:focus{
  outline:none; border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* the one place where "reads as empty" is the job: darkening this makes an
   empty field look filled */
input::placeholder,textarea::placeholder{ color:#9aa1ad; opacity:1 }
input[type=search]{ -webkit-appearance:none; appearance:none }
input[type=search]::-webkit-search-decoration{ -webkit-appearance:none }

/* selects carry their own chevron so they look like the buttons beside them */
select{
  -webkit-appearance:none; appearance:none; padding-right:2.1rem; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .6rem center; background-size:16px;
}
input[type=checkbox],input[type=radio]{
  width:1.15rem; height:1.15rem; min-height:0; padding:0; margin:0;
  accent-color:var(--accent); flex:none;
}

.inline-form{
  display:grid; grid-template-columns:1.4fr 1.2fr .7fr auto;
  gap:.75rem; align-items:end; margin-top:.5rem;
  padding:.9rem; background:var(--well); border:1px solid var(--line); border-radius:var(--r);
}
.inline-form.with-check{ grid-template-columns:1.4fr 1.2fr .7fr 1fr auto auto }
.inline-form .check-field{ display:flex; flex-direction:column; gap:.35rem }
.inline-form .check-field input{ margin-top:auto; margin-bottom:calc((var(--control) - 1.15rem) / 2) }
.inline-form.many{ grid-template-columns:repeat(3,1fr) }
.inline-form.many .check-field{ display:flex; flex-direction:column }
.inline-form.many .check-field input{ width:auto; height:var(--control); margin-top:auto }
.inline-form .wide2{ grid-column:span 2 }
.pair{ display:flex; gap:.4rem }
@media (max-width:760px){
  .inline-form{ grid-template-columns:1fr 1fr }
  .inline-form.with-check{ grid-template-columns:1fr 1fr }
  .inline-form .btn,.inline-form .wide2{ grid-column:1/-1 }
  .inline-form.many{ grid-template-columns:1fr 1fr }
}
@media (max-width:480px){
  .inline-form,.inline-form.many{ grid-template-columns:1fr }
}

/* ── a guest picker ────────────────────────────────────────────────
   A text box that completes from the guest list; the menu hangs under it.
   A picked guest turns the box's edge green: linked, not just typed. */
.picker{ position:relative }
.picker.linked input:not([type=hidden]){
  border-color:var(--good-line); background:var(--good-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23067647' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.5 3.5L15 7'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .6rem center; background-size:16px;
  padding-right:2.1rem;
}
.picker-menu{
  position:absolute; left:0; right:0; top:100%; z-index:30; margin-top:.25rem;
  background:var(--card); border:1px solid var(--line-strong); border-radius:10px;
  box-shadow:var(--shadow-pop); padding:.3rem; max-height:15rem; overflow-y:auto;
  animation:menu-in .14s cubic-bezier(.2,.8,.3,1); transform-origin:top left;
}
.picker-menu[hidden]{ display:none }
.picker-item{
  display:flex; flex-direction:column; align-items:flex-start; gap:.05rem; width:100%;
  font:inherit; text-align:left; color:var(--ink); background:none; border:0;
  border-radius:8px; padding:.45rem .65rem; cursor:pointer;
}
.picker-item b{ font-weight:600; font-size:.88rem }
.picker-item small{ font-size:.74rem; color:var(--faint); overflow-wrap:anywhere }
.picker-item:hover,.picker-item.on{ background:var(--accent-soft) }
@media (pointer:coarse){ .picker-item{ min-height:44px; justify-content:center } }
/* the payer on an expense line: a check when they are on the list */
.trow .sub .payer{ font-weight:600; color:var(--muted) }
.trow .sub .payer.linked{ color:var(--good) }
.trow .sub .payer.linked::before{ content:'\2713\00a0'; font-weight:700 }
#expensePayers{ margin-bottom:.8rem }
#expensePayers[hidden]{ display:none }

/* settings rows: a few fields and their buttons, side by side */
.pay-config{ display:flex; align-items:end; gap:.75rem; flex-wrap:wrap }
.pay-config .field{ width:9.5rem }
@media (max-width:480px){
  .pay-config .field{ width:calc(50% - .4rem) }
  .pay-config .btn{ flex:1 1 auto }
}

/* ── edit dialog ───────────────────────────────────────────────────── */

.edit-dialog{
  border:1px solid var(--line-strong); border-radius:var(--r-lg);
  box-shadow:var(--shadow-pop);
  padding:1.4rem 1.5rem; width:min(27rem, 92vw);
  /* the * { margin:0 } reset above kills the centring margin a dialog gets
     from the browser, which pinned both of these to the top-left corner */
  margin:auto;
  max-height:min(calc(100dvh - 2rem), 100%); overflow-y:auto;
  color:var(--ink);
}
.edit-dialog::backdrop{ background:rgba(17,24,39,.4); animation:sheet-in .18s }
.edit-dialog[open]{ animation:dialog-in .24s cubic-bezier(.2,.8,.3,1) }
@keyframes menu-in{ from{ opacity:0; transform:scale(.96) } }
@keyframes dialog-in{ from{ opacity:0; transform:translateY(10px) scale(.98) } }
.edit-dialog h2{ margin-bottom:1rem }
.edit-dialog .field{ margin-bottom:.8rem }
.edit-dialog .hint{ margin:-.4rem 0 .9rem; font-size:.78rem; color:var(--muted) }
.edit-dialog .check-line{
  display:flex; align-items:center; gap:.6rem;
  font-size:.9rem; padding:.35rem 0; cursor:pointer;
}
.edit-dialog .check-line input{ width:auto }
.edit-dialog .lead-areas{ border:0; padding:0; margin:.6rem 0 0 }
.edit-dialog .lead-areas legend{ font-size:.78rem; color:var(--muted); padding:0; margin-bottom:.1rem }
.edit-dialog .lead-areas .hint{ margin:.2rem 0 0 }

/* ── the leads (Convidats → Responsables) ─────────────────────────────
   One row per lead: who, the parts they run as switches, the sections
   they may open as ticks, and the way out. Saved as they change. */
.lead-add{ margin-bottom:.8rem }
/* the name picker's menu hangs below the box: a .table clips, this one must not */
#leadsBox.table{ overflow:visible }

/* ── l'equip (/admin/leads, admin/team.js) ────────────────────────────
   A card per person who said something about the part, inside the
   part's panel; a ring on what arrived since you last looked. */
.team-card{ border:1px solid var(--line); border-radius:var(--r-sm); padding:.8rem .95rem; margin-top:.6rem; background:var(--card) }
.team-card.fresh{ border-color:var(--accent-line); box-shadow:0 0 0 3px var(--accent-soft) }
.team-top{ display:flex; align-items:baseline; gap:.5rem; flex-wrap:wrap }
.team-top b{ font-size:.95rem }
.team-top a{ color:var(--accent); font-size:.82rem; text-decoration:none; word-break:break-all }
.team-top time{ margin-left:auto; color:var(--faint); font-size:.75rem; white-space:nowrap }
.team-card dl{ margin:.5rem 0 0; display:grid; gap:.35rem }
.team-card dt{ font-size:.68rem; font-weight:650; text-transform:uppercase; letter-spacing:.05em; color:var(--faint) }
.team-card dd{ margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:.9rem }
.team-card dd a{ color:var(--accent) }
.team-list .empty{ color:var(--faint); padding:1.2rem 0 .4rem; text-align:center; font-size:.88rem }
.trow.lead-row{ animation:none; grid-template-columns:minmax(10rem, 1fr) minmax(0, 1.2fr) minmax(0, 1.4fr) auto; align-items:center; gap:.6rem 1.2rem }
.lead-chips{ display:flex; flex-wrap:wrap; align-items:center; gap:.3rem }
.lead-chips > small{ flex-basis:100%; font-size:.7rem; color:var(--faint); text-transform:uppercase; letter-spacing:.05em; margin-right:.15rem }
.chip-toggle,.check-chip{
  display:inline-flex; align-items:center; gap:.3rem; min-height:30px; padding:.2rem .65rem;
  border:1px solid var(--line-strong); border-radius:2rem; background:var(--card); color:var(--muted);
  font:inherit; font-size:.8rem; cursor:pointer;
}
.chip-toggle.on{ color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft); font-weight:600 }
.check-chip input{ margin:0; accent-color:var(--accent) }
.check-chip:has(input:checked){ color:var(--ink); border-color:var(--accent-line) }
.lead-area-list{ display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:.8rem }
.area-chip{
  display:inline-flex; align-items:center; gap:.5rem; padding:.3rem .3rem .3rem .75rem;
  border:1px solid var(--line); border-radius:var(--r-sm); background:var(--well);
}
.area-chip b{ font-weight:600; font-size:.88rem }
.area-chip small{ color:var(--faint); font-size:.75rem }
.area-chip button{
  border:0; background:none; color:var(--faint); font-size:1.1rem; line-height:1;
  width:28px; height:28px; border-radius:50%; cursor:pointer;
}
.area-chip button:hover{ color:var(--bad); background:var(--bad-bg) }
@media (max-width:760px){
  .trow.lead-row{ grid-template-columns:1fr auto }
  .trow.lead-row .lead-chips{ grid-column:1 / -1 }
  .trow.lead-row > .btn{ grid-row:1; grid-column:2 }
}
.dialog-actions{
  display:flex; justify-content:flex-end; gap:.6rem; margin-top:1.1rem;
}
/* ── the movements of one payment ───────────────────────────────────
   A quota that arrives in pieces: each line is money that landed, with the
   person who received it, and the form underneath adds the next one. Sunk
   into a well so it reads as the ledger it is, and not as three more
   fields of the form above it. */
.part-ledger{
  margin-top:1.1rem; padding:.85rem .9rem;
  background:var(--well); border:1px solid var(--line); border-radius:var(--r-sm);
}
.part-ledger h3{ font-size:.82rem; letter-spacing:.02em }
.part-ledger > h3:first-child{ margin-top:0 }
.part-ledger + .part-ledger{ margin-top:.8rem }
.part-ledger .hint{ margin:.25rem 0 .7rem }
.part-rows{ display:grid; gap:.35rem }
.part-row{
  display:flex; align-items:center; gap:.6rem;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-sm);
  padding:.4rem .55rem;
}
.part-who{ display:grid; min-width:0; flex:1 1 auto }
.part-who b{ font-weight:650; font-size:.9rem }
.part-who span{ font-size:.76rem; color:var(--faint); overflow-wrap:anywhere }
.part-who .part-note{ color:var(--muted) }
.part-row .btn.danger{ flex:none; min-width:2rem; padding-inline:.5rem }
/* two rows of two: how much and to whom, then when and what it was —
   the collector's name is the longest thing here and gets the width */
.part-add{
  display:grid; gap:.4rem; margin-top:.7rem;
  grid-template-columns:7.2rem 1fr;   /* wide enough for a date */
}
.part-add input,.part-add select{ font-size:.85rem; height:2.2rem; padding:.2rem .5rem }
/* the collector field is a searchable picker, so it carries its own menu */
.part-add .picker{ min-width:0 }
.part-add .picker input:not([type=hidden]){ width:100% }
.part-add > .btn{ grid-column:1 / -1; justify-content:center }
.part-ledger .note{ margin-top:.6rem; font-size:.8rem }

/* the ledger's amount cell: what has arrived, over what is owed */
.trow.payment .money b{ font-weight:650; color:var(--ink) }
.trow.payment .money .of{ color:var(--faint) }

/* in landscape the form is taller than the screen and Desa fell off the
   bottom with no way to reach it */
.edit-dialog .dialog-actions{
  /* sticky offsets count from inside the dialog's padding: without the
     -1.4rem the bar floated that far above the edge and the form showed
     through underneath it */
  position:sticky; bottom:-1.4rem; background:var(--card);
  margin:1.1rem -1.5rem -1.4rem; padding:.8rem 1.5rem 1.4rem;
  border-top:1px solid var(--line);
}

/* ═══════════════════════════════════════════════════════════════════════
   LISTS  (.table / .trow — collectors, payments, rooms, rotas, expenses…)
   ═══════════════════════════════════════════════════════════════════════ */

.table{ border:1px solid var(--line); border-radius:var(--r); overflow:hidden }
.table:empty{ display:none }
.trow{
  display:grid; align-items:center; gap:.8rem;
  padding:.65rem .9rem; background:var(--card);
  border-top:1px solid var(--line);
}
.trow:first-child{ border-top:0 }
.trow .name{ font-weight:600; min-width:0; overflow-wrap:anywhere }
.trow .sub{ font-size:.78rem; color:var(--faint); overflow-wrap:anywhere }
.trow .num{ font-size:.85rem; color:var(--muted); white-space:nowrap }
.trow.total .name{ font-weight:700 }

.trow.collector{ grid-template-columns:1.6fr 1fr auto auto auto }
/* the Resum's scenario against now: five money columns that line up, each
   an amount with how many people under it */
.trow.gap{ grid-template-columns:1.3fr repeat(5, minmax(5.5rem, 1fr)) }
.trow.gap .num{ text-align:right }
.trow.gap .num b{ display:block; font-weight:550; color:var(--ink) }
.trow.gap .num small{ display:block; font-size:.72rem; color:var(--faint) }
.trow.gap.head .num{ font-size:.7rem; text-transform:uppercase; letter-spacing:.04em; color:var(--faint) }
.trow.gap .gap-short b{ font-weight:700 }
.trow.gap.total .num b{ font-weight:700 }
/* on a phone the name takes its own line and the five figures share the
   next one in equal fifths, so they still sit under their headings */
@media (max-width:760px){
  .trow.gap .num{ flex:1 1 0; min-width:0; text-align:right; font-size:.68rem; white-space:nowrap }
  .trow.gap .num small{ font-size:.62rem }
  .trow.gap .num small .word{ display:none }
  .trow.gap.head .num{ font-size:.56rem; letter-spacing:0 }
  .trow.gap.head > :first-child{ display:none }
}
.trow.payment{ grid-template-columns:1.6fr 1.2fr auto auto auto }
/* the actions, however many a row has: a fixed column so the amounts and
   the states line up down the whole ledger */
.trow.payment > :nth-child(5){ min-width:6.6rem; text-align:right }
.trow.req{ grid-template-columns:2fr auto auto auto }
/* who, where their extra stands, and — for a room confirmed and not yet
   paid — the button that sends mail 2 again (an empty cell otherwise, so
   the pills still line up) */
.trow.xrow{ grid-template-columns:1fr auto auto }
.extras-actions{ display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.75rem }
.extras-actions .btn[hidden]{ display:none }
.trow.rota{ grid-template-columns:1.6fr auto auto auto }
.trow.shift{ grid-template-columns:2fr auto auto auto }
.trow.room{ grid-template-columns:1.4fr 1fr auto auto }
.trow.rtype{ grid-template-columns:1fr 1.6fr auto auto }
.trow.fincol{ grid-template-columns:1.6fr auto 7rem auto }
.trow.expense{ grid-template-columns:2fr auto auto }
/* the ticket's photos on an expense, and the warning when there is none */
.tag.noticket{ color:var(--bad); border-color:var(--bad-line); background:var(--bad-bg) }
.receipts{ display:flex; gap:.35rem; margin-top:.4rem; flex-wrap:wrap }
.receipt{ display:grid; place-items:center; width:2.6rem; height:2.6rem; border-radius:.45rem;
  border:1px solid var(--line-strong); background:var(--well); overflow:hidden; text-decoration:none }
.receipt img{ width:100%; height:100%; object-fit:cover }
.receipt-list{ display:flex; flex-direction:column; gap:.4rem; margin:.4rem 0 .6rem }
.receipt-item{ display:flex; align-items:center; gap:.6rem }
.receipt-item .receipts{ margin:0 }
.receipt-add{ cursor:pointer }
.receipt-add.busy{ opacity:.5; pointer-events:none }
.warn-text{ color:var(--bad) }
.receipt-field input[type=file]{ font-size:.8rem }
/* a lead's own budget, atop their expenses: red where a line went over */
.lead-budget .trow.my-line{ grid-template-columns:1fr auto; align-items:center }
.lead-budget .bar{ margin-top:.4rem }
.lead-budget .num.good{ color:var(--good); font-weight:650 }
.lead-budget .num.bad{ color:var(--bad); font-weight:650 }
.lead-budget .trow.over .name{ color:var(--bad) }
/* ── the budget ──────────────────────────────────────────────────────
   Five figures, a strip for how much of the plan is firm, filters, and a
   row per line: what it is, how much of it has gone out, what it costs. */
.bud-stats{ grid-template-columns:repeat(5,1fr); margin-bottom:.9rem }
.bud-stats .stat b{ font-size:1.3rem }
.bud-stats .stat.neg b{ color:var(--bad) }
.bud-stats .stat.pos b{ color:var(--good) }
.stat .stat-sub{ display:block; margin-top:.35rem; font-size:.74rem; color:var(--faint) }
.stat .stat-sub .bar{ margin:0 0 .35rem }
.stat .bar span{ margin:0 }
.stat-sub .delta{ font-style:normal; font-weight:650 }
.stat-sub .delta.up{ color:var(--bad) }
.stat-sub .delta.down{ color:var(--good) }
.bar.over span{ background:var(--bad) }

.bud-firm{ margin:0 0 1.1rem }
.bud-firm-bar{ display:flex; height:.5rem; border-radius:2rem; overflow:hidden; background:var(--bg) }
.bud-firm-bar span{ display:block; height:100%; transition:width .6s cubic-bezier(.2,.8,.3,1) }
.bud-firm-bar .firm{ background:var(--good) }
.bud-firm-bar .soft{ background:var(--warn-line) }
.bud-firm-key{ display:flex; flex-wrap:wrap; gap:.3rem 1.1rem; margin-top:.5rem; font-size:.78rem; color:var(--muted) }
.bud-firm-key .k{ display:inline-flex; align-items:center; gap:.4rem }
.bud-firm-key b{ color:var(--ink); font-weight:650 }
.bud-firm-key i{ width:.6rem; height:.6rem; border-radius:3px; background:var(--warn-line) }
.bud-firm-key .firm i{ background:var(--good) }
.bud-firm-key .cut i{ background:none; border:1.5px dashed var(--faint) }
.bud .filter-row select{ width:auto; min-width:12rem }

.trow.budget{ grid-template-columns:minmax(0,1fr) 14rem 12.5rem 1rem; cursor:pointer; transition:background .12s }
.trow.budget:hover{ background:var(--well) }
.trow.budget.total,.trow.budget.total:hover{ cursor:default; background:var(--well) }
.trow.budget .name .tag{ margin-left:.45rem }
/* a line with subpartides folds; its subpartides sit indented under it */
.bud-head{ display:flex; align-items:flex-start; gap:.5rem; min-width:0 }
.bud-text{ min-width:0 }
.bud-caret{
  flex:none; width:1.6rem; height:1.6rem; margin:-.1rem 0 0 -.35rem;
  display:inline-flex; align-items:center; justify-content:center;
  border:0; border-radius:6px; background:none; color:var(--muted); cursor:pointer;
  font:inherit; font-size:.95rem;
}
.bud-caret::before{ content:'\25B8'; transition:transform .15s }
.bud-caret.open::before{ transform:rotate(90deg) }
.bud-caret:hover{ background:var(--bg); color:var(--ink) }
.trow.budget.kid{ background:var(--well); border-top-style:dashed }
.trow.budget.kid:hover{ background:var(--bg) }
.trow.budget.kid > .bud-head{ padding-left:1.6rem; position:relative }
.trow.budget.kid > .bud-head::before{
  content:''; position:absolute; left:.55rem; top:-.2rem; width:.6rem; height:.85rem;
  border-left:1.5px solid var(--line-strong); border-bottom:1.5px solid var(--line-strong); border-bottom-left-radius:4px;
}
.trow.budget.kid .name{ font-weight:550; font-size:.92rem }
.bud-sum{
  display:flex; justify-content:space-between; align-items:baseline; gap:1rem;
  margin:0 0 .8rem; padding:.6rem .8rem; border-radius:var(--r-sm);
  background:var(--well); border:1px solid var(--line); font-size:.85rem; color:var(--muted);
}
.bud-sum b{ font-size:1.05rem; color:var(--ink) }
.trow.budget.loose .name{ color:var(--warn) }
.trow .chev{ color:var(--faint); font-size:1.2rem; line-height:1; text-align:right }
.tag.firm{ color:var(--good); border-color:var(--good-line); background:var(--good-bg) }
.tag.soft{ color:var(--warn); border-color:var(--warn-line); background:var(--warn-bg) }
.tag.cut{ color:var(--faint); border:1px dashed var(--line-strong); background:none }
.tag.line{ color:var(--muted); border-color:var(--line-strong); background:var(--well); text-transform:none; letter-spacing:0; font-size:.68rem; font-weight:600 }
.bud-use{ min-width:0; font-size:.78rem; color:var(--muted) }
.bud-use .txt{ display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.bud-use .txt.none{ color:var(--faint) }
.bud-use .txt.bad{ color:var(--bad); font-weight:600 }
.bud-use .bar{ margin-top:.35rem; height:.3rem }
.bud-foot{ margin:.8rem 0 0; font-size:.78rem }
.bud-calc{ margin-top:-.3rem }
.bud-dialog{ width:min(32rem, 94vw) }
.bud-dialog .part-row{ width:100%; font:inherit; text-align:left; cursor:pointer }
.bud-dialog .part-row:hover{ border-color:var(--line-strong) }
.bud-dialog .part-row .num{ margin-left:auto; color:var(--ink) }
.bud-dialog .part-ledger > .btn{ margin-top:.7rem }
@media (max-width:1100px){ .bud-stats{ grid-template-columns:repeat(3,1fr) } }
@media (max-width:640px){
  .bud-stats{ grid-template-columns:repeat(2,1fr) }
  .bud-stats .stat:last-child{ grid-column:1 / -1 }
  .bud .filter-row select{ width:100%; min-width:0 }
}
.budget-money{ text-align:right; min-width:0 }
.budget-money b{ display:block; font-weight:650; color:var(--ink) }
.budget-ly{ display:flex; gap:.4rem; justify-content:flex-end; align-items:center; font-size:.74rem; color:var(--faint); white-space:nowrap }
.budget-ly .delta{ font-weight:650; padding:.1rem .4rem; border-radius:2rem; background:var(--well); border:1px solid var(--line) }
.budget-ly .delta.up{ color:var(--bad); background:var(--bad-bg); border-color:var(--bad-line) }
.budget-ly .delta.down{ color:var(--good); background:var(--good-bg); border-color:var(--good-line) }
.row-acts{ display:flex; flex-wrap:wrap; align-items:center; gap:.35rem; justify-content:flex-end }
.row-acts .sub{ white-space:nowrap }
/* undoing money: the one button on the page that takes a payment away */
.btn.danger{ color:var(--bad) }
.btn.danger:hover:not(:disabled){ background:var(--bad-bg); border-color:var(--bad-line) }
.dialog-undo{
  display:flex; gap:.6rem; align-items:center; flex-wrap:wrap;
  margin-top:1rem; padding-top:.9rem; border-top:1px solid var(--line);
}
.dialog-undo .hint{ margin:0; flex:1 1 12rem }
.dialog-undo[hidden]{ display:none }
.edit-dialog .pair{ display:flex; gap:.6rem }
.edit-dialog .pair .field{ flex:1; margin-bottom:.4rem }
@media (max-width:760px){
  .trow.budget .bud-use{ flex:1 1 100%; order:3 }
  .trow.budget .chev{ display:none }
  /* the whole subpartida steps in, its figures too, not just its name */
  .trow.budget.kid{ padding-left:2.3rem }
  .trow.budget.kid > .bud-head{ padding-left:0 }
  .trow.budget.kid > .bud-head::before{ left:-1.25rem }
  .bud-caret{ width:2.2rem; height:2.2rem; margin:-.45rem -.2rem 0 -.6rem; font-size:1.05rem }
  .budget-money{ text-align:left; flex:1 1 auto }
  .budget-ly{ justify-content:flex-start; flex-wrap:wrap; white-space:normal }
  .trow .row-acts{ margin-left:auto }
}
.settle-amt{ width:7rem }
.table .empty{ padding:.9rem; font-size:.85rem; color:var(--faint); background:var(--card) }

.person-chip{
  display:inline-block; margin:.15rem .3rem .15rem 0;
  font-size:.75rem; color:var(--muted); cursor:pointer;
  border:1px solid var(--line-strong); border-radius:2rem; background:var(--card);
  padding:.2rem .6rem;
}
.person-chip:hover{ color:var(--bad); border-color:var(--bad-line); background:var(--bad-bg) }

/* On a phone every list row is a small card: the name on its own line,
   the figures and the state on the next, the action at the end. The
   grid columns above are for a desk. */
@media (max-width:760px){
  .trow{
    display:flex; flex-wrap:wrap; align-items:center;
    gap:.4rem .7rem; padding:.7rem .85rem;
  }
  .trow > :first-child{ flex:1 1 100% }
  .trow .num{ white-space:normal }
  .trow .btn,.trow .settle-amt{ margin-left:auto }
  .trow .settle-amt{ width:6rem }
  .trow .settle-amt + .btn{ margin-left:0 }
}

/* ═══════════════════════════════════════════════════════════════════════
   THE GUEST LIST
   ═══════════════════════════════════════════════════════════════════════ */

/* ── tools above it ───────────────────────────────────────────────── */

.tools{ display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; flex:1 1 auto; min-width:0 }
.tools input[type=search]{ flex:1 1 12rem; width:auto; min-width:10rem; max-width:24rem }
.tools select{ width:auto; min-width:8rem }
.panel-head .tools{ justify-content:flex-end }
/* Sorting lives in the column heads on desktop; on a phone the whole head is
   display:none, which left the list permanently alphabetical by first name.
   Declared here, above the phone block, so the media query can turn it on. */
#sortPick{ display:none }
/* the applicants' "+" only exists on a phone; the table shows everything.
   Also above the phone block, for the same reason. */
#wlGrid td.wl-fold{ display:none }
/* the list fold, likewise */
#listBox > summary{ list-style:none; display:none }
#listBox > summary::-webkit-details-marker{ display:none }

.filter-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:.5rem 1rem; margin-bottom:.75rem; flex-wrap:wrap;
}
.tools + .filter-row{ margin-top:.6rem }
/* The filter row's right end: how many you're seeing, and a way out.
   Wrapping is not cosmetic here: three nowrap buttons in this row laid the
   guests page out 566px wide inside a 390px phone, which pans the page
   sideways, hides the third button — and poisons every innerWidth
   calculation on it, the context menu's clamp among them. */
.filter-right{ display:flex; align-items:center; gap:.6rem; flex-wrap:wrap }
.shown{ font-size:.8rem; color:var(--faint) }

.segmented{
  display:inline-flex; padding:3px; gap:2px;
  border:1px solid var(--line); border-radius:10px; background:var(--well);
}
.segmented button{
  font:inherit; font-size:.8rem; font-weight:550; padding:.35rem .85rem;
  min-height:2rem; cursor:pointer; color:var(--muted);
  background:none; border:0; border-radius:8px;
  transition:background .12s, color .12s;
}
.segmented button:hover{ color:var(--ink) }
.segmented button.on{ background:var(--card); color:var(--ink); box-shadow:var(--shadow); font-weight:600 }
.segmented button{ transition:background .18s, color .18s, box-shadow .18s }

/* the two ways in on a desktop are a right-click and a double-click, and
   a phone has neither — the ⋮ is the way, and it is already on the card */
@media (any-pointer:coarse){ .hint-desktop{ display:none } }

/* ── the table ─────────────────────────────────────────────────────── */

.grid-wrap{
  border:1px solid var(--line); border-radius:var(--r);
  overflow-x:auto; max-height:36rem; overflow-y:auto;
}
table.grid{ width:100%; border-collapse:collapse; font-size:.86rem; min-width:56rem }
/* the row lands clear of the sticky column heads when "+" scrolls to it */
#gridBody tr{ scroll-margin-top:2.5rem }
.grid th{
  position:sticky; top:0; z-index:1;
  text-align:left; font-size:.68rem; font-weight:650;
  letter-spacing:.07em; text-transform:uppercase; color:var(--faint);
  background:var(--well); border-bottom:1px solid var(--line-strong);
  padding:.6rem .75rem; white-space:nowrap;
}
.grid th.sortable{ cursor:pointer; user-select:none }
.grid th.sortable:hover{ color:var(--ink) }
.grid th .dir{ color:var(--accent) }
.grid td{
  padding:.5rem .75rem; border-bottom:1px solid var(--line);
  background:var(--card); vertical-align:middle; white-space:nowrap;
}
.grid tbody tr:last-child td{ border-bottom:0 }
/* the first dozen rows arrive one after another; the rest are just there */
.grid tbody tr,.trow,.module,.split-item,.stat{ animation:rise .3s cubic-bezier(.2,.8,.3,1) both }
.grid tbody tr:nth-child(1),.trow:nth-child(1),.stat:nth-child(1),.module:nth-child(1){ animation-delay:.02s }
.grid tbody tr:nth-child(2),.trow:nth-child(2),.stat:nth-child(2),.module:nth-child(2){ animation-delay:.05s }
.grid tbody tr:nth-child(3),.trow:nth-child(3),.stat:nth-child(3),.module:nth-child(3){ animation-delay:.08s }
.grid tbody tr:nth-child(4),.trow:nth-child(4),.stat:nth-child(4),.module:nth-child(4){ animation-delay:.11s }
.grid tbody tr:nth-child(5),.trow:nth-child(5),.stat:nth-child(5),.module:nth-child(5){ animation-delay:.14s }
.grid tbody tr:nth-child(6),.trow:nth-child(6),.stat:nth-child(6),.module:nth-child(6){ animation-delay:.17s }
.grid tbody tr:nth-child(7),.trow:nth-child(7){ animation-delay:.2s }
.grid tbody tr:nth-child(8),.trow:nth-child(8){ animation-delay:.23s }
.grid tbody tr:nth-child(9),.trow:nth-child(9){ animation-delay:.26s }
.grid tbody tr:nth-child(10),.trow:nth-child(10){ animation-delay:.29s }
.grid tbody tr:nth-child(n+11),.trow:nth-child(n+11){ animation-delay:.3s }
.grid tr.detail-tr{ animation:none }
.detail{ animation:rise .26s cubic-bezier(.2,.8,.3,1) both }
.grid tbody tr:hover td{ background:color-mix(in srgb, var(--accent) 4%, var(--card)) }
.grid .cell-name b{ font-weight:600 }
.grid .cell-name .playa{ font-style:normal; color:var(--faint); font-size:.8rem }
.grid .cell-dim{ color:var(--muted); max-width:16rem; overflow:hidden; text-overflow:ellipsis }
.grid .cell-num{ text-align:right }
.grid .cell-actions{ text-align:right; white-space:nowrap }
.grid .cell-actions .more + .more{ margin-left:.3rem }
.grid .empty{ color:var(--faint); text-align:center; padding:1.4rem }
.grid .detail-tr td{ white-space:normal; background:var(--well); padding:0 }
/* a number we inherited rather than one they gave us this year */
.grid .old-phone{ opacity:.6; font-style:italic }
.host-pick{ width:auto; min-width:6.5rem; min-height:2.1rem; font-size:.8rem; padding:.25rem 1.8rem .25rem .6rem; background-position:right .45rem center }

/* ── the expandable detail ─────────────────────────────────────────── */

.detail{
  display:grid; grid-template-columns:1fr 1fr; gap:1.2rem 2rem;
  padding:1rem 1.1rem 1.2rem;
  background:var(--well); border-top:1px dashed var(--line-strong);
}
@media (max-width:760px){ .detail{ grid-template-columns:1fr; gap:1rem } }
.facts-block h3{ margin:0 0 .5rem }
.facts{ display:flex; flex-direction:column; gap:.4rem }
.fact{ display:grid; grid-template-columns:8.5rem 1fr; gap:.8rem; align-items:baseline }
.fact dt{ font-size:.78rem; color:var(--faint) }
.fact dd{ font-size:.86rem; color:var(--ink); overflow-wrap:anywhere }
@media (max-width:480px){ .fact{ grid-template-columns:1fr; gap:.05rem } }

/* ── the applicants ────────────────────────────────────────────────── */

#wlGrid td{ vertical-align:middle }
#wlGrid b{ display:block; font-weight:600 }
#wlGrid .sub{ display:block; font-size:12.5px; color:var(--faint) }
#wlGrid .when{ color:var(--faint); white-space:nowrap }
#wlGrid .row-end{ text-align:right; white-space:nowrap }
#wlGrid .row-end button + button{ margin-left:.4rem }
#wlGrid tr.done{ opacity:.55 }
/* the applicant's tags sit on their own line under the name, quieter:
   "no introduction" is a fact about the row, not something to click */
#wlGrid .wl-who .tag{
  margin:.35rem .3rem 0 0; color:var(--muted); border-color:var(--line-strong); background:var(--well);
}
/* what an applicant wrote about themselves, under their name */
.wl-about{
  font-size:.83rem; line-height:1.5; color:var(--muted);
  white-space:pre-wrap; max-width:36rem; margin-top:.35rem;
}

/* ── the list, on a phone ──────────────────────────────────────────
   896px of table in 390px of screen is a sideways scroll nobody wants to
   read a guest list through. Each row becomes a card and each cell prints
   the column name it lost — the heading row is gone, so without that the
   values are a stack of unlabelled strings. The name leads, in the card's
   own type, and the two round buttons keep the corner. */
@media (max-width:700px){
  #sortPick{ display:block }
  .panel-head .tools{ justify-content:flex-start; gap:.5rem }
  .tools input[type=search]{ flex:1 1 100%; max-width:none }
  .tools select{ flex:1 1 40%; min-width:0; font-size:.86rem; padding-left:.6rem }
  .tools #exportBtn{ flex:1 1 40% }
  /* four states do not fit in 390px side by side: the control scrolls,
     and each label stays on one line */
  .segmented{ display:flex; width:100%; overflow-x:auto; scrollbar-width:none }
  .segmented::-webkit-scrollbar{ display:none }
  .segmented button{ flex:1 0 auto; padding-left:.7rem; padding-right:.7rem; white-space:nowrap }
  .filter-right{ width:100%; justify-content:space-between }
  .filter-right .btn.ghost{ margin-left:-.75rem }
  .filter-right .shown{ margin-left:auto }
  #gridBody tr{ scroll-margin-top:1rem }
  /* cards flow with the page: a 34rem window over a stack of cards is a
     nested scroll region, which iOS shows without a scrollbar and pans
     against the page — the applicants read as simply cut off */
  .grid-wrap{ overflow:visible; max-height:none; border:0; border-radius:0 }
  table.grid{ min-width:0; display:block; font-size:.9rem }
  .grid thead{ display:none }
  .grid tbody{ display:block }

  .grid tbody tr{
    display:block; margin-bottom:.5rem; padding:.15rem .1rem .4rem;
    border:1px solid var(--line); border-radius:var(--r);
    background:var(--card); box-shadow:var(--shadow); position:relative;
  }
  .grid tbody tr.is-open{ border-color:var(--accent-line) }
  .grid tbody tr:hover td{ background:none }

  .grid td{
    display:flex; align-items:center; justify-content:space-between;
    gap:1rem; white-space:normal; background:none;
    padding:.4rem .85rem; border:0;
  }
  .grid td:empty{ display:none }

  /* Folded by default: a name and its two states, one line each, so 84 of
     them read as a list and not as 84 forms. "+" unfolds the rest of the
     row together with the answers below it — one toggle, one idea. Scoped
     to #gridBody: the applicants and last-year tables are not this. */
  #gridBody tr:not(.is-open) td:not(.cell-name):not(.cell-paid):not(.cell-rsvp):not(.cell-actions){
    display:none;
  }
  #gridBody tr:not(.is-open) td.cell-paid,
  #gridBody tr:not(.is-open) td.cell-rsvp{ display:inline-flex; padding:0 0 .55rem .85rem }
  #gridBody tr:not(.is-open) td.cell-rsvp{ padding-left:.45rem }
  #gridBody tr:not(.is-open) td.cell-paid::before,
  #gridBody tr:not(.is-open) td.cell-rsvp::before{ content:none }
  #gridBody tr:not(.is-open) td.cell-name{ padding-bottom:.35rem }

  .grid td::before{
    content:attr(data-label);
    flex:0 0 auto; font-size:.66rem; font-weight:650;
    letter-spacing:.07em; text-transform:uppercase; color:var(--faint);
  }
  /* the name is the card's title, so it keeps neither label nor company */
  .grid td.cell-name{
    display:block; padding:.7rem .85rem .45rem;
    /* room for two 44px buttons and the gap between them */
    font-size:1.02rem; padding-right:7rem; line-height:1.35;
  }
  .grid td.cell-name::before{ content:none }
  .grid .cell-dim{ max-width:none; text-align:right }
  .grid td.cell-actions{
    position:absolute; top:.4rem; right:.6rem;
    padding:0; gap:12px; justify-content:flex-end;
  }
  .grid td.cell-actions::before{ content:none }
  .grid .cell-actions .more + .more{ margin-left:0 }
  .grid .more{ min-width:2.4rem; min-height:2.4rem }

  /* The applicants, folded the same way: the name and what they wrote,
     two lines of it, and the "+" in the corner. Everything else — email,
     phone, languages, the two buttons — is there once the card is open.
     A wall of five full cards was not a list anybody could scan. */
  #wlGrid td.wl-who{ display:block; padding:.75rem 3.6rem .5rem .85rem; font-size:1.02rem }
  #wlGrid td.wl-who::before{ content:none }
  #wlGrid td.wl-fold{ display:flex; position:absolute; top:.4rem; right:.6rem; padding:0 }
  #wlGrid td.wl-fold::before{ content:none }
  #wlGrid tr:not(.is-open) td:not(.wl-who):not(.wl-fold){ display:none }
  #wlGrid tr:not(.is-open) .wl-who .sub{ display:none }
  #wlGrid tr:not(.is-open) .wl-about{
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  }
  #wlGrid .row-end{ white-space:normal; justify-content:flex-end; flex-wrap:wrap; gap:.5rem; padding-top:.6rem }
  #wlGrid .row-end::before{ content:none }
  #wlGrid .row-end button + button{ margin-left:0 }

  .grid .detail-tr td, .grid tr.detail-tr{ padding:0 }
  .grid .detail-tr td::before{ content:none }
  .grid tr.detail-tr{ margin-top:-.55rem; border-top-left-radius:0; border-top-right-radius:0; border-top:0 }
  .grid td.empty{ justify-content:center }
  .grid td.empty::before{ content:none }
}

/* ── context menu ──────────────────────────────────────────────────── */

.ctx-menu{
  animation:menu-in .16s cubic-bezier(.2,.8,.3,1); transform-origin:top left;
  position:fixed; z-index:50; min-width:14rem;
  background:var(--card); border:1px solid var(--line);
  border-radius:12px; box-shadow:var(--shadow-pop);
  padding:.35rem; display:flex; flex-direction:column;
  /* eight items in landscape are taller than the screen */
  max-height:calc(100dvh - 1rem); overflow-y:auto; overscroll-behavior:contain;
}
.ctx-item{
  font:inherit; font-size:.86rem; text-align:left; color:var(--ink);
  background:none; border:0; border-radius:8px;
  padding:.5rem .75rem; cursor:pointer;
}
.ctx-item:hover{ background:var(--bg) }
.ctx-item.danger{ color:var(--bad) }
.ctx-item.filter{ color:var(--accent) }
.ctx-title{
  font-size:.68rem; font-weight:650; letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted); padding:.45rem .75rem .2rem;
}
.grid th.filtered{ color:var(--accent) }
.grid th.filtered::after{ content:' ▾'; }
.pill.editable{ cursor:pointer }
.pill.editable:hover{ filter:brightness(.95); box-shadow:0 0 0 1px var(--line-strong) }
.ctx-sep{ height:1px; background:var(--line); margin:.3rem .4rem }
.col-chips{ display:flex; flex-wrap:wrap; gap:.3rem }
.col-chips:empty{ display:none }
.col-chips .chip{ color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft) }
.col-chips .chip.neg{ color:var(--bad); border-color:var(--bad); background:var(--bad-bg) }
.ctx-item.danger:hover{ background:var(--bad-bg) }

/* ── a folded section ──────────────────────────────────────────────────
   Class-scoped, never bare details/summary: this stylesheet serves all
   seven admin pages. */

.adm-fold{ border-top:1px solid var(--line); margin-top:1.4rem }
.adm-fold > summary{
  list-style:none; cursor:pointer; padding:.9rem .2rem; min-height:44px;
  font-size:.72rem; font-weight:650; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted);
  display:flex; align-items:center; gap:.5rem;
}
.adm-fold > summary::-webkit-details-marker{ display:none }
.adm-fold > summary::before{ content:'\25B8'; transition:transform .15s; color:var(--faint) }
.adm-fold[open] > summary::before{ transform:rotate(90deg) }

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════════ */

.modules{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(13rem,1fr));
  gap:.6rem;
}
.module{
  display:block; text-decoration:none; color:inherit;
  border:1px solid var(--line); border-radius:var(--r);
  background:var(--well); padding:.95rem 1rem;
  transition:border-color .12s, background .12s, transform .12s;
}
.module:hover{ border-color:var(--accent-line); background:var(--card); transform:translateY(-2px); box-shadow:var(--shadow-pop) }
.module{ transition:border-color .16s, background .16s, transform .22s cubic-bezier(.2,.8,.3,1), box-shadow .22s }
.module-head{ display:flex; justify-content:space-between; align-items:center; gap:.5rem }
.module-head b{ font-size:.95rem; font-weight:650 }
.module-line{ display:block; font-size:.8rem; color:var(--muted); margin-top:.35rem }

/* the host split */
.split{ display:flex; flex-wrap:wrap; gap:.7rem }
.split-item{
  flex:1 1 8rem; min-width:7rem;
  font:inherit; text-align:left; cursor:pointer;
  background:var(--well); border:1px solid var(--line);
  border-radius:var(--r); padding:.8rem .95rem;
  transition:border-color .12s, background .12s;
}
.split-item b{ display:block; font-size:1.4rem; font-weight:700; line-height:1.1; letter-spacing:-.02em }
.split-item small{ display:block; margin-top:.2rem; font-size:.78rem; color:var(--muted) }
.split-item:hover{ border-color:var(--accent-line); background:var(--card) }
.split-item.on{ border-color:var(--accent); background:var(--accent-soft) }

/* ═══════════════════════════════════════════════════════════════════════
   CALENDARS, BOARDS AND LAST YEAR
   ═══════════════════════════════════════════════════════════════════════ */

.cal-toolbar{ display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:.9rem }
.cal-tab{
  font:inherit; font-size:.78rem; font-weight:550; color:var(--muted);
  background:var(--card); cursor:pointer; min-height:2rem;
  border:1px solid var(--line-strong); border-radius:2rem; padding:.3rem .9rem;
}
.cal-tab:hover{ background:var(--bg) }
.cal-tab.on{ color:var(--accent-ink); background:var(--accent); border-color:var(--accent) }

.cal-grid{ display:flex; gap:.5rem; overflow-x:auto; padding-bottom:.4rem }
.cal-gutter{ flex:0 0 3.2rem }
.cal-col{ flex:1 1 0; min-width:0 }
.cal-grid.many .cal-col{ min-width:17rem }
.cal-day-head{
  font-size:.82rem; font-weight:650; padding:.25rem 0 .5rem; min-height:1.9rem;
  border-bottom:1px solid var(--line-strong); margin-bottom:.4rem; white-space:nowrap;
}
.cal-body{
  position:relative; border-radius:6px;
  background:repeating-linear-gradient(to bottom,
    var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hour,44px));
}
.cal-body.clickable{ cursor:copy }
.cal-gutter .cal-body{ background:none }
.cal-hour{
  position:absolute; right:.35rem; transform:translateY(-45%);
  font-size:.64rem; color:var(--faint);
}
.cal-untimed{ display:flex; flex-direction:column; gap:.3rem; margin-bottom:.5rem }
.cal-block{
  position:absolute; left:2px; right:2px; overflow:hidden;
  border-radius:8px; padding:.3rem 1.2rem .3rem .55rem;
  border:1px solid var(--edge, var(--line-strong)); border-left-width:3px;
  background:var(--fill, var(--bg)); box-shadow:var(--shadow);
}
.cal-block.floating{ position:static }
.cal-block b{ display:block; font-size:.75rem; font-weight:600; line-height:1.25; overflow:hidden; text-overflow:ellipsis }
.cal-block span{ display:block; font-size:.66rem; color:var(--muted); line-height:1.3; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.cal-block.floating span{ white-space:normal }
.cal-block.narrow{ padding:.25rem .4rem }
.cal-block.sim{ border-style:dashed }
.cal-block .cal-x{
  position:absolute; top:.15rem; right:.2rem;
  font:inherit; font-size:.85rem; line-height:1; color:var(--faint);
  background:none; border:0; cursor:pointer; padding:.1rem .2rem;
}
.cal-block .cal-x:hover{ color:var(--bad) }
.cal-block.c1{ --edge:#3347c9; --fill:#eef0fc }
.cal-block.c2{ --edge:#b45309; --fill:#fff7ed }
.cal-block.c3{ --edge:#be185d; --fill:#fdf2f8 }
.cal-block.c4{ --edge:#067647; --fill:#ecfdf3 }
.cal-block.c5{ --edge:#6d28d9; --fill:#f5f3ff }
.cal-block.c6{ --edge:#0e7490; --fill:#ecfeff }
.cal-block.c0{ --edge:var(--line-strong); --fill:var(--card) }

/* shift board staffing states */
.shift-block.st-ok{       --edge:#3347c9; --fill:#eef0fc }
.shift-block.st-short{    --edge:#b45309; --fill:#fffaeb }
.shift-block.st-critical{ --edge:#b42318; --fill:#fef3f2 }
.shift-block.st-full{     --edge:#067647; --fill:#ecfdf3 }

/* last-year reference blocks */
.ly-bars{ display:flex; flex-direction:column; gap:.45rem; max-width:44rem }
.ly-bar{ display:grid; grid-template-columns:9rem 1fr 2.2rem; gap:.7rem; align-items:center }
.ly-bar-label{ font-size:.82rem; color:var(--muted); text-align:right }
.ly-bar-track{ height:.7rem; background:var(--bg); border-radius:2rem; overflow:hidden }
.ly-bar-fill{ height:100%; background:var(--accent); border-radius:2rem; opacity:.8 }
.ly-bar-n{ font-size:.8rem; color:var(--ink) }
@media (max-width:480px){ .ly-bar{ grid-template-columns:6rem 1fr 2.2rem } .ly-bar-label{ font-size:.74rem } }
.ly-tiers{ display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:.8rem }
.pay-config + .ly-tiers{ margin-top:.8rem }
.ly-roomgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(13rem,1fr)); gap:.6rem }
.ly-room{ border:1px solid var(--line); border-radius:var(--r-sm); background:var(--well); padding:.6rem .8rem }
.ly-room b{ display:block; font-size:.85rem; margin-bottom:.15rem }
.ly-room span{ font-size:.78rem; color:var(--muted) }
.ly-rooms .muted{ margin-top:.6rem }

/* ═══════════════════════════════════════════════════════════════════════
   TOUCH
   Gated on `pointer:coarse` — the PRIMARY input — and never on
   `any-pointer`, which would hand a touchscreen laptop phone-sized controls
   inside a desktop table and cost a quarter of its visible rows.
   ═══════════════════════════════════════════════════════════════════════ */

@media (pointer:coarse){
  :root{ --control:2.75rem }
  .btn,.btn.small{ min-height:44px; padding:.55rem 1rem }
  .segmented button,.cal-tab,.subnav button{ min-height:44px; padding:.5rem .95rem }
  .topbar-link{ min-height:44px; display:inline-flex; align-items:center }
  /* the pickers above the list shrink their type to fit three abreast, but
     under 16px iOS zooms in on focus — that is the one thing they may not do */
  .tools select{ font-size:16px }
  .ctx-item{ min-height:44px; padding:.7rem .9rem; display:flex; align-items:center }
  /* "Treu de la llista d'enguany" (reversible) sat flush above
     "Esborra del tot…" (permanent) */
  .ctx-item.danger{ margin-top:12px; border-top:1px solid var(--line) }
  /* inputs under 16px make iOS Safari zoom the page on focus and never
     zoom back, so tapping the search box cost a pinch to undo */
  input,select,textarea{ font-size:16px; min-height:44px }
  .host-pick{ min-width:7rem; min-height:44px; font-size:16px }
  input[type=checkbox],input[type=radio],
  .inline-form.many .check-field input{ width:22px; height:22px; min-height:0; flex:none }
  .edit-dialog .check-line{ min-height:44px }
  .grid .more,.more{ min-width:44px; min-height:44px }
  .side-foot a,.side-foot button,.adm-nav a{ min-height:44px }
}

/* ── the income simulator ──────────────────────────────────────────
   Built for a thumb: every row is one line, the stepper's two buttons are
   44px, the price is a tap away, and on a phone the two numbers that
   matter ride above the tab bar while you scroll the rows. */

.sim-hero{
  padding:1.1rem 1.2rem 1rem; border-radius:var(--r);
  background:linear-gradient(135deg, #1b2461 0%, var(--accent) 60%, #4a5ee6 100%);
  color:#fff; box-shadow:0 8px 24px rgba(51,71,201,.28);
}
.sim-hero > b{ display:block; font-size:2.1rem; font-weight:750; letter-spacing:-.03em; line-height:1.05 }
.sim-hero > small{ display:block; margin-top:.3rem; font-size:.8rem; color:rgba(255,255,255,.8) }
.sim-hero .bar{ background:rgba(255,255,255,.22); margin-top:.8rem }
.sim-hero .bar span{ background:#fff }
.sim-hero .sim-sub{ margin-top:.4rem; color:rgba(255,255,255,.9); font-weight:550 }
.sim-tiles{ display:grid; grid-template-columns:repeat(3,1fr); gap:.6rem; margin:.75rem 0 1rem }
.sim-tile{ background:var(--well); border:1px solid var(--line); border-radius:var(--r); padding:.7rem .85rem; min-width:0 }
.sim-tile b{ display:block; font-size:1.05rem; font-weight:700; letter-spacing:-.01em; overflow-wrap:anywhere }
.sim-tile small{ display:block; font-size:.72rem; color:var(--muted); margin-top:.15rem; line-height:1.3 }
.sim-tile.good b{ color:var(--good) }
.sim-tile.bad b{ color:var(--bad) }
.sim-presets{ display:flex; gap:.5rem; flex-wrap:wrap; margin-bottom:.8rem }

.sim-rows{ border:1px solid var(--line); border-radius:var(--r); overflow:hidden }
.sim-row{
  display:grid; grid-template-columns:1fr auto 6.5rem; align-items:center; gap:.75rem;
  padding:.6rem .9rem; background:var(--card); border-top:1px solid var(--line);
}
.sim-row:first-child{ border-top:0 }
.sim-row.extra{ background:var(--well) }
.sim-left{ min-width:0 }
.sim-left .name{ font-weight:600 }
.sim-priceline{ display:flex; align-items:center; gap:.35rem; margin-top:.1rem }
.sim-price{
  display:inline-flex; align-items:center; gap:.3rem;
  font:inherit; font-size:.8rem; font-weight:550; color:var(--muted);
  background:var(--card); border:1px solid var(--line-strong); border-radius:2rem;
  padding:.15rem .65rem; cursor:pointer; min-height:1.9rem;
  transition:border-color .12s, color .12s, background .12s;
}
.sim-price::after{ content:'\270E'; font-size:.7rem; color:var(--faint) }
.sim-price:hover{ color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft) }
.sim-price.changed{ color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft) }
.sim-price-input{ width:6rem; min-height:2.2rem; padding:.2rem .5rem; font-size:.9rem }
.sim-reset{
  font:inherit; font-size:.9rem; color:var(--faint); background:none; border:0;
  cursor:pointer; padding:.1rem .3rem; border-radius:6px; min-height:1.8rem;
}
.sim-reset:hover{ color:var(--ink); background:var(--bg) }
.sim-total{ text-align:right; font-weight:600; white-space:nowrap }
.sim-foot{ margin:.7rem 0 0 }
.sim-basis{ font-size:.8rem; color:var(--faint); margin:-.2rem 0 .7rem }
.sim-row.sim-head{ background:var(--well) }
.sim-row.sim-var{ background:var(--accent-soft) }
.sim-row .sub{ margin-bottom:.25rem }
.sim-row.sim-var .name::before{ content:'\25CF'; color:var(--accent); font-size:.6rem; margin-right:.4rem; vertical-align:middle }
.sim-row .sub{ font-size:.75rem; color:var(--faint) }
/* a place of your own, written in the last row */
.sim-row.sim-add{ display:flex; gap:.6rem; align-items:center; justify-content:space-between }
.sim-add-fields{ display:flex; gap:.6rem; flex:1; min-width:0 }
.sim-add-fields input[type=text]{ flex:1; min-width:0 }
.sim-add-fields input[type=number]{ width:7rem }
.sim-count{ text-align:center; padding:0 .6rem }
.sim-count b{ display:block; font-size:1.15rem; font-weight:700; line-height:1.1 }
.sim-count small{ display:block; font-size:.66rem; color:var(--faint); white-space:nowrap }
.sim-section{
  padding:.55rem .9rem .35rem; font-size:.68rem; font-weight:650; letter-spacing:.08em;
  text-transform:uppercase; color:var(--faint); background:var(--well); border-top:1px solid var(--line);
}
.stepper .step:disabled{ color:var(--line-strong); cursor:default }
.stepper .step:disabled:hover{ background:none }

.stepper{ display:inline-flex; align-items:center; border:1px solid var(--line-strong); border-radius:10px; background:var(--card); overflow:hidden }
.stepper .step{
  width:2.5rem; height:2.5rem; font:inherit; font-size:1.2rem; line-height:1;
  color:var(--ink); background:none; border:0; cursor:pointer;
  transition:background .12s, transform .1s;
}
.stepper .step:hover{ background:var(--bg) }
.stepper .step:active{ background:var(--accent-soft); transform:scale(.94) }
.stepper .step-num{
  width:3.2rem; min-height:0; height:2.5rem; text-align:center; font-weight:650;
  border:0; border-left:1px solid var(--line); border-right:1px solid var(--line); border-radius:0;
  padding:0; -moz-appearance:textfield;
}
.stepper .step-num::-webkit-inner-spin-button,.stepper .step-num::-webkit-outer-spin-button{ -webkit-appearance:none; margin:0 }
.stepper .step-num:focus{ box-shadow:inset 0 0 0 2px var(--accent-line) }

/* the phone strip: income and margin, riding above the tab bar */
.sim-bar{ display:none }
@media (max-width:959px){
  .sim-bar{
    display:flex; justify-content:space-between; align-items:center; gap:1rem;
    position:fixed; left:.85rem; right:.85rem; bottom:calc(var(--tab-h) + .6rem); z-index:5;
    padding:.6rem 1rem; border-radius:14px;
    background:rgba(17,24,39,.92); color:#fff;
    -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
    box-shadow:0 10px 30px rgba(17,24,39,.3);
    animation:rise .3s cubic-bezier(.2,.8,.3,1) both;
  }
  .sim-bar b{ display:block; font-size:1.05rem; font-weight:700; letter-spacing:-.01em }
  .sim-bar small{ display:block; font-size:.68rem; color:rgba(255,255,255,.7) }
  .sim-bar > div:last-child{ text-align:right }
  .sim-bar .good b{ color:#6ee7a8 }
  .sim-bar .bad b{ color:#fda29b }
  /* room for the strip under the last row */
  [data-pane="sim"] .panel{ margin-bottom:4.6rem }
}
@media (max-width:700px){
  .sim-tiles{ grid-template-columns:1fr 1fr 1fr; gap:.45rem }
  .sim-tile{ padding:.55rem .6rem }
  .sim-tile b{ font-size:.92rem }
  .sim-tile small{ font-size:.66rem }
  .sim-row{ grid-template-columns:1fr auto; row-gap:.35rem; padding:.7rem .85rem }
  .sim-total{ grid-column:1 / -1; text-align:right; font-size:.85rem; color:var(--muted); font-weight:500; margin-top:-.2rem }
  .sim-hero > b{ font-size:1.85rem }
}
@media (pointer:coarse){
  .stepper .step{ width:44px; height:44px }
  .stepper .step-num{ height:44px; font-size:16px }
  .sim-price,.sim-reset{ min-height:44px }
  .sim-price{ padding:.2rem .8rem }
}

/* ── shifts: sheets, candidates, people ─────────────────────────────
   The two sheets (a shift, a person) are the same dialog with a header
   and a body that repaints itself; the candidate lines are buttons, one
   tap each, big enough for a thumb. */

.edit-dialog.wide{ width:min(36rem, 94vw); padding:0 }
.edit-dialog.narrow{ width:min(24rem, 94vw) }
.sheet-head{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:1rem 1.25rem .6rem; position:sticky; top:0; background:var(--card); z-index:1;
}
.sheet-head h2{ margin:0; font-size:1.15rem }
.sheet-body{ padding:0 1.25rem 1.25rem }
.sheet-body h3{ margin:1.1rem 0 .5rem }
.sheet-meta{ display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; font-size:.85rem; color:var(--muted); margin-bottom:.2rem }
.sheet-list{ border:1px solid var(--line); border-radius:var(--r); overflow:hidden }
.sheet-list > .muted{ padding:.8rem .9rem; margin:0 }
.sheet-line,.cand{
  display:flex; align-items:center; justify-content:space-between; gap:.75rem;
  width:100%; padding:.55rem .85rem; min-height:3rem;
  background:var(--card); border:0; border-top:1px solid var(--line);
  font:inherit; text-align:left; color:var(--ink);
}
.sheet-line:first-child,.cand:first-child{ border-top:0 }
.cand{ cursor:pointer; transition:background .12s }
.cand:hover{ background:var(--accent-soft) }
.cand:active{ background:var(--accent-line) }
.cand-left{ display:flex; flex-direction:column; gap:.15rem; min-width:0; flex:1 1 auto }
.sheet-line > .btn,.cand > .pill{ flex:none }
.cand-left b{ font-weight:600 }
.cand-left small{ font-size:.76rem; color:var(--faint) }
.cand-tags{ display:flex; flex-wrap:wrap; gap:.25rem }
.cand-tags .tag{ margin:0 }
.tag.good{ color:var(--good); border-color:var(--good-line); background:var(--good-bg) }
.tag.bad{ color:var(--bad); border-color:var(--bad-line); background:var(--bad-bg) }
.tag.warn{ color:var(--warn); border-color:var(--warn-line); background:var(--warn-bg) }
.sheet-body input[type=search]{ margin-bottom:.5rem }
.sheet-body > select{ margin-bottom:.5rem }
.sheet-body .adm-fold{ margin-top:1.2rem }
.sheet-form{ margin-top:.2rem }
.sheet-form.inline-form{ padding:.75rem; gap:.6rem }
.sheet-form .check-field{ display:flex; flex-direction:column }
.sheet-form .check-field input{ width:auto; height:var(--control); margin-top:auto }
.sheet-body .adm-fold > .btn.danger{ margin-top:.6rem; color:var(--bad) }
@media (max-width:700px){
  .sheet-form.inline-form{ grid-template-columns:1fr 1fr }
  .sheet-form .btn{ grid-column:1/-1 }
}

/* the people list */
.trow.person{ grid-template-columns:1.4fr auto 2fr auto }
.person-left{ cursor:pointer; min-width:0 }
.shift-chips{ display:flex; flex-wrap:wrap; gap:.3rem }
.chip{
  font:inherit; font-size:.74rem; font-weight:550; color:var(--muted);
  background:var(--well); border:1px solid var(--line-strong); border-radius:2rem;
  padding:.2rem .6rem; cursor:pointer; min-height:1.8rem; white-space:nowrap;
}
.chip:hover{ color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft) }
.shift-left{ cursor:pointer; min-width:0 }
.trow.shift.st-critical .name{ color:var(--bad) }
.stat.warn b{ color:var(--warn) }
.sh-stats{ grid-template-columns:repeat(4,1fr) }
@media (max-width:640px){ .sh-stats{ grid-template-columns:repeat(2,1fr) } }
.rota-bar{ margin-top:-.4rem }
.cal-block.tappable{ cursor:pointer; transition:transform .12s, box-shadow .12s }
.cal-block.tappable:hover{ transform:translateY(-1px); box-shadow:var(--shadow-pop) }
@media (max-width:760px){
  .trow.person{ display:flex; flex-wrap:wrap }
  .trow.person .person-left{ flex:1 1 60% }
  .trow.person .shift-chips{ flex:1 1 100% }
  .trow.person .btn{ margin-left:auto }
}
@media (pointer:coarse){
  .chip{ min-height:2.2rem; padding:.3rem .75rem }
  .sheet-line,.cand{ min-height:3.25rem }
}

/* ── the dashboard's drawings ──────────────────────────────────────── */

.charts{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:.75rem }
.chart{
  margin:0; padding:.9rem 1rem 1rem; min-width:0;
  background:var(--well); border:1px solid var(--line); border-radius:var(--r);
}
.chart figcaption{ margin-bottom:.6rem }
.chart figcaption b{ display:block; font-size:.92rem; font-weight:650 }
.chart figcaption small{ display:block; font-size:.74rem; color:var(--faint); line-height:1.35; margin-top:.15rem }
.chart svg{ display:block; width:100%; height:auto; overflow:visible; font-family:inherit }
.chart .muted{ padding:1rem 0 }
.chart-sub{ margin:.85rem 0 .35rem; font-size:.74rem; font-weight:600; color:var(--faint);
  padding-top:.7rem; border-top:1px solid var(--line, #e7e9ee) }
.chart-legend{ display:flex; flex-wrap:wrap; gap:.35rem .9rem; margin-top:.6rem; font-size:.76rem; color:var(--muted) }
.chart-legend i{ display:inline-block; width:.7rem; height:.7rem; border-radius:3px; vertical-align:-1px; margin-right:.35rem }
.chart-legend i.ghost{ background:none; border:1.5px dashed var(--faint) }
.chart-legend b{ color:var(--ink); font-weight:650 }
/* under the beds: what does not add up between the rooms and the extras */
.chart-fix{ margin-top:.8rem; padding:.55rem .75rem; border:1px solid var(--warn-line); border-radius:10px; background:var(--warn-bg); font-size:.8rem; line-height:1.4 }
.chart-fix b{ display:block; color:var(--warn); font-weight:650; margin-bottom:.15rem }
.chart-fix ul{ margin:0; padding-left:1.1rem }
.chart[data-chart="pace"]{ grid-column:1/-1 }
@media (max-width:760px){ .charts{ grid-template-columns:1fr } }

/* the bars grow in, the line draws itself */
.chart .grow{ transform-origin:0 50%; animation:grow .7s cubic-bezier(.2,.8,.3,1) both }
.chart .grow-y{ transform-origin:50% 100%; animation:grow-y .7s cubic-bezier(.2,.8,.3,1) both }
.chart .draw{ stroke-dasharray:1; stroke-dashoffset:1; animation:draw 1.1s .1s cubic-bezier(.2,.8,.3,1) forwards }
.chart .fade{ animation:sheet-in .6s .6s both }
@keyframes grow{ from{ transform:scaleX(0) } }
@keyframes grow-y{ from{ transform:scaleY(0) } }
@keyframes draw{ to{ stroke-dashoffset:0 } }

/* ── less motion ────────────────────────────────────────────────────
   Somebody who asked their phone for less movement gets the same app
   with everything already where it ends up. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.001s !important; animation-delay:0s !important; transition-duration:.001s !important }
  .bar span::after{ display:none }
}

/* ═══════════════════════════════════════════════════════════════════════
   THE DESK, ON A DESKTOP
   ═══════════════════════════════════════════════════════════════════════
   The 82rem reading column suits a form; it starves a table. Convidats
   wanted 1452px of columns inside 1100 — Quota, Habitació, Inscripció and
   the row menu all off the right edge — and the shift board wanted five
   days inside four, on a 1920 screen with 368px of empty desk beside it.
   So: the two pages that are worked in a grid get the whole desk, the
   grid stops insisting that every cell is one unbroken line, and the name
   and the row buttons stay put, so whatever scroll is left never hides
   who the row is or how to act on it. */

@media (min-width:960px){
  body[data-page="guests"] .wrap,
  body[data-page="shifts"] .wrap{ max-width:110rem }

  .grid th,.grid td{ padding-left:.6rem; padding-right:.6rem }
  .grid .cell-dim{ max-width:11rem }

  /* the name keeps its own line and "enviada", "no ha entrat" fall
     underneath it, instead of dragging the column out to 355px */
  #guestGrid th:first-child{ width:14rem }
  #guestGrid td.cell-name{ white-space:normal }
  #guestGrid .cell-name b{ white-space:nowrap }

  #guestGrid thead th:first-child,
  #guestGrid tbody tr:not(.detail-tr) td.cell-name{
    position:sticky; left:0; z-index:2;
    background:var(--card); box-shadow:7px 0 7px -7px rgba(17,24,39,.22);
  }
  #guestGrid thead th:last-child,
  #guestGrid tbody tr:not(.detail-tr) td.cell-actions{
    position:sticky; right:0; z-index:2;
    background:var(--card); box-shadow:-7px 0 7px -7px rgba(17,24,39,.22);
  }
  #guestGrid thead th:first-child,
  #guestGrid thead th:last-child{ z-index:3; background:var(--well) }
  #guestGrid tbody tr:hover td.cell-name,
  #guestGrid tbody tr:hover td.cell-actions{
    background:color-mix(in srgb, var(--accent) 4%, var(--card));
  }

  /* an aspirant's own words are a paragraph, not a 1000px line: let the
     cells wrap — .when and .row-end keep the nowrap they already have —
     and keep the two buttons on screen */
  #wlGrid td{ white-space:normal }
  #wlGrid td.wl-who{ width:22rem }
  #wlGrid td.row-end{
    position:sticky; right:0; z-index:2;
    background:var(--card); box-shadow:-7px 0 7px -7px rgba(17,24,39,.22);
  }
  #wlGrid tbody tr:hover td.row-end{
    background:color-mix(in srgb, var(--accent) 4%, var(--card));
  }

  /* five days at 17rem do not fit a 1440 screen; at 12.5rem they do, and
     a wider desk grows them back — the columns are flex:1 */
  .cal-grid.many .cal-col{ min-width:12.5rem }
  .cal-gutter{ position:sticky; left:0; z-index:2; background:var(--card) }
}

/* ── the room builder ──────────────────────────────────────────────── */
.plan-suggest{ display:grid; gap:.5rem }
.plan-sug{
  display:flex; align-items:center; gap:.75rem; justify-content:space-between;
  padding:.65rem .8rem; border:1px solid var(--line); border-radius:var(--r);
  background:var(--well);
}
.plan-sug.warn{ border-color:var(--warn-line); background:var(--warn-bg) }
.plan-sug .name{ font-weight:650 }
.plan-sug .who{ font-size:.9rem; margin:.1rem 0 }
.plan-sug .sub{ font-size:.78rem; color:var(--muted) }
.plan-sug .sub.warn{ color:var(--warn) }
.plan-sug .btn{ flex:none }
.plan-chips{ display:flex; flex-wrap:wrap; gap:.4rem }
.plan-chip{
  display:inline-flex; flex-direction:column; align-items:flex-start; gap:.1rem;
  min-height:var(--control); padding:.35rem .7rem; text-align:left;
  border:1px solid var(--line-strong); border-radius:var(--r-sm);
  background:var(--card); color:var(--ink); font:inherit; font-size:.85rem; cursor:pointer;
  transition:border-color .12s, background .12s;
}
.plan-chip:hover{ border-color:var(--accent-line) }
.plan-chip.on{ border-color:var(--accent); background:var(--accent-soft); box-shadow:0 0 0 1px var(--accent) }
.plan-chip.gone{ color:var(--bad); border-color:var(--bad-line); background:var(--bad-bg) }
.plan-chip .nm{ font-weight:600 }
.plan-chip .tg{ font-size:.72rem; color:var(--muted) }
.plan-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(15rem, 1fr)); gap:.6rem; align-items:start }
.plan-room{
  display:flex; flex-direction:column; gap:.55rem; min-width:0;
  padding:.75rem; border:1px solid var(--line); border-radius:var(--r); background:var(--well);
}
.plan-room.over{ border-color:var(--warn-line) }
.plan-head{ display:flex; align-items:center; justify-content:space-between; gap:.5rem }
.plan-beds{ display:flex; flex-wrap:wrap; gap:4px }
.plan-beds i{ width:10px; height:10px; border-radius:3px; background:var(--line-strong) }
.plan-beds i.on{ background:var(--accent) }
.plan-beds i.x{ background:var(--warn); margin-left:4px }
.plan-room .plan-chips{ flex-direction:column; flex-wrap:nowrap }
.plan-member{ display:flex; align-items:center; gap:.25rem }
.plan-member .plan-chip{ flex:1 1 auto; min-width:0 }
.plan-member .plan-chip .nm{ overflow:hidden; text-overflow:ellipsis; max-width:100% }
.plan-foot{ display:flex; flex-wrap:wrap; gap:.4rem; margin-top:auto }
/* the bunks asked for past the beds there are: a line of its own, under
   the button that confirms only the ones that fit */
.plan-foot .sub{ flex:1 1 100%; margin:0; font-size:.76rem; color:var(--muted) }
.plan-foot .sub.warn{ color:var(--warn) }
#planRooms > .panel h2{ margin-bottom:.75rem }
.plan-chip .tg.warn{ color:var(--warn); font-weight:600 }
.plan-room.target{ cursor:pointer; border-style:dashed; border-color:var(--accent-line) }
.plan-room.target:hover, .plan-room.drop{ border-style:solid; border-color:var(--accent); background:var(--accent-soft) }
section.drop{ outline:2px dashed var(--accent); outline-offset:-6px }
.plan-chip[draggable="true"]{ cursor:grab }
/* the pick line floats while somebody is waiting for a room */
#planPick.picking{
  position:fixed; z-index:40; left:50%; bottom:max(1rem, env(safe-area-inset-bottom));
  transform:translateX(-50%); width:max-content; max-width:calc(100vw - 2rem);
  display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin:0;
  padding:.55rem .6rem .55rem .9rem; border:1px solid var(--accent); border-radius:var(--r);
  background:var(--card); color:var(--ink); box-shadow:0 8px 28px rgb(0 0 0 / .18);
}
#planPick.picking > span{ font-weight:600 }
@media (max-width:959px){
  #planPick.picking{ bottom:calc(var(--tab-h) + env(safe-area-inset-bottom) + .5rem) }
}
@media (max-width:600px){
  .plan-sug{ flex-direction:column; align-items:stretch }
  .plan-grid{ grid-template-columns:1fr }
}

/* ── the form's answers, question by question ─────────────────────────── */
.ans-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap:.75rem; align-items:start }
.ans-card{ border:1px solid var(--line); border-radius:var(--r); padding:.85rem .9rem; background:var(--card); min-width:0 }
.ans-card h3{ margin:0 0 .6rem; font-size:.95rem; display:flex; align-items:center; gap:.5rem }
.ans-sub{ font-size:.8rem; color:var(--faint); margin:-.35rem 0 .6rem }
.ans-badge{ font-size:.75rem; font-weight:600; color:var(--muted); background:var(--well); border:1px solid var(--line); border-radius:99px; padding:0 .5rem }
.ans-row + .ans-row{ margin-top:.15rem }
.ans-bar{ all:unset; box-sizing:border-box; width:100%; display:grid; grid-template-columns:minmax(6rem, 9.5rem) 1fr 2rem; gap:.6rem; align-items:center; padding:.3rem .35rem; border-radius:var(--r-sm); cursor:pointer }
.ans-bar:hover:not(:disabled){ background:var(--well) }
.ans-bar:focus-visible{ outline:2px solid var(--accent); outline-offset:1px }
.ans-bar:disabled{ cursor:default; opacity:.55 }
.ans-label{ font-size:.85rem; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.ans-track{ height:.55rem; border-radius:99px; background:var(--line); overflow:hidden }
.ans-fill{ display:block; height:100%; border-radius:99px; background:var(--accent); transition:width .3s }
.ans-bar[aria-expanded="true"] .ans-fill{ background:var(--ink) }
.ans-n{ font-size:.85rem; text-align:right; font-variant-numeric:tabular-nums }
.ans-names{ font-size:.82rem; color:var(--muted); margin:.1rem .35rem .45rem; line-height:1.5 }
.ans-texts{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.55rem; max-height:26rem; overflow:auto }
.ans-texts li{ display:flex; flex-direction:column; gap:.1rem; font-size:.85rem; line-height:1.4 }
.ans-texts b{ font-size:.8rem; font-weight:650 }
.ans-texts span{ color:var(--muted); white-space:pre-line; overflow-wrap:anywhere }
.ans-contact{ font-size:.75rem; color:var(--faint); overflow-wrap:anywhere }
.ans-contact a{ color:var(--accent); text-decoration:none }
/* how far the form has got, above everything it says */
.ans-progress{ display:grid; grid-template-columns:auto 1fr; align-items:baseline; gap:.2rem .7rem; margin-bottom:.9rem;
  padding:.75rem .9rem; border:1px solid var(--accent-line); border-radius:var(--r); background:var(--accent-soft) }
.ans-progress b{ font-size:.95rem; color:var(--ink) }
.ans-progress span{ font-size:.82rem; color:var(--muted) }
.ans-progress-bar{ grid-column:1 / -1; display:block; height:6px; border-radius:99px; background:rgba(255,255,255,.7); overflow:hidden; margin-top:.35rem }
.ans-progress-bar span{ display:block; height:100%; background:var(--accent); border-radius:99px }
@media (max-width:560px){ .ans-progress{ grid-template-columns:1fr } }
.ans-copy{ margin-top:.7rem }

/* the made-up tickets, under the add box */
.tt-list{ list-style:none; margin:.5rem 0 0; padding:0; display:grid; gap:.35rem }
.tt-list li{ padding:.55rem .75rem; background:var(--well); border:1px solid var(--line); border-radius:var(--r) }
.tt-list .sub{ color:var(--muted) }

/* the leads' mail: who leads, and who has had it */
.lead-mail-state{ margin:.4rem 0 .8rem }
.lead-mail-list{ list-style:none; padding:0; margin:.5rem 0 0; display:flex; flex-direction:column; gap:.3rem; font-size:.85rem }
.lead-mail-list li{ display:flex; justify-content:space-between; gap:.6rem; align-items:center }
.lead-mail-list li.done{ color:var(--faint) }
.lead-mail-acts{ display:flex; gap:.5rem; flex-wrap:wrap }
/* a ticket's sign-up link: the address and its copy button on one line */
.tt-link-url{ display:flex; gap:.5rem; align-items:center; margin:.25rem 0 .35rem }
.tt-link-url input{ flex:1; min-width:0; font:inherit; font-size:.85rem; padding:.45rem .6rem;
  border:1px solid var(--line); border-radius:var(--r); background:var(--well); color:inherit }

/* still-to-answer: one row per person, the nudge on the right */
.ans-nudge{ list-style:none; margin:.4rem 0 0; padding:0; display:grid; gap:.3rem }
.ans-nudge li{ display:flex; align-items:center; justify-content:space-between; gap:.6rem; font-size:.88rem }
.ans-nudge .btn.wa{ background:#25d366; border-color:#25d366; color:#fff }
