:root {
  --bg: #17171A;
  --surface: #201F22;
  --surface-2: #29282C;
  --text: #EDEAE5;
  --text-muted: #9A958F;
  --border: #322F33;
  --neutral-highlight: #B8B4AE;
  --ember: #E2632E;
  --purple: #7C5FA0;
  --muted-ember: #A8522E;
  --muted-ember-text: #F5DFD3;
  --filter: #B98657;
  --danger: #D97362;
  --title-tier1: #B98657;
}

[data-theme="light"] {
  --bg: #F7F5F2;
  --surface: #EFE9E1;
  --surface-2: #FFFFFF;
  --text: #221F20;
  --text-muted: #7D7670;
  --border: #DAD5CE;
  --neutral-highlight: #8C8680;
  --ember: #E2632E;
  --purple: #7C5FA0;
  --muted-ember: #A8522E;
  --muted-ember-text: #F5DFD3;
  --filter: #B98657;
  --danger: #B5453A;
  --title-tier1: #8B6239;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3 {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

#app-main {
  flex: 1;
  overflow-y: auto;
  padding: 96px 0 84px;
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

#app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background-color: var(--bg);
  border-bottom: 0.5px solid var(--border);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-side--right { justify-content: flex-end; }

.topbar-wordmark {
  min-width: 0;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: clamp(14px, 4.5vw, 20px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  background: var(--bg);
  padding: 6px 18px;
  border-radius: 20px;
}

.bw-ember { color: var(--ember); text-shadow: 0 0 10px rgba(226,99,46,0.5); }
.bw-paper { color: var(--text); }
.bw-filter { color: var(--filter); }

.theme-toggle, .topbar-icon-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 21;
}

.topbar-icon-btn--active {
  color: var(--text);
  background: var(--surface);
  animation: navPulse 2s ease-in-out infinite;
}

.topbar-signup-btn {
  flex-shrink: 0;
  background: var(--muted-ember);
  color: var(--muted-ember-text);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  z-index: 21;
}

/* bottom nav */
#bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background-color: var(--bg);
  border-top: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.bottom-nav-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-unread-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  text-align: center;
}

.nav-btn.active {
  color: var(--purple);
  background: var(--surface);
  animation: navPulse 2s ease-in-out infinite;
}

.nav-btn--feed { color: var(--ember); }
.nav-btn--feed.active {
  color: var(--ember);
  background: var(--surface);
  animation: navPulse 2s ease-in-out infinite;
}

.nav-btn--upload {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--purple);
  color: var(--surface-2);
}

.nav-btn--upload.active {
  background: var(--purple);
  color: var(--surface-2);
  animation: navPulseUpload 2s ease-in-out infinite;
}

@keyframes navPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; }
  50% { box-shadow: 0 0 8px 2px currentColor; }
}

@keyframes navPulseUpload {
  0%, 100% { box-shadow: 0 0 0 0 var(--purple); }
  50% { box-shadow: 0 0 10px 3px var(--purple); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-btn.active, .nav-btn--feed.active, .nav-btn--upload.active, .topbar-icon-btn--active {
    animation: none;
  }
}

@media (hover: hover) {
  .nav-btn:hover { background: var(--surface); }
  .nav-btn--upload:hover { background: var(--surface-2); color: var(--purple); }
}

.nav-btn svg { width: 22px; height: 22px; }
.nav-btn--feed svg { transform: scale(1.15); }

/* form elements */
label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--neutral-highlight);
}

button.primary {
  width: 100%;
  padding: 12px;
  margin-top: 18px;
  background: var(--muted-ember);
  color: var(--muted-ember-text);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover { opacity: 0.9; }
button.primary:disabled { opacity: 0.5; cursor: default; }

button.link, a.link {
  background: none;
  border: none;
  color: var(--neutral-highlight);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  margin-top: 14px;
  text-decoration: none;
}

.status-msg {
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
}

.status-msg.error { background: rgba(217,115,98,0.15); color: var(--danger); }
.status-msg.ok { background: rgba(124,95,160,0.15); color: var(--purple); }

.toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.toast.show { opacity: 1; }

/* feed */
.feed-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 340px;
  overflow: hidden;
  background: var(--surface);
}

.feed-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

.feed-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface);
  display: block;
}

img.feed-media { cursor: pointer; }

.feed-media-missing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.feed-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

.feed-empty p { color: var(--text-muted); margin-top: 6px; }

