:root {
  --bg: #FDFAF5;
  --primary: #C4724A;
  --primary-dark: #a85d3a;
  --accent: #7A9E7E;
  --accent-dark: #5f8263;
  --text: #3D2B1F;
  --text-light: #6b5448;
  --card-bg: #FFFFFF;
  --border: #e8ddd4;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(61, 43, 31, 0.08);
  --shadow-hover: 0 4px 20px rgba(61, 43, 31, 0.12);
  --maybe: #E6A817;
  --maybe-light: #fff8e1;
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --bg: #1a1a2e;
  --primary: #D4845A;
  --primary-dark: #e69a70;
  --accent: #8AB88E;
  --accent-dark: #a0d0a4;
  --text: #e0d8d0;
  --text-light: #a89888;
  --card-bg: #252540;
  --border: #3a3a55;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.4);
  --maybe-light: #3a3520;
}
[data-theme="dark"] .badge-green { background: #1a3a1a; color: #6dbe6d; }
[data-theme="dark"] .badge-orange { background: #3a2a10; color: #e6a030; }
[data-theme="dark"] .badge-red { background: #3a1a1a; color: #e66060; }
[data-theme="dark"] .badge-past { background: #2a2a3a; color: #888; }
[data-theme="dark"] .inline-comment { background: #1a1a2e; }
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.6); }
[data-theme="dark"] .cal-day.has-activity:hover { background: #3a3a55; }
[data-theme="dark"] .cal-day.today { background: var(--primary); color: white; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: var(--card-bg); color: var(--text); border-color: var(--border);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3, h4 { font-family: 'Lora', serif; font-weight: 600; }

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

/* ── Header ── */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 8px;
  position: relative;
  flex-wrap: wrap;
}
.header-left { display: flex; align-items: baseline; gap: 8px; }
.logo {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.logo-sub { font-size: 0.8rem; color: var(--text-light); }
.header-right { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.user-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--primary); }

/* Burger */
.burger-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.burger-btn span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
}

.mobile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  padding: 8px 0;
  z-index: 100;
  min-width: 200px;
}
.mobile-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.mobile-menu a:hover { background: var(--bg); color: var(--primary); }

@media (max-width: 600px) {
  .burger-btn { display: flex; }
  .desktop-only { display: none !important; }
}

/* ── Citation Widget ── */
.citation-widget {
  background: #FDF0E8;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 16px;
  text-align: center;
}
[data-theme="dark"] .citation-widget { background: #3a2a20; }
.citation-text {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 8px;
}
.citation-author {
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ── Weather Widget ── */
.weather-widget {
  margin-bottom: 16px;
}
.weather-days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}
.weather-day {
  flex: 1;
  min-width: 60px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.weather-day:hover { transform: translateY(-2px); }
.weather-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; }
.weather-icon { display: block; font-size: 1.5rem; margin: 4px 0; }
.weather-temp { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.weather-temp small { font-weight: 400; color: var(--text-light); }

/* ── Search bar ── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
.search-bar select {
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  min-width: 140px;
}
.search-bar select:focus { outline: none; border-color: var(--primary); }

/* ── View Toggle ── */
.view-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 4px;
  box-shadow: var(--shadow);
}
.view-toggle button {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}
.view-toggle button.active {
  background: var(--primary);
  color: white;
}

/* ── Section Titles ── */
.section-title {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 24px 0 12px;
}

/* ── Timeline Groups ── */
.timeline-group { margin-bottom: 8px; }
.timeline-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 300;
  animation: toastIn 0.3s ease;
}
.toast.hidden { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-maybe { background: var(--maybe); color: white; border: 2px solid var(--maybe); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; border-radius: 10px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-danger-sm {
  background: #e74c3c; color: white; border: none; border-radius: 8px;
  padding: 4px 10px; cursor: pointer; font-size: 0.85rem;
}
.btn-danger-sm:hover { background: #c0392b; }

/* ── RSVP buttons ── */
.rsvp-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

/* ── Creator actions ── */
.creator-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

/* ── Activity Cards ── */
.activity-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid transparent;
}
.activity-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.activity-card.card-joined {
  border-left-color: var(--accent);
}
.activity-card.card-maybe {
  border-left-color: var(--maybe);
}
.activity-card.card-past {
  opacity: 0.7;
}
.card-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.card-type-badge { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.type-label { font-size: 0.85rem; color: var(--text-light); }
.card-title {
  font-family: 'Lora', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--primary); }
.card-meta-row {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.card-creator { font-style: italic; }
.card-desc {
  font-size: 0.88rem;
  color: var(--text-light);
  margin: 8px 0;
  line-height: 1.5;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.card-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
}

/* Avatars */
.card-avatars { display: flex; align-items: center; gap: 0; }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: -6px;
  border: 2px solid var(--card-bg);
  position: relative;
}
.avatar:nth-child(2) { background: var(--primary); }
.avatar:nth-child(3) { background: #8B6BA3; }
.avatar:nth-child(4) { background: #D4A574; }
.avatar:nth-child(5) { background: #6B8BA4; }
.avatar-more { background: var(--border); color: var(--text-light); font-size: 0.65rem; }
.avatar-count {
  font-size: 0.8rem;
  color: var(--accent-dark);
  font-weight: 600;
  margin-left: 12px;
}

.card-expand-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}
.card-expand-btn:hover { text-decoration: underline; }

/* Inline detail */
.card-detail { padding-top: 4px; }
.card-detail h4 { font-size: 0.95rem; margin-bottom: 8px; }
.inline-comments { margin-bottom: 12px; }
.inline-comment {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
}
.inline-comment strong { color: var(--primary); font-size: 0.85rem; }
.inline-comment .comment-date { color: var(--text-light); font-size: 0.72rem; margin-left: 6px; }
.inline-comment p { margin-top: 3px; font-size: 0.88rem; }
.inline-comment-form { display: flex; gap: 8px; align-items: flex-start; }
.inline-comment-form textarea {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  resize: none;
  transition: border-color 0.2s;
  background: var(--card-bg);
  color: var(--text);
}
.inline-comment-form textarea:focus { outline: none; border-color: var(--primary); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-red { background: #fce4ec; color: #c62828; }
.badge-past { background: #eee; color: #999; }

/* Participant tags */
.participant-tag {
  background: var(--accent);
  color: white;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.tag-maybe {
  background: var(--maybe);
}

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(196, 114, 74, 0.4);
  transition: transform 0.2s, background 0.2s;
  line-height: 1;
  border: none;
  cursor: pointer;
  z-index: 50;
}
.fab:hover { background: var(--primary-dark); transform: scale(1.1); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 43, 31, 0.4);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  padding: 24px;
  z-index: 201;
  overflow-y: auto;
}
@media (min-width: 600px) {
  .modal {
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: 90%;
    border-radius: var(--radius);
    max-height: 85vh;
  }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h2 { font-size: 1.2rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 0.9rem; }
.modal input, .modal select, .modal textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: var(--card-bg);
  color: var(--text);
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.modal .btn { width: 100%; margin-top: 16px; }

/* ── Calendar ── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-nav-title {
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 180px;
  text-align: center;
}
.cal-nav-btn {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
}
.cal-nav-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
}
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.85rem;
  position: relative;
  cursor: default;
}
.cal-day.today { background: var(--primary); color: white; border-radius: 50%; }
.cal-day.today .cal-dot { background: white; }
.cal-day.has-activity { cursor: pointer; font-weight: 700; }
.cal-day.has-activity:hover { background: #f5f0eb; }
.cal-num { line-height: 1; }
.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  margin-top: 2px;
}
.cal-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}
.cal-activity { padding: 8px 0; border-bottom: 1px solid var(--border); }
.cal-activity:last-child { border-bottom: none; }
.cal-activity a { color: var(--primary); text-decoration: none; font-weight: 600; }
.cal-activity a:hover { text-decoration: underline; }
.cal-meta { display: block; font-size: 0.8rem; color: var(--text-light); }

/* ── Onboarding ── */
.onboarding-wrap { max-width: 440px; margin: 40px auto; text-align: center; }
.brand { font-size: 2rem; color: var(--primary); margin-bottom: 4px; }
.brand-sub { color: var(--text-light); margin-bottom: 32px; font-size: 1.05rem; }
.onboarding-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-align: left;
}
.onboarding-card h2 { margin-bottom: 20px; font-size: 1.2rem; }
.onboarding-card label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9rem; }
.onboarding-card input[type="text"],
.onboarding-card input[type="email"],
.onboarding-card input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: var(--card-bg);
  color: var(--text);
}
.onboarding-card input:focus { outline: none; border-color: var(--primary); }
.onboarding-card .btn { width: 100%; margin-top: 20px; }

.radio-group, .checkbox-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.radio-group label, .checkbox-group label { font-weight: 400; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.radio-group input[type="radio"], .checkbox-group input[type="checkbox"] { accent-color: var(--primary); }

.field-status { font-size: 0.85rem; margin-top: 4px; min-height: 1.2em; }
.field-status.ok { color: var(--accent-dark); }
.field-status.error { color: #c62828; }
.error-msg { color: #c62828; font-size: 0.85rem; margin-top: 6px; min-height: 1.2em; }
.success-msg { color: var(--accent-dark); font-size: 0.9rem; margin-bottom: 12px; font-weight: 600; }
.hidden { display: none !important; }

.magic-link-box { background: var(--bg); border-radius: 10px; padding: 16px; margin: 16px 0; text-align: center; }
.magic-link-url { display: block; word-break: break-all; font-size: 0.85rem; margin: 8px 0; color: var(--primary); }
.magic-link-hint { font-size: 0.8rem; color: var(--text-light); margin-top: 10px; }
.btn-copy { background: none; border: 1px solid var(--primary); color: var(--primary); padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.btn-copy:hover { background: var(--primary); color: #fff; }

/* ── Detail page ── */
.back-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.back-link:hover { text-decoration: underline; }
.detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.detail-card h1 { font-size: 1.4rem; margin-bottom: 8px; }
.detail-meta { color: var(--text-light); font-size: 0.9rem; margin-bottom: 4px; }
.detail-desc { margin: 16px 0; line-height: 1.7; }
.detail-participants { margin: 20px 0; }
.detail-participants h3 { font-size: 1rem; margin-bottom: 8px; }
.detail-participants h4 { font-size: 0.9rem; margin-bottom: 6px; color: var(--maybe); }
.participants-list { display: flex; flex-wrap: wrap; gap: 6px; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Comments (detail page) ── */
.comments-list { margin-bottom: 20px; }
.comment { background: var(--bg); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.comment strong { color: var(--primary); }
.comment-date { color: var(--text-light); font-size: 0.75rem; margin-left: 8px; }
.comment p { margin-top: 4px; }
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s;
  background: var(--card-bg);
  color: var(--text);
}
.comment-form textarea:focus { outline: none; border-color: var(--primary); }
.comment-form .btn { margin-top: 8px; }

/* ── Form page ── */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.form-card h1 { margin-bottom: 20px; font-size: 1.3rem; }
.form-card label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9rem; }
.form-card input, .form-card select, .form-card textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: var(--card-bg);
  color: var(--text);
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-card .btn { width: 100%; margin-top: 20px; }

/* ── Admin table ── */
.admin-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 0.85rem; }
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  font-family: 'Lora', serif;
  color: var(--primary);
}
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }

.empty-state { text-align: center; color: var(--text-light); padding: 40px 0; font-size: 1.05rem; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .container { padding: 0 10px 100px; }
  .logo { font-size: 1.3rem; }
  .activity-card { padding: 16px; }
  .onboarding-wrap { margin: 20px auto; }
  .detail-card { padding: 16px; }
  .card-meta-row { flex-direction: column; gap: 2px; }
  .card-row-top { flex-direction: column; align-items: flex-start; }
  .card-actions { align-self: flex-end; margin-top: -24px; }
  .search-bar { flex-direction: column; }
  .search-bar select { min-width: auto; }
}

/* ── Avatar grid (onboarding) ── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 10px 0 16px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  -webkit-overflow-scrolling: touch;
}
.avatar-grid .avatar-pick {
  font-size: 1.5rem;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: rgba(196,114,74,0.2);
  touch-action: manipulation;
  user-select: none;
}
.avatar-grid .avatar-pick:hover { border-color: var(--primary); transform: scale(1.08); }
.avatar-grid .avatar-pick:active { transform: scale(0.95); }
.avatar-grid .avatar-pick.selected {
  border-color: var(--primary);
  border-width: 3px;
  background: rgba(196,114,74,0.1);
  box-shadow: 0 0 0 2px rgba(196,114,74,0.2);
}

/* ── Emoji avatar on cards ── */
.avatar.avatar-emoji {
  background: transparent;
  font-size: 1.15rem;
  border: 2px solid var(--border);
}

/* ── Members page ── */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.member-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 12px;
  text-align: center;
  transition: box-shadow 0.2s;
}
.member-card:hover { box-shadow: var(--shadow-hover); }
.member-avatar { font-size: 2.8rem; line-height: 1; margin-bottom: 8px; }
.member-pseudo { font-family: 'Lora', serif; font-weight: 600; font-size: 1rem; color: var(--text); margin-bottom: 4px; }
.member-meta { font-size: 0.8rem; color: var(--text-light); line-height: 1.5; }

/* ── Profile page ── */
a.user-avatar { text-decoration: none; cursor: pointer; }
.profil-wrap { max-width: 480px; margin: 0 auto; }
.profil-header { text-align: center; margin-bottom: 20px; }
.profil-big-avatar { font-size: 3.5rem; line-height: 1; margin-bottom: 8px; }
.profil-header h2 { font-family: 'Lora', serif; font-size: 1.3rem; margin-bottom: 4px; }
.profil-since { font-size: 0.85rem; color: var(--text-light); }
.profil-stats {
  display: flex; justify-content: center; gap: 24px;
  margin-bottom: 20px; padding: 12px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.profil-stat { text-align: center; }
.profil-stat strong { display: block; font-size: 1.3rem; color: var(--primary); }
.profil-stat span { font-size: 0.78rem; color: var(--text-light); }
.profil-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.profil-card h3 { font-size: 0.95rem; margin: 16px 0 8px; color: var(--text); }
.profil-card h3:first-child { margin-top: 0; }
.profil-card input[type="text"], .profil-card input[type="email"] {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border);
  border-radius: 10px; font-family: 'Nunito', sans-serif; font-size: 1rem;
  background: var(--card-bg); color: var(--text); transition: border-color 0.2s;
}
.profil-card input:focus { outline: none; border-color: var(--primary); }
.profil-card .btn { width: 100%; margin-top: 16px; }
.profil-check {
  display: flex; align-items: center; gap: 8px; font-weight: 400;
  font-size: 0.9rem; cursor: pointer; margin-bottom: 4px;
}
.profil-check input { accent-color: var(--primary); }
