/* Rhinoly Design System — social-first, not SaaS */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Pure neutral backgrounds — no purple/peach/violet undertones */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-elevated: #222222;
  /* Orange-only accents */
  --gradient-brand: linear-gradient(135deg, #e8750a 0%, #ff8c00 100%);
  --gradient-warm: linear-gradient(135deg, #cc6600 0%, #e8750a 100%);
  --gradient-surface: linear-gradient(135deg, #161616 0%, #222222 100%);
  --text-primary: #eeeeee;
  --text-secondary: #999999;
  --text-muted: #666666;
  --accent-primary: #e8750a;
  --accent-orange: #e8750a;
  --accent-orange-light: #ff8c00;
  --accent-orange-dark: #cc6600;
  --accent-link: #ff8c00;
  --border-subtle: rgba(232, 117, 10, 0.15);
  --border-orange: rgba(232, 117, 10, 0.35);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
  --glow-orange: 0 0 12px rgba(232, 117, 10, 0.45);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --nav-height: 62px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
}

@media (min-width: 768px) {
  .app-shell {
    padding-bottom: 24px;
    display: grid;
    grid-template-columns: 240px 1fr 320px;
    gap: 0;
    max-width: 1280px;
    margin: 0 auto;
  }
}

/* ===== TOP HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .app-header { grid-column: 1 / -1; }
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-orange);
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  transition: background var(--transition);
}

.header-icon-btn:hover,
.header-icon-btn:active {
  background: var(--bg-elevated);
}

.header-icon-btn svg {
  width: 24px;
  height: 24px;
}

.signal-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent-orange);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* ===== DESKTOP SIDEBAR ===== */
.sidebar-nav {
  display: none;
}

@media (min-width: 768px) {
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 4px;
    position: sticky;
    top: var(--header-height);
    height: calc(100dvh - var(--header-height));
    border-right: 1px solid var(--border-subtle);
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all var(--transition);
  }

  .sidebar-link svg { width: 24px; height: 24px; flex-shrink: 0; }

  .sidebar-link:hover { background: var(--bg-elevated); color: var(--text-primary); }
  .sidebar-link.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
  }
  .sidebar-link.active svg { color: var(--accent-orange); }

  .sidebar-spacer { flex: 1; min-height: 16px; }

  .sidebar-link-logout {
    color: var(--text-muted);
    margin-top: 8px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
    border-radius: 0;
  }

  .sidebar-link-logout:hover {
    color: var(--accent-orange-light);
    background: rgba(232, 117, 10, 0.1);
  }
}

/* ===== MOBILE BOTTOM NAV (Instagram-style) ===== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
}

@media (min-width: 768px) {
  .mobile-bottom-nav { display: none; }
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  transition: color var(--transition), transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 6px 0;
  min-height: 44px;
  position: relative;
}

.nav-item:active { transform: scale(0.92); }

.nav-item svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.75;
  transition: all var(--transition);
}

.nav-item span.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

.nav-item.active { color: var(--text-primary); }
.nav-item.active svg { stroke: var(--accent-orange); fill: none; }

.nav-item.nav-create .nav-create-btn {
  width: 44px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
}

.nav-item.nav-create .nav-create-btn svg {
  width: 22px;
  height: 22px;
  stroke: white;
  stroke-width: 2.5;
}

.nav-item .nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  background: var(--accent-orange);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .main-content {
    grid-column: 2;
    max-width: none;
    padding: 24px 20px;
  }
}

.right-panel {
  display: none;
}

@media (min-width: 768px) {
  .right-panel {
    display: block;
    grid-column: 3;
    padding: 24px 16px;
    position: sticky;
    top: var(--header-height);
    height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    border-left: 1px solid var(--border-subtle);
  }
}

/* ===== POST CARD ===== */
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-elevated);
  border: 2px solid transparent;
  background-image: none;
  border: 2px solid var(--accent-orange);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 80px; height: 80px; }

.post-author-name { font-weight: 700; font-size: 0.9rem; }
.post-author-handle { color: var(--text-secondary); font-size: 0.8rem; }

.post-quote-text {
  padding: 12px 16px 0;
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
}

.post-content-text {
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
}

.post-media-wrap {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
}

.post-media-wrap img,
.post-media-wrap video {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.post-overlay-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 0 2px rgba(0,0,0,0.9);
  pointer-events: none;
  white-space: pre-wrap;
  text-align: center;
  max-width: 90%;
  word-break: break-word;
  line-height: 1.3;
  z-index: 2;
}

.embedded-post {
  margin: 12px 16px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
}

a.embedded-post-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

a.embedded-post-link:hover {
  border-color: rgba(255, 107, 0, 0.35);
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.1);
}

a.embedded-post-link:active {
  transform: scale(0.995);
}

.embedded-post-text {
  padding: 0 12px 8px;
  font-size: 0.85rem;
}

.post-actions {
  display: flex;
  align-items: center;
  padding: 10px 16px 14px;
  gap: 4px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}

.action-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.action-btn.liked {
  color: var(--accent-orange-light);
}
.action-btn.liked svg {
  stroke: var(--accent-orange-light);
  filter: drop-shadow(0 0 6px rgba(232, 117, 10, 0.5));
}
.action-btn.save-btn {
  margin-left: auto;
  padding: 8px 10px;
}
.action-btn.saved {
  color: var(--accent-orange);
}
.action-btn.saved svg {
  stroke: var(--accent-orange);
  fill: var(--accent-orange);
  filter: drop-shadow(0 0 8px rgba(232, 117, 10, 0.45));
}
.action-btn svg { width: 22px; height: 22px; transition: all var(--transition); }

.hashtag-link, .mention-link { color: var(--accent-orange-light); font-weight: 600; }

/* ===== COMPOSER / UPLOAD UI ===== */
.composer-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.composer-overlay.open { display: flex; }

.composer-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.composer-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.composer-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.composer-body { padding: 20px; overflow-y: auto; flex: 1; }

.post-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.post-type-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.post-type-tab.active {
  background: rgba(232, 117, 10, 0.15);
  color: var(--accent-orange);
  border-color: rgba(232, 117, 10, 0.3);
}

/* Custom file upload — NO default "Choose File" */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  margin-bottom: 16px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-orange);
  background: rgba(232, 117, 10, 0.06);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  font-size: 16px;
  z-index: 3;
}

.upload-zone-icon,
.upload-zone-title,
.upload-zone-sub {
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.upload-zone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: var(--accent-orange);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone-icon svg { width: 28px; height: 28px; color: white; }
.upload-zone-title { font-weight: 700; margin-bottom: 4px; }
.upload-zone-sub { color: var(--text-secondary); font-size: 0.85rem; }

.media-preview-box {
  display: none;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  background: #000;
}

.media-preview-box.visible { display: block; }

.media-preview-simple {
  display: none;
  position: relative;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-subtle);
}

.media-preview-simple.visible { display: block; }

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

.overlay-toggle-btn {
  display: block;
  margin: 0 0 16px;
  width: 100%;
}

.overlay-draggable-text[hidden] {
  display: none !important;
}

.media-preview-box img,
.media-preview-box video {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.media-preview-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* Text overlay editor */
.overlay-editor {
  display: none;
  margin-bottom: 16px;
}

.overlay-editor.visible { display: block; }

.overlay-canvas-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  touch-action: none;
}

.overlay-canvas-wrap img,
.overlay-canvas-wrap video {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.overlay-draggable-text {
  position: absolute;
  cursor: grab;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  user-select: none;
  transform: translate(-50%, -50%);
  max-width: 90%;
  text-align: center;
  word-break: break-word;
  z-index: 5;
  padding: 4px 8px;
  touch-action: none;
}

.overlay-draggable-text:active { cursor: grabbing; }

.overlay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
}

