/* WishListTracker: mobile-first styles. No inline styles anywhere (CSP).
   Design v1: evergreen, cranberry and a little gold on warm paper. Phones get a
   bottom tab bar; above 720px the header carries a labelled top nav. */
:root {
  --paper: #fbf7f0;
  --card: #ffffff;
  --ink: #1f2a24;
  --ink-2: #2b342f;
  --muted: #5e655f;
  --faint: #8f877a;
  --line: #e8e0d2;
  --sand: #efe9de;
  --sand-fg: #3a443e;
  --pine: #1f5a45;         /* links, headings, outlines */
  --pine-bg: #1f5a45;      /* filled buttons */
  --pine-deep: #16402f;
  --on-pine: #ffffff;
  --mint: #e3eee7;
  --mint-fg: #16402f;
  --wheat: #f5ecd8;
  --wheat-fg: #4a360c;
  --wheat-line: #5a420f;
  --blush: #f9e4e7;
  --blush-fg: #4a1520;
  --berry: #9a2136;
  --berry-text: #8a1e31;
  --gold: #c89b3c;
  --hero: #1f5a45;
  --hero-sub: #d6e6dc;
  --focus: #c89b3c;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wide: 1160px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--pine); }
a:hover { color: var(--pine-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; }

/* ---------- Header (desktop, and phones when signed out) ---------- */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-inner { max-width: var(--wide); margin: 0 auto; padding: 8px 20px; min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.brand { font: 600 21px var(--serif); color: var(--pine); text-decoration: none; padding: 8px 0; }
.top-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 22px; font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; }
.top-nav a:hover { background: var(--sand); }
.top-nav a[aria-current="page"] { background: var(--pine-bg); color: var(--on-pine); }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }

/* ---------- Bottom tab bar (phones) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.tabbar a { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font: 600 12px var(--sans); text-decoration: none; }
.tabbar .tab-icon { width: 56px; height: 30px; border-radius: 15px; display: grid; place-items: center; }
.tabbar a[aria-current="page"] { color: var(--mint-fg); }
.tabbar a[aria-current="page"] .tab-icon { background: var(--mint); }
.signed-in main { padding-bottom: 96px; }
.phone-only { display: block; }

@media (max-width: 719px) {
  .signed-in .top { display: none; }
}
@media (min-width: 720px) {
  .tabbar, .phone-only { display: none; }
  .signed-in main { padding-bottom: 64px; }
  .top-inner { padding: 8px 32px; min-height: 72px; gap: 8px 28px; }
  .brand { font-size: 23px; }
}

/* ---------- Page frame ---------- */
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 32px; }
main.wide { max-width: var(--wide); }
@media (min-width: 720px) { main { padding: 24px 32px 64px; } }