.feed-top-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.feed-username {
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.feed-report-btn {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#feed-report { color: var(--ember); }

.feed-badge {
  background: rgba(0,0,0,0.4);
  color: #fff;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.feed-badge--featured { background: rgba(124,95,160,0.8); }

.feed-badge--mod-pick {
  background: rgba(226,99,46,0.85);
  border: none;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

.feed-nav-group {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  z-index: 2;
}

.feed-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: var(--ember);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.feed-side-rail {
  position: absolute;
  right: 10px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  z-index: 2;
}

.feed-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.feed-action-bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.feed-action-bubble--active {
  background: var(--purple);
  color: #fff;
}

.feed-action-bubble--active svg {
  fill: currentColor;
}

.feed-action-count {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0,0,0,0.5);
  padding: 2px 7px;
  border-radius: 10px;
}

/* comments overlay */
.comments-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 60px;
  top: 0;
  background: rgba(0,0,0,0.45);
  z-index: 15;
  align-items: flex-end;
  justify-content: center;
}

.comments-panel {
  width: 100%;
  max-width: 480px;
  max-height: 65vh;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.comments-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.comments-list {
  overflow-y: auto;
  padding: 12px 16px;
  flex: 1;
}

.comment-row {
  margin-bottom: 12px;
  font-size: 13px;
}

.comment-row--deleted { opacity: 0.65; }

.media-cell-unavailable {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-muted);
}

.grid-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.grid-pager .modal-btn {
  flex-shrink: 0;
  width: auto;
  padding: 8px 16px;
}

.grid-pager .modal-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.grid-pager-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  min-width: 0;
}

/* Moderator and admin flair are intentionally SEPARATE rules, not a
   shared class. Mod is static ember; admin is purple and pulses,
   because an admin marking something official is the rarer and more
   serious case. */
.comment-row--flair-mod {
  border-left: 3px solid var(--ember);
  padding-left: 11px;
}

@keyframes adminFlairPulse {
  0%, 100% { border-left-color: var(--purple); }
  50% { border-left-color: rgba(124, 95, 160, 0.3); }
}

.comment-row--flair-admin {
  border-left: 3px solid var(--purple);
  padding-left: 11px;
  animation: adminFlairPulse 2.4s ease-in-out infinite;
}

/* The purple alone still distinguishes admin from mod, so nothing is
   lost when animation is switched off. */
@media (prefers-reduced-motion: reduce) {
  .comment-row--flair-admin { animation: none; }
}

.comment-edited {
  color: var(--text-muted);
  font-size: 11px;
}

.staff-flair-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  margin-top: 10px;
  background: rgba(226,99,46,0.08);
  border: 1px solid var(--ember);
  border-radius: 8px;
  cursor: pointer;
}

.staff-flair-toggle input {
  width: auto;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--ember);
}

.staff-flair-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.staff-flair-toggle-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ember);
}

.staff-flair-toggle-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.staff-flair-toggle--inline {
  margin-top: 8px;
  padding: 8px 11px;
}

.staff-flair-toggle--inline span {
  font-size: 12px;
  color: var(--ember);
}

.comment-edit-input {
  width: 100%;
  margin-top: 6px;
  font-size: 13px;
}

.comment-deleted-text {
  color: var(--text-muted);
  font-style: italic;
}

.comment-replying-to {
  display: block;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
  cursor: pointer;
  text-align: left;
}

.comment-replying-to:hover {
  color: var(--ember);
}

.comment-row--highlighted {
  animation: commentHighlightFlash 1.5s ease;
}

@keyframes commentHighlightFlash {
  0%, 100% { background-color: transparent; }
  15% { background-color: rgba(226,99,46,0.15); }
}

.comment-author {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--purple);
  font-weight: 600;
  margin-right: 6px;
}

.comment-body { color: var(--text); }

.comment-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 11px;
  margin-top: 9px;
}

.comment-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 0;
  cursor: pointer;
}

.comment-reply-btn:hover { color: var(--text); }

.comment-reply-btn--danger { color: var(--danger); }

.comment-action-sep {
  color: var(--border);
  font-size: 11px;
  user-select: none;
}

.comments-replying-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--purple);
  padding: 0 16px 8px;
}

.comments-replying-bar button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.comments-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.comments-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 0.5px solid var(--border);
}

.comments-input-row input {
  flex: 1;
  margin: 0;
}

