/* ═══════════════════ MODALS · SHEETS · CARDS · TOASTS ═════════════════════ */

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-root:empty, .sheet-root:empty, .menu-root:empty { display: none; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 20, .62);
  backdrop-filter: blur(3px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn var(--t-base) var(--ease-out) both;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  width: min(560px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  overflow: hidden;
  animation: modalIn var(--t-base) var(--ease-out) both;
}
.modal--wide { width: min(880px, 100%); }
.modal--narrow { width: min(420px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }

/* ── Side panel variant (member detail view on desktop) ───────────────────
   Matches the mockup: a persistent panel docked to the right edge, not a
   centred popup — the member card is something you keep open and browse
   from, not a one-off dialog. Mobile is untouched (Modal.panel already
   routes to the normal bottom sheet there). */
.scrim--side { align-items: stretch; justify-content: flex-end; }
.modal--side {
  width: min(420px, 100%);
  max-height: none;
  margin: 0;
  animation: slideInRight var(--t-base) var(--ease-out) both;
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } }

.modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.modal__title { font-size: var(--fs-md); font-weight: 800; font-family: var(--font-display); letter-spacing: var(--tracking-display); }
.modal__sub { font-size: var(--fs-xs); color: var(--text-dim); }
.modal__body { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  flex: none;
  flex-wrap: wrap;
}
.modal__foot .grow { flex: 1; }

/* ── Drawer (desktop right-side slide-over) ──────────────────────────────────
   The member's full details, pinned to the right edge with the tree still
   visible beside it — the mockup's `.side-panel`. Mobile never sees this
   (Modal.detail routes to the bottom sheet below instead). */
.scrim--drawer {
  align-items: stretch;
  justify-content: flex-end;
  padding: 16px;
}
.drawer {
  position: relative;
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  transition: transform var(--t-base) var(--ease-out);
}
.drawer.is-open { transform: translateX(0); }
.drawer__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; }
.drawer__foot {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
.drawer__foot .grow { flex: 1; }

/* One row of equal-width actions, matching the mockup's footer. Situational
   actions get their own full-width row (see member-card.js's actions()). */
.mcard-actions { display: flex; align-items: center; gap: 10px; }
.mcard-actions .btn { min-width: 0; }
.mcard-actions-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* The "needs sign-off" tag the mockup puts inside the Edit button. */
.btn__tag {
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0,0,0,.16);
  font-size: 8px;
  font-weight: 800;
  font-style: normal;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Amber Edit button — the mockup's third footer action is amber in both
   themes, distinct from the theme-inverted --btn-primary pair. */
.btn--gold { background: var(--gold); color: var(--text-on-gold); box-shadow: var(--sh-2); font-weight: 700; }
.btn--gold:hover { background: var(--gold-bright); }
/* Floating over the panel's own scrolling content, top-right. */
.drawer__tools {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
.drawer__tool {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--sh-1);
}
.drawer__tool:hover { background: var(--surface-3); }

/* ── Bottom sheet (mobile member card) ───────────────────────────────────── */
.sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 20, .55);
  z-index: var(--z-sheet);
  animation: fadeIn var(--t-base) var(--ease-out) both;
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-sheet);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: var(--sh-4);
  transform: translateY(100%);
  transition: transform var(--t-base) var(--ease-out);
  padding-bottom: var(--safe-b);
  touch-action: none;
}
.sheet.is-open { transform: translateY(0); }
/* Same floating top-right treatment as .drawer__tools/.drawer__tool —
   sits above the grab handle, which is centred, so the two never collide. */
.sheet__tools {
  position: absolute;
  top: 10px; right: 12px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
.sheet__tool {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--sh-1);
}
.sheet__tool:hover { background: var(--surface-3); }
.sheet__grab {
  width: 40px; height: 4px;
  margin: 9px auto 4px;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  flex: none;
}
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px 16px; touch-action: pan-y; }

/* ── Member card ─────────────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════
   Member card — deep glass look, matching Mockup/family_tree_detail_cards.html:
   a dark radial "aura" glow behind the header, tinted per rank, and one
   prominent crest badge (icon + rank + system name) every single card gets,
   linked account or not. Ghost/In-memory/Fallen Leaf outrank whatever role
   someone actually holds, same priority as the tree card.
   ═══════════════════════════════════════════════════════════════════════════ */
/* ── Hero (photo → name → nickname → rank pill) ──────────────────────────────
   Matches the mockup's actual detail-panel layout: a plain-ringed centred
   photo, then the name, then a small rounded rank pill below it — not the
   loud full-width gradient banner this used to lead with. The banner put
   the rank ahead of the person; the mockup (and every tree card already
   restyled this session) treats rank as a quiet accent, not the headline. */
