/* ═══════════════════════════════════════════════════════════
   seat-picker.css — the "who sits in this chair?" picker
   (PICK-A-SEAT-PLAN.md §6, design/pick-a-seat-mockups.html .picker).
   Every class is `sp-` so nothing here can restyle the app, and nothing
   in the app can reach in. Tokens come from styles.css :root.
   ═══════════════════════════════════════════════════════════ */

/* Above the room labels (40) and the phone sheets (60), below toasts (75),
   so the Undo toast a pick raises is never hidden behind a picker. */
.sp-panel{position:fixed;z-index:72;display:flex;flex-direction:column;
  background:var(--panel);color:var(--ink);font-size:14px;line-height:1.35;
  box-shadow:var(--shadow-l),0 0 0 1px #F0E3EA;outline:0}

/* ── desktop popover ── */
.sp-pop{width:320px;max-width:calc(100vw - 16px);max-height:min(430px,calc(100vh - 16px));border-radius:var(--r)}
/* Below the content (the panel is its own stacking context), so the inner
   half of the square never paints over the header or the footer. */
.sp-lead{position:absolute;z-index:-1;width:12px;height:12px;background:var(--panel);transform:rotate(45deg)}
.sp-pop[data-side="right"] .sp-lead{box-shadow:-1px 1px 0 #F0E3EA}
.sp-pop[data-side="left"] .sp-lead{box-shadow:1px -1px 0 #F0E3EA}
.sp-pop[data-side="below"] .sp-lead{box-shadow:-1px -1px 0 #F0E3EA}
.sp-pop[data-side="above"] .sp-lead{box-shadow:1px 1px 0 #F0E3EA}

/* ── phone bottom sheet ── */
.sp-veil{position:fixed;inset:0;z-index:71;background:rgba(36,26,35,.35)}
.sp-sheet{left:0;right:0;bottom:0;height:min(70vh,560px);height:min(70dvh,560px);
  border-radius:24px 24px 0 0;box-shadow:0 -16px 44px rgba(58,42,56,.22)}
.sp-grab{flex:none;width:40px;height:5px;border-radius:9px;background:var(--panel3);margin:8px auto 2px}

/* ── entrance: fade + 6px rise; the sheet rises from the bottom ── */
.sp-pop.sp-in{animation:spRise var(--dur-s) var(--ease) both}
.sp-sheet.sp-in{animation:spSheet var(--dur-m) var(--ease) both}
.sp-veil.sp-in{animation:spFade var(--dur-s) var(--ease) both}
@keyframes spRise{from{opacity:0;transform:translateY(6px)}}
@keyframes spSheet{from{transform:translateY(100%)}}
@keyframes spFade{from{opacity:0}}

/* ── header ── */
.sp-head{flex:none;display:flex;align-items:center;gap:10px;padding:12px 12px 8px}
.sp-title{flex:1;min-width:0;font-weight:900;font-size:14.5px;line-height:1.25;overflow-wrap:anywhere;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sp-dial{flex:none;position:relative;width:34px;height:34px;border-radius:50%;
  background:var(--coral-soft);box-shadow:inset 0 0 0 2px var(--coral)}
.sp-dial i{position:absolute;width:var(--d,6px);height:var(--d,6px);border-radius:50%;transform:translate(-50%,-50%);
  background:var(--panel);box-shadow:inset 0 0 0 1px var(--ink-faint)}
.sp-dial i.sp-mine{background:var(--rose);box-shadow:none}
.sp-dial i.sp-ours{background:var(--lilac);box-shadow:none}
.sp-dial i.sp-cur{width:calc(var(--d,6px) + 1px);height:calc(var(--d,6px) + 1px);background:var(--ink);
  box-shadow:0 0 0 2px var(--panel),0 0 0 3px var(--ink)}
.sp-x{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;
  color:var(--ink-soft);font-weight:900;font-size:14px;transition:background var(--dur-xs),color var(--dur-xs)}
.sp-x:hover{background:var(--rose-soft);color:var(--rose)}
.sp-x:focus-visible,.sp-letus:focus-visible{outline:2px solid var(--rose);outline-offset:2px}

/* ── who is in this chair now ── */
.sp-occ-slot:empty{display:none}
.sp-occ{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:0 12px 8px;padding:8px 10px;
  border-radius:14px;font-weight:900;font-size:13px}
.sp-occ-mine{background:var(--rose-soft)}
.sp-occ-ours{background:var(--lilac-soft)}
.sp-occ-text{flex:1 1 140px;min-width:0;overflow-wrap:anywhere}
.sp-letus{flex:none;max-width:100%;padding:4px 10px;border-radius:999px;background:var(--lilac-soft);
  color:#6E4FB0;font-weight:900;font-size:12px;line-height:1.3;text-align:center}
.sp-occ-mine .sp-letus{background:var(--panel)}
.sp-letus:hover{background:var(--lilac);color:#fff}

/* ── search ── */
.sp-search{flex:none;display:flex;align-items:center;gap:7px;margin:0 12px 6px;padding:0 12px;
  border:2px solid var(--panel2);border-radius:999px;background:var(--cream);cursor:text}
.sp-search:focus-within{border-color:var(--rose);box-shadow:0 0 0 4px var(--rose-soft)}
.sp-search svg{width:16px;height:16px;flex:none;stroke:var(--ink-soft);fill:none;stroke-width:2;stroke-linecap:round}
/* 16px on phones: anything smaller makes iOS zoom the page on focus. */
.sp-input{flex:1;min-width:0;border:0;outline:0;background:transparent;padding:8px 0;
  font:inherit;font-weight:750;font-size:14px;color:var(--ink)}
.sp-sheet .sp-input{font-size:16px}
.sp-input::placeholder{color:var(--ink-faint);opacity:1}

/* ── list ── */
.sp-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 6px 6px}
.sp-sec{font-size:11px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint);padding:8px 8px 4px}
.sp-row{display:flex;align-items:center;gap:8px;min-height:38px;padding:6px 8px;border-radius:12px;cursor:pointer;
  transition:background var(--dur-xs)}
.sp-row:hover,.sp-row.sp-act{background:var(--panel2)}
.sp-row.sp-act{box-shadow:inset 0 0 0 2px var(--rose-soft)}
.sp-row[aria-disabled="true"]{cursor:not-allowed}
.sp-row[aria-disabled="true"]:hover{background:transparent}
.sp-row[aria-disabled="true"].sp-act{background:var(--panel2)}
.sp-av{flex:none;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  background:var(--lilac);color:#fff;font-weight:900;font-size:12px}
.sp-row[aria-disabled="true"] .sp-av{opacity:.45}
.sp-text{flex:1;min-width:0;display:flex;flex-direction:column}
.sp-name{font-weight:800;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sp-row[aria-disabled="true"] .sp-name{color:var(--ink-faint)}
/* The tag wraps rather than clips: Greek tags run long at 320px. */
.sp-sub{display:block;font-size:11.5px;font-weight:800;line-height:1.25;color:var(--ink-soft);overflow-wrap:anywhere}
.sp-sub-no{color:var(--danger)}
.sp-more{padding:8px;font-size:12px;font-weight:800;color:var(--ink-faint);text-align:center;overflow-wrap:anywhere}

/* ── the promise ── */
.sp-foot{flex:none;padding:9px 12px;border-top:1px solid var(--panel3);font-size:12px;font-weight:800;line-height:1.35;
  color:#6E4FB0;background:linear-gradient(90deg,var(--panel),var(--lilac-soft));border-radius:0 0 var(--r) var(--r)}
.sp-sheet .sp-foot{border-radius:0;padding-bottom:calc(9px + env(safe-area-inset-bottom))}

@media (prefers-reduced-motion:reduce){
  .sp-pop.sp-in,.sp-sheet.sp-in,.sp-veil.sp-in{animation:none}
  .sp-row,.sp-x{transition:none}
}
