/* Newton Family Wishlists. Mobile first; no build step. */

:root {
  color-scheme: light dark;

  --bg: #f6efe2;
  --surface: #fffdf8;
  --surface-2: #f1e8d6;
  --ink: #2a201a;
  --muted: #76675b;
  --line: #e4d7c0;

  --accent: #b0242f;       /* cranberry: buttons */
  --accent-ink: #ffffff;
  --accent-text: #a31f2a;  /* cranberry: text/links on surfaces */
  --pine: #1e5b3f;
  --pine-btn: #1e5b3f;     /* filled green controls (brighter in dark mode so they stay visible) */
  --pine-ink: #f6efe2;
  --pine-soft: #dcebe1;
  --pine-text: #1a5238;
  --gold: #c58f1d;
  --gold-soft: #f8e9c4;
  --gold-text: #7d5a0b;
  --danger: #a31f2a;

  --shadow: 0 1px 2px rgb(70 40 15 / 0.06), 0 8px 22px rgb(70 40 15 / 0.07);
  --radius: 18px;
  --tabbar: 64px;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --display: ui-serif, 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120f;
    --surface: #231b16;
    --surface-2: #2e241d;
    --ink: #f6ecdf;
    --muted: #b3a393;
    --line: #3d3128;

    --accent: #c9363f;
    --accent-text: #ff9096;
    --pine: #153a29;
    --pine-btn: #2d7d58;
    --pine-soft: #1f3d2d;
    --pine-text: #7fd0a5;
    --gold: #e3b04b;
    --gold-soft: #3b2f13;
    --gold-text: #efc56b;
    --danger: #ff9096;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 22px rgb(0 0 0 / 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
body:has(dialog[open]) { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); letter-spacing: -0.01em; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-text); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 80%, transparent); outline-offset: 2px; }

/* ---------- App shell ---------- */