.comments-input-row button {
  background: var(--muted-ember);
  color: var(--muted-ember-text);
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* upload */
.upload-dropzone {
  width: 100%;
  min-height: 180px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  margin-top: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-dropzone--drag {
  border-color: var(--purple);
  background: rgba(124,95,160,0.08);
}

.upload-dropzone-text {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.upload-preview {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.tag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 6px 4px 12px;
  font-size: 12px;
  color: var(--text);
}

.tag-chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}

.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-suggestion {
  background: var(--surface);
  border: 0.5px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* custom modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-panel {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
}

.modal-body {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}

.modal-btn--danger {
  background: var(--danger);
  color: #fff;
  border: none;
}

.modal-btn--staff {
  background: var(--ember);
  color: var(--muted-ember-text);
  border: none;
}

/* search */
.search-section-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 16px 0 8px;
}

.search-tag-list, .search-user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-tag-btn, .search-user-btn {
  background: var(--surface);
  border: 0.5px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}

.search-tag-btn--selected {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.search-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.search-media-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
}

.media-cell-btn {
  position: absolute;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.media-cell-btn--edit { right: 32px; }
.media-cell-btn--delete { right: 4px; color: var(--danger); }

.search-media-cell img, .search-media-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* profile */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 8px;
}

.profile-avatar-row {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-avatar--sm { width: 34px; height: 34px; font-size: 13px; }

.profile-identity { min-width: 0; }

.profile-username { font-size: 16px; font-weight: 600; }

.profile-title {
  display: inline-block;
  font-size: 10px;
  background: rgba(124,95,160,0.18);
  color: var(--purple);
  border-radius: 10px;
  padding: 2px 7px;
  margin-top: 3px;
}

.role-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.role-badge--admin { color: var(--purple); }
.role-badge--mod { color: #6FD3A8; }

/* Staff username treatment. Admin and mod are SEPARATE rules — admin
   uses the theme's royal purple, mod stays iridescent. */
@keyframes staffFoilSweep {
  from { background-position: 0 50%; }
  to   { background-position: 340px 50%; }
}

.username--mod {
  background-image: linear-gradient(110deg, #E2632E 0%, #E8C15C 25%, #6FD3A8 50%, #7C5FA0 75%, #E2632E 100%);
  background-size: 340px 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: staffFoilSweep 5s linear infinite, staffHueShift 9s linear infinite;
}

/* Admin: a solid purple name with the @ carrying the motion. The name
   itself doesn't animate — an admin comment shouldn't pull the eye
   continuously, and the badge already states the role. Deliberately not
   a gradient sweep, so it can't be confused with the moderator
   treatment or a member's foil. */
.username--admin {
  color: #9B7BC4;
}

/* Platinum, and only platinum: ember belongs to mod flair and the
   premium badge, gold to the Exclusive foil. Platinum appears nowhere
   else inline, so it stays unambiguous. */
.username-at {
  display: inline-block;
  color: #DCE1EB;
  animation: adminAtTwinkle 2.6s ease-in-out infinite;
}

@keyframes adminAtTwinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .username-at { animation: none; }
}

@keyframes staffHueShift {
  from { filter: hue-rotate(0deg); }
  to   { filter: hue-rotate(360deg); }
}

/* Without animation both still read as distinctly staff, so the signal
   survives for anyone who's asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .username--mod,
  .username--admin { animation: none; }
}

.profile-bio { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.profile-link { font-size: 12px; color: var(--purple); display: block; margin-top: 4px; }

.profile-icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0.5px solid var(--border);
  background: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-stats {
  display: flex;
  gap: 16px;
  margin: 14px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.profile-stats b { color: var(--text); }

.profile-tabs {
  display: flex;
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  font-size: 12px;
}

.profile-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.profile-tab--active {
  color: var(--text);
  border-bottom-color: var(--purple);
}

#profile-tab-content { padding-top: 8px; }

.profile-follow-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}

/* notifications */
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-header h1 { margin: 0; }
.notif-header .link { margin: 0; }

.notif-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  border-bottom: 0.5px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.notif-row--unread {
  background: var(--surface);
  border-left: 3px solid var(--ember);
  padding-left: 9px;
}

.tab-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 9px;
  background: var(--ember);
  color: var(--muted-ember-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.notif-icon { color: var(--text-muted); flex-shrink: 0; }

.notif-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
}

.notif-time { font-size: 11px; color: var(--text-muted); }

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  flex-shrink: 0;
}

.notif-delete-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ember);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.notif-mark-read-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.notif-mark-read-btn:hover { color: var(--purple); }

/* support */
.ticket-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 0.5px solid var(--border);
  padding: 12px 0;
}

.ticket-row-open {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.ticket-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ticket-subject { font-size: 14px; color: var(--text); }

.ticket-status {
  font-size: 10px;
  border-radius: 10px;
  padding: 3px 9px;
  flex-shrink: 0;
  text-transform: capitalize;
}

.ticket-status--open { background: rgba(168,82,46,0.2); color: var(--muted-ember); }
.ticket-status--in_progress { background: rgba(124,95,160,0.2); color: var(--purple); }
.ticket-status--resolved { background: var(--surface-2); color: var(--text-muted); }

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.ticket-message {
  align-self: flex-start;
  max-width: 80%;
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 12px;
}

.ticket-message--mine {
  align-self: flex-end;
  background: var(--muted-ember);
}

.ticket-message--mine .ticket-message-body { color: var(--muted-ember-text); }
.ticket-message--mine .notif-time { color: rgba(245,223,211,0.7); }

.ticket-message-body { font-size: 13px; color: var(--text); }

/* admin panel */
.admin-shell {
  display: flex;
  min-height: 100%;
  position: relative;
  padding: 8px 16px 16px;
}

.admin-drawer-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  padding: 0 0 14px;
  cursor: pointer;
}

.admin-sidebar {
  width: 150px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 16px;
  border-right: 0.5px solid var(--border);
}

.admin-nav-item {
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
}

.admin-nav-item--active {
  color: var(--text);
  background: var(--surface);
  border-left-color: var(--purple);
}

.admin-content {
  flex: 1;
  min-width: 0;
  padding-left: 16px;
}

@media (max-width: 640px) {
  .admin-drawer-toggle { display: flex; }
  .admin-sidebar {
    position: fixed;
    top: 72px;
    bottom: 60px;
    left: 0;
    width: 180px;
    background: var(--bg);
    padding: 16px;
    border-right: 0.5px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 25;
  }
  .admin-sidebar--open { transform: translateX(0); }
  .admin-content { padding-left: 0; }
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.admin-stat-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 12px;
}

.admin-stat-label { font-size: 11px; color: var(--text-muted); }
.admin-stat-value { font-size: 20px; font-weight: 600; color: var(--text); margin-top: 4px; }

.admin-section-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 20px 0 8px;
}

.admin-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100px;
}

.admin-chart-bar {
  flex: 1;
  background: var(--purple);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
}

