/* OnlyPaws — parodie OnlyFans, thème pattes */
:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --surface2: #1c1c2b;
  --border: #2a2a3d;
  --text: #f4f4f8;
  --muted: #9898b0;
  --accent: #00aff0;
  --accent2: #ff6eb4;
  --accent-glow: rgba(0, 175, 240, 0.25);
  --pink-glow: rgba(255, 110, 180, 0.2);
  --radius: 14px;
  --font: 'Outfit', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--accent-glow), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, var(--pink-glow), transparent),
    var(--bg);
}

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

.hidden { display: none !important; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

.app-layout {
  display: flex;
  flex: 1;
  align-items: stretch;
  width: 100%;
}

main {
  flex: 1;
  min-width: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
}

/* Sidebar profils — collée au bord droit */
.profiles-sidebar {
  position: fixed;
  top: 3.25rem;
  right: 0;
  width: 240px;
  height: calc(100vh - 3.25rem);
  height: calc(100dvh - 3.25rem);
  margin: 0;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  border-right: none;
  border-radius: 0;
  background: rgba(20, 20, 31, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  z-index: 90;
  overflow: hidden;
}

@media (min-width: 901px) {
  #app.app--with-sidebar .app-layout,
  #app.app--with-sidebar .footer {
    padding-right: 240px;
  }
}

.profiles-sidebar__head {
  padding: 1rem 0.85rem 0.55rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.profiles-sidebar__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.profiles-sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.45rem 0.5rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profiles-sidebar__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.profiles-sidebar__item:hover {
  background: var(--surface2);
  border-color: var(--border);
}

.profiles-sidebar__item--active {
  background: rgba(0, 175, 240, 0.12);
  border-color: rgba(0, 175, 240, 0.35);
}

.profiles-sidebar__avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.profiles-sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profiles-sidebar__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.profiles-sidebar__name {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profiles-sidebar__meta {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profiles-sidebar__empty {
  margin: 0.5rem 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
  background: rgba(20, 20, 31, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
}

.logo__paw { font-size: 1.5rem; }
.logo__text { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.logo__accent { color: var(--accent); }

.topbar__nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.topbar__user { color: var(--muted); font-size: 0.9rem; margin: 0 0.25rem; }

/* Buttons */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), #0088cc);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn--primary:hover { box-shadow: 0 6px 28px var(--accent-glow); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--surface2); }
.btn--outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn--block { width: 100%; margin-top: 0.5rem; }
.btn--sm { padding: 0.35rem 0.85rem; font-size: 0.82rem; margin-top: 0.65rem; }

/* Auth */
.auth-card {
  max-width: 440px;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.auth-card__hero {
  text-align: center;
  padding: 2rem 1.5rem 1rem;
  background: linear-gradient(180deg, rgba(0,175,240,0.12), transparent);
}

.auth-card__emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.auth-card__hero h1 { margin: 0 0 0.5rem; font-size: 1.75rem; }
.tagline { color: var(--muted); line-height: 1.5; margin: 0; font-size: 0.95rem; }
.tagline em { color: var(--accent2); font-style: normal; }

.auth-loading, .auth-forms { padding: 1.5rem; text-align: center; }
.auth-note { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab {
  flex: 1;
  padding: 0.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tab--active { background: var(--accent); color: #fff; border-color: var(--accent); }

.auth-form label, .form-card label {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-form input, .form-card input, .form-card textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.auth-form input:focus, .form-card input:focus, .form-card textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-error { color: #ff6b8a; font-size: 0.9rem; margin-top: 0.75rem; }

/* Hero banner */
.hero-banner {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0,175,240,0.08), rgba(255,110,180,0.08));
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.hero-banner h2 { margin: 0 0 0.35rem; font-size: 1.5rem; }
.hero-banner p { margin: 0; color: var(--muted); }

/* Grids */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.post-card, .profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover, .profile-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.post-card__img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface2);
  cursor: zoom-in;
}

.post-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card__body { padding: 0.85rem 1rem 1rem; }
.post-card__meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.post-card__meta a { color: var(--accent); }
.post-card__caption { font-size: 0.95rem; line-height: 1.4; margin: 0; }
.post-card__score {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0,175,240,0.15);
  color: var(--accent);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.post-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
  padding: 0.25rem 0.55rem;
  border-bottom: 1px solid var(--border);
}

.post-card__icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  opacity: 0.55;
  line-height: 1;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.post-card__icon-btn:hover {
  opacity: 1;
  color: var(--accent);
  background: rgba(0, 175, 240, 0.08);
}

.post-card__icon {
  font-size: 0.88rem;
  line-height: 1;
}

.post-card__comment-count {
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 0.75rem;
  text-align: center;
  color: var(--muted);
}

.post-card__icon-btn:hover .post-card__comment-count {
  color: var(--accent);
}

.post-comments__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(50vh, 320px);
  overflow-y: auto;
}

.post-comments__empty,
.post-comments__loading {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.post-comment {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 6px);
  padding: 0.5rem 0.65rem;
}

.post-comment__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.post-comment__author {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.post-comment__body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  word-break: break-word;
}

.post-comment__delete {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.1rem 0.25rem;
  line-height: 1;
}

.post-comment__delete:hover {
  color: #ff6b8a;
}

.popup {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 12, 0.82);
  backdrop-filter: blur(6px);
}

.popup__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  max-height: 85vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  animation: lightbox-in 0.2s ease;
}

.popup__panel--sm {
  width: min(100%, 22rem);
}

.popup__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.popup__close:hover {
  background: var(--bg);
  border-color: var(--accent);
}

.popup__title {
  margin: 0 0 0.85rem;
  padding-right: 1.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.popup-comment-form__input {
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.65rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 4.5rem;
  margin-bottom: 0.65rem;
}

.popup-comment-form__input:focus {
  outline: none;
  border-color: var(--accent);
}

.popup-comment-login {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.profile-card {
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
}

.profile-card__avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 2px solid var(--accent);
}

.profile-card__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-card__name { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.2rem; }
.profile-card__species { color: var(--muted); font-size: 0.85rem; }
.profile-card__stats { margin-top: 0.6rem; font-size: 0.8rem; color: var(--accent2); }

/* Profile header */
.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.profile-header__avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border: 3px solid var(--accent);
}

.profile-header__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-header__info h2 { margin: 0 0 0.25rem; font-size: 1.6rem; }
.profile-header__species { color: var(--accent2); font-weight: 600; margin-bottom: 0.5rem; }
.profile-header__bio { color: var(--muted); line-height: 1.5; margin: 0 0 0.75rem; }
.profile-header__stats { font-size: 0.9rem; color: var(--muted); }
.profile-header__stats strong { color: var(--text); }

.profile-subscribers {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-subscribers__title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.profile-subscribers__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-subscribers__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.profile-subscribers__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
}

.profile-subscribers__user {
  font-weight: 600;
  color: var(--accent);
}

.profile-subscribers__date {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.profile-actions__group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn--danger {
  color: #ff6b8a;
  border-color: rgba(255, 107, 138, 0.45);
}

.btn--danger:hover {
  background: rgba(255, 107, 138, 0.12);
  border-color: #ff6b8a;
}

.profile-edit-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.profile-edit-panel h3 {
  margin: 0 0 1.1rem;
  font-size: 1.1rem;
  color: var(--text);
}

.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-edit-field {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 0.95rem 0.7rem;
}

.profile-edit-field__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.profile-edit-field__optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}

.profile-edit-field__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  color: var(--text);
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.profile-edit-field__textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.profile-edit-field__input::placeholder {
  color: #6a6a82;
}

.profile-edit-field__input:hover {
  border-color: #3a3a52;
}

.profile-edit-field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #1a1a28;
}

.profile-edit-field__input:-webkit-autofill,
.profile-edit-field__input:-webkit-autofill:hover,
.profile-edit-field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface2) inset;
  box-shadow: 0 0 0 1000px var(--surface2) inset;
  transition: background-color 9999s ease-out 0s;
}

.profile-edit-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding-top: 0.25rem;
}

