/* ============================================================
   Kinkspace – Flat UI  |  palette: black & red
   ============================================================ */

:root {
  --bg:            #0a0a0a;
  --surface:       #141414;
  --surface-2:     #1e1e1e;
  --surface-3:     #252525;
  --border:        #2a2a2a;
  --accent:        #e63946;
  --accent-hover:  #ff4757;
  --accent-muted:  rgba(230, 57, 70, 0.15);
  --text:          #f0f0f0;
  --text-muted:    #888888;
  --text-disabled: #444444;
  --success:       #2ecc71;
  --warning:       #f39c12;
  --radius:        4px;
  --transition:    150ms ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { display: block; max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrap { display: flex; flex-direction: column; min-height: 100vh; }

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.navbar__brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.navbar__brand span { color: var(--accent); }

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.nav-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-btn.active { color: var(--accent); font-weight: 600; }

.navbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.username-badge {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ── Main content ────────────────────────────────────────────── */
.main {
  padding-top: 2rem;
  padding-bottom: 3rem;
  flex: 1;
  padding: 2rem 0;
}

/* ── Auth views ─────────────────────────────────────────────── */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.auth-card__sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.625rem;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  padding: 0.6rem 0.875rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: var(--surface-3);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-disabled); }

.form-textarea { resize: vertical; min-height: 120px; }

.form-select {
  appearance: none;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover:not(:disabled) { background: var(--accent-muted); }

.btn-muted {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-muted:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--accent);
  border: 1px solid transparent;
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
}
.btn-danger:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.btn-sm { font-size: 0.8125rem; padding: 0.35rem 0.75rem; }
.btn-full { width: 100%; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card--accent {
  border-left: 3px solid var(--accent);
}

/* ── Post card ───────────────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.post-card:hover { border-color: #3a3a3a; }

.post-card--clickable {
  cursor: pointer;
}

.post-card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.post-card__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.avatar-image {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.post-card__author {
  font-weight: 600;
  font-size: 0.9375rem;
}

.post-card__time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

.post-card__body {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #d8d8d8;
  margin-bottom: 0.875rem;
  word-break: break-word;
}

.post-card__footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-card__gallery {
  display: block;
  margin: 0 0 0.9rem;
}

.post-photo-preview {
  position: relative;
}

.post-photo-preview__image {
  width: 100%;
  max-height: 420px;
  border-radius: var(--radius);
  object-fit: cover;
}

.post-photo-preview__more {
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.post-photo-preview__meta {
  margin-top: 0.5rem;
}

.post-photo-card__meta {
  padding: 0.5rem;
}

.post-photo-card__description {
  font-size: 0.8125rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-photo-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.post-photo-card__tag {
  font-size: 0.7rem;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid rgba(230, 57, 70, 0.35);
}

.post-detail {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem;
}

.post-detail__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.post-detail__time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-detail__content {
  margin-bottom: 1rem;
  color: #d8d8d8;
  line-height: 1.7;
}

.post-detail__media {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.post-detail__hero-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.post-detail__hero {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  margin: 0 auto;
}

.post-detail__caption {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
}

.post-detail__thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.post-detail__thumb-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
}

.post-detail__thumb-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.post-detail__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.post-upload-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.post-upload-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.65rem;
}

.post-upload-item__preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.post-upload-item__fields {
  min-width: 0;
}

.visibility-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.visibility-badge--public {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.visibility-badge--private {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

/* ── Report card ─────────────────────────────────────────────── */
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.report-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.report-entity-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent-muted);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.report-card__id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.report-card__reason { font-size: 0.9rem; color: #d8d8d8; }

/* ── Group cards ─────────────────────────────────────────────── */
.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
}

.group-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.group-card__name {
  font-size: 1rem;
  font-weight: 700;
}

.group-card__meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.group-card__actions {
  display: flex;
  justify-content: flex-end;
}

@media (min-width: 960px) {
  .stack.groups-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ── Status badge ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

.badge--open    { background: var(--accent-muted); color: var(--accent); }
.badge--success { background: rgba(46,204,113,.15); color: #2ecc71; }
.badge--warn    { background: rgba(243,156,18,.15);  color: #f39c12; }

/* ── Profile edit ────────────────────────────────────────────── */
.profile-edit-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.profile-edit-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.profile-edit-info { flex: 1; min-width: 0; }
.profile-edit-name { font-size: 1.125rem; font-weight: 700; }
.profile-edit-tagline { font-size: .875rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Profile section tabs ──────────────────────────────────── */
.profile-section-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-section-tabs::-webkit-scrollbar { display: none; }

.profile-section-tab {
  flex: 1;
  min-width: max-content;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.profile-section-tab:hover { color: var(--text); }
.profile-section-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-count {
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: .1rem .4rem;
  min-width: 1.3em;
  text-align: center;
}

.profile-section-body {
  padding: 1.5rem;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 1px solid var(--border);
}

.profile-gallery-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.profile-gallery-item {
  overflow: hidden;
}

.profile-gallery-item__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.profile-gallery-item__body {
  padding: 0.8rem;
}

.profile-gallery-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

/* ── Tag cloud / chip toggle ─────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tag-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .825rem;
  font-family: inherit;
  padding: .35rem .9rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  user-select: none;
}
.tag-btn:hover { border-color: var(--accent); color: var(--text); }
.tag-btn.selected { background: var(--accent-muted); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.tag-btn--warn.selected  { background: rgba(243,156,18,.15); border-color: #f39c12; color: #f39c12; }
.tag-btn--danger.selected { background: rgba(231,76,60,.15); border-color: #e74c3c; color: #e74c3c; }

/* ── Toggle group (radio pills) ──────────────────────────────── */
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.toggle-option {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.25rem;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.toggle-option + .toggle-option { border-left: 1px solid var(--border); }
.toggle-option.active { background: var(--accent-muted); color: var(--accent); }

/* ── Privacy toggle switch ───────────────────────────────────── */
.privacy-toggles { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; }
.privacy-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  cursor: pointer;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}
.toggle-switch.on { background: var(--accent); border-color: var(--accent); }
.toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left var(--transition);
}
.toggle-switch.on .toggle-switch-thumb { left: 22px; }

/* ── Page headers ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.375rem;
  font-weight: 700;
}

/* ── Feed / stack ────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 0.875rem; }

/* Feed 2-column grid on wide viewports */
@media (min-width: 960px) {
  .stack.feed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1280px) {
  .stack.feed-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.empty-state__text { font-size: 0.9375rem; }

/* ── Alert / error ───────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert--error {
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  color: #ff8a92;
}

.alert--success {
  background: rgba(46,204,113,.12);
  border: 1px solid #2ecc71;
  color: #2ecc71;
}

/* ── Report modal overlay ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
}

.modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.modal__actions {
  display: flex;
  gap: 0.625rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── Loader ──────────────────────────────────────────────────── */
.loader {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.pagination__info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Scroll bar (webkit) ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Quill rich text editor (dark theme) ─────────────────────── */
#profile-bio-editor .ql-editor {
  min-height: 160px;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.7;
}
#profile-bio-editor .ql-editor.ql-blank::before {
  color: var(--text-muted);
  font-style: italic;
}
.ql-toolbar.ql-snow,
.ql-container.ql-snow {
  border-color: var(--border) !important;
  background: var(--surface-2);
}
.ql-toolbar.ql-snow {
  border-radius: var(--radius) var(--radius) 0 0;
}
.ql-container.ql-snow {
  border-radius: 0 0 var(--radius) var(--radius);
}
.ql-toolbar .ql-stroke { stroke: var(--text-muted) !important; }
.ql-toolbar .ql-fill  { fill:   var(--text-muted) !important; }
.ql-toolbar .ql-picker-label { color: var(--text-muted) !important; }
.ql-toolbar button:hover .ql-stroke,
.ql-toolbar .ql-active .ql-stroke { stroke: var(--accent) !important; }
.ql-toolbar button:hover .ql-fill,
.ql-toolbar .ql-active .ql-fill  { fill:   var(--accent) !important; }
.ql-toolbar button:hover .ql-picker-label,
.ql-toolbar .ql-active .ql-picker-label { color: var(--accent) !important; }

/* Rich text bio display on public profile */
.bio-html-content p  { margin: 0 0 0.5rem; }
.bio-html-content ul,
.bio-html-content ol  { padding-left: 1.5rem; margin: 0 0 0.5rem; }
.bio-html-content h2  { font-size: 1.1rem; font-weight: 700; margin: 0.75rem 0 0.25rem; }
.bio-html-content h3  { font-size: 1rem;   font-weight: 700; margin: 0.5rem 0 0.2rem; }
.bio-html-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 0.5rem 0;
  padding: 0.25rem 0.75rem;
  color: var(--text-muted);
}
.bio-html-content a { color: var(--accent); text-decoration: underline; }

/* ── Public profile card ─────────────────────────────────────── */
.pub-profile {
  max-width: 780px;
  margin: 0 auto;
}

/* Hero */
.pub-profile__hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.pub-profile__avatar {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-profile__hero-info {
  flex: 1;
  min-width: 0;
}

.pub-profile__name {
  font-size: 1.625rem;
  font-weight: 800;
  margin: 0 0 .5rem;
  color: var(--text);
}

.pub-profile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .5rem;
}

.pub-profile__meta-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8125rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .2rem .65rem;
}

.pub-profile__meta-badge i {
  color: var(--accent);
  font-size: .75rem;
}

.pub-profile__since {
  font-size: .8rem;
  color: var(--text-disabled);
  display: flex;
  align-items: center;
  gap: .35rem;
}

.pub-profile__since i { font-size: .75rem; }

/* Body */
.pub-profile__body {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.pub-profile__section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.pub-profile__section-title {
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.pub-profile__bio {
  color: var(--text);
  line-height: 1.75;
  font-size: .9375rem;
  /* Reset ql-editor container styles */
  border: none !important;
  padding: 0 !important;
  min-height: unset !important;
  outline: none !important;
  cursor: default !important;
  /* white-space: pre-wrap is inherited from .ql-editor — do NOT override it,
     that is what preserves Quill's line breaks inside <p> tags */
}

.pub-profile__bio em { color: var(--text-muted); }

.pub-profile__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.pub-gallery-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pub-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.pub-gallery-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.pub-gallery-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.pub-gallery-card__meta {
  padding: 0.5rem;
  font-size: 0.8rem;
  color: var(--text);
}

.pub-gallery-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.pub-gallery-card__tag {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid rgba(230, 57, 70, 0.35);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
}

.pub-profile__tag {
  font-size: .8125rem;
  padding: .3rem .75rem;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: capitalize;
}

.pub-profile__tag--accent {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 600px) {
  .pub-profile__hero {
    flex-direction: column;
    text-align: center;
  }
  .pub-profile__meta { justify-content: center; }
  .pub-profile__since { justify-content: center; }
  .post-card__gallery {
    display: block;
  }
  .post-detail {
    padding: 0.85rem;
  }
  .post-detail__thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .profile-gallery-grid {
    grid-template-columns: 1fr;
  }
  .post-upload-item {
    grid-template-columns: 1fr;
  }
  .pub-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Notification bell & panel ──────────────────────────────── */
.notif-wrap {
  position: relative;
}

.notif-btn {
  position: relative;
  font-size: 1rem;
  padding: 0.4rem 0.6rem;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  line-height: 1;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 200;
  overflow: hidden;
}

.notif-panel__header {
  padding: .75rem 1rem;
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}

.notif-empty {
  padding: 1.25rem 1rem;
  color: var(--text-muted);
  font-size: .875rem;
  text-align: center;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
}

.notif-item:last-child { border-bottom: none; }

.notif-item--accepted { background: rgba(46, 204, 113, 0.05); }

.notif-item__avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.notif-item__text {
  font-size: .875rem;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

.notif-item__actions {
  display: flex;
  gap: .4rem;
}

.notif-item__check {
  color: var(--success);
  font-size: .875rem;
  align-self: center;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .auth-card { padding: 1.75rem 1.25rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .navbar__nav .nav-btn { padding: 0.35rem 0.5rem; font-size: 0.8125rem; }
}