.admin-row {
  border-bottom: 0.5px solid var(--border);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.admin-row-main {
  background: none;
  border: none;
  font-size: 13px;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 0.5px solid var(--border);
  padding: 12px 0;
}

.admin-user-avatar {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}

.admin-user-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-name {
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-action {
  flex-shrink: 0;
  white-space: nowrap;
}

.admin-filter-row {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.admin-filter-btn {
  background: var(--surface);
  border: 0.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}

.admin-filter-btn--active { color: var(--text); border-color: var(--purple); }

.admin-media-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-bottom: 0.5px solid var(--border);
  padding: 10px 0;
}

.admin-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 13px;
}

.admin-media-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

.admin-media-thumb img, .admin-media-thumb video { width: 100%; height: 100%; object-fit: cover; }

.admin-media-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.admin-media-actions { display: flex; gap: 8px; margin-top: 6px; }

.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

/* initial loading state - shows instantly before any JS/data has loaded */
.initial-loading {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ember);
  animation: loadingBreathe 1.6s ease-in-out infinite;
}

@keyframes loadingBreathe {
  0%, 100% { opacity: 0.35; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .initial-loading { animation: none; opacity: 0.7; }
}

/* offline takeover */
.offline-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 32px;
  z-index: 25;
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--danger);
}

.offline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: offlinePulse 2s ease-in-out infinite;
}

.offline-icon {
  color: var(--ember);
  animation: offlineFloat 4s ease-in-out infinite;
}

.offline-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.offline-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 260px;
}

.offline-retry {
  margin-top: 6px;
  padding: 10px 28px;
  border-radius: 20px;
  border: none;
  background: var(--muted-ember);
  color: var(--muted-ember-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.offline-retry:hover { opacity: 0.9; }

@keyframes offlinePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

@keyframes offlineFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .offline-dot, .offline-icon { animation: none; }
}

/* fallback shown if the app never finishes loading */
.load-fallback {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
  z-index: 30;
}

.load-fallback a { color: var(--purple); }

/* upload progress - burns from right to left toward a fixed filter zone */
.upload-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  margin-top: 12px;
}

.upload-progress-filter {
  position: absolute;
  left: 0;
  top: 0;
  width: 20%;
  height: 100%;
  background: var(--filter);
}

.upload-progress-white {
  position: absolute;
  left: 20%;
  top: 0;
  height: 100%;
  background: #EDEAE5;
}

.upload-progress-ash {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background: #8C8680;
}

.upload-progress-ember {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--ember);
  animation: uploadEmberPulse 1.2s ease-in-out infinite;
  transition: left 0.15s ease;
}

@keyframes uploadEmberPulse {
  0%, 100% { box-shadow: 0 0 4px 1px rgba(226,99,46,0.8); }
  50% { box-shadow: 0 0 8px 3px rgba(226,99,46,1); }
}

@media (prefers-reduced-motion: reduce) {
  .upload-progress-ember { animation: none; }
}

.upload-progress-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.grid-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* profile comments section cleanup */
.profile-jump-link {
  margin-left: auto;
  background: none;
  border: none;
  font: inherit;
  font-size: 11px;
  color: var(--purple);
  cursor: pointer;
  padding: 0;
}

.profile-comments-divider {
  border-top: 1px solid var(--border);
  margin: 24px 0 0;
  scroll-margin-top: 90px;
}

.profile-comments-box {
  background: var(--surface);
  border-radius: 10px;
  padding: 4px 12px;
  margin-top: 4px;
}

.profile-comments-box .comment-row {
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
}

.profile-comments-box .comment-row:last-of-type {
  border-bottom: none;
}

/* featured post spotlight card */
.featured-post-card {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  margin: 4px 0 14px;
  background: none;
  border: 1.5px solid var(--ember);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.featured-post-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--surface-2);
  flex-shrink: 0;
  overflow: hidden;
}

