:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2e5d3a;
  --accent-soft: #e8f1ea;
  --danger: #b91c1c;
  --warn: #b45309;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; display: flex; flex-direction: column; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: white; font-weight: 700; font-size: 13px;
}
.brand-text { font-size: 16px; letter-spacing: -0.01em; }
.site-nav { display: flex; gap: 18px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: var(--ink); }

.main { flex: 1; padding: 32px 20px 56px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0; }

/* Hero / section */
.hero { margin-bottom: 28px; }
.hero h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 28px 0 12px; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.center { text-align: center; }

.back-link { color: var(--muted); text-decoration: none; font-size: 13px; display: inline-block; margin-bottom: 12px; }
.back-link:hover { color: var(--ink); }

/* Dashboard */
.dash-hero { margin-bottom: 20px; }
.dash-hero-eyebrow {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px;
}
.dash-hero h1 { font-size: 30px; margin: 0 0 4px; letter-spacing: -0.02em; }
.dash-hero-sub { color: var(--muted); font-size: 14px; margin: 0; }

.dash-cta-row { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.dash-cta { padding: 12px 20px; font-size: 15px; font-weight: 500; }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
}
.dash-main { min-width: 0; }
.dash-side { min-width: 0; }
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.dash-section { margin-bottom: 28px; }
.dash-section-label {
  font-size: 13px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.dash-simple-list { list-style: none; padding: 0; margin: 0; }
.dash-simple-list li { padding: 6px 0; font-size: 14px; }
.dash-simple-list a { color: var(--ink); text-decoration: none; font-weight: 500; }
.dash-simple-list a:hover { color: var(--accent); }

.btn-link-small {
  display: inline-block; margin-top: 10px;
  color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 500;
}
.btn-link-small:hover { text-decoration: underline; }

/* Event date-block cards */
.event-cards { display: flex; flex-direction: column; gap: 10px; }
.event-card {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  text-decoration: none; color: var(--ink);
  transition: border-color 0.12s ease, transform 0.08s ease;
}
.event-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.event-date-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 10px; padding: 10px 6px; width: 72px;
}
.edb-month { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.edb-day { font-size: 26px; font-weight: 700; line-height: 1; margin: 2px 0; letter-spacing: -0.02em; }
.edb-weekday { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.event-card-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.event-card-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.event-card-meta .meta-item::after { content: '·'; margin-left: 8px; color: var(--line); }
.event-card-meta .meta-item:last-child::after { display: none; }
.event-card-rsvp { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.event-card-arrow { color: var(--muted); font-size: 22px; padding: 0 6px; }
.events-empty { padding: 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

/* Spotlight card */
.spotlight-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
}
.spotlight-label {
  font-size: 11px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em; align-self: flex-start;
}
.spotlight-body {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--ink); padding: 6px 0 0;
}
.spotlight-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; overflow: hidden;
  margin-bottom: 6px;
}
.spotlight-avatar img { width: 100%; height: 100%; object-fit: cover; }
.spotlight-name { font-size: 17px; font-weight: 600; }
.spotlight-household { font-size: 13px; color: var(--muted); }
.spotlight-place { font-size: 12px; color: var(--muted); }
.spotlight-bio { font-size: 13px; color: var(--ink); margin-top: 6px; line-height: 1.4; }
.spotlight-linkedin {
  margin-top: 12px; padding: 10px 18px;
  background: #0A66C2; color: white; text-decoration: none; font-weight: 500; font-size: 13px;
  border-radius: 6px; width: 100%; text-align: center;
}
.spotlight-linkedin:hover { background: #084b92; }

/* LinkedIn hero on profile */
.linkedin-hero {
  display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(135deg, #0A66C2, #084b92);
  color: white; text-decoration: none;
  padding: 14px 18px; border-radius: var(--radius);
  margin-bottom: 20px;
}
.linkedin-hero:hover { filter: brightness(1.06); }
.linkedin-hero-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.linkedin-hero-headline { font-size: 16px; font-weight: 600; margin-top: 2px; }
.linkedin-hero-cta { font-size: 13px; opacity: 0.95; margin-top: 4px; }

/* Small in-line LinkedIn icon */
.linkedin-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 3px;
  background: #0A66C2; color: white; font-size: 10px; font-weight: 700;
  text-decoration: none; margin-left: 6px; vertical-align: middle;
  font-family: -apple-system, sans-serif;
}
.linkedin-ico:hover { background: #084b92; }

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: #d1d5db; }
.card-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.card-sub { color: var(--muted); font-size: 13px; }
.card-meta { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* Search */
.scope-toggle { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; background: #f3f4f6; border-radius: 10px; width: fit-content; }
.scope-tab { padding: 6px 14px; border-radius: 7px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 500; }
.scope-tab:hover { color: var(--ink); }
.scope-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input[type=search] {
  flex: 1; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
.search-bar input[type=search]:focus { outline: none; border-color: var(--accent); }
.search-bar button {
  padding: 10px 16px; background: var(--accent); color: white;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer;
}
.search-bar button:hover { background: #254a2d; }
.btn-link { padding: 10px 12px; color: var(--muted); text-decoration: none; font-size: 14px; align-self: center; }

/* Roster table */
.roster {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.roster th, .roster td {
  padding: 10px 14px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.roster thead th { background: #f3f4f1; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.roster tr:last-child td { border-bottom: none; }
.roster .contact a { color: var(--accent); text-decoration: none; }
.roster .contact a:hover { text-decoration: underline; }
.roster .phone { color: var(--muted); font-size: 13px; }
.person-link { color: var(--ink); text-decoration: none; font-weight: 500; }
.person-link:hover { color: var(--accent); }

/* Tags */
.tag {
  display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
  letter-spacing: 0.05em;
}
.tag-guest { background: #fef3c7; color: var(--warn); }
.tag-minor { background: #dbeafe; color: #1e40af; }
.tag-deceased { background: #e5e7eb; color: #4b5563; font-style: italic; }

/* Member list (household page) */
.member-list { list-style: none; padding: 0; margin: 0; }
.member-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.member-row:last-child { border-bottom: none; }
.role-badge {
  font-size: 10px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
}
.role-badge.role-child { background: #fef9c3; color: #854d0e; }
.inline-email { color: var(--muted); font-size: 13px; text-decoration: none; }
.inline-email:hover { color: var(--ink); }
.inline-phone { color: var(--muted); font-size: 13px; }

/* Person page */
.person-hero {
  display: flex; align-items: center; gap: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; flex-shrink: 0;
}
.person-hero h1 { margin: 0 0 4px; font-size: 22px; }

.two-col {
  display: grid; gap: 24px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
}
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

.kv { margin: 0; }
.kv dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 10px; }
.kv dt:first-child { margin-top: 0; }
.kv dd { margin: 2px 0 0; font-size: 14px; }
.kv a { color: var(--accent); text-decoration: none; }
.kv a:hover { text-decoration: underline; }

.rel-list { list-style: none; padding: 0; margin: 0; }
.rel-list li { padding: 6px 0; font-size: 14px; }
.rel-kind {
  display: inline-block; width: 110px; color: var(--muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
}
.rel-list a { color: var(--ink); text-decoration: none; }
.rel-list a:hover { color: var(--accent); }

.rel-dl { margin: 0; }
.rel-dl dt {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; margin-top: 12px;
}
.rel-dl dt:first-child { margin-top: 0; }
.rel-dl dd { margin: 2px 0 0; font-size: 14px; line-height: 1.5; }
.rel-dl a { color: var(--ink); text-decoration: none; }
.rel-dl a:hover { color: var(--accent); }

/* Gift chips */
.gift-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gift-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; border-radius: 16px; text-decoration: none;
  background: var(--accent-soft); color: var(--accent); font-size: 13px;
  border: 1px solid transparent;
}
.gift-chip:hover { border-color: var(--accent); }
.gift-kind { font-weight: 600; text-transform: capitalize; }
.gift-label { color: var(--ink); font-size: 12px; }

/* Nav */
.nav-me { color: var(--ink) !important; font-weight: 500; }
.nav-muted { color: var(--muted) !important; font-size: 12px; }

/* Dropdown in nav (using <details>/<summary>) */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  list-style: none; cursor: pointer;
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 0;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after {
  content: ' ▾'; font-size: 10px; color: var(--muted);
}
.nav-dropdown > summary:hover,
.nav-dropdown[open] > summary { color: var(--ink); }
.nav-dropdown .dropdown-menu {
  position: absolute; top: 100%; left: 0;
  margin-top: 10px; min-width: 160px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  padding: 6px; z-index: 100;
  display: flex; flex-direction: column;
}
.nav-dropdown .dropdown-menu a {
  padding: 8px 12px; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.nav-dropdown .dropdown-menu a:hover { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 680px) {
  .nav-dropdown .dropdown-menu {
    position: static; margin-top: 6px; box-shadow: none;
    border: 1px dashed var(--line);
  }
}

.nav-admin {
  color: var(--accent) !important; font-weight: 600;
  border: 1px solid var(--accent-soft); padding: 2px 8px; border-radius: 6px;
}
.nav-admin:hover { background: var(--accent-soft); }

/* Auth */
.auth-wrap { max-width: 440px; margin: 40px auto; }
.auth-wrap h1 { font-size: 24px; margin: 0 0 8px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.auth-form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.auth-form input {
  padding: 10px 12px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink);
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form button {
  padding: 12px; font-size: 15px; font-weight: 500;
  background: var(--accent); color: white; border: none; border-radius: 8px; cursor: pointer;
}
.auth-form button:hover { background: #254a2d; }

.alert { padding: 12px 14px; border-radius: 8px; font-size: 14px; margin: 16px 0; }
.alert-ok { background: var(--accent-soft); color: var(--accent); }
.alert-warn { background: #fef3c7; color: var(--warn); }
.alert-info { background: #dbeafe; color: #1e40af; }
.alert code { background: rgba(0,0,0,0.05); padding: 1px 6px; border-radius: 4px; }

/* Buttons */
.btn-primary {
  display: inline-block; padding: 10px 16px; background: var(--accent); color: white;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer;
}
.btn-primary:hover { background: #254a2d; }
.btn-outline {
  display: inline-block; padding: 8px 14px; background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 8px; font-size: 13px; font-weight: 500;
  text-decoration: none; cursor: pointer;
}
.btn-outline:hover { background: var(--accent-soft); }
.btn-tiny-danger {
  padding: 4px 10px; background: transparent; border: 1px solid var(--line);
  color: var(--danger); border-radius: 6px; font-size: 11px; cursor: pointer;
}
.btn-tiny-danger:hover { border-color: var(--danger); background: #fef2f2; }

.flex-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }

/* Event template picker */
.template-picker { margin-bottom: 22px; }
.template-picker-heading {
  display: grid; grid-template-columns: 1fr auto 2fr; gap: 14px; align-items: stretch;
  margin-bottom: 12px;
}
.template-or {
  align-self: center; color: var(--muted); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.template-big {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color 0.12s ease, transform 0.08s ease;
}
.template-big:hover { border-color: var(--accent); transform: translateY(-1px); }
.template-big.active { border-color: var(--accent); background: var(--accent-soft); }
.tb-icon { font-size: 22px; }
.tb-label { font-weight: 600; font-size: 15px; }
.tb-sub { color: var(--muted); font-size: 12px; }

.template-category-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.template-category-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.template-categories { display: flex; gap: 8px; flex-wrap: wrap; }
.template-cat-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 20px; cursor: pointer; font: inherit; color: var(--ink); font-size: 13px;
}
.template-cat-btn:hover { border-color: var(--accent); }
.template-cat-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.tc-icon { font-size: 15px; }

.template-list {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-top: 10px;
}
.template-list-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.template-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.template-chip {
  padding: 8px 14px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink);
}
.template-chip:hover { border-color: var(--accent); color: var(--accent); }
.template-chip.active { background: var(--accent); color: white; border-color: var(--accent); }

@media (max-width: 680px) {
  .template-picker-heading { grid-template-columns: 1fr; }
  .template-or { text-align: center; padding: 6px 0; }
}

/* `hidden` should actually hide even when a rule sets display */
[hidden] { display: none !important; }

/* Fieldset sections in the form */
.form-fieldset {
  grid-column: 1 / -1;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 0;
  background: var(--bg);
}
.form-fieldset legend {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; padding: 0 6px;
}
.radio-row { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.form-grid .radio-opt,
.radio-opt {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer;
  text-transform: none; letter-spacing: normal; color: var(--ink);
  font-weight: normal;
}
.radio-opt input[type=radio] { width: 16px; height: 16px; cursor: pointer; }
.radio-opt small { font-weight: normal; }
.loc-sub {
  margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.form-grid .loc-sub label,
.loc-sub label {
  display: flex; flex-direction: column; gap: 4px;
  text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; color: var(--muted);
}

/* Invite scope pills */
.scope-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.form-grid .scope-pill,
.scope-pill {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; font-size: 13px; text-transform: none; letter-spacing: normal;
  font-weight: normal; color: var(--ink);
}
.scope-pill input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.scope-pill:hover { border-color: var(--accent); }
.scope-pill:has(input:checked) { background: var(--accent); color: white; border-color: var(--accent); }

/* Custom invite picker */
.custom-picker {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
}
@media (max-width: 680px) { .custom-picker { grid-template-columns: 1fr; } }
.cp-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.household-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  max-height: 260px; overflow-y: auto; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
@media (max-width: 680px) { .household-grid { grid-template-columns: 1fr; } }
.form-grid .household-check,
.household-check {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 4px;
  font-size: 13px; cursor: pointer;
  text-transform: none; letter-spacing: normal; color: var(--ink); font-weight: normal;
}
.household-check:hover { background: var(--accent-soft); }
.household-check input { flex-shrink: 0; }

.picker-search {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; background: var(--surface); margin-bottom: 6px;
}
.picker-results {
  max-height: 230px; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.form-grid .picker-row,
.picker-row {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 4px; cursor: pointer;
  font-size: 13px; text-transform: none; letter-spacing: normal; color: var(--ink); font-weight: normal;
}
.picker-row:hover { background: var(--accent-soft); }

/* Forms */
.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 24px;
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 9px 11px; font-size: 14px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink);
  text-transform: none; letter-spacing: normal;
  font-family: inherit;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus { outline: none; border-color: var(--accent); }
.form-grid .inline-check {
  flex-direction: row; align-items: center; gap: 8px; text-transform: none; font-size: 14px; color: var(--ink);
}
.form-actions { margin-top: 16px; display: flex; gap: 12px; align-items: center; }
.form-actions button {
  padding: 10px 18px; background: var(--accent); color: white;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.form-actions button:hover { background: #254a2d; }

.gift-edit-list { list-style: none; padding: 0; margin: 0 0 14px 0; display: flex; flex-direction: column; gap: 8px; }
.gift-edit-list li { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.gift-add-form {
  display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap;
  padding: 14px; border: 1px dashed var(--line); border-radius: 8px; background: var(--bg);
}
.gift-add-form select,
.gift-add-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 14px; }
.gift-add-form input[type=text] { flex: 1; min-width: 200px; }
.gift-add-form button {
  padding: 8px 16px; background: var(--accent); color: white; border: none; border-radius: 6px; font-size: 13px; cursor: pointer;
}

/* Event list */
.event-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.event-row {
  display: grid; grid-template-columns: 180px 1fr auto auto; gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; color: var(--ink);
}
.event-row:hover { border-color: var(--accent); }
.event-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.event-title { font-weight: 500; }
.event-host { color: var(--muted); font-size: 12px; }
.event-meta { color: var(--accent); font-size: 12px; font-weight: 500; }
.event-list-muted .event-row { background: transparent; color: var(--muted); }
@media (max-width: 680px) {
  .event-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Person hero extra */
.person-hero-body { flex: 1; }

/* RSVP */
.rsvp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
}
.rsvp-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.rsvp-pill { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.rsvp-yes, .rsvp-tag-yes { background: var(--accent-soft); color: var(--accent); }
.rsvp-maybe, .rsvp-tag-maybe { background: #fef3c7; color: var(--warn); }
.rsvp-no, .rsvp-tag-no { background: #fee2e2; color: var(--danger); }
.rsvp-pending, .rsvp-tag-pending { background: #f3f4f6; color: var(--muted); }

.rsvp-form { display: flex; align-items: center; gap: 6px; }
.rsvp-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.rsvp-btn {
  padding: 8px 14px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer;
}
.rsvp-btn:hover { border-color: var(--accent); }
.rsvp-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

.invite-list { list-style: none; padding: 0; margin: 0; }
.invite-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.invite-row:last-child { border-bottom: none; }
.invite-row a { color: var(--ink); text-decoration: none; }
.invite-row a:hover { color: var(--accent); }
.rsvp-tag { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; text-transform: capitalize; }

/* ═════════ Messages v2 — Instagram DM + iMessage style ═════════ */
.unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  background: var(--danger); color: white; border-radius: 10px;
  font-size: 11px; font-weight: 700; margin-left: 4px;
}
.nav-messages { position: relative; }

/* ---------- Inbox ---------- */
.dm-page { max-width: 640px; margin: 0 auto; }
.dm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.dm-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.dm-compose-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 18px;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.dm-compose-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

.dm-list { list-style: none; padding: 0; margin: 0; }
.dm-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px;
  align-items: center; padding: 10px 8px; border-radius: 12px;
  text-decoration: none; color: var(--ink);
}
.dm-item:hover { background: var(--bg); }
.dm-item.unread .dm-name { font-weight: 700; }
.dm-item.unread .dm-preview { color: var(--ink); font-weight: 500; }
.dm-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; overflow: hidden;
}
.dm-content { min-width: 0; }
.dm-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dm-name { font-size: 15px; line-height: 1.2; }
.dm-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.dm-preview {
  font-size: 13px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-preview strong { color: var(--muted); font-weight: 500; }
.dm-badge-col { display: flex; align-items: center; gap: 4px; }
.dm-eye { font-size: 14px; opacity: 0.6; }

.dm-empty {
  padding: 40px 20px; text-align: center;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
}
.dm-empty p { color: var(--muted); margin-bottom: 14px; }

/* ---------- Compose ---------- */
.dm-compose-page { max-width: 640px; margin: 0 auto; }
.dm-compose-head {
  display: grid; grid-template-columns: 40px 1fr 80px; align-items: center; gap: 10px;
  padding: 6px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.dm-back {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); text-decoration: none; font-size: 20px; background: var(--surface);
  border: 1px solid var(--line);
}
.dm-back:hover { border-color: var(--accent); }
.dm-compose-title { font-weight: 600; font-size: 16px; }
.dm-compose-next {
  padding: 8px 16px; background: var(--accent); color: white; border: none;
  border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 14px;
}
.dm-compose-next:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

.dm-to-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface);
  border-radius: 12px 12px 0 0;
}
.dm-to-label { color: var(--muted); font-size: 13px; }
.dm-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.dm-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 6px 4px 10px; background: var(--accent-soft); color: var(--accent);
  border-radius: 14px; font-size: 13px;
}
.dm-chip button { background: transparent; border: none; color: var(--accent); cursor: pointer; font-size: 16px; padding: 0 4px; }
.dm-to-row input[type=text] { flex: 1; min-width: 120px; padding: 4px 0; border: none; background: transparent; font-size: 14px; outline: none; }
.dm-group-name { padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dm-group-name input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }

.dm-people {
  background: var(--surface); border: 1px solid var(--line);
  border-top: none; border-radius: 0 0 12px 12px;
  max-height: 58vh; overflow-y: auto;
}
.dm-person {
  display: grid; grid-template-columns: 40px 1fr 20px; gap: 10px; align-items: center;
  padding: 8px 12px; cursor: pointer;
  text-transform: none; letter-spacing: normal; font-size: 14px; color: var(--ink); font-weight: normal;
  border-bottom: 1px solid var(--line);
}
.dm-person:last-child { border-bottom: none; }
.dm-person:hover { background: var(--bg); }
.dm-person input[type=checkbox] { position: absolute; opacity: 0; }
.dm-person-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; text-transform: uppercase;
}
.dm-person-meta { min-width: 0; }
.dm-person-name { font-weight: 500; font-size: 14px; }
.dm-person-sub { font-size: 12px; }
.dm-person-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: transparent; font-size: 12px;
}
.dm-person:has(input:checked) .dm-person-check { background: var(--accent); border-color: var(--accent); color: white; }

/* ---------- Chat view (iMessage/Instagram style) ---------- */
.chat-page {
  display: flex; flex-direction: column; max-width: 760px; margin: 0 auto;
  min-height: calc(100vh - 160px);
}
.chat-bar {
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 10px;
  padding: 6px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
  position: sticky; top: 0; z-index: 10; background: var(--bg);
}
.chat-back {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
}
.chat-back:hover { border-color: var(--accent); }
.chat-peer { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-peer-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-peer-meta { min-width: 0; }
.chat-peer-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.chat-peer-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

.chat-info { position: relative; }
.chat-info summary {
  list-style: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--muted);
}
.chat-info summary::-webkit-details-marker { display: none; }
.chat-info summary:hover { border-color: var(--accent); color: var(--accent); }
.chat-info-pop {
  position: absolute; right: 0; top: 44px; z-index: 15;
  min-width: 240px; max-height: 400px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  padding: 10px;
}
.chat-info-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.chat-info-member {
  display: flex; align-items: center; gap: 8px; padding: 6px;
  text-decoration: none; color: var(--ink); font-size: 13px; border-radius: 8px;
}
.chat-info-member:hover { background: var(--accent-soft); }
.chat-info-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: white;
  font-weight: 700; font-size: 10px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; text-transform: uppercase;
}
.chat-info-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-stream {
  flex: 1; overflow-y: auto; padding: 8px 4px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.chat-empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.chat-empty-icon { font-size: 40px; margin-bottom: 10px; }
.chat-empty-text { font-size: 14px; }

.chat-time-divider {
  text-align: center; font-size: 11px; color: var(--muted);
  margin: 14px 0 6px;
}

.msg-row { display: flex; gap: 6px; align-items: flex-end; margin-top: 6px; }
.msg-row.stacked { margin-top: 1px; }
.msg-row.out { flex-direction: row-reverse; }
.msg-avatar-slot { width: 28px; flex-shrink: 0; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; text-transform: uppercase;
  text-decoration: none;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-wrap { max-width: 75%; display: flex; flex-direction: column; }
.msg-row.out .msg-wrap { align-items: flex-end; }
.msg-author-label {
  font-size: 11px; color: var(--muted); font-weight: 500; padding: 0 10px; margin-bottom: 2px;
}
.msg-bubble {
  padding: 8px 14px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--line); font-size: 15px; line-height: 1.35;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.msg-row.out .msg-bubble {
  background: var(--accent); color: white; border-color: var(--accent);
}
.msg-row.stacked.in .msg-bubble { border-top-left-radius: 6px; }
.msg-row.stacked.out .msg-bubble { border-top-right-radius: 6px; }
.msg-body { white-space: pre-wrap; }
.msg-bubble audio { display: block; max-width: 100%; margin-top: 2px; }
.msg-row.out .msg-bubble audio { filter: invert(1) hue-rotate(180deg); }

/* ---------- Composer ---------- */
.chat-input {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 4px 10px;
  position: sticky; bottom: 0; background: var(--bg); z-index: 5;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.chat-input-box {
  flex: 1; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 6px 4px 6px 14px; min-height: 40px;
}
.chat-input-box input[type=text] {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 15px; padding: 6px 0;
}
.chat-mic, .chat-send {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.chat-mic { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.chat-mic:hover { border-color: var(--accent); }
.chat-send { background: var(--accent); color: white; font-weight: 700; }
.chat-send:hover { background: #254a2d; }

.rec-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--danger);
  border-radius: 22px;
}
.chat-input { position: relative; }
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); animation: pulse 1s infinite;
}
.rec-timer { flex: 1; font-variant-numeric: tabular-nums; color: var(--danger); font-weight: 600; font-size: 14px; }
.rec-cancel, .rec-send {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rec-cancel { background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.rec-send { background: var(--accent); color: white; font-weight: 700; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-readonly {
  padding: 12px; background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius); text-align: center; font-size: 13px;
}

/* Person profile: Message button action row */
.person-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 680px) {
  .dm-item { padding: 8px 4px; }
  .chat-bar { padding: 6px 0; }
  .chat-stream { padding: 6px 0 12px; }
  .msg-wrap { max-width: 82%; }
  .chat-input-box input[type=text] { font-size: 16px; }
  .chat-peer-name { font-size: 14px; }
}

/* ═════════ Post composer + post cards ═════════ */
.post-composer {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 20px;
}
.composer-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; overflow: hidden; flex-shrink: 0;
}
.composer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.composer-body { flex: 1; min-width: 0; }
.composer-body textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; background: var(--bg); resize: vertical;
}
.composer-body textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.composer-tools { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.composer-photo {
  cursor: pointer; color: var(--muted); font-size: 13px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  display: inline-flex; align-items: center; gap: 4px;
}
.composer-photo:hover { border-color: var(--accent); color: var(--accent); }
.composer-photo input[type=file] { display: none; }
.composer-scope {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); font-size: 13px;
}
.composer-post { margin-left: auto; padding: 8px 18px; font-size: 14px; }

.post-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
}
.post-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.post-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; overflow: hidden; flex-shrink: 0;
  text-decoration: none;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-meta { flex: 1; min-width: 0; }
.post-author a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.post-author a:hover { color: var(--accent); }
.post-time { font-size: 12px; }
.post-kebab { margin-left: auto; }

.btn-ghost-icon {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: 18px; padding: 0 8px; line-height: 1;
}
.btn-ghost-icon:hover { color: var(--danger); }

.post-body { font-size: 15px; line-height: 1.5; margin: 4px 0 10px; white-space: pre-wrap; word-wrap: break-word; }
.post-photo { margin: 0 -16px 10px; }
.post-photo img { width: 100%; display: block; max-height: 560px; object-fit: cover; }

.post-actions { display: flex; align-items: center; gap: 16px; padding: 6px 0 8px; border-top: 1px solid var(--line); margin-top: 8px; }
.react-btn {
  display: inline-flex; align-items: center; gap: 6px; background: transparent;
  border: none; cursor: pointer; font: inherit; color: var(--muted); font-size: 13px;
  padding: 4px 8px; border-radius: 6px;
}
.react-btn:hover { background: var(--accent-soft); }
.react-btn.liked { color: var(--danger); font-weight: 500; }
.react-icon { font-size: 14px; }
.comment-count { font-size: 13px; }

.post-comments { list-style: none; padding: 0; margin: 6px 0; border-top: 1px solid var(--line); padding-top: 8px; }
.post-comment {
  padding: 4px 0; font-size: 13px; line-height: 1.5;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.comment-author { font-weight: 600; color: var(--ink); }
.comment-body { color: var(--ink); }
.comment-time { font-size: 11px; }
.comment-delete { font-size: 14px; padding: 0 4px; margin-left: auto; }

.comment-form { display: flex; gap: 6px; margin-top: 6px; }
.comment-form input[type=text] {
  flex: 1; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; background: var(--bg);
}
.comment-form input[type=text]:focus { outline: none; border-color: var(--accent); background: var(--surface); }

.feed-sidebar-section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 12px;
}

@media (max-width: 680px) {
  .post-composer {
    padding: 12px; gap: 10px;
    position: sticky; top: 56px; z-index: 20;
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }
  .post-photo { margin: 0 -12px 10px; }
  .post-card { padding: 12px; }
  .post-photo img { max-height: 400px; }
  .composer-body textarea { min-height: 60px; font-size: 16px; }
  .composer-tools { gap: 6px; }
  .composer-photo, .composer-scope { font-size: 14px; padding: 10px 12px; }
  .composer-post { padding: 10px 18px; font-size: 15px; }
  .react-btn { padding: 8px 12px; font-size: 14px; }
  .comment-form input[type=text] { padding: 10px 12px; font-size: 16px; }
  .comment-form button { padding: 10px 14px; }
}

/* Email list */
.email-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.email-label {
  font-size: 11px; color: var(--muted); padding: 1px 7px;
  background: #f3f4f6; border-radius: 10px; text-transform: lowercase;
}
.email-primary {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  color: var(--accent); padding: 1px 6px; letter-spacing: 0.05em;
  background: var(--accent-soft); border-radius: 4px;
}

.email-edit-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.email-edit-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px;
}
.email-edit-addr { font-weight: 500; flex: 1; min-width: 200px; word-break: break-all; }
.btn-tiny {
  padding: 4px 10px; font-size: 11px; background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.btn-tiny:hover { border-color: var(--accent); color: var(--accent); }
.email-add-form {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 14px; border: 1px dashed var(--line); border-radius: 8px; background: var(--bg);
}
.email-add-form input[type=email] { flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; background: var(--surface); }
.email-add-form input[type=text] { flex: 0 1 180px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; background: var(--surface); }
.email-add-form button { padding: 8px 16px; background: var(--accent); color: white; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; }

/* Social links */
.social-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.social-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; border-radius: 16px; text-decoration: none;
  background: #eef2ff; color: #3730a3; font-size: 13px;
  border: 1px solid transparent;
}
.social-chip:hover { border-color: #3730a3; }
.social-kind { font-weight: 600; text-transform: capitalize; }
.social-label { color: var(--ink); font-size: 12px; }
.social-linkedin { background: #e0f2fe; color: #0369a1; }
.social-instagram { background: #fce7f3; color: #be185d; }
.social-facebook { background: #dbeafe; color: #1e40af; }
.social-x { background: #f3f4f6; color: #111827; }
.social-tiktok { background: #f5f5f5; color: #111827; }
.social-youtube { background: #fee2e2; color: #991b1b; }
.social-website { background: var(--accent-soft); color: var(--accent); }

/* Management card */
.manage-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.manage-form {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
  padding: 14px; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px;
}
.manage-form label { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 220px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.manage-form select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; }
.manage-form button { padding: 10px 18px; background: var(--accent); color: white; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }

/* Feed */
.feed-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.feed-post {
  display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px;
}
.feed-kind-badge {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 10px; border-radius: 12px; text-align: center; align-self: start;
}
.feed-kind-engagement .feed-kind-badge { background: #fde68a; color: #92400e; }
.feed-kind-wedding .feed-kind-badge { background: #fbcfe8; color: #9d174d; }
.feed-kind-baby .feed-kind-badge { background: #e0e7ff; color: #3730a3; }
.feed-kind-graduation .feed-kind-badge { background: #dcfce7; color: #14532d; }
.feed-kind-funeral .feed-kind-badge { background: #e5e7eb; color: #374151; }
.feed-kind-anniversary .feed-kind-badge { background: #fce7f3; color: #831843; }
.feed-kind-job .feed-kind-badge { background: #dbeafe; color: #1e40af; }
.feed-kind-move .feed-kind-badge { background: #fef3c7; color: #92400e; }

.feed-headline { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.feed-text { margin: 4px 0 8px; font-size: 14px; color: var(--ink); }
.feed-meta { color: var(--muted); font-size: 12px; }
.feed-meta a { color: var(--muted); text-decoration: none; }
.feed-meta a:hover { color: var(--ink); }
@media (max-width: 680px) {
  .feed-post { grid-template-columns: 1fr; gap: 6px; padding: 14px; }
  .feed-kind-badge { justify-self: start; }
}

/* Admin */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.admin-stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.admin-stat .stat-num { font-size: 28px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.admin-stat .stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.admin-nav { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 24px; }
.admin-nav a {
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px;
}
.admin-nav a.active { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.admin-nav a:hover { border-color: var(--accent); }
.tag-admin { background: #fde68a; color: #92400e; font-size: 10px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; letter-spacing: 0.05em; font-weight: 600; }

/* Family tree — indented list style */
.tree-list,
.tree-sublist {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.tree-sublist {
  padding-left: 22px;
  margin-left: 8px;
  border-left: 1px dashed var(--line);
}
.tree-li {
  position: relative;
  padding: 6px 0 6px 18px;
}
.tree-li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 14px;
  height: 1px;
  background: var(--line);
}
.tree-list > .tree-li {
  padding-left: 0;
}
.tree-list > .tree-li::before {
  display: none;
}
.tree-line {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
}
.tree-person-inline {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.tree-person-inline:hover { color: var(--accent); }
.tree-amp-inline { color: var(--muted); font-weight: 400; margin: 0 4px; }
.tree-memoriam { color: var(--muted); font-style: italic; font-size: 12px; font-weight: 400; }

@media (max-width: 680px) {
  .tree-sublist { padding-left: 14px; }
  .tree-li { padding-left: 12px; }
  .tree-line { padding: 5px 12px; font-size: 13px; }
}

/* Yearbook */
.gen-section { margin-bottom: 28px; }
.gen-heading {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-size: 18px; margin: 24px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.gen-range { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0.02em; }
.gen-count {
  margin-left: auto; font-size: 12px; color: var(--accent);
  background: var(--accent-soft); padding: 2px 10px; border-radius: 10px; font-weight: 500;
}

.yearbook-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.yearbook-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 10px 12px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.yearbook-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: #d1d5db; }
.yearbook-muted { opacity: 0.6; }
.yearbook-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; overflow: hidden;
  margin-bottom: 6px;
}
.yearbook-avatar img { width: 100%; height: 100%; object-fit: cover; }
.yearbook-name { font-weight: 600; font-size: 14px; text-align: center; }
.yearbook-year { font-size: 11px; color: var(--accent); }
.yearbook-house { font-size: 11px; color: var(--muted); text-align: center; }

@media (max-width: 680px) {
  .yearbook-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .yearbook-avatar { width: 58px; height: 58px; font-size: 18px; }
}

/* Event header image */
.event-header-image {
  height: 220px; width: 100%; background-size: cover; background-position: center;
  border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 14px;
}
.image-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.upload-label { cursor: pointer; display: inline-flex; align-items: center; }
@media (max-width: 680px) {
  .event-header-image { height: 160px; }
  .image-controls { flex-direction: column; align-items: stretch; }
  .upload-label { justify-content: center; }
}

/* Bring list */
.bring-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.bring-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.bring-row.bring-claimed { background: var(--accent-soft); border-color: var(--accent); }
.bring-item { font-size: 14px; }
.bring-claimer { color: var(--accent); font-size: 13px; font-weight: 500; margin-left: auto; margin-right: 8px; }
.btn-tiny-primary {
  padding: 4px 12px; background: var(--accent); color: white;
  border: none; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer;
}
.btn-tiny-primary:hover { background: #254a2d; }
.bring-add-form { display: flex; gap: 8px; }
.bring-add-form input[type=text] { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; background: var(--surface); }
.bring-add-form button { padding: 8px 14px; background: var(--accent); color: white; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; }

/* Map */
.map-canvas {
  width: 100%; height: 560px; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden; margin-bottom: 20px;
  background: #e5e7eb;
}
.map-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.map-pop-name { font-weight: 600; }
.map-pop-name a { color: var(--accent); text-decoration: none; }
.map-pop-loc { color: var(--muted); font-size: 12px; }
.map-pop-count { font-size: 12px; color: var(--accent); margin-top: 4px; }

/* Alerts near the composer */
.compose-alert { margin: 0 0 12px; }

/* Mobile */
@media (max-width: 680px) {
  .wrap { padding: 0 14px; }
  .main { padding: 16px 14px 48px; }

  /* Sticky header for easier nav on phones */
  .site-header {
    padding: 10px 0;
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .site-header .wrap { flex-wrap: wrap; gap: 8px; }
  .brand-text { display: none; }

  /* Bigger tap targets on all nav links */
  .site-nav { gap: 6px; font-size: 14px; flex-wrap: wrap; }
  .site-nav a, .nav-dropdown > summary {
    padding: 8px 10px; min-height: 36px;
    display: inline-flex; align-items: center;
  }

  .hero h1 { font-size: 22px; }
  h2 { font-size: 16px; }

  /* Directory table → card list */
  .roster thead { display: none; }
  .roster, .roster tbody, .roster tr, .roster td {
    display: block; width: 100%; border: none;
  }
  .roster { background: transparent; border: none; }
  .roster tr {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  }
  .roster td { padding: 2px 0 !important; border: none !important; font-size: 14px; }
  .roster td.contact { margin-top: 6px; font-size: 13px; color: var(--muted); }
  .roster td.contact a { color: var(--accent); }

  /* Event rows */
  .event-row { grid-template-columns: 1fr; gap: 2px; padding: 12px 14px; }
  .event-date { font-size: 12px; }
  .event-meta { font-size: 12px; }

  /* Person hero */
  .person-hero { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .avatar { width: 52px; height: 52px; font-size: 18px; }

  /* RSVP */
  .rsvp-bar { flex-direction: column; align-items: stretch; padding: 12px 14px; }
  .rsvp-form { justify-content: space-between; }
  .rsvp-btn { flex: 1; text-align: center; }

  /* Forms */
  .form-card { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-actions { flex-wrap: wrap; }

  /* Email editor */
  .email-edit-row { flex-direction: column; align-items: flex-start; }
  .email-edit-addr { min-width: 0; width: 100%; }
  .email-add-form { flex-direction: column; align-items: stretch; }
  .email-add-form input,
  .email-add-form button { width: 100%; }

  /* Gift add form */
  .gift-add-form { flex-direction: column; align-items: stretch; }
  .gift-add-form select,
  .gift-add-form input,
  .gift-add-form button { width: 100%; }

  /* Household address card */
  .auth-wrap { margin: 20px auto; }

  /* Admin cards */
  .admin-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-stat { padding: 12px 14px; }
  .admin-stat .stat-num { font-size: 22px; }

  /* Map */
  .map-canvas { height: 400px; }
}