.overlay-controls label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.overlay-controls input[type="text"],
.overlay-controls input[type="range"],
.overlay-controls input[type="color"] {
  width: 100%;
}

.overlay-controls input[type="text"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.control-group { flex: 1; min-width: 100px; }

.rhino-input,
.rhino-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color var(--transition);
  margin-bottom: 16px;
}

.rhino-input:focus,
.rhino-textarea:focus {
  outline: none;
  border-color: var(--accent-orange);
}

.rhino-textarea { min-height: 100px; }

.rhino-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition);
  width: 100%;
}

.rhino-btn-primary {
  background: var(--accent-orange);
  color: white;
  box-shadow: none;
}

.rhino-btn-primary:hover { background: var(--accent-orange-dark); }
.rhino-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.rhino-btn-primary.is-muted { opacity: 0.55; }

.rhino-btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.rhino-btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  width: auto;
}

/* ===== FLUX INBOX ===== */
.flux-inbox-page { padding-bottom: 8px; }

.flux-inbox-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.flux-inbox-list { display: flex; flex-direction: column; gap: 8px; }

.flux-inbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.flux-inbox-row:active { transform: scale(0.985); }

.flux-inbox-row--unread {
  background: linear-gradient(90deg, rgba(255, 107, 0, 0.08) 0%, var(--bg-card) 48%);
  border-color: rgba(255, 107, 0, 0.22);
}

.flux-inbox-body { flex: 1; min-width: 0; }

.flux-inbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.flux-inbox-name {
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flux-inbox-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.flux-inbox-preview {
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.flux-inbox-row--unread .flux-inbox-preview {
  color: var(--text-primary);
  font-weight: 500;
}

.flux-unread-badge {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: var(--accent-orange);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.35);
  animation: fluxBadgeIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.flux-unread-badge--hidden {
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  min-width: 0;
  width: 0;
  padding: 0;
  overflow: hidden;
}

.flux-unread-badge--clearing {
  opacity: 0;
  transform: scale(0.6);
}

@keyframes fluxBadgeIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== FLUX CHAT ===== */
.flux-chat-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.flux-chat-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.flux-chat-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.flux-chat-header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.flux-auto-save-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.flux-auto-save-btn[aria-pressed="true"] {
  color: var(--accent-orange);
  border-color: rgba(255, 107, 0, 0.35);
}

.flux-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 10px 8px 4px;
  margin-left: -4px;
  border-radius: var(--radius-md);
  color: var(--accent-orange);
  font-size: 0.9rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.flux-back-btn:active { background: var(--bg-elevated); opacity: 0.85; }

.flux-back-btn svg { flex-shrink: 0; }

.flux-chat-partner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.flux-chat-partner-text {
  min-width: 0;
  overflow: hidden;
}

.flux-chat-partner-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flux-chat-partner-handle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.flux-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--header-height) - var(--nav-height) - var(--safe-bottom));
}

@media (min-width: 768px) {
  .flux-chat-container { height: calc(100dvh - var(--header-height) - 40px); }
}

.flux-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: auto;
  overflow-anchor: auto;
}

.flux-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.flux-bubble.mine {
  align-self: flex-end;
  background: var(--accent-orange);
  color: white;
  border-bottom-right-radius: 4px;
}

.flux-bubble.theirs {
  align-self: flex-start;
  background: var(--bg-elevated);
  border-bottom-left-radius: 4px;
}

.flux-bubble-media img,
.flux-bubble-media video {
  border-radius: 12px;
  max-width: 220px;
  margin-top: 4px;
}

/* Flux media composer bar */
.flux-composer {
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
}

.flux-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.flux-composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.flux-voice-btn.active,
.flux-voice-btn.is-recording {
  color: var(--accent-orange);
  background: rgba(255, 107, 0, 0.22);
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.35);
}

.flux-inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.flux-inbox-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 0 8px;
}

.flux-groups-rings-wrap {
  margin-bottom: 8px;
}

.flux-groups-rings-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.flux-groups-rings-scroll::-webkit-scrollbar { display: none; }

.flux-group-ring {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}

.flux-group-ring:active {
  transform: scale(0.96);
}

.flux-group-ring-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), #ff9a3c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 2px rgba(255, 107, 44, 0.35);
}

.flux-group-ring-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.flux-group-ring-preview {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.flux-group-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-orange), #ff9a3c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.flux-group-avatar--lg { width: 40px; height: 40px; font-size: 1rem; }
.flux-group-avatar--xl { width: 72px; height: 72px; font-size: 1.6rem; margin: 0 auto 12px; }

.flux-create-group { max-width: 560px; }
.flux-create-header { margin-bottom: 20px; }
.flux-create-header h1 { font-size: 1.4rem; font-weight: 800; margin-top: 8px; }
.flux-create-form .rhino-label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 0.85rem; }
.flux-create-section { font-size: 1rem; font-weight: 700; margin: 24px 0 8px; }
.flux-create-subsection { font-size: 0.88rem; font-weight: 600; margin: 18px 0 8px; color: var(--text-secondary); }
.flux-create-hint { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 10px; }
.flux-member-pick-list { display: flex; flex-direction: column; gap: 8px; }
.flux-member-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}
.flux-member-pick input { flex-shrink: 0; }
.flux-member-pick span { display: flex; flex-direction: column; min-width: 0; }
.flux-member-pick small { color: var(--text-secondary); font-size: 0.78rem; }
.flux-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.flux-search-row .rhino-input { flex: 1; }
.flux-create-submit { width: 100%; margin-top: 24px; }

.flux-group-sender {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-orange);
  margin-bottom: 4px;
}

.flux-group-info { max-width: 520px; }
.flux-group-info-hero { text-align: center; margin: 20px 0 28px; }
.flux-group-info-desc { color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }
.flux-group-info-desc--empty { font-style: italic; opacity: 0.7; }
.flux-group-add-members { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.08)); }
.flux-group-info-section { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }
.flux-group-member-list { display: flex; flex-direction: column; gap: 8px; }
.flux-group-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.flux-group-member-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.flux-group-member-link span { display: block; font-size: 0.78rem; color: var(--text-secondary); }
.flux-group-member-link strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flux-member-remove-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.flux-leave-group-btn {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  font-weight: 700;
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.35);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.flux-group-info-admin { margin-bottom: 20px; }
.flux-group-info-edit-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.flux-group-info-edit-form .rhino-input { width: 100%; }

/* Group invite page */
.flux-group-invite-page { max-width: 480px; margin: 0 auto; padding: 16px; }
.flux-group-invite-card,
.flux-invite-card {
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-align: center;
}
.flux-invite-label,
.flux-invite-type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin-bottom: 12px;
}
.flux-invite-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 20px;
  word-break: break-word;
}
.flux-invite-user-link { color: var(--accent-orange); font-weight: 700; text-decoration: none; }
.flux-invite-group-name {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
}
.flux-invite-from {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.flux-invite-from a {
  color: var(--accent-orange);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}
.flux-invite-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.flux-invite-actions .rhino-btn { min-width: 120px; }

/* Notification rows for group invites */
.flux-group-invite-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}
.flux-group-invite-body { flex: 1; min-width: 0; }
.flux-invite-notif-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin: 0 0 4px;
}
.flux-invite-notif-label--non-fellow,
.flux-invite-label--non-fellow { color: #b07ce8; }
.flux-invite-notif-group {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 0 0 4px;
}
.flux-invite-notif-from {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 10px;
}
.flux-invite-notif-from a { color: var(--accent-orange); font-weight: 700; text-decoration: none; }
.flux-group-invite-row .flux-req-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.flux-group-edit-form,
.flux-group-info-edit-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; text-align: left; }
.flux-group-edit-form .rhino-input,
.flux-group-info-edit-form .rhino-input { width: 100%; }