.featured-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-post-label {
  color: var(--ember);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.featured-post-subtitle {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.featured-post-card--hidden {
  border: 1.5px dashed var(--ember);
  background: linear-gradient(135deg, rgba(226,99,46,0.08), rgba(41,40,44,0.4));
  cursor: default;
}

.featured-post-thumb--hidden {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ember);
}

.featured-post-card--hidden .featured-post-label { color: var(--ember); }

/* feed viewer layout + caption/description */
.feed-page-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.feed-viewer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.feed-panel {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.feed-panel-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: linear-gradient(90deg, rgba(226,99,46,0.15), rgba(185,134,87,0.08));
  border: 0.5px solid var(--ember);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.feed-panel-item-label {
  color: var(--ember);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feed-panel-item-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-callout-label {
  color: var(--ember);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.challenge-callout-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.feed-caption-box {
  flex-shrink: 0;
  max-height: 30%;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-top: none;
}

.feed-caption {
  position: relative;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  padding-left: 9px;
}

.feed-caption::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 3px;
  height: 12px;
  background: var(--ember);
  border-radius: 2px;
}

.feed-description {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  padding-left: 9px;
}

.feed-description--collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-description-toggle {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--filter);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 0 0;
  cursor: pointer;
}

.legal-link {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
  text-decoration: none;
}

.legal-link:hover { text-decoration: underline; }

.legal-link-inline {
  color: var(--purple);
  text-decoration: none;
  font-weight: 600;
}

.legal-link-inline:hover { text-decoration: underline; }

.admin-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 6px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.storage-convert-pulse {
  animation: storageConvertPulse 1.8s ease-out infinite;
}

@keyframes storageConvertPulse {
  0% { box-shadow: 0 0 0 0 rgba(226,99,46,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(226,99,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,99,46,0); }
}

@media (prefers-reduced-motion: reduce) {
  .storage-convert-pulse { animation: none; border-color: var(--ember); }
}

.storage-convert-box {
  margin-top: 10px;
  padding: 12px;
  background: var(--surface);
  border-radius: 10px;
}

.storage-convert-box p {
  font-size: 12px;
  color: var(--text);
  margin: 0 0 8px;
}

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

/* albums */
.album-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.album-card {
  background: var(--surface);
  border: none;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.album-cover {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface-2);
}

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

.album-card-info { padding: 8px; }

.album-card-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.album-card-count {
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 2px;
}

.add-posts-cell { position: relative; }

.add-posts-checkmark {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.add-posts-cell--selected {
  outline: 2px solid var(--ember);
  outline-offset: -2px;
}

.add-posts-cell--selected .add-posts-checkmark {
  background: var(--ember);
}

/* single shared indicator for NSFW-tagged media, reused across every grid/list */
.media-nsfw {
  position: relative;
  border: 2px solid var(--ember);
}

.media-nsfw::after {
  content: "18+";
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--ember);
  color: var(--muted-ember-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 4px;
  z-index: 1;
}

.feed-stage--nsfw {
  border: 2px solid var(--ember);
}

.feed-stage--nsfw::after {
  content: "18+";
  position: absolute;
  bottom: 20px;
  left: 10px;
  background: var(--ember);
  color: var(--muted-ember-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 2;
}

/* direct messages */
.dm-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 10px;
}

#dm-message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 2px;
}

.dm-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 80%;
}

.dm-message--own {
  align-items: flex-end;
  align-self: flex-end;
}

.dm-message-bubble {
  background: var(--surface);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.dm-message--own .dm-message-bubble {
  background: var(--muted-ember);
  color: var(--muted-ember-text);
}

.dm-message-image {
  max-width: 220px;
  border-radius: 10px;
  margin-top: 4px;
  cursor: pointer;
}

.dm-compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.dm-compose-row input[type="text"] {
  flex: 1;
}

.dm-icon-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dm-icon-btn:hover { color: var(--text); }

/* earned title tiers */
.title-tier-1 {
  background: none;
  color: var(--title-tier1);
  font-size: 13px;
  font-weight: 600;
}

.title-tier-2 {
  background: none;
  color: var(--ember);
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(226,99,46,0.5);
}

.title-tier-3 {
  background: none;
  font-size: 13px;
  font-weight: 700;
  background-image: linear-gradient(90deg, var(--ember), #E8C15C, var(--filter), var(--ember));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleTier3Shimmer 3s linear infinite, titleTier3Glow 2s ease-in-out infinite;
}

@keyframes titleTier3Shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes titleTier3Glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(226,99,46,0.4)); }
  50% { filter: drop-shadow(0 0 9px rgba(226,99,46,0.7)); }
}

@media (prefers-reduced-motion: reduce) {
  .title-tier-3 { animation: none; }
}

/* avatar border tiers, driven by the same tier as the equipped title */
.avatar-border-tier-1 {
  padding: 2px;
  background: var(--title-tier1);
}

.avatar-border-tier-2 {
  padding: 2.5px;
  background: var(--ember);
  box-shadow: 0 0 8px 1px rgba(226,99,46,0.5);
}

.avatar-border-tier-3 {
  padding: 3px;
  background-image: linear-gradient(120deg, var(--ember), #E8C15C, var(--filter), var(--ember), #E8C15C);
  background-size: 250% 250%;
  animation: avatarFoilSweep 3.5s linear infinite, avatarFoilPulse 2.5s ease-in-out infinite;
}

.avatar-border-tier-1 img,
.avatar-border-tier-2 img,
.avatar-border-tier-3 img,
.avatar-border-tier-1 .avatar-initials-inner,
.avatar-border-tier-2 .avatar-initials-inner,
.avatar-border-tier-3 .avatar-initials-inner {
  border-radius: 50%;
  width: 100%;
  height: 100%;
}

.avatar-border-tier-1 img,
.avatar-border-tier-2 img,
.avatar-border-tier-3 img {
  display: block;
  object-fit: cover;
}

.avatar-initials-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
  height: 100%;
}

@keyframes avatarFoilSweep {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes avatarFoilPulse {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(226,99,46,0.45); }
  50% { box-shadow: 0 0 14px 3px rgba(124,95,160,0.6); }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-border-tier-3 { animation: none; }
}

.title-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.title-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.title-picker-row--selected {
  border-color: var(--ember);
  background: var(--surface-2);
}

.title-picker-row:not(.title-picker-row--selected) .title-tier-3,
.title-picker-row:not(.title-picker-row--selected) .title-tier-4,
.title-picker-row:not(.title-picker-row--selected) .avatar-border-tier-3,
.title-picker-row:not(.title-picker-row--selected) .avatar-border-tier-4 {
  animation: none;
}

.report-history-flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  margin-top: 4px;
}

.feed-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.feed-tags-row .tag-chip {
  font: inherit;
  cursor: default;
}

.tag-chip--community {
  border-color: var(--ember);
  color: var(--ember);
}

.tag-chip--locked {
  border-color: var(--ember);
  border-width: 1.5px;
  color: var(--ember);
}

.tag-suggestion--locked {
  border-color: var(--ember);
  color: var(--ember);
}