.shell { display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--pine); color: var(--pine-ink);
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.topbar-inner {
  max-width: 760px; margin: 0 auto; min-height: 56px;
  display: flex; align-items: center; gap: 12px;
}
.brand { font: 700 1.15rem var(--display); display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; white-space: nowrap; text-decoration: none; color: inherit; }
.brand-mark { font-size: 1.35rem; }
.countdown {
  font-size: 0.8rem; font-weight: 650; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 90%, #fff 0%); color: #2b1d02;
}
@media (max-width: 400px) { .countdown .wide { display: none; } }
@media (max-width: 340px) { .brand { font-size: 1rem; } .brand-mark { display: none; } }  /* very small phones */
.me-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--pine-ink) 55%, transparent);
  background: color-mix(in srgb, var(--pine-ink) 14%, transparent); font-size: 1.3rem; cursor: pointer; display: grid; place-items: center; padding: 0;
}
/* string lights */
.lights {
  height: 9px; margin: 0 -16px;
  background:
    radial-gradient(circle at 8px 4px, #e5484d 3.2px, transparent 3.8px) 0 0 / 64px 9px repeat-x,
    radial-gradient(circle at 24px 4px, #f2b84b 3.2px, transparent 3.8px) 0 0 / 64px 9px repeat-x,
    radial-gradient(circle at 40px 4px, #6dd49b 3.2px, transparent 3.8px) 0 0 / 64px 9px repeat-x,
    radial-gradient(circle at 56px 4px, #f6efe2 3.2px, transparent 3.8px) 0 0 / 64px 9px repeat-x;
  opacity: 0.95;
}

main {
  flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) calc(var(--tabbar) + 36px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(var(--tabs, 3), 1fr); height: var(--tabbar); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 0.74rem; font-weight: 600;
}
.tab[aria-current='page'] { color: var(--accent-text); }

/* ---------- Common bits ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 14px; border: 1.5px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 650; cursor: pointer; text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.pine { background: var(--pine-btn); color: #fff; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.9rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 1.05rem; border-radius: 16px; }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 0;
  background: transparent; color: inherit; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.icon-btn:disabled:hover { background: transparent; }

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: grid; gap: 14px; }
.eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--muted); }

.avatar {
  --h: 140;
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem;
  background: hsl(var(--h) 55% 88%); box-shadow: inset 0 0 0 2px hsl(var(--h) 45% 72%);
}
.avatar.big { width: 64px; height: 64px; font-size: 2.1rem; }
@media (prefers-color-scheme: dark) {
  .avatar { background: hsl(var(--h) 30% 22%); box-shadow: inset 0 0 0 2px hsl(var(--h) 30% 34%); }
}

.back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 12px -6px; padding: 6px 10px 6px 4px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.back:hover { background: var(--surface-2); }

.empty { text-align: center; padding: 44px 20px; display: grid; gap: 10px; justify-items: center; color: var(--muted); }
.empty .big { font-size: 3rem; }
.empty h2 { color: var(--ink); font-size: 1.3rem; }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--gold-soft); color: var(--gold-text); font-size: 0.92rem;
}
.notice svg { flex: none; margin-top: 2px; }
.notice.pine { background: var(--pine-soft); color: var(--pine-text); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 72px); z-index: 100;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none; max-width: min(92vw, 460px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 0.95rem; box-shadow: var(--shadow);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* a modal dialog sits in the top layer, so keep the toast above its backdrop's content area */
.toast.error { background: #8f1d27; color: #fff; }

/* ---------- Family home ---------- */

.hero { padding: 6px 2px 18px; }
.hero h1 { font-size: 1.9rem; line-height: 1.15; }
.hero p { margin-top: 6px; color: var(--muted); }

.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.person {
  display: block; padding: 14px 16px 12px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: inherit; border: 1px solid var(--line);
}
.person-head { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.person-main { flex: 1; min-width: 0; }
.person-name { font-weight: 700; font-size: 1.08rem; display: flex; align-items: center; gap: 8px; }
.person-sub { color: var(--muted); font-size: 0.9rem; margin-top: 1px; }
.tag { font-size: 0.7rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-text); }
.tag.pine { background: var(--pine-soft); color: var(--pine-text); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--pine-text); border-radius: 99px; }
.chev { color: var(--muted); flex: none; }

/* occasions inside a person's card */
.occasions { display: grid; gap: 8px; margin-top: 12px; }
.occasion-row { display: block; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); text-decoration: none; color: inherit; }
.occasion-row:active { transform: scale(0.99); }
.occasion-row .line { display: flex; align-items: center; gap: 10px; }
.occasion-row .label { font-weight: 700; }
.occasion-row .count { flex: 1; color: var(--muted); font-size: 0.88rem; text-align: right; }
.occasion-row .progress { background: var(--surface); margin-top: 8px; }

/* coming up */
.upcoming { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.upcoming-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: var(--gold-soft); color: var(--gold-text); text-decoration: none; font-size: 0.9rem; }
.upcoming-chip strong { color: inherit; }
.upcoming-chip .muted { color: inherit; opacity: 0.8; }

/* Christmas / Birthday switcher */
.occasions-switch { display: flex; width: 100%; margin: 0 0 14px; }
.occasions-switch a { flex: 1; text-align: center; padding: 9px 12px; border-radius: 9px; font-weight: 650; font-size: 0.92rem; color: var(--muted); text-decoration: none; }
.occasions-switch a[aria-current='page'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.birthday-line { color: var(--gold-text); font-weight: 600; font-size: 0.9rem; margin-top: 2px; }

/* "I got it" archive */
details.received { margin-top: 22px; }
details.received summary { cursor: pointer; font-weight: 700; padding: 10px 2px; color: var(--muted); }
details.received > .muted { margin: 0 0 10px; }

.birthday-row { display: grid; grid-template-columns: 1.4fr 0.9fr 1.1fr; gap: 8px; }

/* ---------- Lists & item cards ---------- */

.list-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.list-head h1 { font-size: 1.6rem; line-height: 1.15; }
.list-head p { color: var(--muted); font-size: 0.93rem; margin-top: 2px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 12px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 650; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.card {
  position: relative; display: block; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-main {
  display: flex; gap: 14px; width: 100%; padding: 12px; text-align: left; background: none; border: 0; cursor: pointer;
}
.thumb {
  flex: none; width: 96px; height: 96px; border-radius: 12px; background: #fff; overflow: hidden; display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.empty-thumb { background: var(--surface-2); color: var(--muted); }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.title {
  font-weight: 650; font-size: 1.02rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.88rem; color: var(--muted); }
.price { font-weight: 750; color: var(--ink); font-size: 0.98rem; }
.note-line { font-size: 0.86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.card-foot { display: flex; align-items: center; gap: 10px; padding: 0 12px 12px; flex-wrap: wrap; }
.card-foot .grow { flex: 1; min-width: 0; }

.bought-badge { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 700; font-size: 0.9rem; color: var(--pine-text); }
.bought-badge svg { flex: none; margin-top: 2px; }
.bought-badge.split { color: var(--gold-text); }
.edited-warn { display: flex; align-items: flex-start; gap: 6px; font-size: 0.82rem; color: var(--gold-text); background: var(--gold-soft); padding: 6px 10px; border-radius: 10px; width: 100%; }
.card.is-bought .thumb img, .card.is-bought .info { opacity: 0.55; }
.card.mine { border-color: color-mix(in srgb, var(--pine-text) 55%, var(--line)); }
.card.is-bought::after, .card.is-split::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--pine-text);
}
.card.is-split::after { background: var(--gold); }  /* open to split: still needs people, so not dimmed */
.card.is-split { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }

.fab {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); z-index: 15;
  height: 56px; padding: 0 22px 0 18px; border-radius: 28px; border: 0; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; cursor: pointer;
  box-shadow: 0 8px 24px rgb(120 20 30 / 0.4);
}
.fab:active { transform: scale(0.97); }

/* skeletons */
.skeleton { border-radius: var(--radius); height: 120px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- Sheets ---------- */

dialog.sheet {
  padding: 0; border: 0; color: var(--ink); background: var(--surface);
  width: 100%; max-width: 100%; max-height: 94dvh; margin: auto 0 0 0;
  border-radius: 24px 24px 0 0; overflow: hidden; box-shadow: 0 -10px 40px rgb(0 0 0 / 0.25);
  animation: sheet-up 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
  flex-direction: column;
}
dialog.sheet[open] { display: flex; }
dialog.sheet::backdrop { background: rgb(20 10 5 / 0.55); animation: fade 0.2s ease; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; max-width: 520px; border-radius: 24px; max-height: 90dvh; }
  dialog.sheet.wide { max-width: 640px; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 22px; flex: none; }
.sheet-head h2 { font-size: 1.3rem; }
.sheet-body { overflow-y: auto; padding: 8px 22px calc(24px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }

/* ---------- Forms ---------- */

label.field { display: grid; gap: 6px; font-weight: 650; font-size: 0.9rem; }
label.field > span.hint { font-weight: 500; color: var(--muted); font-size: 0.82rem; }
input[type='text'], input[type='password'], input[type='url'], textarea, select {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); font-size: 16px; /* 16px stops iOS zooming on focus */ font-weight: 450;
}
textarea { min-height: 84px; resize: vertical; }
textarea.title-input { min-height: 78px; resize: none; line-height: 1.3; }
input:focus, textarea:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 0; border-color: var(--gold); }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }

.status { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; min-height: 22px; color: var(--muted); }
.status:empty { display: none; }
.status.ok { color: var(--pine-text); }
.status.warn { color: var(--gold-text); }
.error-text { color: var(--danger); font-weight: 600; font-size: 0.92rem; }

.preview-row { display: flex; gap: 14px; align-items: flex-start; }
.preview-thumb { position: relative; flex: none; width: 112px; height: 112px; border-radius: 14px; background: #fff; border: 1.5px dashed var(--line); overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.preview-thumb img { width: 100%; height: 100%; object-fit: contain; }
.preview-thumb.has-image { border-style: solid; }
.preview-thumb button { position: absolute; inset: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; gap: 2px; align-content: center; color: inherit; font-size: 0.78rem; font-weight: 650; }
.preview-thumb.has-image button { opacity: 0; background: rgb(0 0 0 / 0.45); color: #fff; }
.preview-thumb.has-image button:hover, .preview-thumb.has-image button:focus-visible { opacity: 1; }
.preview-side { flex: 1; min-width: 0; display: grid; gap: 8px; }

.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice.two { grid-template-columns: repeat(2, 1fr); }
.choice label { cursor: pointer; position: relative; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 0 6px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 650; font-size: 0.86rem; line-height: 1.15; }
.choice input:checked + span { background: var(--pine-btn); border-color: var(--pine-btn); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--gold) 80%, transparent); outline-offset: 2px; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.form-actions .btn:first-child { flex: 1; }

/* ---------- Item detail sheet ---------- */

.detail-img { width: 100%; aspect-ratio: 4 / 3; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); display: grid; place-items: center; }
.detail-img img { width: 100%; height: 100%; object-fit: contain; }
.detail-title { font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
.detail-note { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); padding: 12px 14px; border-radius: 12px; }

/* ---------- Auth ---------- */

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--pine) 25%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 26px 22px 24px; display: grid; gap: 18px; }
.auth-logo { text-align: center; display: grid; gap: 4px; }
.auth-logo .tree { font-size: 3rem; line-height: 1; }
.auth-logo h1 { font-size: 1.7rem; }

/* ---------- Split gifts ---------- */

.split-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 0.9rem; font-weight: 600; color: var(--muted); cursor: pointer; }
input.switch.small { width: 42px; height: 26px; }
input.switch.small::after { width: 20px; height: 20px; top: 3px; left: 3px; }
input.switch.small:checked::after { transform: translateX(16px); }
.icon-btn.outlined { width: 38px; height: 38px; border: 1.5px solid var(--line); border-radius: 12px; }

/* ---------- Share switch ---------- */

.share-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.share-text { flex: 1; display: grid; gap: 2px; }
.share-text small { color: var(--muted); font-size: 0.84rem; line-height: 1.35; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background 0.15s; margin: 0; border: 0; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); transition: transform 0.15s; }
input.switch:checked { background: var(--pine-btn); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:disabled { opacity: 0.55; }

/* ---------- Admin ---------- */

.code-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.code-box code { font: 700 1.05rem ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.member-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.member-row .avatar { width: 40px; height: 40px; font-size: 1.3rem; }
.key-badge { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--pine-text); }
.code-box code.link-text { font: 600 0.82rem ui-monospace, SFMono-Regular, Menlo, monospace; white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
.member-row .grow { flex: 1 1 160px; min-width: 0; font-weight: 650; }
.member-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.emoji-grid button { height: 46px; font-size: 1.5rem; border-radius: 12px; border: 1.5px solid transparent; background: var(--surface-2); cursor: pointer; padding: 0; }
.emoji-grid button[aria-pressed='true'] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