/* Full-bleed greeting band: pine with gold dots and a gold ribbon line. */
.hero { background-color: var(--hero); background-image: radial-gradient(rgba(222, 186, 104, .38) 1.2px, transparent 1.7px); background-size: 17px 17px; border-bottom: 4px solid var(--gold); color: #fff; }
.hero-inner { max-width: var(--wide); margin: 0 auto; padding: 22px 20px 26px; }
.hero-date { font-weight: 500; font-size: 14px; color: var(--hero-sub); }
.hero h1 { margin: 6px 0 0; font: 600 34px/1.1 var(--serif); letter-spacing: -.01em; color: #fff; }
@media (min-width: 720px) {
  .hero { background-size: 20px 20px; border-bottom-width: 5px; }
  .hero-inner { padding: 40px 32px 44px; }
  .hero-date { font-size: 16px; }
  .hero h1 { font-size: 48px; line-height: 1.05; }
}

h1 { font: 600 32px/1.1 var(--serif); margin: 8px 0 6px; }
h2 { font: 600 20px/1.25 var(--serif); margin: 0 0 12px; }
h3 { font-size: 1.05rem; }
.lede { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.section-label { margin: 26px 4px 10px; font: 700 13px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
/* A list of your own's heading on the list page (spec 2026-09-30 §4.2). */
.list-section .section-add { margin-left: auto; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; text-decoration: none; margin-left: -4px; }
.muted { color: var(--muted); }
.notes { white-space: pre-line; font-style: italic; color: var(--sand-fg); }

/* ---------- Surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin: 0 0 16px; }
.card.highlight { border: 2px solid var(--pine); }
.notice, .error, .banner, .strip { border-radius: 16px; padding: 14px 16px; margin: 0 0 16px; font-size: 15px; line-height: 1.45; }
.notice { background: var(--mint); color: var(--mint-fg); }
.notice[data-notice] { display: flex; align-items: center; gap: 12px; padding-right: 8px; }
.notice[data-notice] span { flex: 1; }
.notice-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.notice-close:hover { background: rgba(0, 0, 0, .06); }
.error { background: var(--blush); color: var(--blush-fg); font-weight: 500; }
.strip { background: var(--sand); color: var(--sand-fg); display: flex; gap: 10px; align-items: center; font-size: 14px; }
.strip svg { flex: none; }
.banner { display: flex; gap: 12px; align-items: flex-start; background: var(--wheat); color: var(--wheat-fg); }
.banner.mint { background: var(--mint); color: var(--mint-fg); }
.banner.blush { background: var(--blush); color: var(--blush-fg); }
.banner p { margin: 0; font-weight: 500; }
.banner .icon { font-size: 22px; line-height: 1.2; }
.banners { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-bottom: 8px; }
.banners .banner { margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; font: 600 16px var(--sans); border-radius: 999px; border: 1.5px solid var(--pine-bg); background: var(--pine-bg); color: var(--on-pine); cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--on-pine); filter: brightness(1.08); }
.btn.secondary { background: var(--card); color: var(--pine); border-color: var(--pine); }
.btn.secondary:hover { background: var(--mint); color: var(--pine-deep); filter: none; }
.btn.quiet { background: var(--card); color: var(--ink); border-color: var(--faint); }
.btn.quiet:hover { background: var(--sand); color: var(--ink); filter: none; }
.btn.danger { background: var(--berry); border-color: var(--berry); color: #fff; }
.btn.outline-gold { background: transparent; border-color: var(--wheat-line); color: var(--wheat-fg); min-height: 44px; }
.btn.big { min-height: 52px; }
.btn.block { width: 100%; }
.linkish { background: none; border: 0; min-height: 44px; padding: 0 4px; font: inherit; font-weight: 500; color: var(--pine); text-decoration: underline; cursor: pointer; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions.two-up { display: grid; grid-template-columns: 1fr 1fr; }
.stack > * + * { margin-top: 14px; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 15px; color: var(--ink-2); margin: 0 0 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; line-height: 1.45; }
input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="date"], input:not([type]), textarea, select {
  width: 100%; min-height: 50px; padding: 12px 14px; font: 400 16px var(--sans); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--faint); border-radius: 12px;
}
input:focus, textarea:focus, select:focus { border-color: var(--pine); outline: none; box-shadow: 0 0 0 3px var(--mint); }
textarea { min-height: 96px; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--pine-bg); flex: none; margin: 1px 0 0; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; min-height: 44px; }
/* A question with a "?" tip beside it (spec 2026-09-30 §6.1). The tip's text
   drops below the whole line, so it fits a phone. */
.field-label { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 600; }
details.tip > summary { list-style: none; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--sand-fg); font-size: 13px; font-weight: 700; }
details.tip > summary::-webkit-details-marker { display: none; }
.tip-text { display: none; position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-weight: 400; font-size: 14px; line-height: 1.45; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
details.tip[open] + .tip-text { display: block; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }
.birthday-picker { max-width: 360px; }
.field-row .btn { flex: none; border-radius: 12px; background: var(--mint); color: var(--mint-fg); border-color: var(--mint); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--sand); border-radius: 26px; margin: 0 0 18px; }
.segmented a { min-height: 44px; border-radius: 22px; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; }
.segmented a[aria-current="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- People ---------- */
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 600 17px var(--serif); background: var(--pine-bg); }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.av-1 { background: #9a2136; } .av-2 { background: #3d5f7a; } .av-3 { background: #8a4b2e; }
.av-4 { background: #6a4b7e; } .av-5 { background: #4a5a2a; } .av-6 { background: #8a2f55; } .av-7 { background: #2f6b6b; }
.people { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.people li + li { border-top: 1px solid var(--line); }
.people a { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 14px 12px 16px; color: var(--ink); text-decoration: none; }
.people a:hover { background: var(--paper); color: var(--ink); }
.people .who-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.people .name { font-weight: 600; font-size: 17px; line-height: 1.25; }
.people .sub { font-size: 14px; color: var(--muted); }
.chev { flex: none; color: var(--faint); }
.bday { font-weight: 600; font-size: 14px; color: var(--berry-text); }
.bday-chip { display: inline-block; font-weight: 600; font-size: 14px; color: var(--berry-text); background: var(--blush); padding: 4px 10px; border-radius: 12px; }
.person-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 16px; }
.person-head h1 { margin: 0 0 6px; font-size: 30px; }
.person-head .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }

/* ---------- Items ---------- */
.items { display: grid; gap: 12px; }
@media (min-width: 720px) { .items { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; } }
.item { display: flex; flex-direction: column; padding: 0; margin: 0; overflow: hidden; }
.item-main { display: flex; gap: 14px; align-items: center; padding: 12px; }
.item-photo { width: 76px; height: 76px; flex: none; border-radius: 12px; overflow: hidden; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; background: var(--sand); color: var(--pine); }
.item-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item h3 { font: 600 16px/1.3 var(--sans); margin: 0; overflow-wrap: anywhere; }
.item h3 a { color: var(--ink); text-decoration: none; }
.item h3 a:hover { text-decoration: underline; }
.item p { margin: 0; font-size: 14px; line-height: 1.35; }
.item .meta { color: var(--muted); }
.item .looking { color: var(--pine); font-weight: 500; animation: pulse 1.8s ease-in-out infinite; }
.item .failed { color: var(--berry-text); font-weight: 600; }
.item.slow .looking { color: var(--muted); animation: none; }
.item.slow .spinner { display: none; }
.item-foot { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.item-foot .actions { margin-top: 0; }
.item-foot .actions .btn { min-height: 44px; font-size: 15px; }
.secret-strip { padding: 8px 14px; background: var(--sand); color: var(--sand-fg); font-weight: 600; font-size: 13px; }
.item.secret { border-color: var(--faint); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--pine); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .spinner, .item .looking { animation: none; } }

/* ---------- Claims ---------- */
.claim-state { min-height: 48px; border-radius: 24px; display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-weight: 600; font-size: 15px; }
.claim-state.mine { background: var(--mint); color: var(--mint-fg); }
.claim-state.mine .soft { font-weight: 400; }
.claim-state.taken { background: var(--wheat); color: var(--wheat-fg); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps li { min-height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 600; font-size: 12px; background: var(--sand); color: var(--sand-fg); }
.steps li.done { background: var(--pine-bg); color: var(--on-pine); }
.total { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.total .label { font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.total .amount { margin-top: 4px; font: 600 34px/1 var(--serif); color: var(--pine); }
.total .sub { text-align: right; font-size: 14px; line-height: 1.4; color: var(--muted); }
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--berry); color: #fff; display: inline-grid; place-items: center; font: 700 12px var(--sans); letter-spacing: 0; }
.attn { background: var(--wheat); color: var(--wheat-fg); border-radius: 16px; padding: 14px 16px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.attn p { margin: 0; }

/* ---------- Misc ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; background: var(--mint); color: var(--mint-fg); }
.chip.secret { background: var(--sand); color: var(--sand-fg); }
.copy { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.9rem; }
/* Home: each family's invite link (Jordan, 2026-09-29) */
.invites { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.invite-row + .invite-row { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.invite-row p { margin: 0 0 6px; }
.invite-row .hint { margin: 0; }
table.log { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.log th, table.log td { text-align: left; padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }
label.pick { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Family ---------- */
/* minmax(0, …): the sideways-scrolling rows (chips, Coming up) must not widen the page. */
.family-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; }
.family-grid .section-label:first-child { margin-top: 10px; }
.bdays { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.bday-card { flex: none; width: 148px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); text-decoration: none; font-size: 13px; }
.bday-card .avatar { margin-bottom: 8px; }
.bday-card .name { font-weight: 600; font-size: 16px; line-height: 1.2; }
.bday-card:hover { border-color: var(--pine); color: var(--ink); }
/* A holiday under "Coming up": an icon where a person's avatar would be; not a link. */
.bday-card.occasion:hover { border-color: var(--line); }
.occasion-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); font-size: 16px; margin-bottom: 8px; }
@media (min-width: 900px) {
  .family-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .bdays { flex-direction: column; overflow: visible; }
  .bday-card { width: auto; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
  .bday-card .avatar, .bday-card .occasion-icon { grid-row: span 3; margin: 0; }
}

/* ---------- Lists and My Shopping ---------- */
.list-head { margin-bottom: 18px; }
.list-head .actions.two-up { margin: 16px 0 14px; }
.list-head .strip { margin: 0; }
.hint.center { text-align: center; margin: 8px 0 0; }
@media (min-width: 900px) { .list-head { max-width: 640px; } }

/* ---------- My Shopping (per the design) ----------
   Phones: total, then Needs attention, then a plain header per person with
   each gift as its own card. Desktop: gifts on the left, one card per person
   with a tinted header band and a row per gift; the total and Needs attention
   stay put on the right. */
.shop-layout { display: grid; gap: 24px; margin-top: 16px; }
.shop-side { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.shop-side .total { margin: 0; }
.shop-side .section-label { margin: 24px 4px 10px; }
.shop-side .card.total:only-child { margin-bottom: 0; }
.attn-list { display: flex; flex-direction: column; gap: 10px; }
.attn { margin: 0; }
.attn-title { font-weight: 600; font-size: 15px; line-height: 1.4; color: #2b2410; }
.attn p { font-size: 15px; line-height: 1.4; }
.attn .attn-note { font-size: 14px; }
.attn-chip { align-self: flex-start; font: 500 14px ui-monospace, Menlo, Consolas, monospace; color: #2b2410; background: var(--card); padding: 6px 10px; border-radius: 8px; }
.attn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.attn-actions form { margin: 0; }
.btn.gold { background: var(--wheat-line); border-color: var(--wheat-line); color: #fff; min-height: 44px; }
.attn.reminder { flex-direction: row; gap: 10px; align-items: flex-start; background: var(--blush); color: var(--blush-fg); }
.attn.reminder p { font-weight: 500; text-wrap: pretty; }
.attn-icon { font-size: 20px; line-height: 1.2; }
.attn-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.btn.outline-berry { background: transparent; border-color: var(--berry-text); color: var(--blush-fg); min-height: 40px; font-size: 15px; }
.btn.outline-berry:hover { background: rgba(154, 33, 54, .08); color: var(--blush-fg); filter: none; }
.attn-actions .btn { min-height: 44px; font-size: 15px; }
.attn-actions .linkish { color: var(--wheat-fg); }

.shop-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.shop-group-head { display: flex; align-items: center; gap: 10px; margin: 2px 4px 10px; }
.shop-group-head h2 { margin: 0; flex: 1; font: 600 20px var(--serif); }
.shop-group-head h2 a { color: var(--ink); text-decoration: none; }
.shop-group-head h2 a:hover { text-decoration: underline; }
.shop-group-head .subtotal { font-weight: 600; font-size: 16px; }
.shop-rows { display: flex; flex-direction: column; gap: 10px; }
.shop-row { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.shop-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shop-info h3 { margin: 0; font: 600 16px/1.3 var(--sans); }
.shop-info h3 a { color: inherit; text-decoration: none; }
.shop-info h3 a:hover { text-decoration: underline; }
.shop-info p { margin: 0; font-size: 14px; }
.shop-info .meta { color: var(--muted); }
.shop-info .failed { color: var(--berry-text); font-weight: 600; }
.shop-info .buy-link { margin: 8px 0 0; }
/* Each step box is a button that fills its rounded box, so the hover tint
   follows the same rounded shape. */
.steps li:has(form) { place-items: stretch; }
.shop-row .steps form { margin: 0; display: grid; }
.steps li > span, .steps .step { width: 100%; min-height: 30px; display: grid; place-items: center; }
.steps .step { border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0 4px; transition: background-color .15s; }
.steps .step:hover { background: #e2dacb; }
.steps li.done .step:hover { background: #2c7258; }
.steps .step:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }

/* "Paid $44.99": looks like plain text; a dotted underline on hover hints
   that it can be changed. */
.paid-edit { display: inline; margin: 0; }
.paid-show { display: inline; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.paid-show:hover, .paid-show:focus-visible { text-decoration-color: currentColor; outline: none; }
.paid-field { white-space: nowrap; }
.paid-field input { display: inline-block; width: 6.5em; min-height: 30px; padding: 2px 8px; margin-left: 2px; font-size: 14px; border-radius: 8px; }
.shop-info .meta { font-size: 14px; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shop-actions form { margin: 0; }
.shop-actions > form:last-child { flex: 1; }
.shop-actions > form:last-child .btn { width: 100%; min-height: 46px; }
.shop-actions .btn { min-height: 44px; font-size: 15px; }
.shop-actions .linkish { min-height: 44px; font-size: 15px; }
.given-note { flex: 1; margin: 0; font: 500 14px/1.4 var(--sans); color: #2f5a48; }
.shop-actions .given-note + form { flex: none; }
.shop-actions .given-note + form .btn { width: auto; }

@media (min-width: 720px) {
  .shop-group { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
  .shop-group-head { margin: 0; padding: 14px 20px; background: #f7f2e9; border-bottom: 1px solid var(--line); gap: 12px; }
  .shop-group-head .avatar { width: 36px; height: 36px; font-size: 15px; }
  .shop-group-head h2 { font-size: 22px; }
  .shop-group-head .subtotal { font-size: 17px; }
  .shop-rows { gap: 0; }
  .shop-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 16px 20px; border: 0; border-radius: 0; }
  .shop-row + .shop-row { border-top: 1px solid var(--sand); }
  .shop-info { flex: 1 1 220px; }
  .shop-row .steps { grid-template-columns: repeat(4, 78px); }
  .shop-actions { flex: 0 0 auto; min-width: 250px; justify-content: flex-end; flex-wrap: nowrap; }
  .shop-actions > form:last-child { flex: none; }
  .shop-actions > form:last-child .btn { width: auto; min-height: 44px; }
  .given-note { text-align: right; }
}
@media (min-width: 1000px) {
  .shop-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; margin-top: 24px; }
  .shop-side { grid-column: 2; grid-row: 1; position: sticky; top: 24px; }
  .shop-main { grid-column: 1; grid-row: 1; }
  .shop-side .total { display: block; padding: 20px 22px; }
  .shop-side .total .amount { margin-top: 6px; font-size: 44px; }
  .shop-side .total .sub { margin-top: 8px; text-align: left; font-size: 15px; }
  .shop-side .section-label { margin-top: 20px; }
  .attn { padding: 16px 18px; }
}

/* ---------- Forms, import, settings, admin, sign-in ---------- */
.how { margin: 0; padding-left: 22px; }
.how li + li { margin-top: 6px; }
.picks { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.picks li + li { border-top: 1px solid var(--line); }
.picks label.pick { padding: 14px 16px; min-height: 56px; cursor: pointer; }
.picks label.pick > span { display: flex; flex-direction: column; gap: 2px; }
.picks label.pick.dup { opacity: .6; cursor: default; }
.sticky-submit { position: sticky; bottom: 96px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
@media (min-width: 720px) { .sticky-submit { bottom: 16px; } }
.center-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; }
.big-name { font: 600 22px var(--serif); }
.person-line { display: flex; align-items: center; gap: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2e8b57; margin-right: 8px; vertical-align: middle; }
.dot.off { background: var(--berry); }
.solo { max-width: 440px; margin: 16px auto 0; }
.solo h1 { margin-bottom: 14px; }
.solo .welcome { font: 600 20px var(--serif); color: var(--pine); margin: 0 0 4px; }
@media (min-width: 720px) { .solo { margin-top: 40px; } }
/* A single claim button or "Bob's got this" sits beside Open, as in the design. */
.item-foot:has(> form:first-child, > .claim-state:first-child) { flex-direction: row; align-items: center; }
.item-foot:has(> form:first-child, > .claim-state:first-child) > :first-child { flex: 1; margin: 0; }
.item-foot > form:first-child .btn { min-height: 48px; }
.item-foot .actions .btn { padding: 0 14px; font-size: 14px; }
.actions.two-up .btn { padding: 0 12px; font-size: 15px; }
.items { align-items: start; }
.tabbar .tab-icon { position: relative; }
.tabbar .badge { position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--berry); color: #fff; font: 700 11px/18px var(--sans); text-align: center; }
.top-nav .count { margin-left: 6px; }
details.batch { padding: 0; }
details.batch summary { min-height: 52px; padding: 14px 16px; font-weight: 600; color: var(--pine); cursor: pointer; }
details.batch[open] summary { border-bottom: 1px solid var(--line); }
details.batch form { padding: 16px; }

/* ---------- After Christmas and Gifts received ---------- */
.xmas { margin: 0 0 20px; }
.xmas-head { background: var(--berry); color: #fff; border-radius: 18px; padding: 16px; margin-bottom: 10px; }
.xmas-head h2 { margin: 0 0 6px; color: #fff; font-size: 19px; }
.xmas-head p { margin: 0; color: #fbe9ec; font-size: 15px; }
.xmas-item p { margin: 0 0 10px; }
.xmas-item .actions { margin-top: 6px; }
.xmas-item .btn { min-height: 46px; font-size: 15px; }
.banner > div { flex: 1; min-width: 0; }
.banner .btn { margin-top: 10px; }
.thanks { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 22px; border: 1.5px solid var(--faint); background: var(--card); font: 600 15px var(--sans); color: var(--ink); cursor: pointer; }
.thanks .box { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--faint); display: grid; place-items: center; font-size: 15px; }
.thanks.done { background: var(--mint); border-color: var(--mint); color: var(--mint-fg); }
.thanks.done .box { background: var(--pine-bg); border-color: var(--pine-bg); color: #fff; }

/* ---------- Brand (wishit.gift) ---------- */
.brand { padding: 4px 0; line-height: 0; }
.brand img { height: 44px; width: auto; }
.stacked-logo { display: block; width: 200px; height: auto; margin: 0 auto 8px; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero-mark { width: 56px; height: 56px; flex: none; }
@media (min-width: 720px) {
  .brand img { height: 48px; }
  .hero-mark { width: 88px; height: 88px; }
}

/* ---------- List tiles: every tile the same size, photo first ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; } }
.tile { position: relative; display: flex; flex-direction: column; min-width: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tile.secret { border-color: var(--faint); }
.tile .secret-strip { padding: 6px 10px; font-size: 12px; }
/* The photo box is always square: overflow:hidden stops a large image from
   stretching it, and the image is pinned inside and shrunk to fit. */
.tile-photo { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.tile-photo .item-photo { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; background: #fff; }
.tile-photo .item-photo img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 10px; box-sizing: border-box; }
.tile-photo .item-photo svg { width: 40px; height: 40px; }
.tile-body { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 2px; min-width: 0; }
.tile h3 { margin: 0 0 2px; font: 600 14px/1.3 var(--sans); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; overflow-wrap: anywhere; }
.tile p { margin: 0; font-size: 13px; line-height: 1.35; }
.tile .meta, .tile .notes { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta { color: var(--ink-2); font-weight: 600; }
.tile-claim { padding: 6px 10px 0; }
.tile-claim .btn { min-height: 40px; font-size: 14px; }
.tile-claim .claim-state { min-height: 36px; padding: 4px 12px; font-size: 13px; border-radius: 18px; }
.tile-claim .claim.mine { display: flex; flex-direction: column; gap: 4px; }
.claim-next { font-size: 13px; font-weight: 600; padding: 2px 4px; }
.tile-actions { display: flex; gap: 6px; padding: 8px 10px 10px; }
.tile-actions form { margin: 0; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--pine); cursor: pointer; text-decoration: none; padding: 0; }
.icon-btn:hover { background: var(--mint); border-color: var(--mint); color: var(--pine-deep); }
[data-edit-href] .tile-body { cursor: pointer; }

/* Selecting: a checkbox over each photo; ticked tiles get a berry outline. */
.tile .pick-box { display: none; position: absolute; top: 8px; left: 8px; z-index: 2; width: 36px; height: 36px; align-items: center; justify-content: center; margin: 0; background: rgba(255, 255, 255, .92); border-radius: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); cursor: pointer; }
.tile .pick-box input { width: 22px; height: 22px; accent-color: var(--berry); }
.selecting .tile .pick-box { display: flex; }
.selecting .tile { cursor: pointer; }
.selecting .tile-actions { visibility: hidden; }
.selecting .tile:has(input[form="bulk-remove"]:checked) { border-color: var(--berry); box-shadow: 0 0 0 2px var(--berry); }

/* The toolbar above the grid: count and Select; while selecting, All / count / Cancel / Delete. */
.list-toolbar { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 56px; margin: 0 0 12px; padding: 8px 4px; background: var(--paper); }
.list-toolbar .tb-count { flex: 1; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.tb-select { display: none; align-items: center; gap: 8px; }
.selecting .tb-select { display: flex; }
.selecting .tb-normal, .selecting .list-toolbar .tb-count { display: none; }
.selecting .list-toolbar { border-bottom: 1px solid var(--line); }
.tb-all { display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 0 0; font-weight: 600; font-size: 14px; min-height: 40px; cursor: pointer; }
.tb-all input { width: 20px; height: 20px; accent-color: var(--berry); }
.bulk-count { font-weight: 600; font-size: 14px; margin-right: auto; }
.selecting .tb-select { flex: 1; }
.list-toolbar .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Edit popup: a bottom sheet on phones, a centered dialog on desktop ---------- */
dialog.sheet { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--paper); color: var(--ink); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
dialog.sheet::backdrop { background: rgba(20, 30, 25, .5); }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; background: var(--paper); }
.sheet-head h2 { margin: 0; font-size: 24px; }
.sheet-body { padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-body > form + form { margin-top: 0; }
@media (min-width: 720px) { dialog.sheet { width: min(560px, calc(100% - 40px)); margin: auto; border-radius: 22px; } }

/* ---------- Amazon import pill and review ---------- */
.import-pill { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 15; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 8px 8px 8px 14px; min-height: 48px; border-radius: 24px; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); font-weight: 600; font-size: 15px; }
.import-pill a { color: #fff; text-decoration: none; padding: 6px 8px 6px 0; }
.import-pill a:hover { text-decoration: underline; color: #fff; }
.import-pill .spinner { width: 22px; height: 22px; border-width: 3px; border-color: rgba(255, 255, 255, .25); border-top-color: #fff; flex: none; }
.import-pill.done { background: var(--pine-bg); }
.import-pill.failed { background: var(--berry); }
.import-pill .pill-icon { width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 13px; flex: none; }
.import-pill form { margin: 0; }
.pill-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.selecting .import-pill { display: none; }
@media (min-width: 720px) { .import-pill { right: 24px; bottom: 24px; } }
.picks .pick { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; min-height: 56px; }
.picks .pick > span { display: flex; flex-direction: column; gap: 2px; }
.picks div.pick.dup { opacity: .7; }
.import-wait h2 { margin: 6px 0 0; }
/* Reserve the same text and claim space on every tile, so rows line up across
   the whole list, not just within one row: title (2 lines) + price + notes. */
.tile-body { min-height: 98px; }
.tile-claim { min-height: 66px; }
.tile .meta.muted { color: var(--muted); font-weight: 400; }

/* Store line, and an icon row that's always there, so buttons line up across
   tiles whether or not an item has a link. */
.tile .store { min-height: 1.35em; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-actions { min-height: 56px; box-sizing: border-box; }
.tile-claim { min-height: 52px; }
.tile-claim .btn.sm { min-height: 36px; }
/* "You're getting this" fits the same 52px as the button: one line each. */
.tile-claim .claim.mine { gap: 2px; }
.tile-claim .claim-state { min-height: 26px; font-size: 12px; }
.tile-claim .claim-state, .tile-claim .claim-next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 26px; padding-top: 0; padding-bottom: 0; }
.tile-claim { min-height: 58px; box-sizing: border-box; }
/* Title (2 lines) + store + price + notes, reserved on every tile. */
.tile-body { min-height: 116px; }
.tile-claim .claim-next { line-height: 18px; font-size: 12px; padding: 0 4px; }

/* Filter and sort bar */
.list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.fchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding: 2px; }
.fchip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2); font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; }
.fchip[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.fchip-n { font-weight: 400; opacity: .7; }
.filter-end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.list-filters .toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.list-filters .toggle input { width: 18px; height: 18px; accent-color: var(--pine); }
/* The sort menu: a pill like the store buttons. */
.list-filters select { width: auto; min-height: 36px; padding: 0 34px 0 14px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231f5a45' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center; color: var(--ink-2); font: 600 13px var(--sans); cursor: pointer; appearance: none; }

/* Drop-down menus, site-wide. Browsers that allow it (Chrome and Edge) also
   get an open list in the site's style: a rounded card, a mint highlight, the
   chosen option in pine. Others (like iPhones) show their own picker. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { background-image: none; }
  .list-filters select { appearance: base-select; background-image: none; padding-right: 12px; height: 36px; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
  select::picker-icon { color: var(--pine); transition: rotate .2s; }
  select:open::picker-icon { rotate: 180deg; }
  ::picker(select) { margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
  option { padding: 9px 12px; border-radius: 10px; color: var(--ink); font: 500 14px var(--sans); cursor: pointer; }
  option::checkmark { display: none; }
  option:hover, option:focus-visible { background: var(--mint); color: var(--mint-fg); outline: none; }
  option:checked { background: var(--pine); color: #fff; font-weight: 600; }
}

/* Changes made in place: tiles fade in or out, popups slide, and a short
   message slides up at the bottom. */
@keyframes tile-in { from { opacity: 0; transform: scale(.97); } }
@keyframes tile-out { to { opacity: 0; transform: scale(.95); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.tile.leaving { animation: tile-out .25s ease-in forwards; pointer-events: none; }
.tile.arriving { animation: tile-in .35s ease-out both; }
dialog.sheet[open] { animation: sheet-in .25s ease-out; }
dialog.sheet.closing { animation: sheet-out .2s ease-in forwards; }
dialog.sheet[open]::backdrop { animation: fade-in .25s ease-out; }
dialog.sheet.closing::backdrop { animation: fade-out .2s ease-in forwards; }
@media (min-width: 720px) {
  dialog.sheet[open] { animation-name: pop-in; }
  dialog.sheet.closing { animation-name: pop-out; }
}
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20; width: fit-content; max-width: 520px; margin: 0 auto; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: flex; align-items: center; gap: 12px; padding-right: 8px; animation: pop-in .2s ease-out; }
@media (min-width: 720px) { .toast { bottom: 24px; } }

/* Confirm popup ("Remove this from the list?"): the same sheet as the edit
   popup, sized for one question and two buttons. */
dialog.confirm .sheet-body { padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); }
.confirm-msg { margin: 0 0 18px; font-size: 17px; line-height: 1.45; color: var(--ink); }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }
@media (min-width: 720px) {
  dialog.sheet.confirm { width: min(420px, calc(100% - 40px)); }
  .confirm-actions { justify-content: flex-end; }
  .confirm-actions .btn { flex: none; min-width: 120px; }
}

/* ---------- A family's own page (spec 2026-09-28 §6.5) ----------
   Phones: one column in DOM order (waiting, invite, members, settings).
   Wider: members on the left, everything else stacked on the right. */
.fam-head { margin: 4px 0 16px; }
.fam-head h1 { margin: 0 0 4px; }
.fam-head p { margin: 0; }
.fam-grid { display: grid; gap: 16px; }
.fam-grid > .card { margin: 0; }
.fam-grid h2 { display: flex; align-items: baseline; gap: 8px; }
.row-actions { display: flex; gap: 8px; }
.switch-form { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.switch-form label.check { align-items: center; margin: 0; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 0; border-top: 1px solid var(--line); }
.member-list li:first-child { border-top: 0; }
.member-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.row-menu { position: relative; }
.row-menu summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; font-size: 20px; color: var(--muted); }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary:hover, .row-menu[open] summary { background: var(--sand); color: var(--ink); }
.row-menu-pop { position: absolute; right: 0; top: 46px; z-index: 5; min-width: 170px; display: grid; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.row-menu-pop .linkish { width: 100%; text-align: left; text-decoration: none; padding: 0 12px; border-radius: 10px; }
.row-menu-pop .linkish:hover { background: var(--sand); }
.linkish.danger-text { color: var(--berry-text); }
.more-btn { margin-top: 8px; }
details.fam-settings > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
details.fam-settings > summary::-webkit-details-marker { display: none; }
details.fam-settings > summary h2 { margin: 0; }
details.fam-settings > summary::after { content: '›'; font-size: 26px; line-height: 1; color: var(--muted); transition: transform .15s; }
details.fam-settings[open] > summary { margin-bottom: 12px; }
details.fam-settings[open] > summary::after { transform: rotate(90deg); }
.fam-delete { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.fam-leave { margin-top: 20px; }
@media (max-width: 719px) {
  .fam-people[data-collapsed] li:nth-child(n+6) { display: none; }
}
@media (min-width: 720px) {
  .fam-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "members waiting" "members invite" "members settings"; grid-template-rows: auto auto 1fr; align-items: start; }
  .fam-grid.no-waiting { grid-template-areas: "members invite" "members settings"; grid-template-rows: auto 1fr; }
  .fam-waiting { grid-area: waiting; }
  .fam-invite { grid-area: invite; }
  .fam-members { grid-area: members; }
  .fam-settings { grid-area: settings; }
  .more-btn { display: none; }
}

/* ---------- Family chips on the Family page (spec 2026-09-28 §6.4) ----------
   Phones: one row that scrolls sideways. Wider: the chips wrap. */
.fchips { display: flex; gap: 8px; margin: 20px 0 6px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--faint); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.fchip:hover { background: var(--sand); color: var(--ink); }
.fchip[aria-current="true"] { background: var(--pine-bg); border-color: var(--pine-bg); color: var(--on-pine); }
.fam-note { margin: 8px 4px; font-size: 15px; }
.fam-note a { font-weight: 600; }
.ftag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--sand); color: var(--sand-fg); font-size: 12px; font-weight: 600; vertical-align: 1px; }
.banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (min-width: 720px) {
  .fchips { flex-wrap: wrap; overflow: visible; }
}

/* ---------- Side-menu pages: Settings, Site admin (spec 2026-09-28 §6.2–6.3) ----------
   Phones: /settings is the menu alone; each section is its own page with a
   back link. Wider: the menu on the left (sticky), the section on the right. */
.side-menu h1 { margin: 8px 0 14px; }
.side-menu ul { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.side-menu li + li { border-top: 1px solid var(--line); }
.side-menu a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; color: var(--ink); font-weight: 600; text-decoration: none; }
.side-menu a::after { content: '›'; font-size: 22px; color: var(--muted); }
.side-menu a:hover { background: var(--paper); color: var(--ink); }
.side-menu a[aria-current="page"] { background: var(--mint); color: var(--mint-fg); }
.side-menu ul.side-foot { margin-top: 16px; padding: 0 16px; }
.side-menu ul.side-foot a { padding: 0; }
.side-back { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 4px -4px; font-weight: 600; text-decoration: none; }
.side-panel h2 { font-size: 24px; }
.side-panel h3 { margin: 18px 0 6px; }
.small { font-size: 14px; }
.sub-line { display: block; margin-top: 2px; }
@media (max-width: 719px) {
  .side-layout[data-index] .side-panel { display: none; }
  .side-layout:not([data-index]) .side-menu { display: none; }
}
@media (min-width: 720px) {
  .side-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
  .side-menu { position: sticky; top: 24px; }
  .side-menu a::after { content: none; }
  /* /settings shows its first section beside the menu, so mark it (not on phones, where only the menu shows). */
  .side-layout[data-index] .side-menu > ul:not(.side-foot) > li:first-child > a { background: var(--mint); color: var(--mint-fg); }
  .side-back { display: none; }
  .side-panel { padding-top: 58px; }
}

/* Moving between pages: a quick cross-fade instead of a white flash
   (browsers without view transitions just load normally). */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  .tile.leaving, dialog.sheet[open], dialog.sheet.closing, dialog.sheet::backdrop, .toast { animation: none; }
  @view-transition { navigation: none; }
}

/* An import's review: a long list scrolls in its own box, the buttons stay in
   view, and each item shows its photo (Jordan, 2026-09-30). */
.picks-scroll { max-height: min(60vh, 640px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.picks-scroll .picks { margin: 0; }
.pick .item-photo { width: 56px; height: 56px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .tile.arriving { animation: none; } }