.mcard {
  position: relative;
  text-align: center;
  padding: 48px 16px 8px;
  margin: -8px -4px 0;
  border-radius: var(--r-xl);
  overflow: hidden;
}
/* Plain ring for every card — .avatar is display:inline-flex (fine next to
   text elsewhere) but inside this block-level wrapper that leaves the usual
   few pixels of baseline whitespace below it, so .portrait .avatar is
   forced block to close that gap. */
.portrait { position: relative; width: max-content; margin: 4px auto 14px; }
.portrait .avatar { display: block; }
.mcard__photo {
  position: relative;
  z-index: 1;
  margin: 4px auto 0;
  border: 4px solid var(--bg-elevated);
  box-shadow: var(--sh-2);
}

/* ── Rank pill — icon + label only, the system-name/description now lives
   in the separate .rank-meaning card further down instead of crammed into
   this pill as a second line. Same palette as the tree cards. ─────────── */
.mcard__rankpill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  margin-top: 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: var(--sh-1);
}
.mcard__rankpill--member   { color: #0ea5e9; background: #f0f9ff; border: 1px solid rgba(14,165,233,.3); }
.mcard__rankpill--rooted   { color: #10b981; background: #ecfdf5; border: 1px solid rgba(16,185,129,.3); }
.mcard__rankpill--verified { color: #8b5cf6; background: #f5f3ff; border: 1px solid rgba(139,92,246,.3); }
.mcard__rankpill--subadmin { color: #c026d3; background: #fdf4ff; border: 1px solid rgba(192,38,211,.3); }
.mcard__rankpill--admin    { color: #f59e0b; background: #fffbeb; border: 1px solid rgba(245,158,11,.3); }
.mcard__rankpill--fallen   { color: #64748b; background: #f1f5f9; border: 1px solid rgba(100,116,139,.3); }
.mcard__rankpill--memorial { color: #78716c; background: #f5f5f4; border: 1px solid rgba(120,113,108,.3); }
:root[data-theme="dark"] .mcard__rankpill--member   { color: #38bdf8; background: color-mix(in srgb, #38bdf8 22%, var(--bg-elevated)); border-color: rgba(56,189,248,.4); }
:root[data-theme="dark"] .mcard__rankpill--rooted   { color: #34d399; background: color-mix(in srgb, #34d399 22%, var(--bg-elevated)); border-color: rgba(52,211,153,.4); }
:root[data-theme="dark"] .mcard__rankpill--verified { color: #a78bfa; background: color-mix(in srgb, #a78bfa 22%, var(--bg-elevated)); border-color: rgba(167,139,250,.4); }
:root[data-theme="dark"] .mcard__rankpill--subadmin { color: #d946ef; background: color-mix(in srgb, #d946ef 22%, var(--bg-elevated)); border-color: rgba(217,70,239,.4); }
:root[data-theme="dark"] .mcard__rankpill--admin    { color: #fbbf24; background: color-mix(in srgb, #fbbf24 26%, var(--bg-elevated)); border-color: rgba(251,191,36,.4); }
:root[data-theme="dark"] .mcard__rankpill--fallen   { color: #94a3b8; background: color-mix(in srgb, #94a3b8 22%, var(--bg-elevated)); border-color: rgba(148,163,184,.4); }
:root[data-theme="dark"] .mcard__rankpill--memorial { color: #e2e8f0; background: #0f172a; border-color: rgba(226,232,240,.3); }

/* Floating "Birthday Today!" pill, positioned over the hero exactly like
   the mockup's — separate from the descriptive .birthday-banner card
   further down, which explains what to do about it (that card has no
   mockup equivalent, it's the app's own addition). */
.mcard__bday-pill {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: #f43f5e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: var(--sh-2);
  animation: floatCake 2.5s ease-in-out infinite;
}

/* No special name treatment for a birthday — matches the mockup, which
   never recolours the name itself; the floating pill above already says
   it's their birthday. */
.birthday-banner {
  position: relative; z-index: 1;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, rgba(236,72,153,.16), rgba(168,85,247,.16), rgba(236,72,153,.16));
  border: 1px solid rgba(236,72,153,.4);
  text-align: center;
}
.birthday-banner__title {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 800; font-size: var(--fs-sm); color: #f9a8d4;
  text-transform: uppercase; letter-spacing: .04em;
}
.birthday-banner__text { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-muted); }

/* ── 👻 Ghost pending banner ──────────────────────────────────────────────── */
.ghost-banner {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: rgba(249,115,22,.10);
  border: 1px solid rgba(249,115,22,.35);
  text-align: left;
}
.ghost-banner__glyph { flex: none; color: #fb923c; margin-top: 1px; }
.ghost-banner__title { font-weight: 800; font-size: var(--fs-sm); color: #fdba74; }
.ghost-banner__text { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.5; }

/* number + years, plaque style */
.mcard__identity {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.mcard__years {
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.mcard__aged { font-size: var(--fs-xs); color: var(--text-dim); }

/* relationship badge */
.rel-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px auto 0;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(245,158,11, .55);
  background: rgba(245,158,11, .10);
  color: var(--gold);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.rel-pill__glyph { display: grid; place-items: center; }

/* the remembered-for line */
.memorial-note {
  margin-top: 16px;
  padding: 4px 8px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

/* No special name treatment for the Guardian — the source mockup
   (family_tree_detail_cards.html) uses plain solid text for every card's
   name regardless of role, and a shimmering gradient-clip effect is what
   caused three separate rounds of "the name isn't visible in light theme"
   bugs. Matches the mockup and can't go illegible on any theme. */
.mcard__name {
  font-size: var(--fs-xl);
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
  line-height: 1.15;
}
.mcard__nick { color: var(--text-muted); font-size: var(--fs-base); margin-top: 2px; }
.mcard__chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* A single-column list of rows, each with an icon in a circle — matches
   the mockup's info rows exactly (it never boxed these into a bento grid;
   each row is just a hover-tinted list item). */
.mcard__facts {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  text-align: left;
}
.fact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: var(--fs-sm);
  border-radius: var(--r-lg);
  background: transparent;
  border: 1px solid transparent;
  transition: background var(--t-fast);
  min-width: 0;
}
.fact:hover { background: var(--surface-2); }
.fact--wide { grid-column: unset; }
.fact__icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  border: 1px solid var(--line-soft);
  /* Neutral, not amber-tinted — matches the mockup exactly (every info
     row's icon circle is plain slate, regardless of what the row is
     about; only the rank-meaning callout and rank-specific accents get
     colour). */
  background: var(--surface-3);
  color: var(--text-dim);
}
.setting-block__title svg { color: var(--gold); }
.fact__body { flex: 1; min-width: 0; }
.fact__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1px;
}
.fact__value { color: var(--text); font-weight: 700; overflow-wrap: anywhere; display: block; }

/* What the rank actually means — the mockup always shows this under a
   living card's info rows, specifically so a rank like Rooted Sapling is
   never mistaken for a privilege upgrade instead of what it is. */
.rank-meaning {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  text-align: left;
}
.rank-meaning__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.rank-meaning__desc { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.5; }

.mcard__section { margin-top: 16px; text-align: left; }
.mcard__section-title {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.funfact {
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface);
  font-style: italic;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.relationship-box {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(245,158,11,.13), rgba(51,65,85,.18));
  border: 1px solid rgba(245,158,11,.28);
  font-size: var(--fs-sm);
}
.relationship-box strong { color: var(--gold); font-size: var(--fs-md); display: block; margin-top: 2px; }

/* Family connections — one labeled group per relation type (Spouse/
   Partner, Parents, Siblings, Children), each a column of horizontal
   rows. Matches the mockup's relationshipMiniCard layout exactly, in
   place of the old flat grid of small square tiles. */
.relation-group { margin-top: 10px; }
.relation-group__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.relation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 6px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  text-align: left;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.relation-row:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, var(--surface)); }
.relation-row__body { flex: 1; min-width: 0; }
.relation-row__label { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.relation-row__name { font-weight: 700; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relation-row__meta { font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.relation-row__chevron { flex: none; display: flex; color: var(--text-dim); transform: rotate(-90deg); }
.relation-row__tag {
  flex: none;
  padding: 5px 10px;
  border-radius: var(--r-md);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--danger-soft);
  color: var(--danger);
}

/* The divorce / restore control on a spouse's own row — the marriage
   belongs to that pairing, so the control sits beside the person it
   concerns rather than in a separate list (matches the mockup). */
.relation-row__act {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.relation-row__act svg { width: 13px; height: 13px; }
.relation-row__act--divorce {
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  background: transparent;
  color: var(--danger);
}
.relation-row__act--divorce:hover { background: var(--danger); color: #fff; }
.relation-row__act--restore {
  border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent);
  background: transparent;
  color: var(--ok);
}
.relation-row__act--restore:hover { background: var(--ok); color: #04241a; }
.relation-row__appr {
  margin-left: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  color: var(--gold);
  font-size: 7px;
  font-style: normal;
}

/* ── Share panel ─────────────────────────────────────────────────────────── */
.share-link {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  word-break: break-all;
}
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  transition: transform var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.share-btn:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--text); }
.share-btn__glyph { font-size: 22px; line-height: 1; }
.qr-box { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: var(--r-md); }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-toast);
  pointer-events: none;
  width: min(430px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-radius: var(--r-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  font-size: var(--fs-sm);
  pointer-events: auto;
  animation: toastIn var(--t-base) var(--ease-out) both;
}
.toast.is-out { animation: toastOut var(--t-base) var(--ease-soft) both; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px) scale(.97); } }
.toast__glyph { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; flex: none; font-size: 12px; font-weight: 800; }
.toast--ok    .toast__glyph { background: var(--ok-soft); color: var(--ok); }
.toast--error .toast__glyph { background: var(--danger-soft); color: var(--danger); }
.toast--info  .toast__glyph { background: var(--info-soft); color: var(--info); }
.toast--warn  .toast__glyph { background: var(--warn-soft); color: var(--warn); }
.toast__action { margin-left: auto; color: var(--gold); font-weight: 700; font-size: var(--fs-xs); }

/* ── Dropdown menus / popovers ───────────────────────────────────────────── */
.popover {
  position: fixed;
  z-index: var(--z-menu);
  min-width: 240px;
  max-width: min(400px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-4);
  animation: popIn var(--t-fast) var(--ease-out) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.popover__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.popover__title { font-weight: 700; font-size: var(--fs-sm); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text);
  text-align: left;
  transition: background var(--t-fast);
}
.menu-item:hover { background: var(--surface-3); }
.menu-item svg { width: 17px; height: 17px; color: var(--text-dim); flex: none; }
.menu-item__icon {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  flex: none;
}
.menu-item:hover .menu-item__icon { background: var(--surface); color: var(--gold); }
.menu-item:hover .menu-item__icon svg { color: inherit; }
.menu-item--danger .menu-item__icon { background: var(--danger-soft); color: var(--danger); }
.menu-item--danger .menu-item__icon svg { color: inherit; }
.menu-item--danger { color: var(--danger); }
.menu-item small { display: block; color: var(--text-dim); font-size: var(--fs-xs); font-weight: 400; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }

/* ── Notification list ───────────────────────────────────────────────────── */
.notif-group-title {
  padding: 6px 10px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.notif {
  display: flex;
  gap: 11px;
  padding: 11px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background var(--t-fast);
}
.notif:hover { background: var(--surface-2); }
.notif--unread { background: var(--surface-2); border-color: var(--line); }
.notif__glyph {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  font-size: 14px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.notif__glyph--ok     { background: var(--ok-soft);     color: var(--ok); }
.notif__glyph--warn   { background: var(--warn-soft);   color: var(--warn); }
.notif__glyph--danger { background: var(--danger-soft); color: var(--danger); }
.notif__glyph--info   { background: var(--info-soft);   color: var(--info); }
.notif__glyph--gold   { background: rgba(245,158,11,.18); color: var(--gold); }
.notif__body { flex: 1; min-width: 0; font-size: var(--fs-sm); }
.notif__title { font-weight: 700; }
.notif__text { color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.notif__time { color: var(--text-dim); font-size: var(--fs-xs); margin-top: 4px; }
.notif__actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.notif__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; margin-top: 6px; }

/* ── Add-member wizard ───────────────────────────────────────────────────── */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.step-bar { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.step-bar__fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: var(--r-pill); transition: width var(--t-base) var(--ease-out); }
.step-label { font-size: var(--fs-xs); color: var(--text-dim); font-weight: 700; white-space: nowrap; }

.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  text-align: center;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); background: var(--surface-2); color: var(--text); }
.photo-preview { display: flex; align-items: center; gap: 14px; }

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.impact-note {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--info-soft);
  color: var(--info);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

/* ── Review list (wizard step 4) ─────────────────────────────────────────── */
.review-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: var(--fs-sm); }
.review-row:last-child { border-bottom: 0; }
.review-row span:first-child { color: var(--text-dim); }
.review-row span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* ── Empty states ────────────────────────────────────────────────────────── */
.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 34px 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}
.empty__glyph { display: flex; justify-content: center; opacity: .55; color: var(--text-dim); }
.empty__glyph svg { width: 30px; height: 30px; }

@media (max-width: 720px) {
  .scrim { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: none;
    max-height: 94dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: sheetIn var(--t-base) var(--ease-out) both;
    padding-bottom: var(--safe-b);
  }
  @keyframes sheetIn { from { transform: translateY(100%); } }
  .modal__foot { position: sticky; bottom: 0; }
}