.flux-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
  list-style: none;
}
.flux-lb-row:last-child { border-bottom: none; }
.flux-lb-rank { width: 24px; font-weight: 800; color: var(--accent-orange); text-align: center; flex-shrink: 0; }
.flux-lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.flux-lb-pts,
.flux-lb-points { font-weight: 800; color: var(--accent-orange); flex-shrink: 0; }
.flux-lb-empty { text-align: center; color: var(--text-secondary); padding: 16px; list-style: none; }

.comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.comment-react-btn,
.comment-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  background: transparent;
  border: none;
}

.comment-react-btn.is-active { color: var(--accent-orange); }
.comment-dislike-btn.is-active { color: #e74c3c; }
.comment-reply-btn { color: var(--text-secondary); }

.comment-replies {
  margin-left: 36px;
  padding-left: 12px;
  border-left: 2px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item--reply .avatar { width: 28px; height: 28px; }

.comment-reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  font-size: 0.85rem;
}

.comment-reply-cancel {
  border: none;
  background: transparent;
  color: var(--accent-orange);
  font-weight: 600;
  font-size: 0.8rem;
}


.flux-attach-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
}

.flux-attach-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.flux-input-wrap { flex: 1; }

.flux-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: none;
  max-height: 100px;
}

.flux-send-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--accent-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform var(--transition), opacity var(--transition);
}

.flux-send-btn:disabled { opacity: 0.4; transform: none; }
.flux-send-btn:not(:disabled):active { transform: scale(0.92); }

/* Media preview strip before send */
.flux-media-preview {
  display: none;
  margin-bottom: 10px;
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 2px solid var(--accent-orange);
  position: relative;
}

.flux-media-preview.visible { display: flex; align-items: center; gap: 12px; }

.flux-media-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
}

.flux-media-preview-info { flex: 1; }
.flux-media-preview-info p { font-size: 0.85rem; font-weight: 600; }
.flux-media-preview-info span { font-size: 0.75rem; color: var(--text-secondary); }

.flux-media-preview-actions {
  display: flex;
  gap: 8px;
}

.flux-media-preview-send {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--accent-orange);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.flux-media-preview-cancel {
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 50% -10%, rgba(232, 117, 10, 0.18) 0%, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  border: 1px solid rgba(232, 117, 10, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-orange-light);
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 0.9rem;
}

.form-group { margin-bottom: 16px; }
.profile-email-card {
  margin-bottom: 28px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}
.profile-email-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
}
.profile-email-hint,
.profile-email-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 12px;
}
.profile-email-status--ok { color: var(--accent-orange-light); }
.profile-email-status--pending { color: #c9a227; }
.profile-email-form .form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.flash-messages { padding: 0 16px; max-width: 600px; margin: 0 auto; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}
.flash-success { background: rgba(232, 117, 10, 0.12); color: var(--accent-orange-light); }
.flash-danger { background: rgba(204, 102, 0, 0.15); color: var(--accent-orange); }
.flash-warning { background: rgba(255, 140, 0, 0.15); color: var(--accent-orange-light); }
.flash-info { background: rgba(232, 117, 10, 0.15); color: var(--accent-orange-light); }

/* ===== PULSE ===== */
.pulse-header {
  margin-bottom: 24px;
}

.pulse-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-orange);
}

.trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.trend-tag {
  padding: 8px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-orange);
  border: 1px solid rgba(232, 117, 10, 0.25);
  transition: all var(--transition);
}

.trend-tag:hover { background: rgba(232, 117, 10, 0.12); }

/* ===== PROFILE ===== */
.profile-cover {
  height: 160px;
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

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

.profile-info {
  padding: 0 16px 20px;
  margin-top: -40px;
  position: relative;
}

.profile-stats {
  display: flex;
  gap: 24px;
  margin: 16px 0;
}

.stat-item { text-align: center; }
.stat-value { font-weight: 800; font-size: 1.1rem; }
.stat-label { font-size: 0.75rem; color: var(--text-secondary); }

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-logout-btn {
  color: var(--text-muted);
}

.profile-logout-btn:hover {
  color: var(--accent-orange-light);
  background: rgba(232, 117, 10, 0.12);
}

/* ===== NOTIFICATIONS ===== */
.notif-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-full);
}

.notif-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.notif-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: background var(--transition);
}

.notif-item.unread { border-left: 3px solid var(--accent-orange); }

.notif-avatar-link { flex-shrink: 0; }

.notif-body-link {
  flex: 1;
  min-width: 0;
  display: block;
  color: inherit;
}

/* ===== SEARCH ===== */
.search-bar-wrap {
  margin-bottom: 20px;
}

.search-bar {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 12px 20px 12px 44px;
  color: var(--text-primary);
  font-size: 0.95rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23999999' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
}

.search-bar:focus { outline: none; border-color: var(--accent-orange); }

.search-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 8px;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

/* ===== LIKE / SAVE ENHANCED ===== */
.like-btn.liked .like-count { color: var(--accent-orange-light); }

/* ===== COMMENTS ===== */
.comments-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.comments-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comments-count {
  background: var(--bg-elevated);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.comments-list { margin-bottom: 20px; }
.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border: 1px solid var(--border-subtle);
}

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

.comment-item .comment-delete-btn {
  margin-left: auto;
  margin-top: 4px;
}
.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 4px;
}
.comment-meta span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.comment-text {
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}
.comment-form { margin-top: 8px; }
.comment-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.comment-form-actions .comment-submit-btn { margin-left: auto; }
.comment-input { min-height: 72px; margin-bottom: 12px; }

.comment-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.comment-attach-btn:hover,
.comment-attach-btn:active,
.comment-voice-btn.active {
  color: var(--accent-orange);
  border-color: rgba(255, 107, 0, 0.35);
  background: rgba(255, 107, 0, 0.08);
}

.comment-attach-btn input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.comment-media img {
  max-width: 220px;
  border-radius: 12px;
  display: block;
  margin-top: 6px;
}

@keyframes commentPhotoIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.comments-empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 16px;
  text-align: center;
}

/* ===== VOICE RECORDING ===== */
.voice-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
}
.voice-record-btn.active,
.voice-record-btn:active {
  background: rgba(232, 117, 10, 0.15);
  border-color: var(--accent-orange);
  color: var(--accent-orange-light);
}
.voice-record-lg {
  width: 100%;
  justify-content: center;
  padding: 20px;
  flex-direction: column;
  border-radius: var(--radius-md);
}
.voice-recording-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}
.voice-recording-status.recording {
  color: var(--accent-orange-light);
  font-weight: 600;
  animation: pulse-rec 1s infinite;
}
@keyframes pulse-rec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.audio-player-wrap {
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}
.audio-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
}
.rhino-audio {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-full);
}
.rhino-audio-sm { max-width: 260px; }

/* ===== SAVED COLLECTION ===== */
.saved-page { max-width: 680px; margin: 0 auto; }
.saved-header { margin-bottom: 24px; }
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}
.saved-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
@media (min-width: 480px) {
  .saved-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}
.saved-grid-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  display: block;
}
.saved-grid-item img,
.saved-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.saved-grid-text {
  width: 100%;
  height: 100%;
  padding: 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-elevated);
}
.saved-grid-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 60%, rgba(0,0,0,0.7));
  display: flex;
  align-items: flex-end;
  padding: 8px;
  opacity: 0;
  transition: opacity var(--transition);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}
.saved-grid-item:hover .saved-grid-overlay,
.saved-grid-item:active .saved-grid-overlay { opacity: 1; }
.saved-grid-video { position: relative; width: 100%; height: 100%; }
.saved-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.saved-collection-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===== SHARE PAGE ===== */
.share-page { max-width: 560px; margin: 0 auto; }
.share-form-label,
.share-preview-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.share-quote-input { margin-bottom: 20px; }
.share-preview-label { margin-top: 4px; }
.share-preview-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}
.share-submit-btn { width: 100%; }

