/* Global font */
body { font-family: 'Crimson Pro', Georgia, serif; }

/* ── Dark mode warm palette overrides ──────────────────────────────── */
/* These override Tailwind's cold slate dark-mode colors with warm browns */
.dark .dark\:bg-slate-800 { background-color: #231610 !important; }
.dark .dark\:bg-slate-700 { background-color: #2e1c0e !important; }
.dark .dark\:bg-slate-900 { background-color: #18110a !important; }
.dark .dark\:border-slate-700 { border-color: rgba(160, 130, 95, 0.22) !important; }
.dark .dark\:border-slate-600 { border-color: rgba(160, 130, 95, 0.3) !important; }
.dark .dark\:border-slate-800 { border-color: rgba(160, 130, 95, 0.15) !important; }
.dark .dark\:divide-slate-700 > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(160, 130, 95, 0.18) !important;
}

/* ── Shared editorial page layout ───────────────────────────────────── */
.fn-page {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 3rem;
}

.fn-page-inner { width: 100%; max-width: 400px; }

.fn-page-header { text-align: center; margin-bottom: 1.75rem; }

.fn-page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 1.75rem;
  color: #2c1810;
  margin: 0 0 0.375rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.dark .fn-page-title { color: #f5e5d0; }

.fn-page-sub {
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: #6b5442;
  margin: 0;
}
.dark .fn-page-sub { color: #9a7e5a; }

/* ── Shared card ────────────────────────────────────────────────────── */
.fn-card {
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 2px 12px rgba(44, 24, 16, 0.07), 0 0 0 1px rgba(139, 115, 85, 0.18);
  padding: 2.25rem 2.5rem;
}
.dark .fn-card {
  background: #231610;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(154, 126, 90, 0.18);
}
@media (max-width: 480px) {
  .fn-card { padding: 1.75rem 1.5rem; }
}

/* ── Form elements ──────────────────────────────────────────────────── */
.fn-field { margin-bottom: 1.25rem; }

.fn-field-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.fn-label {
  display: block;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a3525;
  margin-bottom: 0.45rem;
}
.dark .fn-label { color: #c8a880; }

.fn-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(139, 115, 85, 0.32);
  background: #fdfaf6;
  color: #2c1810;
  border-radius: 2px;
  padding: 0.65rem 0.9rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.05rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  box-sizing: border-box;
  min-height: 44px;
}
.fn-input:focus {
  border-color: #8b5e3c;
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.11);
  background: #ffffff;
}
.fn-input::placeholder { color: #c0ab95; font-style: italic; }
/* iOS Safari date/datetime inputs ignore width constraints without this */
input[type="date"].fn-input,
input[type="datetime-local"].fn-input {
  -webkit-appearance: none;
  appearance: none;
}
.dark .fn-input { background: #18110a; border-color: rgba(154, 126, 90, 0.3); color: #f5e5d0; }
.dark .fn-input:focus { border-color: #c4895a; box-shadow: 0 0 0 3px rgba(196, 137, 90, 0.13); background: #1e1408; }
.dark .fn-input::placeholder { color: #7a5e40; }

.fn-select {
  width: 100%;
  border: 1px solid rgba(139, 115, 85, 0.32);
  background: #fdfaf6;
  color: #2c1810;
  border-radius: 2px;
  padding: 0.65rem 0.9rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.05rem;
  outline: none;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
}
.fn-select:focus { border-color: #8b5e3c; box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.11); }
.dark .fn-select { background: #18110a; border-color: rgba(154, 126, 90, 0.3); color: #f5e5d0; }

.fn-submit {
  width: 100%;
  background: #2c1810;
  color: #faf6f0;
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.8rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  min-height: 44px;
  margin-top: 0.25rem;
}
.fn-submit:hover { background: #3d241a; }
.fn-submit:active { transform: translateY(1px); }
.dark .fn-submit { background: #c4895a; color: #18110a; }
.dark .fn-submit:hover { background: #d49a6a; }

.fn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2c1810;
  color: #faf6f0;
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 44px;
  text-decoration: none;
}
.fn-btn:hover { background: #3d241a; }
.dark .fn-btn { background: #c4895a; color: #18110a; }
.dark .fn-btn:hover { background: #d49a6a; }

.fn-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #6b5442;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  padding: 0.55rem 0.875rem;
  border: 1px solid rgba(139, 115, 85, 0.32);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-height: 44px;
  text-decoration: none;
}
.fn-btn-ghost:hover { background: rgba(44, 24, 16, 0.05); color: #2c1810; }
.dark .fn-btn-ghost { color: #9a7e5a; border-color: rgba(154, 126, 90, 0.3); }
.dark .fn-btn-ghost:hover { background: rgba(245, 229, 208, 0.06); color: #f5e5d0; }

/* ── Flash messages ─────────────────────────────────────────────────── */
.fn-flash-error {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: #fdf3f1;
  border: 1px solid rgba(185, 80, 60, 0.25);
  border-left: 3px solid #b9503c;
  border-radius: 2px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.95rem;
  color: #7a2e20;
  line-height: 1.4;
}
.fn-flash-success {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: #f2f7f1;
  border: 1px solid rgba(60, 130, 80, 0.25);
  border-left: 3px solid #3c8250;
  border-radius: 2px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.95rem;
  color: #1e4d2b;
  line-height: 1.4;
}
.dark .fn-flash-error { background: #2a1008; border-left-color: #c05040; color: #e8a090; }
.dark .fn-flash-success { background: #0a2010; border-left-color: #40a060; color: #80c890; }

/* ── Typography helpers ─────────────────────────────────────────────── */
.fn-link {
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  color: #8b5e3c;
  text-decoration: none;
}
.fn-link:hover { color: #5c3d25; text-decoration: underline; }
.dark .fn-link { color: #c4895a; }
.dark .fn-link:hover { color: #e0a870; }

.fn-footer-link {
  text-align: center;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9rem;
  color: #8b7355;
  margin-top: 1.25rem;
}
.dark .fn-footer-link { color: #7a6040; }

/* ── Profile/settings page layout ──────────────────────────────────── */
.fn-settings-page {
  max-width: 32rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

.fn-settings-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.6rem;
  color: #2c1810;
  margin: 0 0 1.75rem;
  letter-spacing: -0.01em;
}
.dark .fn-settings-title { color: #f5e5d0; }

.fn-settings-card {
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 1px 8px rgba(44, 24, 16, 0.06), 0 0 0 1px rgba(139, 115, 85, 0.16);
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.dark .fn-settings-card {
  background: #231610;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(154, 126, 90, 0.16);
}
@media (max-width: 480px) {
  .fn-settings-card { padding: 1.25rem 1.25rem; }
}

.fn-settings-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.05rem;
  color: #2c1810;
  margin: 0 0 1.25rem;
}
.dark .fn-settings-card-title { color: #f5e5d0; }

.fn-settings-rule {
  border: none;
  border-top: 1px solid rgba(139, 115, 85, 0.16);
  margin: 1.25rem 0;
}
.dark .fn-settings-rule { border-top-color: rgba(154, 126, 90, 0.16); }

.fn-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: #4a3525;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
.fn-checkbox-label:last-child { margin-bottom: 0; }
.dark .fn-checkbox-label { color: #c8a880; }

.fn-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #8b5e3c;
  flex-shrink: 0;
  cursor: pointer;
}

.fn-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.95rem;
}
.fn-meta-row:last-child { border-bottom: none; padding-bottom: 0; }
.fn-meta-key { color: #8b7355; font-style: italic; }
.dark .fn-meta-key { color: #9a7e5a; }
.fn-meta-val { color: #2c1810; font-weight: 600; }
.dark .fn-meta-val { color: #f5e5d0; }

/* Settings page — section header */
.fn-settings-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(139, 115, 85, 0.12);
}
.fn-settings-section-header svg { color: #8b7355; flex-shrink: 0; }
.dark .fn-settings-section-header { border-bottom-color: rgba(154, 126, 90, 0.15); }
.dark .fn-settings-section-header svg { color: #9a7e5a; }

.fn-settings-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b7355;
}
.dark .fn-settings-section-label { color: #7a6040; }

/* Settings page — rows */
.fn-settings-row-wrap { position: relative; }

.fn-settings-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
  transition: opacity 0.15s;
}
.fn-settings-row:last-child { border-bottom: none; }
.fn-settings-row-wrap--editing .fn-settings-row { opacity: 0.45; pointer-events: none; }

.fn-settings-row-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b7355;
  width: 5.5rem;
  flex-shrink: 0;
}
.dark .fn-settings-row-label { color: #7a6040; }

.fn-settings-row-value {
  flex: 1;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: #4a3525;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dark .fn-settings-row-value { color: #c8a880; }

.fn-settings-row-edit {
  font-size: 0.78rem;
  color: #8b5e3c;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  font-family: inherit;
  white-space: nowrap;
}
.fn-settings-row-edit:hover { background: rgba(139, 94, 60, 0.1); color: #6b3c1e; }
.dark .fn-settings-row-edit { color: #c4895a; }
.dark .fn-settings-row-edit:hover { background: rgba(196, 137, 90, 0.12); color: #e0a870; }

.fn-row-form {
  display: none;
  padding: 0.75rem 0 0.25rem;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}
.fn-settings-row-wrap--editing .fn-row-form { display: block; }
.fn-row-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* Settings page — pill toggle switch */
.fn-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.fn-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.fn-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(139, 115, 85, 0.25);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
}
.fn-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.fn-toggle input:checked + .fn-toggle-slider { background: #8b5e3c; }
.fn-toggle input:checked + .fn-toggle-slider::before { transform: translateX(20px); }
.fn-toggle input:disabled + .fn-toggle-slider { opacity: 0.45; cursor: not-allowed; }
.fn-toggle input:focus-visible + .fn-toggle-slider { box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.25); }
.dark .fn-toggle input:focus-visible + .fn-toggle-slider { box-shadow: 0 0 0 3px rgba(196, 137, 90, 0.3); }
.fn-settings-row-edit:focus-visible { outline: 2px solid rgba(139, 94, 60, 0.5); outline-offset: 2px; }
.fn-drawer-footer-btn:focus-visible { outline: 2px solid rgba(139, 94, 60, 0.5); outline-offset: 2px; }
.fn-settings-feedback-link:focus-visible { outline: 2px solid rgba(139, 94, 60, 0.5); outline-offset: 2px; }
.dark .fn-toggle-slider { background: rgba(154, 126, 90, 0.3); }
.dark .fn-toggle input:checked + .fn-toggle-slider { background: #c4895a; }

/* Settings page — toggle row layout */
.fn-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}
.fn-toggle-row:last-child { border-bottom: none; }
.fn-toggle-row--sub { padding-left: 1rem; }
.fn-toggle-row--sub .fn-toggle-row-label { font-size: 0.9rem; color: #6b5442; }
.dark .fn-toggle-row--sub .fn-toggle-row-label { color: #9a7e5a; }
.fn-toggle-row-label {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: #4a3525;
}
.dark .fn-toggle-row-label { color: #c8a880; }
.fn-toggle-row-sub {
  font-size: 0.78rem;
  color: #8b7355;
  margin-top: 0.1rem;
}
.dark .fn-toggle-row-sub { color: #7a6040; }

/* Settings page — avatar row */
.fn-settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}
.fn-settings-avatar-row:hover { background: rgba(44, 24, 16, 0.03); }
.dark .fn-settings-avatar-row:hover { background: rgba(245, 229, 208, 0.04); }
.fn-settings-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5e5d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #8b5e3c;
  border: 2px solid rgba(139, 94, 60, 0.18);
}
.dark .fn-settings-avatar-circle { background: #3a2a1c; color: #c4895a; border-color: rgba(196, 137, 90, 0.2); }
.fn-settings-avatar-label {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: #4a3525;
}
.dark .fn-settings-avatar-label { color: #c8a880; }
.fn-settings-avatar-sub {
  font-size: 0.75rem;
  color: #8b7355;
  margin-top: 0.1rem;
}
.dark .fn-settings-avatar-sub { color: #7a6040; }
.fn-settings-avatar-remove {
  font-size: 0.75rem;
  color: #b9503c;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
}
.fn-settings-avatar-remove:hover { color: #8b3020; }
.dark .fn-settings-avatar-remove { color: #e08878; }

/* Settings page — centered avatar layout */
.fn-settings-avatar-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 0 1rem;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
  cursor: pointer;
}
.fn-settings-avatar-circle--lg { width: 72px; height: 72px; font-size: 1.75rem; }
.fn-settings-avatar-btns { display: flex; align-items: center; gap: 0.75rem; }
.fn-settings-avatar-change-btn {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: #4a3525;
  background: rgba(139, 115, 85, 0.1);
  border: 1px solid rgba(139, 115, 85, 0.22);
  border-radius: 4px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
.fn-settings-avatar-change-btn:hover { background: rgba(139, 115, 85, 0.18); }
.fn-settings-avatar-change-btn:focus-visible { outline: 2px solid #8b5e3c; outline-offset: 2px; }
.dark .fn-settings-avatar-change-btn { color: #c8a880; background: rgba(154, 126, 90, 0.12); border-color: rgba(154, 126, 90, 0.2); }
.dark .fn-settings-avatar-change-btn:hover { background: rgba(154, 126, 90, 0.2); }

/* Notifications sub-labels and note */
.fn-settings-sub-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #8b7355;
  padding: 0.75rem 0 0;
}
.dark .fn-settings-sub-label { color: #7a6040; }
.fn-settings-note {
  font-size: 0.78rem;
  color: #8b7355;
  line-height: 1.4;
  padding: 0.25rem 0 0.6rem;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
  margin: 0;
}
.dark .fn-settings-note { color: #9a8060; }
#push-toggle-row { border-bottom: none; }

/* Settings page — feedback footer link */
.fn-settings-feedback-link {
  display: block;
  text-align: center;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9rem;
  color: #8b7355;
  text-decoration: none;
  margin-top: 1.25rem;
  padding: 0.5rem;
  transition: color 0.15s;
}
.fn-settings-feedback-link:hover { color: #4a3525; }
.dark .fn-settings-feedback-link { color: #7a6040; }
.dark .fn-settings-feedback-link:hover { color: #c8a880; }

/* ── @mention links ─────────────────────────────────────────────────────────── */
.mention {
  color: #7c3aed;
  font-weight: 600;
  text-decoration: none;
}
.mention:hover { text-decoration: underline; }
.dark .mention { color: #a78bfa; }

/* ── @mention autocomplete dropdown ─────────────────────────────────────────── */
#mention-dropdown {
  position: absolute;
  z-index: 100;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-width: 180px;
  max-height: 220px;
  overflow-y: auto;
}
.dark #mention-dropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.mention-option {
  padding: 8px 12px;
  cursor: pointer;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9rem;
  color: #374151;
}
.mention-option:hover,
.mention-option.active {
  background: #ede9fe;
  color: #5b21b6;
}
.dark .mention-option { color: #cbd5e1; }
.dark .mention-option:hover,
.dark .mention-option.active {
  background: #3b1f6e;
  color: #c4b5fd;
}

/* ── Video embed ─────────────────────────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin-top: 12px;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Photo library ───────────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
@media (min-width: 640px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.photo-chip-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.photo-chip-row::-webkit-scrollbar { display: none; }
.photo-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  text-decoration: none;
}
.photo-chip img, .photo-chip .photo-chip-initial {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
}
.photo-chip-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #94a3b8;
  color: white;
  font-weight: 600;
  font-size: 1rem;
}
.photo-chip.active img, .photo-chip.active .photo-chip-initial {
  border-color: #8b5e3c;
}
.photo-chip span {
  font-size: 0.7rem;
  color: #64748b;
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dark .photo-chip span { color: #9a7e5a; }

/* ── Nav icon buttons (search + notifications) ──────────────────── */
.fn-nav-icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  color: #8b7355;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  flex-shrink: 0;
  text-decoration: none;
  position: relative;
}

.fn-nav-icon-btn:hover {
  background: rgba(44, 24, 16, 0.06);
  color: #2c1810;
}

.dark .fn-nav-icon-btn { color: #9a7e5a; }
.dark .fn-nav-icon-btn:hover { background: rgba(245, 229, 208, 0.07); color: #f5e5d0; }

/* ── Hamburger drawer navigation ────────────────────────────────── */
.fn-hamburger {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  color: #8b7355;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  flex-shrink: 0;
  margin-left: 0.125rem;
}
.fn-hamburger:hover { background: rgba(44, 24, 16, 0.06); color: #2c1810; }
.dark .fn-hamburger { color: #9a7e5a; }
.dark .fn-hamburger:hover { background: rgba(245, 229, 208, 0.07); color: #f5e5d0; }

.fn-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.fn-drawer-overlay--open { opacity: 1; pointer-events: auto; }

.fn-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 70vw;
  max-width: 280px;
  background: #ffffff;
  border-left: 1px solid rgba(139, 115, 85, 0.18);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.25s ease, width 0.3s ease, max-width 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.fn-drawer--open { transform: translateX(0); }
.fn-drawer--searching { width: 100vw; max-width: 100vw; }

.fn-drawer-header {
  display: flex;
  align-items: flex-start;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(139, 115, 85, 0.18);
  position: relative;
}
.fn-drawer-user-name {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2c1810;
  line-height: 1.3;
}
.fn-drawer-user-role {
  font-size: 0.75rem;
  color: #8b7355;
  margin-top: 0.1rem;
}
.fn-drawer-header-link {
  text-decoration: none;
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  margin: -0.15rem -0.3rem;
  transition: background 0.15s;
  display: block;
}
.fn-drawer-header-link:hover { background: rgba(44, 24, 16, 0.06); }
.dark .fn-drawer-header-link:hover { background: rgba(245, 229, 208, 0.07); }
.fn-drawer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  color: #8b7355;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.fn-drawer-close:hover { background: rgba(44, 24, 16, 0.06); color: #2c1810; }

.fn-drawer-nav { flex: 1; padding: 0.5rem 0; }
.fn-drawer-footer { border-top: 1px solid rgba(139, 115, 85, 0.18); padding: 0.5rem 0; }

.fn-drawer-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: #6b5442;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.fn-drawer-link:hover { color: #2c1810; background: rgba(44, 24, 16, 0.05); }
.fn-drawer-link--active {
  color: #2c1810;
  border-left-color: #8b5e3c;
  background: rgba(44, 24, 16, 0.04);
  font-weight: 600;
}
.fn-drawer-link--danger { color: #b9503c; }
.fn-drawer-link--danger:hover { color: #8b3020; background: rgba(185, 80, 60, 0.06); }

.fn-drawer-sep {
  height: 1px;
  background: rgba(139, 115, 85, 0.18);
  margin: 0.25rem 0;
}

.dark .fn-drawer { background: #221510; border-left-color: rgba(154, 126, 90, 0.2); }
.dark .fn-drawer-header { border-bottom-color: rgba(154, 126, 90, 0.2); }
.dark .fn-drawer-user-name { color: #f5e5d0; }
.dark .fn-drawer-user-role { color: #7a6040; }
.dark .fn-drawer-close { color: #9a7e5a; }
.dark .fn-drawer-close:hover { background: rgba(245, 229, 208, 0.07); color: #f5e5d0; }
.dark .fn-drawer-footer { border-top-color: rgba(154, 126, 90, 0.2); }
.dark .fn-drawer-link { color: #9a7e5a; }
.dark .fn-drawer-link:hover { color: #f5e5d0; background: rgba(245, 229, 208, 0.06); }
.dark .fn-drawer-link--active { color: #f5e5d0; border-left-color: #c4895a; background: rgba(245, 229, 208, 0.05); }
.dark .fn-drawer-link--danger { color: #e08878; }
.dark .fn-drawer-link--danger:hover { color: #f5a090; background: rgba(224, 136, 120, 0.07); }
.dark .fn-drawer-sep { background: rgba(154, 126, 90, 0.2); }

/* Drawer — primary/secondary tiers */
.fn-drawer-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #b5a090;
  padding: 0.75rem 1.25rem 0.25rem;
  display: block;
}
.dark .fn-drawer-section-label { color: #7a6040; }

.fn-drawer-link--primary {
  font-size: 1.05rem;
  padding: 0.85rem 1.25rem;
}

.fn-drawer-link--secondary {
  font-size: 0.875rem;
  color: #8b7355;
  padding: 0.6rem 1.25rem;
}
.dark .fn-drawer-link--secondary { color: #7a6040; }
.dark .fn-drawer-link--secondary:hover { color: #f5e5d0; }

.fn-drawer-footer-btn {
  display: block;
  width: calc(100% - 2rem);
  margin: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  text-align: center;
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #b9503c;
  background: none;
  border: 1px solid rgba(185, 80, 60, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.fn-drawer-footer-btn:hover { background: rgba(185, 80, 60, 0.06); border-color: rgba(185, 80, 60, 0.6); }
.dark .fn-drawer-footer-btn { color: #e08878; border-color: rgba(224, 136, 120, 0.3); }
.dark .fn-drawer-footer-btn:hover { background: rgba(224, 136, 120, 0.07); border-color: rgba(224, 136, 120, 0.6); }

/* ── Drawer search ────────────────────────────────────────────────────────── */

/* Search field wrapper */
.fn-drawer-search-wrap {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(139, 115, 85, 0.12);
  flex-shrink: 0;
}
.fn-drawer-search-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(139, 115, 85, 0.07);
  border-radius: 18px;
  padding: 0.38rem 0.85rem;
  cursor: text;
  transition: background 0.15s;
}
.fn-drawer-search-bar:focus-within { background: rgba(139, 115, 85, 0.12); }
.dark .fn-drawer-search-bar { background: rgba(154, 126, 90, 0.1); }
.dark .fn-drawer-search-bar:focus-within { background: rgba(154, 126, 90, 0.17); }

.fn-drawer-search-icon { color: #8b7355; flex-shrink: 0; }
.dark .fn-drawer-search-icon { color: #7a6040; }

.fn-drawer-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: #2c1810;
  outline: none;
  padding: 0;
}
.fn-drawer-search-input::placeholder { color: #a89070; }
.dark .fn-drawer-search-input { color: #f5e5d0; }
.dark .fn-drawer-search-input::placeholder { color: #6b5040; }

/* Cancel button: invisible until search mode */
.fn-drawer-search-cancel {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: #8b5e3c;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.fn-drawer--searching .fn-drawer-search-cancel { opacity: 1; pointer-events: auto; }
.dark .fn-drawer-search-cancel { color: #c4895a; }

/* Results container */
.fn-drawer-search-results {
  flex: 1;
  overflow-y: auto;
  flex-direction: column;
  padding: 0.25rem 0 1.5rem;
  transition: opacity 0.2s ease;
}

/* Italic hint (loading / keep typing / no results) */
.fn-drawer-search-hint {
  padding: 1.25rem 1.5rem 0.5rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #8b7355;
}
.dark .fn-drawer-search-hint { color: #7a6040; }

/* Result count label */
.fn-drawer-search-count {
  padding: 0.75rem 1.5rem 0.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b5a090;
}
.dark .fn-drawer-search-count { color: #7a6040; }

/* Result list wrapper */
.fn-drawer-result-list { padding: 0 0.5rem; }

/* Individual result */
.fn-drawer-result-card {
  display: block;
  text-decoration: none;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
  transition: background 0.12s;
  border-radius: 4px;
}
.fn-drawer-result-card:last-child { border-bottom: none; }
.fn-drawer-result-card:hover { background: rgba(44, 24, 16, 0.04); }
.dark .fn-drawer-result-card { border-bottom-color: rgba(154, 126, 90, 0.1); }
.dark .fn-drawer-result-card:hover { background: rgba(245, 229, 208, 0.04); }

/* Meta row: avatar + author + date */
.fn-drawer-result-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.fn-drawer-result-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.fn-drawer-result-avatar--initial {
  background: rgba(139, 94, 60, 0.15);
  color: #8b5e3c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}
.dark .fn-drawer-result-avatar--initial { background: rgba(196, 137, 90, 0.15); color: #c4895a; }
.fn-drawer-result-author { font-size: 0.75rem; font-weight: 600; color: #4a3525; }
.dark .fn-drawer-result-author { color: #c8a880; }
.fn-drawer-result-date { font-size: 0.72rem; color: #8b7355; margin-left: auto; }
.dark .fn-drawer-result-date { color: #7a6040; }

/* Post title: Playfair italic, warm */
.fn-drawer-result-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  color: #2c1810;
  line-height: 1.3;
  margin-bottom: 0.15rem;
}
.dark .fn-drawer-result-title { color: #f5e5d0; }

/* Snippet body */
.fn-drawer-result-snippet { font-size: 0.8rem; color: #6b5442; line-height: 1.45; }
.dark .fn-drawer-result-snippet { color: #9a7e5a; }

/* Highlight marks in search results */
.fn-drawer-search-results mark {
  background: rgba(251, 191, 36, 0.45);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}
.dark .fn-drawer-search-results mark { background: rgba(146, 64, 14, 0.65); color: #fef3c7; }

/* ── Comments UX (feed card toggle + pill input) ─────────────────────────── */
.fn-comment-section { display: none; }
.fn-comment-section--open { display: block; }

.fn-comment-pill--active {
  border-color: #8b5e3c !important;
  font-style: normal !important;
}
.dark .fn-comment-pill--active { border-color: #a97c50 !important; }

.fn-comment-send--hidden { display: none; }

/* ── Reply overflow toggle (post detail) ─────────────────────────────────── */
.fn-reply-toggle {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #8b5e3c;
  background: #fdf6f0;
  border: 1px solid #e5c9b0;
  border-radius: 9999px;
  padding: 3px 12px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}
.fn-reply-toggle:hover { background: #f5ebe0; }
.dark .fn-reply-toggle {
  color: #c49a6c;
  background: #2c1f14;
  border-color: #5c3d2e;
}
.dark .fn-reply-toggle:hover { background: #3a2a1c; }

/* ── Feedback page ─────────────────────────────────────────── */
.fn-feedback-page {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.fn-feedback-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #2c1810;
  margin-bottom: 0.25rem;
}

.fn-feedback-subtitle {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: #8b7355;
  margin-bottom: 1.75rem;
}

.fn-feedback-pills {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.fn-feedback-pill {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: #6b5442;
  background: transparent;
  border: 1.5px solid rgba(139, 115, 85, 0.4);
  border-radius: 2rem;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.fn-feedback-pill:hover {
  background: rgba(44, 24, 16, 0.05);
  border-color: rgba(139, 115, 85, 0.7);
  color: #2c1810;
}

.fn-feedback-pill--active {
  background: #2c1810;
  color: #f5e5d0;
  border-color: #2c1810;
}

.fn-feedback-pill--active:hover {
  background: #4a2818;
  border-color: #4a2818;
  color: #fff;
}

.fn-feedback-form-wrap {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.fn-feedback-form-wrap--open {
  max-height: 900px;
  opacity: 1;
}

.fn-feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.25rem;
}

.fn-feedback-severity {
  display: flex;
  gap: 1.5rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.95rem;
  color: #6b5442;
}

.fn-feedback-severity label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.dark .fn-feedback-title { color: #f5e5d0; }
.dark .fn-feedback-subtitle { color: #7a6040; }
.dark .fn-feedback-pill { color: #9a7e5a; border-color: rgba(154, 126, 90, 0.35); }
.dark .fn-feedback-pill:hover { background: rgba(245, 229, 208, 0.06); border-color: rgba(154, 126, 90, 0.6); color: #f5e5d0; }
.dark .fn-feedback-pill--active { background: #f5e5d0; color: #2c1810; border-color: #f5e5d0; }
.dark .fn-feedback-pill--active:hover { background: #fff; border-color: #fff; }
.dark .fn-feedback-severity { color: #9a7e5a; }