.post-card__img-wrap { position: relative; }

.post-card__delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  min-width: 2rem;
  padding: 0.35rem 0.55rem;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(4px);
  color: #ff6b8a;
  border-color: rgba(255, 107, 138, 0.5);
}

.post-card__delete:hover {
  background: rgba(255, 107, 138, 0.2);
}

/* Upload */
.upload-zone, .form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.form-card { max-width: 480px; margin: 0 auto; }
.form-sub { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.9rem; }

.file-drop {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.file-drop__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.file-drop__trigger {
  display: block;
  cursor: pointer;
}

.file-drop:hover,
.file-drop--active {
  border-color: var(--accent);
  background: rgba(0,175,240,0.05);
}

.file-drop--active {
  border-color: var(--accent2);
  background: rgba(255,110,180,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,110,180,0.25);
}

.file-drop--editing {
  padding: 0;
  border-style: solid;
  border-color: var(--border);
  background: var(--bg);
}

.file-drop__icon { display: block; font-size: 2rem; margin-bottom: 0.35rem; opacity: 0.85; }
.file-drop__label { display: block; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.file-drop__hint { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.35rem; }

/* Inline editor */
.upload-editor { padding: 1rem; }

.editor-stage-wrap { margin-bottom: 0.85rem; }

.editor-stage {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 12px 32px rgba(0,0,0,0.35);
  background: #0a0a0f;
  touch-action: none;
  user-select: none;
}

.editor-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.editor-stage--panning canvas { cursor: grabbing; }
.editor-stage--place-emote canvas { cursor: copy; }

.editor-hint--active {
  color: var(--accent2);
  font-weight: 600;
}

  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.55rem 0 0;
}

.editor-controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.editor-slider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.editor-slider span { min-width: 5.5rem; }
.editor-slider input[type=range] { flex: 1; accent-color: var(--accent); }

.emote-selected-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.emote-selected-controls .editor-slider { flex: 1; min-width: 180px; }

.emote-palette {
  margin-bottom: 0.85rem;
  padding: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.emote-palette__title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.emote-palette__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.emote-palette__btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.emote-palette__btn:hover {
  transform: scale(1.08);
  border-color: var(--accent);
  background: rgba(0,175,240,0.12);
}

.editor-change-photo { margin-top: 0.25rem; }

/* Caption field */
.caption-field {
  margin-bottom: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.65rem;
}

.caption-field__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.caption-field__optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}

.caption-field__input {
  display: block;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.caption-field__input::placeholder { color: #6a6a82; }

.caption-field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.caption-field__counter {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 1.05rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 12, 0.88);
  backdrop-filter: blur(8px);
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  max-width: min(960px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lightbox-in 0.2s ease;
}

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox__close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: background 0.15s, border-color 0.15s;
}

.lightbox__close:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 4rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  background: #0a0a0f;
}

.lightbox__meta {
  margin-top: 0.85rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 36rem;
}

.lightbox__meta a {
  color: var(--accent);
  font-weight: 600;
}

.lightbox__caption {
  color: var(--text);
  margin: 0.35rem 0 0;
}

.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.footer p { margin: 0.25rem 0; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease;
}

.toast--err { border-color: #ff6b8a; color: #ff6b8a; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 900px) {
  .profiles-sidebar { display: none !important; }
}

@media (max-width: 600px) {
  .profile-header { flex-direction: column; align-items: center; text-align: center; }

  .topbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "logo logout"
      "explore myanimals"
      "create create";
    align-items: center;
    gap: 0.4rem 0.35rem;
    padding: 0.55rem 0.75rem;
    padding-top: max(0.55rem, env(safe-area-inset-top, 0px));
  }

  .topbar__nav { display: contents; }

  .logo {
    grid-area: logo;
    justify-self: start;
    min-width: 0;
  }

  .logo__text { font-size: 1.15rem; }

  .topbar__logout {
    grid-area: logout;
    justify-self: end;
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
  }

  .topbar__tab {
    font-size: 0.82rem;
    padding: 0.5rem 0.35rem;
    text-align: center;
    width: 100%;
  }

  #btnExplore { grid-area: explore; }
  #btnMyProfiles { grid-area: myanimals; }

  .topbar__create {
    grid-area: create;
    width: 100%;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    text-align: center;
  }

  .topbar__user { display: none; }
}