.tag-chip--removable {
  cursor: pointer;
}

.tag-chip--add {
  cursor: pointer;
  border-style: dashed;
  color: var(--text-muted);
}

.tag-chip--add:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.report-card {
  background: var(--surface);
  border-radius: 10px;
  border-left: 3px solid var(--border);
  padding: 14px 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.report-card--severe { border-left-color: var(--danger); }
.report-card--caution { border-left-color: var(--muted-ember); }

.report-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.report-card-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.report-card-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.report-card-time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.report-category-pill {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 6px;
  padding: 3px 8px;
  text-transform: uppercase;
}

.report-card--severe .report-category-pill { color: var(--danger); }
.report-card--caution .report-category-pill { color: var(--muted-ember); }

.report-card-content {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
}

.report-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-claim-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.report-claim-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.report-claim-btn--claimed {
  background: rgba(226,99,46,0.12);
  border-color: var(--ember);
  color: var(--ember);
}

.report-card-actions {
  display: flex;
  gap: 8px;
}

.feed-admin-delete-btn {
  margin-left: 0;
  color: var(--ember);
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 10px;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-feed {
  width: 100%;
  height: 60vh;
  max-height: 520px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.skeleton-grid .skeleton {
  aspect-ratio: 1;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

#auth-toggle {
  color: var(--ember);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 18px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.toggle-row-text { flex: 1; min-width: 0; }

.toggle-row-label {
  font-size: 13px;
  color: var(--text);
  display: block;
}

.toggle-row-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  transition: background 0.15s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--ember);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: #17171A;
}

.settings-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.settings-card-title {
  font-size: 12px;
  color: var(--ember);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.settings-card-title--muted { color: var(--text-muted); }

.img-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.img-fullscreen-overlay img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  border-radius: 4px;
}

.img-fullscreen-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(30,28,26,0.75);
  color: var(--ember);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.img-fullscreen-zoom-controls {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 1;
}

.img-fullscreen-zoom-controls button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30,28,26,0.75);
  color: var(--ember);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.img-fullscreen-zoom-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* membership tiers */
.membership-head {
  text-align: center;
  margin-bottom: 20px;
}

.membership-head h1 { margin-bottom: 6px; }

.membership-head p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* Three side-by-side cards need far more room than the 480px the feed
   and profile screens use. */
.screen--wide { max-width: 940px; }

.membership-tiers {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

/* Below roughly two comfortable card widths there isn't room for three
   columns, so they stack with the recommended tier first. */
@media (max-width: 720px) {
  .membership-tiers { flex-direction: column; }
  .membership-tier--premium { order: -1; }
}

.membership-tier {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Optional tier artwork. Hidden entirely if the file is missing, so a
   card without one doesn't leave a gap. */
.membership-art {
  width: 100%;
  max-width: 110px;
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
}

.membership-tier--premium {
  border: 1px solid var(--ember);
  background: linear-gradient(180deg, rgba(226,99,46,0.07), var(--surface) 55%);
}

.membership-tier--exclusive {
  border: 1px solid var(--filter);
  background: linear-gradient(180deg, rgba(185,134,87,0.08), var(--surface) 55%);
}

.membership-tier--active { box-shadow: inset 0 0 0 1px var(--neutral-highlight); }

.membership-ribbon {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ember);
  color: var(--muted-ember-text);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.membership-name {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.membership-name--premium { color: var(--ember); }

.membership-name--exclusive {
  background-image: linear-gradient(110deg, #E2632E, #C87A42 18%, #EDEAE5 34%, #FFFFFF 42%, #EDEAE5 50%, #B98657 68%, #E2632E);
  background-size: 300px 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: membershipFoil 6s linear infinite;
}

@keyframes membershipFoil {
  from { background-position: 0 50%; }
  to { background-position: 300px 50%; }
}

.membership-price {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 2px;
}

.membership-price small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.membership-tagline {
  font-size: 11px;
  color: var(--text-muted);
  min-height: 30px;
  line-height: 1.45;
}

.membership-features {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  flex: 1;
}

.membership-features li {
  font-size: 12px;
  color: var(--text);
  padding: 6px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.4;
}

.membership-tick {
  color: var(--ember);
  flex-shrink: 0;
  margin-top: 1px;
  display: inline-flex;
}

.membership-inherits {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 0 2px;
  border-top: 0.5px solid var(--border);
  margin-top: 10px;
}

.membership-btn {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: not-allowed;
}

.membership-btn--current {
  background: var(--surface-2);
  color: var(--text-muted);
}

.membership-btn--premium {
  background: var(--ember);
  color: var(--muted-ember-text);
  opacity: 0.65;
}

.membership-btn--exclusive {
  background: var(--filter);
  color: var(--muted-ember-text);
  opacity: 0.65;
}

.membership-soon {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 7px;
}

.membership-footnote {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 22px;
  line-height: 1.5;
}

/* three columns can't fit a phone — stack, with the recommended tier first */
@media (max-width: 700px) {
  .membership-tiers { flex-direction: column; }
  .membership-tier--premium { order: -1; }
}

/* Member username foils. All share the sweep animation and clipping;
   only the gradient differs, so retuning a colour is a one-line change.
   The 8 solids are Premium; logo/gold/rainbow are Exclusive. */
.username--style-ember,
.username--style-silver,
.username--style-teal,
.username--style-rose,
.username--style-bronze,
.username--style-azure,
.username--style-jade,
.username--style-logo,
.username--style-gold,
.username--style-rainbow {
  background-size: 340px 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: staffFoilSweep 5s linear infinite;
}

.username--style-ember   { background-image: linear-gradient(110deg,#B8481C 0%,#E2632E 25%,#FFD9B8 40%,#E2632E 55%,#B8481C 100%); }
.username--style-silver  { background-image: linear-gradient(110deg,#6E6C68 0%,#C4C0BA 25%,#FFFFFF 40%,#C4C0BA 55%,#6E6C68 100%); }
.username--style-teal    { background-image: linear-gradient(110deg,#2A7A5E 0%,#6FD3A8 25%,#E0FFF2 40%,#6FD3A8 55%,#2A7A5E 100%); }
.username--style-rose    { background-image: linear-gradient(110deg,#9E3A4A 0%,#E88C9A 25%,#FFE8EC 40%,#E88C9A 55%,#9E3A4A 100%); }
.username--style-bronze  { background-image: linear-gradient(110deg,#7A5433 0%,#B98657 25%,#F4E4D0 40%,#B98657 55%,#7A5433 100%); }
.username--style-azure   { background-image: linear-gradient(110deg,#2A5E7A 0%,#7CB8E8 25%,#E4F4FF 40%,#7CB8E8 55%,#2A5E7A 100%); }
.username--style-jade    { background-image: linear-gradient(110deg,#2F6B4F 0%,#9FE07C 25%,#F0FFE4 40%,#9FE07C 55%,#2F6B4F 100%); }

.username--style-logo    { background-image: linear-gradient(110deg,#E2632E 0%,#C87A42 16%,#EDEAE5 32%,#FFFFFF 40%,#EDEAE5 48%,#B98657 66%,#E2632E 100%); }
.username--style-gold    { background-image: linear-gradient(110deg,#8A6A1F 0%,#E8C15C 25%,#FFF8E0 40%,#E8C15C 55%,#8A6A1F 100%); }
.username--style-rainbow { background-image: linear-gradient(110deg,#E2632E 0%,#E8C15C 18%,#FFFFFF 32%,#6FD3A8 46%,#7CB8E8 62%,#7C5FA0 78%,#E2632E 100%); }

@media (prefers-reduced-motion: reduce) {
  [class*="username--style-"] { animation: none; }
}

.role-badge--premium { color: var(--ember); }
.role-badge--exclusive { color: #B98657; }

/* Style selector in settings */
.style-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.style-swatch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.style-swatch--selected { border-color: var(--ember); }

.style-swatch--locked {
  cursor: default;
  opacity: 0.45;
}

.style-swatch-lock {
  position: absolute;
  top: 4px;
  right: 5px;
  color: var(--text-muted);
}

.style-picker-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
}

/* Plain username colours — a flat colour with no gradient or motion,
   for members who want a coloured name without the foil shine. */
.username--style-plain-ember  { color: #E2632E; }
.username--style-plain-silver { color: #C4C0BA; }
.username--style-plain-teal   { color: #6FD3A8; }
.username--style-plain-rose   { color: #E88C9A; }
.username--style-plain-bronze { color: #B98657; }
.username--style-plain-azure  { color: #7CB8E8; }
.username--style-plain-jade   { color: #9FE07C; }

/* Section labels in the style picker */
.style-picker-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 2px;
}

/* Titles reference */
.titles-ref-tier {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 6px;
}

.titles-ref-tier:first-child { margin-top: 0; }

.titles-ref-row {
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
  opacity: 0.55;
}

.titles-ref-row--unlocked { opacity: 1; }

.titles-ref-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.titles-ref-check {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ember);
}

.titles-ref-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.titles-ref-progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  margin-top: 7px;
  overflow: hidden;
}

.titles-ref-progress-bar {
  height: 100%;
  background: var(--muted-ember);
  border-radius: 2px;
}

.titles-ref-progress-text {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Byline: username, role badge, then the caption on one line. Moved off
   the image overlay, which was getting crowded once badges, staff
   controls, share and report all shared that row — and would overlap
   badly with a long username. */
.feed-byline {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  margin-bottom: 6px;
  padding-left: 9px;
}

/* In the byline the username is plain text, not the pill it needed
   when it sat over the image. It shrinks before the caption does, so a
   long name truncates rather than pushing the caption off the line.

   background-COLOR, not the `background` shorthand: the shorthand also
   resets background-image and background-clip, which wipes out the
   staff/member foil styles. Those set -webkit-text-fill-color to
   transparent and rely on clipping a gradient to the glyphs, so losing
   the gradient leaves the name invisible rather than unstyled. */
.feed-byline .feed-username {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-weight: 700;
  flex-shrink: 1;
  min-width: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-byline .feed-caption {
  margin-bottom: 0;
  padding-left: 0;
  font-weight: 400;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The caption's accent bar is for when it sits as its own block. Inline
   next to the username it just reads as a stray mark. */
.feed-byline .feed-caption::before {
  display: none;
}

.feed-byline-sep {
  color: var(--border);
  flex-shrink: 0;
}

.feed-byline .role-badge { flex-shrink: 0; }

/* Failed-query state — distinct from an empty one, so a fault doesn't
   read as "there's nothing here". */
.query-error {
  padding: 16px;
  text-align: center;
}

.query-error-msg {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Tappable favourite count, shown on your own posts */
.feed-action-count--btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fav-by-locked {
  padding: 14px;
  background: rgba(226,99,46,0.08);
  border: 1px solid var(--ember);
  border-radius: 8px;
  text-align: center;
}

.fav-by-locked p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Tier 4 — rare. Platinum: a slow drift across a cool neutral with a
   soft outer glow.
   
   Deliberately NOT purple. Purple is reserved for admin usernames and
   the admin comment flair, and a title sharing that colour would blur a
   role signal into a cosmetic one. It also avoids ember and bronze so
   it can't be read as a louder tier 2 or 3, and avoids teal/azure since
   those are premium foil colours. */
@keyframes titleTier4Drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes titleTier4Glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(220,225,235,0.4)); }
  50% { filter: drop-shadow(0 0 8px rgba(220,225,235,0.9)); }
}

.title-tier-4 {
  background: none;
  font-size: 13px;
  font-weight: 700;
  background-image: linear-gradient(100deg, #8A8F99, #DCE1EB, #FFFFFF, #DCE1EB, #8A8F99);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: titleTier4Drift 7s ease-in-out infinite, titleTier4Glow 3s ease-in-out infinite;
}

.avatar-border-tier-4 {
  padding: 3px;
  background-image: linear-gradient(100deg, #8A8F99, #DCE1EB, #FFFFFF, #DCE1EB, #8A8F99);
  background-size: 220% 220%;
  animation: titleTier4Drift 7s ease-in-out infinite, titleTier4Glow 3s ease-in-out infinite;
}

.avatar-border-tier-4 img,
.avatar-border-tier-4 .avatar-initials-inner {
  border-radius: 50%;
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .title-tier-4,
  .avatar-border-tier-4 { animation: none; }
}

/* Codex preview — the title rendered in its own tier styling, with the
   avatar border it grants shown alongside it. */
.titles-ref-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.titles-ref-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.titles-ref-swatch-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface-2);
}

.titles-ref-row--locked .titles-ref-preview { opacity: 0.5; }

/* Locked titles preview their colour but hold still. With ~29 titles
   listed, animating every one is noise — and it means unlocking a tier
   3 or 4 title visibly does something. */
.titles-ref-row--locked .title-tier-3,
.titles-ref-row--locked .title-tier-4,
.titles-ref-row--locked .avatar-border-tier-3,
.titles-ref-row--locked .avatar-border-tier-4 {
  animation: none;
}

/* ---------------- challenge screen ---------------- */
.challenge-hero {
  background: linear-gradient(180deg, rgba(226,99,46,0.12), var(--surface) 70%);
  border: 1px solid var(--ember);
  border-radius: 12px;
  padding: 16px;
}

.challenge-hero-label {
  font-size: 10px;
  color: var(--ember);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.challenge-hero-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 600;
  margin: 5px 0 6px;
}

.challenge-hero-prompt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 11px;
}

.challenge-hero-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.challenge-hero-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.chip-tag {
  font-size: 12px;
  background: var(--surface-2);
  border: 0.5px solid var(--ember);
  color: var(--ember);
  border-radius: 20px;
  padding: 4px 11px;
}

.challenge-section-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 22px 0 9px;
}

.challenge-example-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.challenge-example {
  aspect-ratio: 1;
  border: 1.5px solid var(--ember);
  border-radius: 8px;
  overflow: hidden;
}

.challenge-example img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.challenge-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.challenge-empty b { color: var(--ember); }

.challenge-see-all {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--ember);
  margin-top: 9px;
}

/* board-style comments — richer than a post's, for a shared thread */
.comment-row--board {
  display: flex;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 0;
}

.comment-board-body { flex: 1; min-width: 0; }

.comment-board-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.comment-row--board .comment-body {
  display: block;
  margin-top: 4px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* suggestions */
.suggestion-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.suggestion-input-row input { flex: 1; min-width: 0; }
.suggestion-input-row .modal-btn { width: auto; flex-shrink: 0; padding: 10px 16px; }

.suggestion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--border);
}

.suggestion-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}

.suggestion-vote--on {
  border-color: var(--ember);
  color: var(--ember);
}

.suggestion-vote:disabled { cursor: default; opacity: 0.5; }
.suggestion-vote-arrow { font-size: 9px; line-height: 1; }
.suggestion-vote-count { font-size: 12px; font-weight: 700; }

.suggestion-text {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.suggestion-by {
  background: none;
  border: none;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

/* A dismissed suggestion stays listed as a record of what was
   considered, but recedes so the live ones read first. */
.admin-row--dismissed { opacity: 0.5; }

/* Tag chips in the feed modal: the label searches, the × removes. */
.tag-chip-search {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 6px;
}

.tag-chip-remove:hover { color: var(--danger); }

/* While the full-resolution image is still downloading, the 480px
   thumbnail is on screen. A slight blur hides its softness and makes
   the swap read as sharpening rather than as a second image loading. */
.feed-media--loading {
  filter: blur(1.5px);
  transition: filter 0.25s ease;
}

/* Global image-load-failure placeholder. object-fit forced to contain
   so the fallback icon is never cropped, regardless of what fit the
   original element used. */
.img-load-failed {
  object-fit: contain !important;
}
