/* Parent side (and the login page). Phone first. Plain tokens with a
   prefers-color-scheme override rather than light-dark(): Safari 16 on the
   iPad has to render this too. */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-alt: #f2ede4;
  --border: #e2dace;
  --text: #20262b;
  --text-dim: #6b6459;
  --accent: #1d1f2b;
  --accent-text: #ffffff;
  --ok: #2f8f4e;
  --no: #b3341e;
  --sun: #f4b942; --grass: #7cc47f; --sky: #6fb7e6; --berry: #e06c9f; --peach: #f2946b; --lilac: #a98ce3;
  --radius: 10px;
  --pad: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181b;
    --surface: #1b2126;
    --surface-alt: #222a30;
    --border: #2c353c;
    --text: #e8e6e1;
    --text-dim: #9aa3ab;
    --accent: #2a2d3e;
    --accent-text: #f7f5ef;
    --ok: #6fc48a;
    --no: #ef8f7f;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
img { display: block; }
.inline { display: inline; }
.muted { color: var(--text-dim); font-size: 14px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) var(--pad) 10px;
  background: var(--accent); color: var(--accent-text);
  overflow-x: auto;
}
.nav__brand { font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav__links { display: flex; gap: 2px; }
.nav__link {
  padding: 6px 10px; border-radius: 999px; color: inherit; text-decoration: none;
  opacity: 0.75; font-size: 15px; white-space: nowrap; border: 0; background: transparent; font: inherit; cursor: pointer;
}
.nav__link.is-active, .nav__link:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.badge {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: var(--sun); color: #1d1f2b; font-size: 12px; font-weight: 700; text-align: center;
}

.main { max-width: 760px; margin: 0 auto; padding: var(--pad) var(--pad) 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.page-head h1 { margin: 0; font-size: 24px; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 12px; }
.flash--alert { background: rgba(179, 52, 30, 0.12); color: var(--no); }
.flash--notice { background: rgba(47, 143, 78, 0.12); color: var(--ok); }
.empty { padding: 40px 0; text-align: center; color: var(--text-dim); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn--small { padding: 4px 10px; font-size: 14px; }
.btn--ok { background: var(--ok); color: #fff; border-color: var(--ok); min-width: 44px; }
.btn--no { background: transparent; color: var(--no); border-color: var(--no); min-width: 44px; }
.btn--toggle.is-on { background: var(--surface-alt); font-weight: 600; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.form { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.form--inline { flex-direction: row; max-width: none; }
.form--inline .input { flex: 1 1 auto; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; color: var(--text-dim); }
.input {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; width: 100%;
}
.input--short { width: 6em; }
.input--emoji { width: 5em; font-size: 24px; }
.input--pin { font-size: 28px; letter-spacing: 0.4em; text-align: center; }
.form__actions { display: flex; gap: 8px; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.check input { width: 22px; height: 22px; margin: 0; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch-pick .swatch { cursor: pointer; border: 3px solid transparent; }
.swatch-pick input:checked + .swatch { border-color: var(--text); }
.swatch {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.swatch--sun { background: var(--sun); } .swatch--grass { background: var(--grass); }
.swatch--sky { background: var(--sky); } .swatch--berry { background: var(--berry); }
.swatch--peach { background: var(--peach); } .swatch--lilac { background: var(--lilac); }

.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.who__emoji { font-size: 20px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--surface-alt); font-size: 12px; }
.tag--bad { color: var(--no); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; font-size: 14px; }
.chip.is-active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.list__item--stack { flex-direction: column; align-items: stretch; }
.list__head { display: flex; align-items: center; gap: 12px; }
.list__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.list__body strong { overflow: hidden; text-overflow: ellipsis; }
.list__avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.list__thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.subs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.subs__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* ---------- queue cards ---------- */
.qcard {
  display: flex; flex-direction: column;
  margin-bottom: 14px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
}
.qcard__thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.qcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.qcard__thumb--round { aspect-ratio: auto; background: transparent; padding: 12px; }
.qcard__thumb--round img { width: 88px; height: 88px; border-radius: 50%; }
.card__duration {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 13px; font-weight: 600;
}
.qcard__body { padding: 12px; }
.qcard__title { margin: 0 0 4px; font-size: 17px; line-height: 1.3; }
.qcard__meta { margin: 0 0 8px; color: var(--text-dim); font-size: 14px; }
.qcard__rows { display: flex; flex-direction: column; gap: 6px; }
.qcard__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qcard__row--all { border-top: 1px solid var(--border); padding-top: 6px; }
@media (min-width: 560px) {
  .qcard { flex-direction: row; }
  .qcard__thumb { flex: 0 0 240px; aspect-ratio: auto; }
  .qcard__body { flex: 1 1 auto; }
}

/* ---------- login ---------- */
.login { max-width: 360px; margin: 15vh auto 0; text-align: center; }
.login__title { font-size: 28px; margin: 0 0 8px; }
.login__hint { color: var(--text-dim); font-size: 14px; }
.login__form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