/* ===== AUTH POLISHED ===== */
.auth-card-polished { padding: 40px 32px; }
.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.auth-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--accent-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}
.auth-logo-wrap h1 {
  font-size: 1.6rem;
  margin: 0;
  color: var(--accent-orange-light);
}
.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.rhino-input-icon {
  padding-left: 44px !important;
  margin-bottom: 0 !important;
}
.auth-form .form-group { margin-bottom: 18px; }
.auth-submit { margin-top: 8px; }
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.auth-footer a { color: var(--accent-orange-light); font-weight: 600; }
.auth-forgot-wrap {
  text-align: center;
  margin-top: 14px;
}
.auth-forgot-link {
  font-size: 0.85rem;
  color: var(--accent-orange-light);
  font-weight: 600;
}
.auth-signup-link { color: var(--accent-orange) !important; }
.auth-divider { margin: 0 8px; opacity: 0.4; }

/* ===== TOAST ===== */
.rhino-toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 3000;
}
.rhino-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (min-width: 768px) {
  .rhino-toast { bottom: 24px; }
}

/* Hide native checkboxes globally in auth/forms */
.field-hint {
  display: block;
  font-size: 0.8rem;
  margin-top: 6px;
  color: var(--text-secondary);
}

.overlay-remove-btn {
  z-index: 10;
}

.form-group .rhino-input { margin-bottom: 0; }

.auth-form input[type="checkbox"] { display: none; }
.upload-zone input[type="file"],
.flux-attach-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* ===== MOBILE NAV — 6 items ===== */
@media (max-width: 767px) {
  .mobile-bottom-nav .nav-item svg {
    width: 22px;
    height: 22px;
  }
  .mobile-bottom-nav .nav-item span.nav-label {
    font-size: 9px;
    letter-spacing: 0;
  }
  .mobile-bottom-nav .nav-item.nav-create .nav-create-btn {
    width: 40px;
    height: 30px;
  }
}

/* ===== PROFILE LINKS (tappable usernames) ===== */
.profile-link {
  color: inherit;
  text-decoration: none;
}
.profile-link:hover {
  color: var(--accent-orange);
  text-decoration: underline;
}
.profile-link--inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.profile-link--viewer-stack {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}
.profile-link--viewer-stack:hover {
  color: #fff;
  opacity: 0.9;
  text-decoration: none;
}
.echo-viewer-meta .profile-link--viewer-stack {
  flex: 1;
}
.series-viewer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.comment-meta .profile-link strong {
  font-weight: 700;
}
.post-author-handle .profile-link {
  color: var(--text-secondary);
}
.post-author-handle .profile-link:hover {
  color: var(--accent-orange);
}
.flux-group-sender.profile-link {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-orange);
  margin-bottom: 4px;
  text-decoration: none;
}
.flux-group-sender.profile-link:hover {
  text-decoration: underline;
}

/* ===== ECHO (24h stories) ===== */
.echo-page {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 24px;
}

.echo-page-header {
  margin-bottom: 20px;
}

.echo-page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-orange-light);
}

.echo-page-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 4px 0 14px;
}

.echo-add-btn {
  width: auto !important;
  display: inline-flex !important;
}

.echo-rings-wrap {
  margin-bottom: 8px;
}

.echo-rings-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.echo-rings-scroll::-webkit-scrollbar { display: none; }

.echo-ring {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 72px;
  padding: 0;
}

.echo-ring-avatar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
}

.echo-ring-avatar-btn .echo-ring-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
}

.echo-ring-active .echo-ring-avatar-wrap,
.echo-ring-self .echo-ring-avatar-wrap {
  background: var(--gradient-brand);
  border-color: transparent;
}

.echo-ring-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-primary);
}

.echo-ring-plus {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
  line-height: 1;
}

.echo-ring-name {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.echo-empty-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 8px 4px 0;
  margin: 0;
}

/* ===== ECHO SERIES ===== */
.echo-series-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.echo-series-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  margin-bottom: 16px;
}

.echo-series-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  flex: 1;
}

.echo-series-sub {
  width: 100%;
  margin: -4px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.echo-series-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.echo-series-empty {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 8px 0;
}

.series-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.series-card {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.series-card-media {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

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

.series-card-text {
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-secondary);
  height: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.series-card-audio,
.series-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(232,117,10,0.15), rgba(0,0,0,0.2));
  font-size: 2rem;
}

.series-card-parts {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.series-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(232,117,10,0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.series-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 0;
}

.series-card-author {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.series-card-title {
  margin: 0;
  padding: 0 2px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.series-add-part-btn {
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-orange);
  background: rgba(232,117,10,0.1);
  border: 1px solid rgba(232,117,10,0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.series-viewer {
  position: fixed;
  inset: 0;
  z-index: 4100;
  background: rgba(8, 10, 14, 0.94);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.series-viewer.open { display: flex; }

.series-viewer-header {
  flex-shrink: 0;
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.series-viewer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.series-viewer-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  flex: 1;
}

.series-viewer-info .profile-link--viewer-stack {
  color: var(--text-primary);
}

.series-viewer-info .profile-link--viewer-stack:hover {
  color: var(--text-primary);
  opacity: 0.88;
}

.series-viewer-series-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.series-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.series-viewer-header .echo-viewer-avatar {
  border-color: var(--accent-orange);
}

.series-viewer-header .echo-viewer-name {
  color: var(--text-primary);
}

.series-viewer-header .echo-viewer-close {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.series-interest-btn {
  padding: 7px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.series-interest-btn:hover {
  border-color: rgba(255, 107, 44, 0.45);
}

.series-interest-btn.is-active {
  background: rgba(255, 107, 44, 0.12);
  border-color: rgba(255, 107, 44, 0.45);
  color: var(--accent-orange);
}

.series-flash-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  min-height: 0;
}

.series-flash-card-wrap {
  flex: 1;
  max-width: min(440px, 100%);
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  user-select: none;
  perspective: 1200px;
}

.series-flash-card {
  width: 100%;
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  will-change: transform;
}

.series-flash-card.is-exit-left {
  transform: translateX(-110%) rotate(-4deg);
  opacity: 0;
}

.series-flash-card.is-exit-right {
  transform: translateX(110%) rotate(4deg);
  opacity: 0;
}

.series-flash-card.is-enter-right {
  transform: translateX(48px);
  opacity: 0;
}

.series-flash-card.is-enter-left {
  transform: translateX(-48px);
  opacity: 0;
}

.series-flash-card--bounce {
  animation: seriesCardBounce 0.32s ease;
}

@keyframes seriesCardBounce {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(8px); }
  70% { transform: translateX(-6px); }
}

.series-flash-card-media {
  position: relative;
  flex: 1;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0c10;
  overflow: hidden;
}

.series-flash-image,
.series-flash-card-media video,
.series-flash-card-media img {
  width: 100%;
  max-height: min(58vh, 520px);
  object-fit: contain;
  display: block;
}

.series-flash-video {
  width: 100%;
  max-height: min(58vh, 520px);
  object-fit: contain;
  background: #000;
}

.series-flash-audio {
  width: 100%;
  padding: 32px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.series-flash-text {
  width: 100%;
  padding: 28px 24px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.series-flash-overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.series-flash-caption {
  padding: 14px 18px 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  white-space: pre-wrap;
  word-break: break-word;
}

.series-flash-nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.series-flash-nav:hover:not(:disabled) {
  border-color: rgba(255, 107, 44, 0.45);
  background: rgba(255, 107, 44, 0.08);
  color: var(--accent-orange);
}

.series-flash-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.series-flash-footer {
  flex-shrink: 0;
  padding: 12px 16px 18px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.series-flash-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.series-flash-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: background 0.2s ease, transform 0.2s ease;
}

.series-flash-dot.is-done {
  background: rgba(255, 107, 44, 0.35);
}

.series-flash-dot.is-active {
  background: var(--accent-orange);
  transform: scale(1.2);
}

.series-flash-counter {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.series-flash-hint {
  margin: 8px 0 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
  transition: opacity 0.25s ease;
}

.series-flash-hint.is-hidden {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.series-extra-media {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 28vh;
  overflow-y: auto;
  border-top: 1px solid var(--border-subtle);
}

.series-extra-media img,
.series-extra-media video {
  max-width: 100%;
  border-radius: var(--radius-md);
}

.series-owner-add-btn {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  z-index: 3;
  padding: 10px 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-orange);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

@media (max-width: 560px) {
  .series-flash-stage {
    padding: 10px 6px;
    gap: 4px;
  }

  .series-flash-nav {
    width: 38px;
    height: 38px;
  }

  .series-flash-card {
    border-radius: 16px;
  }
}

.series-create-overlay,
.series-add-overlay {
  position: fixed;
  inset: 0;
  z-index: 4500;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.series-create-overlay.open,
.series-add-overlay.open { display: flex; }

.series-create-sheet {
  width: min(100%, 520px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 18px 28px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.series-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.series-create-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.series-create-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.series-create-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.series-type-tabs { margin-bottom: 12px; }

.echo-viewer {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #000;
  display: none;
  flex-direction: column;
}

.echo-viewer.open {
  display: flex;
}

.echo-viewer-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 12px 12px 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent);
}

.echo-progress-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.echo-progress-seg {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  overflow: hidden;
}

.echo-progress-seg.done {
  background: rgba(255,255,255,0.9);
}

.echo-progress-seg.active .echo-progress-fill {
  height: 100%;
  width: 0;
  background: rgba(255,255,255,0.95);
  animation: echoProgress 6s linear forwards;
}

@keyframes echoProgress {
  from { width: 0; }
  to { width: 100%; }
}

.echo-viewer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.echo-viewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-orange);
}

.echo-viewer-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.echo-viewer-time {
  font-size: 0.72rem;
  opacity: 0.75;
}

.echo-viewer-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.echo-viewer-body {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.echo-viewer-media {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.echo-viewer-media img,
.echo-viewer-media video {
  max-width: 100%;
  max-height: 100dvh;
  object-fit: contain;
}

.echo-overlay-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  pointer-events: none;
  white-space: pre-wrap;
  text-align: center;
  max-width: 90%;
}

.echo-text-only {
  padding: 32px;
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  text-align: center;
  max-width: 90%;
}

.echo-audio-wrap {
  padding: 24px;
  width: 100%;
  max-width: 360px;
}

.echo-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 1;
  background: transparent;
  border: none;
}

.echo-tap-prev { left: 0; }
.echo-tap-next { right: 0; }

/* ===== MEDIA PREVIEW GRID (composer) ===== */
.comment-form-top {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.comment-voice-preview {
  margin: 10px 0;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.comment-voice-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.media-preview-grid {
  display: none;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.media-preview-grid.visible { display: block; }

.media-preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-orange-light);
  margin-bottom: 10px;
}

.media-preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.media-preview-grid-inner {
  display: grid;
  gap: 6px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
}

.media-preview-grid-inner.count-1 { grid-template-columns: 1fr; }
.media-preview-grid-inner.count-2 { grid-template-columns: 1fr 1fr; }
.media-preview-grid-inner.count-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.media-preview-grid-inner.count-3 .media-preview-cell:first-child { grid-row: span 2; }
.media-preview-grid-inner.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.media-preview-cell {
  position: relative;
  background: #000;
  min-height: 100px;
  aspect-ratio: 1;
  overflow: hidden;
}

.media-preview-cell .preview-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-cell-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  z-index: 2;
}

/* ===== POST MEDIA GALLERY (feed) ===== */
.post-media-gallery {
  display: grid;
  gap: 3px;
  background: var(--bg-primary);
}

.post-media-gallery.count-1 { grid-template-columns: 1fr; }
.post-media-gallery.count-2 { grid-template-columns: 1fr 1fr; }
.post-media-gallery.count-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.post-media-gallery.count-3 .gallery-cell:first-child { grid-row: span 2; }
.post-media-gallery.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.gallery-cell {
  position: relative;
  background: #000;
  overflow: hidden;
  min-height: 120px;
}

.gallery-cell img,
.gallery-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-height: 420px;
}

.post-media-gallery.count-1 .gallery-cell img,
.post-media-gallery.count-1 .gallery-cell video {
  max-height: 520px;
  object-fit: contain;
}

/* ===== FLUX REQUESTS ===== */
.flux-req-row .flux-req-after { margin-left: auto; }

/* ===== FLUX GAMES ===== */
.flux-games-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}

.flux-games-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.flux-leaderboard-btn {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-orange);
  background: rgba(255, 140, 0, 0.12);
  border: 1px solid rgba(255, 140, 0, 0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.flux-leaderboard-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}

.flux-leaderboard-modal.open { display: flex; }

.flux-leaderboard-inner {
  width: min(100%, 360px);
  max-height: 70vh;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.flux-leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.flux-leaderboard-header h3 { margin: 0; font-size: 1rem; }

.flux-leaderboard-list {
  margin: 0;
  padding: 8px 12px 12px;
  list-style: none;
}

.flux-game-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.flux-game-modal.open { display: flex; }

.flux-game-modal-inner {
  position: relative;
  max-width: 100%;
  width: min(420px, 100%);
}

.flux-game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(22, 22, 22, 0.95);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
}

#fluxGameLiveScore {
  font-weight: 700;
  color: var(--accent-orange-light);
  font-size: 0.95rem;
}

#fluxGameTitle {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.flux-game-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 0 8px;
}

.flux-game-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

#fluxGameCanvas {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  max-width: 100%;
  width: 100%;
  display: block;
  touch-action: none;
  border: 1px solid var(--border-subtle);
  border-top: none;
}

/* ===== CONFIRM DIALOG ===== */
.rhino-confirm {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.rhino-confirm.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rhino-confirm-box {
  position: relative;
  z-index: 10001;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  animation: confirmIn 0.25s ease;
}

.rhino-confirm-box p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

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

@keyframes confirmIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== ICON ACTION BUTTONS ===== */
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  flex-shrink: 0;
  transition: all var(--transition);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.icon-action-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.icon-action-btn:hover,
.icon-action-btn:active {
  color: var(--accent-orange);
  background: rgba(255, 107, 0, 0.1);
}

.post-owner-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 8px;
  margin-top: -8px;
}

/* ===== COMMENT MEDIA PREVIEW ===== */
.comment-file-input {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  font-size: 16px;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.comment-media-stage {
  display: none;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

#commentMediaStage:not([hidden]),
#commentVoiceStage:not([hidden]),
#spaceVoiceStage:not([hidden]) {
  display: block !important;
}

.comment-media-stage.is-visible,
.comment-preview-stage.is-visible,
.media-preview-stage.comment-preview-stage:not([hidden]) {
  display: block !important;
  animation: commentPhotoIn 0.25s ease;
}

.comment-media-stage-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  max-height: 280px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.comment-media-stage .comment-preview-media {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.comment-media-stage audio {
  width: 100%;
  min-width: 240px;
}

.comment-voice-stage.is-visible {
  display: block !important;
}

/* ===== COMMENT ATTACH (CLIP ONLY) ===== */
.comment-attach-preview {
  position: relative;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  animation: commentPhotoIn 0.25s ease;
}

.comment-attach-preview-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  max-height: 220px;
}

.comment-preview-media {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

.comment-attach-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  z-index: 2;
}

.comment-voice-preview {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.comment-voice-preview audio { width: 100%; }

/* ===== FLUX E2E + PREVIEW ===== */
.flux-e2e-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0 4px;
}

.flux-recovery-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.flux-recovery-overlay.open {
  opacity: 1;
  visibility: visible;
}

.flux-recovery-box {
  width: 100%;
  max-width: 380px;
  padding: 24px 22px;
  border-radius: var(--radius-lg, 16px);
  background: var(--bg-elevated, #1a1a1a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  text-align: center;
}

.flux-recovery-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--accent-orange, #ff6b00);
}

.flux-recovery-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.flux-recovery-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 16px;
  text-align: left;
}

.flux-recovery-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-align: center;
}

.flux-recovery-error {
  color: #ff6b6b;
  font-size: 0.82rem;
  margin: 0 0 10px;
}

.flux-recovery-submit {
  width: 100%;
  margin-top: 4px;
}

.flux-attach-preview {
  position: relative;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.flux-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  max-height: 180px;
}

.flux-preview-media {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.flux-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}

.flux-msg-time {
  font-size: 0.7rem;
  opacity: 0.7;
  display: block;
  margin-top: 4px;
}

.flux-decrypt-fail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

.post-type-tabs[style*="none"] + #mediaUploadSection .upload-zone-title {
  font-size: 0.95rem;
}

/* ===== ECHO UPLOAD SHEET ===== */
.echo-upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.echo-upload-overlay.open { display: flex; }

.echo-upload-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  padding: 0 20px 24px;
  animation: slideUp 0.3s ease;
}

.echo-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.echo-upload-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.media-preview-stage {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.media-preview-stage-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 360px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.preview-media-large {
  max-width: 100%;
  max-height: 360px;
  width: 100%;
  object-fit: contain;
  display: block;
}

.preview-media-audio {
  width: 100%;
  min-width: 260px;
}

#composerPreviewStage .media-preview-grid {
  display: block;
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
}

#composerPreviewStage .media-preview-cell {
  min-height: 180px;
  max-height: 320px;
  aspect-ratio: auto;
}

#composerPreviewStage .media-preview-cell .preview-media {
  max-height: 320px;
  object-fit: contain;
}

/* ===== SPACES ===== */
.aura-feed-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.aura-create-space-btn {
  width: auto !important;
}

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

.space-card-body {
  padding: 4px 0 8px;
}

.space-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.space-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.space-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.space-card-activity {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.space-card-desc {
  margin-bottom: 10px;
}

.space-card-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.space-privacy-tag {
  font-weight: 600;
  color: var(--accent-orange);
}

.space-meta-dot {
  opacity: 0.5;
}

.space-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.space-badge--active {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

.space-badge--scheduled {
  background: rgba(107, 140, 255, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(107, 140, 255, 0.35);
}

.space-card--scheduled {
  border-left-color: var(--accent-blue);
}

.space-badge--closed {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.space-card-badge {
  margin-left: auto;
}

.space-card-actions {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.space-card-actions .space-open-btn,
.space-card-actions .space-join-action {
  margin-right: auto;
}

.space-create-page {
  max-width: 560px;
  margin: 0 auto;
}

.space-create-header {
  margin-bottom: 20px;
}

.space-create-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 12px 0 6px;
}

.space-create-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.space-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.space-activity-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.space-activity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: center;
  min-height: 72px;
}

.space-activity-option input:checked + .space-activity-card {
  border-color: var(--accent-orange);
  background: rgba(232, 117, 10, 0.1);
}

.space-activity-icon {
  font-size: 1.25rem;
}

.space-activity-label {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
}

.space-privacy-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.space-privacy-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.4;
  cursor: pointer;
}

.space-create-submit {
  width: 100%;
  margin-top: 8px;
}

.space-schedule-block {
  margin: 16px 0 20px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.space-schedule-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

.space-schedule-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.space-schedule-fields {
  margin-top: 12px;
}

.space-scheduled-banner {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(107, 140, 255, 0.1);
  border: 1px solid rgba(107, 140, 255, 0.25);
}

.space-scheduled-banner p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.space-scheduled-banner-sub {
  margin-top: 6px !important;
  font-weight: 400 !important;
  font-size: 0.82rem !important;
  color: var(--text-secondary) !important;
}

.rhino-label-optional {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.space-page {
  max-width: 640px;
  margin: 0 auto;
}

.space-page-header {
  margin: 16px 0 20px;
}

.space-page-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.space-page-icon {
  font-size: 2rem;
  line-height: 1;
}

.space-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.space-page-activity {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.space-page-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.space-page-desc {
  margin-top: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.space-ended-banner {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 107, 44, 0.1);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.space-archive-banner p {
  margin: 0;
}

.space-archive-until {
  margin-top: 6px !important;
  font-size: 0.82rem;
  opacity: 0.85;
}

.space-archive-card-note {
  width: 100%;
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.space-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.space-participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.space-participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  text-decoration: none;
  color: inherit;
}

.space-participants,
.space-interaction,
.space-pending-requests {
  margin-bottom: 24px;
}

.space-request-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.space-request-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.space-chat {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}

.space-messages {
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.space-msg {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: 0.9rem;
}

.space-msg.mine {
  align-self: flex-end;
  background: rgba(232, 117, 10, 0.15);
}

.space-msg-sender {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.space-msg time {
  display: block;
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.space-msg img,
.space-msg video {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}

.space-msg-media {
  margin-top: 6px;
  min-width: min(260px, 100%);
}

.space-msg-voice audio {
  width: 100%;
  min-width: 220px;
  max-width: 280px;
  display: block;
}

.space-voice-stage {
  margin: 0 10px 10px;
}

.space-voice-stage .media-preview-stage-inner {
  min-height: 72px;
  max-height: 120px;
  background: var(--bg-elevated);
}

.space-voice-stage audio {
  width: 100%;
  max-width: 320px;
}

.space-chat-form {
  display: block;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.space-chat-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.space-msg.mine:has(.space-msg-voice) {
  min-width: min(260px, 85%);
}

.space-chat-input-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: flex-end;
}

.space-composer-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.space-input-wrap {
  flex: 1;
  min-width: 0;
}

.space-chat-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 11px 18px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.space-chat-input::placeholder {
  color: var(--text-secondary);
}

.space-chat-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 2px rgba(232, 117, 10, 0.12);
}

.space-send-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-full);
  background: var(--accent-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition);
}

.space-send-btn:active {
  transform: scale(0.92);
}

.space-chat-composer .voice-recording-status {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0 4px;
}

.space-voice-btn.active,
.space-voice-btn.is-recording {
  color: var(--accent-orange);
  background: rgba(232, 117, 10, 0.22);
  box-shadow: 0 0 0 2px rgba(232, 117, 10, 0.35);
}

.space-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}

.space-attach-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.space-attach-btn input {
  display: none;
}

.space-chat-empty,
.space-chat-locked {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.space-chat-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.space-chat-locked p {
  margin: 0;
}

.space-placeholder-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.space-page-actions {
  margin-top: 16px;
}

.aura-feed-end {
  text-align: center;
  padding: 24px 16px 32px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.poll-widget {
  margin: 12px 0 4px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  color: #fff;
}

.poll-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.35;
  color: #fff;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poll-option {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  background: var(--surface, rgba(0, 0, 0, 0.2));
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
  color: #fff;
}

.poll-option:hover:not(:disabled) {
  border-color: var(--accent, #ff6b2c);
}

.poll-option.is-voted {
  border-color: var(--accent, #ff6b2c);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 44, 0.45);
}

.poll-option.is-voted .poll-option-bar {
  background: rgba(255, 107, 44, 0.32);
}

.poll-option-voted-mark {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent, #ff6b2c);
  margin-left: auto;
}

.poll-option:disabled {
  cursor: default;
}

.poll-option-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 107, 44, 0.18);
  border-radius: 11px 0 0 11px;
  transition: width 0.35s ease;
  pointer-events: none;
}

.poll-option-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
}

.poll-option-media {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  position: relative;
  padding: 0;
  border: none;
  cursor: zoom-in;
}

.poll-option-media.poll-media-expand:hover {
  outline: 2px solid rgba(255, 255, 255, 0.35);
}

.poll-media-expand-icon {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

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

.poll-option-media audio {
  width: 120px;
  height: 36px;
}

.poll-option-label {
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.3;
  word-break: break-word;
  color: #fff;
}

.poll-option-pct {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent, #ff6b2c);
  flex-shrink: 0;
}

.poll-meta {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.poll-media-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.poll-media-lightbox.open {
  display: flex;
}

.poll-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.poll-lightbox-content img,
.poll-lightbox-content video {
  max-width: min(96vw, 720px);
  max-height: 85vh;
  border-radius: 12px;
  object-fit: contain;
  display: block;
}

.poll-composer-section {
  margin-top: 12px;
}

.poll-options-builder {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.poll-option-row {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.poll-option-media-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.poll-option-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.15));
  cursor: pointer;
}

.poll-option-attach:hover {
  color: var(--accent, #ff6b2c);
  border-color: var(--accent, #ff6b2c);
}

.poll-option-voice-btn {
  font: inherit;
}

.poll-option-voice-btn.active {
  color: var(--accent, #ff6b2c);
  border-color: var(--accent, #ff6b2c);
  background: rgba(255, 107, 44, 0.1);
}

.poll-option-voice-btn svg {
  flex-shrink: 0;
}

.poll-option-voice-status {
  width: 100%;
  font-size: 0.75rem;
  margin-top: 4px;
}

.poll-option-preview {
  flex: 1;
  min-width: 0;
}

.poll-opt-thumb {
  max-width: 80px;
  max-height: 56px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

/* Echo editor + sound */
.echo-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.echo-edit-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.echo-edit-btn:hover {
  border-color: var(--accent, #ff6b2c);
  color: var(--accent, #ff6b2c);
}

.echo-preview-wrap {
  position: relative;
}

.echo-preview-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.echo-edit-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.echo-edit-options {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.echo-edit-option {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.echo-edit-option.active {
  border-color: var(--accent, #ff6b2c);
  color: var(--accent, #ff6b2c);
  background: rgba(255, 107, 44, 0.08);
}

.echo-edit-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 8px 0 0;
}

.echo-text-colors {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.echo-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.echo-color-swatch.active {
  border-color: var(--accent, #ff6b2c);
  box-shadow: 0 0 0 2px rgba(255, 107, 44, 0.3);
}

.echo-text-overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: move;
  user-select: none;
  max-width: 90%;
  text-align: center;
  z-index: 3;
}

.echo-crop-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.echo-crop-shade {
  position: absolute;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.echo-crop-shade-t { top: 0; left: 0; right: 0; }
.echo-crop-shade-b { left: 0; right: 0; bottom: 0; }
.echo-crop-shade-l { top: 0; bottom: 0; left: 0; }
.echo-crop-shade-r { top: 0; bottom: 0; right: 0; }

.echo-crop-box {
  position: absolute;
  border: 2px solid #fff;
  pointer-events: auto;
  cursor: move;
}

.echo-crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  pointer-events: auto;
}

.echo-crop-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.echo-crop-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.echo-crop-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.echo-crop-handle.se { bottom: -7px; right: -7px; cursor: nwse-resize; }

.echo-trim-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.echo-trim-field {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.echo-trim-field input[type="range"] {
  width: 100%;
  margin-top: 4px;
}

.echo-viewer-media {
  position: relative;
}

.echo-sound-btn {
  position: absolute;
  bottom: 24px;
  right: 16px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.echo-sound-btn.is-unmuted svg line {
  display: none;
}

/* Flux group selected members */
.flux-selected-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.flux-selected-members[hidden] {
  display: none;
}

.flux-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  font-size: 0.82rem;
}

.flux-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flux-chip-remove {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.flux-chip-remove:hover {
  color: var(--accent, #ff6b2c);
}

.flux-member-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.flux-member-result:hover {
  background: rgba(255, 107, 44, 0.08);
}

.flux-member-result span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.flux-member-result small {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.avatar-xs {
  width: 24px;
  height: 24px;
}

/* Debate from post */
.debate-enter-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 107, 44, 0.12), rgba(255, 140, 80, 0.06));
  border: 1px solid rgba(255, 107, 44, 0.25);
}

.debate-enter-icon { font-size: 1.5rem; }

.debate-enter-text { flex: 1; min-width: 0; }
.debate-enter-text p { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-secondary); }

.debate-author-actions {
  margin: 12px 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-elevated, rgba(255,255,255,0.04));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.debate-author-actions p { flex: 1 1 100%; margin: 0 0 4px; font-size: 0.9rem; }

.mention-debate { color: #f59e0b; font-weight: 700; }

/* Debate Space moderation */
.space-hand-queue {
  margin: 0 16px 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-elevated, rgba(255,255,255,0.04));
}

.space-hand-list { display: flex; flex-direction: column; gap: 8px; }

.space-hand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.space-hand-name { flex: 1; font-size: 0.9rem; }

.space-hand-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.space-chat-locked {
  padding: 12px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.space-chat-locked .rhino-btn { margin-top: 8px; }

/* Swipe-to-reply */
.flux-bubble,
.space-msg {
  position: relative;
  transition: transform 0.12s ease-out;
  touch-action: pan-y;
}

.flux-bubble.swipe-reply-dragging,
.space-msg.swipe-reply-dragging {
  user-select: none;
  cursor: grabbing;
}

.flux-bubble.swipe-reply-active::before,
.space-msg.swipe-reply-active::before {
  content: '↩';
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-orange-light);
  font-size: 1.1rem;
  opacity: 0.9;
}

.msg-reply-btn {
  position: absolute;
  top: 50%;
  right: -4px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}

@media (hover: hover) {
  .flux-bubble:hover .msg-reply-btn,
  .space-msg:hover .msg-reply-btn {
    opacity: 1;
  }
}

.msg-flash-highlight {
  animation: msg-flash 1.2s ease;
  border-radius: 10px;
}

@keyframes msg-flash {
  0%, 100% { background: transparent; box-shadow: none; }
  35% { background: rgba(255, 107, 44, 0.22); box-shadow: 0 0 0 2px rgba(255, 107, 44, 0.35); }
}

/* Reply quote & banner */
.chat-reply-quote {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 6px 10px;
  border: none;
  border-left: 3px solid var(--accent-orange);
  border-radius: 6px;
  background: rgba(0,0,0,0.28);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.chat-reply-quote:hover {
  background: rgba(255, 107, 44, 0.12);
}

.chat-reply-quote:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

.chat-reply-quote strong { display: block; font-size: 0.8rem; color: var(--accent-orange-light); }
.chat-reply-quote span { color: var(--text-secondary); }

.chat-reply-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 107, 44, 0.1);
  border-left: 3px solid var(--accent-orange);
  font-size: 0.85rem;
}

.chat-reply-banner[hidden] {
  display: none !important;
}

.chat-reply-banner--compact {
  margin-bottom: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.chat-reply-banner--compact .chat-reply-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.chat-reply-banner--compact .chat-reply-preview {
  margin-top: 2px;
}

.chat-reply-banner-inner { flex: 1; min-width: 0; }
.chat-reply-preview { margin: 4px 0 0; font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-reply-cancel {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

/* @mention autocomplete */
.mention-autocomplete-wrap { position: relative; }

.mention-autocomplete-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: 6px;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--surface-card, #1a1a1a);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 50;
}

.mention-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 0.88rem;
}

.mention-autocomplete-item:hover { background: rgba(255, 107, 44, 0.1); }

.schedule-post-block {
  margin: 14px 0;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.schedule-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.schedule-post-copy {
  min-width: 0;
}

.schedule-post-title {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
}

.schedule-post-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.rhino-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}

.rhino-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.rhino-switch input[type="hidden"] {
  display: none;
}

.rhino-switch-track {
  display: block;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--border-subtle);
  position: relative;
  transition: background 0.22s ease, box-shadow 0.22s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.rhino-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease;
}

.rhino-switch input[type="checkbox"]:checked ~ .rhino-switch-track {
  background: linear-gradient(135deg, var(--accent-orange), #ff8c42);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.rhino-switch input[type="checkbox"]:checked ~ .rhino-switch-track .rhino-switch-thumb {
  transform: translateX(20px);
}

.rhino-switch input[type="checkbox"]:focus-visible ~ .rhino-switch-track {
  outline: 2px solid rgba(255, 107, 44, 0.55);
  outline-offset: 2px;
}

.schedule-post-fields {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.schedule-post-fields[hidden] {
  display: none !important;
}

.schedule-post-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.schedule-quick-chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.schedule-quick-chip:hover,
.schedule-quick-chip.active {
  border-color: rgba(255, 107, 44, 0.45);
  color: var(--accent-orange);
  background: rgba(255, 107, 44, 0.08);
}

.schedule-post-datetime {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.schedule-post-field {
  min-width: 0;
}

.schedule-date-input,
.schedule-time-input {
  width: 100%;
}

.schedule-time-input {
  color-scheme: light dark;
}

.schedule-time-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}

.schedule-time-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.schedule-post-summary {
  margin: 12px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-orange);
  line-height: 1.4;
}

.schedule-post-summary[hidden] {
  display: none !important;
}

.post-card--scheduled {
  border-color: rgba(255, 107, 44, 0.28);
}

.post-scheduled-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 107, 44, 0.1);
  border: 1px solid rgba(255, 107, 44, 0.22);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-orange);
}

.post-scheduled-badge svg {
  flex-shrink: 0;
}

#postContentWrap .rhino-label {
  margin-bottom: 6px;
}

@media (max-width: 480px) {
  .schedule-post-datetime {
    grid-template-columns: 1fr;
  }
}

/* Flux voice calls */
body.flux-call-open {
  overflow: hidden;
}

.flux-call-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--accent-orange-light);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.flux-call-header-btn:hover {
  background: rgba(232, 117, 10, 0.12);
}

.flux-call-header-btn:active {
  transform: scale(0.94);
}

.flux-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(12px);
}

.flux-call-overlay[hidden] {
  display: none !important;
}

.flux-call-panel {
  width: min(360px, 100%);
  text-align: center;
  padding: 32px 24px 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.flux-call-avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 18px;
}

.flux-call-avatar {
  width: 108px;
  height: 108px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid rgba(232, 117, 10, 0.35);
}

.flux-call-pulse {
  position: absolute;
  inset: -10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-orange);
  animation: flux-call-pulse 1.6s ease-out infinite;
}

.flux-call-pulse[hidden] {
  display: none;
}

@keyframes flux-call-pulse {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.18); opacity: 0; }
}

.flux-call-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.flux-call-handle {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.flux-call-status {
  margin: 14px 0 0;
  color: var(--accent-orange-light);
  font-size: 0.92rem;
  font-weight: 600;
}

.flux-call-timer {
  margin: 8px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.flux-call-timer[hidden] {
  display: none;
}

.flux-call-actions {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.flux-call-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 64px;
}

.flux-call-control-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.flux-call-actions[hidden] {
  display: none;
}

.flux-call-btn {
  width: 58px;
  height: 58px;
  border: none;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: transform var(--transition), opacity var(--transition);
}

.flux-call-btn:active {
  transform: scale(0.92);
}

.flux-call-btn-accept {
  background: #22a06b;
  box-shadow: 0 8px 24px rgba(34, 160, 107, 0.35);
}

.flux-call-btn-decline,
.flux-call-btn-end {
  background: #d64545;
  box-shadow: 0 8px 24px rgba(214, 69, 69, 0.35);
}

.flux-call-btn-mute {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.flux-call-btn-mute .flux-call-icon--mic-off {
  display: none;
}

.flux-call-btn-mute.is-muted .flux-call-icon--mic-on {
  display: none;
}

.flux-call-btn-mute.is-muted .flux-call-icon--mic-off {
  display: block;
}

.flux-call-btn-mute.is-muted {
  color: #e07070;
  border-color: rgba(224, 112, 112, 0.5);
  background: rgba(224, 112, 112, 0.14);
}

.flux-call-btn-speaker {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.flux-call-btn-speaker.is-active {
  color: var(--accent-orange-light);
  border-color: rgba(232, 117, 10, 0.55);
  background: rgba(232, 117, 10, 0.16);
  box-shadow: 0 0 0 2px rgba(232, 117, 10, 0.12);
}

.flux-call-btn-speaker.is-active + .flux-call-control-label {
  color: var(--accent-orange-light);
}

.flux-call-btn-mute.is-muted + .flux-call-control-label {
  color: #e07070;
}

/* Flux call history in chat */
.flux-call-log {
  align-self: center;
  width: min(100%, 320px);
  margin: 8px auto;
  padding: 10px 14px;
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.flux-call-log-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.flux-call-log-icon {
  display: inline-flex;
  color: var(--accent-orange-light);
}

.flux-call-log-icon--out {
  transform: scaleX(-1);
}

.flux-call-log-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.flux-call-log--missed .flux-call-log-text,
.flux-call-log--missed .flux-call-log-icon {
  color: #e07070;
}

.flux-call-log-time {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  opacity: 0.85;
}

/* ===== SIGNUP LEGAL + POLICY MODALS ===== */
.auth-legal-block {
  margin: 20px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-legal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.auth-form .auth-legal-check {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.auth-legal-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 5px;
  border: 2px solid var(--border-subtle, rgba(255, 255, 255, 0.2));
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.auth-legal-check:checked + .auth-legal-box {
  border-color: var(--accent-orange);
  background: var(--accent-orange);
}

.auth-legal-check:checked + .auth-legal-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-legal-check:focus-visible + .auth-legal-box {
  outline: 2px solid var(--accent-orange-light);
  outline-offset: 2px;
}

.auth-legal-link,
.legal-inline-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent-orange-light);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.auth-legal-link:hover,
.legal-inline-link:hover {
  color: var(--accent-orange);
}

.legal-email-link {
  color: var(--accent-orange-light);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-email-link:hover {
  color: var(--accent-orange);
}

.legal-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.legal-modal-overlay.open {
  display: flex;
}

.legal-modal-box {
  width: min(560px, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #1a1a1f);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.legal-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.legal-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.legal-modal-close:hover {
  color: var(--text-primary);
}

.legal-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.legal-modal-footer {
  padding: 12px 20px 18px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  display: flex;
  justify-content: flex-end;
}

.legal-doc h3 {
  margin: 18px 0 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.legal-doc h3:first-of-type {
  margin-top: 12px;
}

.legal-doc p {
  margin: 0 0 10px;
}

.legal-doc ul {
  margin: 0 0 12px 1.1rem;
  padding: 0;
}

.legal-doc li {
  margin-bottom: 6px;
}

.legal-doc-updated {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px !important;
}

.auth-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

