/* ============ Variables & reset ============ */
:root {
  --bg: #000000;
  --panel: #000000;
  --line: #2f3336;
  --line-soft: #1f2225;
  --text: #e7e9ea;
  --text-dim: #8b98a5;
  --brand: #ff9900;
  --brand-press: #ff9900;
  --danger: #f4212e;
  --ok: #00ba7c;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(
      1200px 800px at 10% -10%,
      rgba(29, 155, 240, 0.08),
      transparent 60%
    ),
    radial-gradient(
      1200px 800px at 110% 10%,
      rgba(0, 186, 124, 0.06),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ============ Topbar (fixed) ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.2) blur(10px);
  background: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid var(--line);
}

.topbar .row {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 20px rgba(29, 155, 240, 0.7);
}

.logo h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.spacer {
  flex: 1;
}

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

/* ======== Colonne droite (widgets style X) ======== */
.right {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding-right: 8px;
  /* petit spacing */
}

/* Scroll plus subtil */
.right::-webkit-scrollbar {
  width: 6px;
}

.right::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 10px;
}

/* Widget card compacte */
.right .widget {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

/* Titres sobres */
.right .widget strong {
  font-size: 16px;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

/* Texte d’info (muted) */
.right .widget p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.4;
}

/* Search box (style X) */
.right .widget input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 999px;
  background: #202327;
  color: var(--text);
  font-size: 14px;
}

.right .widget input[type="search"]::placeholder {
  color: var(--text-dim);
}

.right .widget input[type="search"]:focus {
  outline: 2px solid var(--brand);
}

/* User card dans la colonne droite */
.right .user-card {
  margin-bottom: 14px;
}

/* Colonne droite plus étroite et widgets compacts */
.right {
  max-width: 360px;
}

/* ~ X sidebar width */
.right .user-card {
  margin-bottom: 14px;
}

/* Cover: ratio bas + hauteur limitée */
.user-card .user-cover {
  width: 100%;
  aspect-ratio: 3 / 1;
  /* ~ 3:1 comme X */
  max-height: 140px;
  /* garde la cover basse */
  background-size: cover;
  background-position: center;
  background-color: #101214;
  border-bottom: 1px solid var(--line);
}

/* Si tu utilises la variante <img> pour la cover */
.user-card .user-cover-img {
  width: 100%;
  aspect-ratio: 3 / 1;
  max-height: 140px;
  object-fit: cover;
  display: block;
}

/* Avatar plus petit (comme X) et bon overlap */
.user-card .user-main {
  position: relative;
  padding: 38px 12px 14px;
  /* réduit l’espace */
}

.user-card .user-photo {
  position: absolute;
  top: -28px;
  /* chevauchement plus léger */
  left: 12px;
  width: 56px;
  /* <= taille avatar */
  height: 56px;
  border-radius: 999px;
  border: 3px solid var(--panel);
  object-fit: cover;
}

/* Texte décalé juste ce qu’il faut */
.user-card .user-info {
  padding-left: 80px;
  /* 56 + marges */
  min-height: 40px;
}

/* Typo compacte comme X */
.user-card .user-name {
  font-size: 16px;
  font-weight: 800;
}

.user-card .user-username {
  font-size: 13px;
  margin-left: 6px;
  color: var(--text-dim);
}

.user-card .user-bio {
  margin: 8px 0 10px;
  font-size: 14px;
  line-height: 1.35;
}

/* Métadonnées fines */
.user-card .user-meta {
  font-size: 12.5px;
  gap: 8px 12px;
  padding-top: 8px;
}

/* Petits écrans: encore plus compact */
@media (max-width: 900px) {
  .right {
    max-width: none;
  }

  .user-card .user-cover,
  .user-card .user-cover-img {
    max-height: 120px;
    aspect-ratio: 3 / 1;
  }

  .user-card .user-photo {
    width: 52px;
    height: 52px;
    top: -26px;
  }

  .user-card .user-info {
    padding-left: 76px;
  }
}

/* Avatar des posts (timeline) plus petit */
.post {
  grid-template-columns: 40px 1fr;
  gap: 10px;
}

.post .avatar {
  width: 40px;
  height: 40px;
}

/* ===== Replies popup — style X ===== */
.replies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line);
}

.replies-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
}

.replies-title .at {
  color: var(--text-dim);
  font-weight: 600;
}

.reply-composer {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.rc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0d10;
}

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

.rc-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rc-textarea {
  width: 100%;
  min-height: 96px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.rc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
}

.rc-chip:hover {
  background: #101217;
  color: var(--text);
}

.rc-vis {
  appearance: none;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 600;
}

.rc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rc-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rc-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rc-counter {
  color: var(--text-dim);
  font-size: 13px;
}

.rc-send {
  background: var(--brand);
  border: none;
  color: #fff;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.rc-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rc-previews {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 1fr);
}

.rc-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
}

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

.rc-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ===== Modal scrollable façon X ===== */
body.no-scroll {
  overflow: hidden;
}

/* La feuille du modal prend l'écran (hauteur max) et scrolle en interne */
.modal .sheet {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  /* hauteur max visible */
  width: 100%;
  max-width: 680px;
  overflow: hidden;
  /* on confie le scroll à .bd */
}

/* Header collant en haut */
.modal .hd {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

/* Corps scrollable */
.modal .bd {
  overflow-y: auto;
  /* 🎯 le scroll se fait ici */
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px;
}

/* Replies container: s'adapte et remplit l'espace, pas de marges parasites */
#repliesBody {
  padding: 0;
  margin: 0;
}

/* Variante mobile: plein écran */
@media (max-width: 600px) {
  .modal {
    padding: 0;
  }

  .modal .sheet {
    border-radius: 0;
  }

  .modal .bd {
    padding-bottom: 72px;
  }

  /* un peu d'air sous le composer */
}

/* (Rappel) Layout des replies: avatar à gauche, contenu à droite */
#repliesBody article.post {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  box-sizing: border-box;
}

#repliesBody article.post .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0d10;
}

#repliesBody article.post .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#repliesBody > .post {
  display: contents;
}

/* neutralise le wrapper div.post */

/* Reset pour le wrapper (il ne doit rien styler) */
#repliesBody > .post {
  padding: 0;
  margin: 0;
  border: none;
  display: flex;
}

/* C’est l’ARTICLE qui doit gérer l’alignement */
#repliesBody article.post {
  display: grid;
  grid-template-columns: 44px 1fr;
  /* avatar fixe + contenu flexible */
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  box-sizing: border-box;
}

/* Avatar à gauche */
#repliesBody article.post .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0d10;
  justify-self: start;
  /* collé à gauche */
}

/* Image avatar */
#repliesBody article.post .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Bloc texte prend toute la place à droite */
#repliesBody article.post > div:nth-child(2) {
  width: 100%;
}

.muted {
  display: none !important;
}

/* ===== Ajout barre visuelle au champ reply ===== */
.rc-textarea {
  width: 100%;
  min-height: 96px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;

  padding-left: 12px;
  /* espace pour la barre */
  border-left: 3px solid var(--brand);
  /* barre colorée à gauche */
  border-radius: 0;
  /* pas d’arrondi sur le côté gauche */
}

/* Quand on focus: barre plus visible */
.rc-textarea:focus {
  border-left-color: var(--brand-press);
  background: rgba(255, 153, 0, 0.05);
  /* léger highlight */
}

.wrap {
  margin-top: 20px;
}

/* ============ Layout 3 colonnes ============ */
.wrap {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 260px minmax(0, 600px) 1fr;
  gap: 16px;
}

.left {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
}

.right {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow: auto;
}

/* ============ Nav / cards ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text);
}

.nav a:hover {
  background: #16181c;
}

.nav a span:first-child {
  width: 22px;
  text-align: center;
}

.widget {
  padding: 12px;
}

.widget strong {
  display: block;
  margin-bottom: 6px;
}

.muted {
  color: var(--text-dim);
}

/* ============ Center / feed ============ */
.center {
  border-radius: var(--radius);
  overflow: hidden;
}

.feed .empty {
  padding: 28px;
  text-align: center;
  color: var(--text-dim);
}

.loadmore {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
}

/* ============ Post ============ */
.post {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.post:hover {
  background: #0a0b0d;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2b2f33, #1b1f22);
  border: 1px solid var(--line);
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.meta .name {
  font-weight: 700;
}

.meta .time {
  color: var(--text-dim);
}

.body {
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 2px 0 8px;
}

/* ============ Photos (grille responsive à la X) ============ */
.photos {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.photos:has(img:nth-child(1):last-child) {
  grid-template-columns: 1fr;
}

.photos:has(img:nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr;
}

.photos:has(img:nth-child(3):last-child) {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 160px;
}

.photos:has(img:nth-child(4)) {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 160px;
}

/* ============ Toolbar ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.chip:hover {
  background: #0b0d10;
  color: var(--text);
}

.chip.active {
  color: #f91880;
}

.like-count {
  min-width: 1.25em;
  display: inline-block;
  text-align: center;
}

/* ============ Buttons ============ */
.topbtn {
  appearance: none;
  border: 1px solid var(--line);
  color: var(--text);
  background: #0b0d10;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.topbtn:hover {
  filter: brightness(1.05);
}

.topbtn.primary {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
}

.topbtn.primary:hover {
  background: var(--brand-press);
}

/* ============ Modal ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: 0.18s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  z-index: 60;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal .sheet {
  width: 100%;
  max-width: 680px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal .hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal .bd {
  padding: 14px 16px;
}

.xbtn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
}

.xbtn:hover {
  background: #111;
}

/* ============ Composer ============ */
textarea {
  background: #0a0b0d;
  color: var(--text);
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: #3a3f44;
}

.row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

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

/* Uploader / Dropzone */
.dropzone {
  min-height: 120px;
  border: 1px dashed #3a3f44;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: #0a0b0d;
}

.dropzone.drag {
  outline: 2px solid var(--brand);
  outline-offset: -4px;
  background: #0b1220;
}

.dz-help strong {
  display: block;
}

.previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thumb {
  position: relative;
  width: 120px;
  aspect-ratio: 1/1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

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

.thumb button {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

select {
  background: #0a0b0d;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ============ Replies modal specific ============ */
#repliesBody .post {
  border: none;
  border-radius: 0;
}

#repliesBody hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 8px 0;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: #16181c;
  color: var(--text);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ Scrollbars (subtiles) ============ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #1f2327;
  border-radius: 10px;
  border: 2px solid #0a0b0d;
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .wrap {
    grid-template-columns: 72px minmax(0, 600px) 1fr;
  }

  .nav a span:last-child {
    display: none;
  }
}

@media (max-width: 900px) {
  .wrap {
    grid-template-columns: 1fr;
  }

  .left,
  .right {
    display: none;
  }

  .center {
    border-radius: var(--radius);
  }
}

.chip {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  /* light white with low opacity for subtle contrast */
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.2);
  /* slightly stronger on hover */
}

.meta {
  padding-bottom: 10px;
}

/* ===== Topbar responsive ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.tb-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 16px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 25px rgba(29, 155, 240, 0.7);
}

/* Nav desktop */
.tb-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.tb-nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-dim);
  padding: 6px 0;
  position: relative;
}

.tb-nav a:hover {
  color: var(--text);
}

.tb-nav a.active {
  color: var(--text);
}

.tb-nav a.active::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--brand);
}

/* Right actions */
.tb-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Burger (mobile only) */
.tb-burger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
}

.tb-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
}

/* Drawer mobile */
.tb-drawer {
  position: fixed;
  inset: 54px 0 auto 0;
  /* sous le header */
  background: rgba(0, 0, 0, 0.96);
  border-bottom: 1px solid var(--line);
  transform: translateY(-120%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s;
  z-index: 59;
}

.tb-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.tb-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  gap: 6px;
}

.tb-drawer-nav a {
  display: block;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--text);
}

.tb-drawer-nav a.active {
  background: #101317;
}

.tb-drawer-nav a:hover {
  background: #0e1115;
}

/* Responsive rules */
@media (max-width: 900px) {
  .tb-nav {
    display: none;
  }

  /* cache la nav desktop */
  .tb-burger {
    display: inline-flex;
  }

  /* affiche le burger */
  .tb-right .auth {
    display: none;
  }

  /* compacter la droite */
  .tb-inner {
    padding: 0 10px;
  }
}

/* Optionnel: état overlay page quand le drawer est ouvert */
body.nav-open {
  overflow: hidden;
}

/* Logo: dot par défaut */
.logo .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 25px rgba(29, 155, 240, 0.7);
  border: 1px solid var(--line);
  overflow: hidden;
  /* utile si on met une image */
}

/* Quand un user est connecté: on affiche sa photo en fond */
.logo .dot.is-user {
  background: #0b0d10 center/cover no-repeat;
  /* base si pas d'image */
  box-shadow: none;
  border-color: #2a2e32;
}

/* Optionnel: fin liseré autour de l’avatar */
.logo .dot.is-user::after {
  content: "";
  position: absolute;
  /* nécessite position relative sur le parent si besoin */
}

.wrap {
  margin-top: 20px;
}

.icon-burger {
  color: #fff;
  /* stroke prend currentColor → blanc */
}

/* Nav: icône + label alignés */
.tb-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-dim);
  padding: 6px 0;
  position: relative;
}

.tb-nav a:hover {
  color: var(--text);
}

.tb-nav a.active {
  color: var(--text);
}

/* Soulignement pour l'actif (prend la largeur du lien icône+label) */
.tb-nav a.active::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--brand);
}

/* Les SVG héritent de la couleur du texte */
.tb-nav a svg {
  color: currentColor;
}

/* Mobile: cacher les libellés pour compacter */
@media (max-width: 900px) {
  .tb-nav {
    display: none;
  }

  /* (déjà cachée si tu utilises le drawer) */
  /* si un jour tu affiches la nav en mobile: */
  /* .tb-nav .label { display: none; } */
}

/* Drawer mobile avec icônes + labels */
.tb-drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  /* espace icône/texte */
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  min-height: 44px;
  /* target tactile confortable */
}

.tb-drawer-nav a svg {
  flex: 0 0 auto;
  /* icône taille fixe */
  color: currentColor;
  /* hérite de la couleur du lien */
}

.tb-drawer-nav a .label {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-drawer-nav a.active {
  background: #101317;
}

.tb-drawer-nav a:hover {
  background: #0e1115;
}

.tb-drawer-nav a.active {
  background: #101317;
  color: var(--text);
  /* texte blanc */
  outline: 2px solid transparent;
}

.tb-burger svg {
  color: #fff;
}

/* ===== Gallery / Lightbox ===== */
.sa-gallery {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.sa-gallery.open {
  display: block;
}

.sa-gallery .sg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(2px);
}

.sa-gallery .sg-frame {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 20px;
}

.sa-gallery .sg-close {
  justify-self: end;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  cursor: pointer;
}

.sa-gallery .sg-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  /* allow img to scale */
}

.sa-gallery .sg-img {
  max-width: 92vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.sa-gallery .sg-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 24px;
  line-height: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sa-gallery .sg-prev {
  left: 12px;
}

.sa-gallery .sg-next {
  right: 12px;
}

.sa-gallery .sg-counter {
  justify-self: center;
  margin-top: 8px;
  color: var(--text-dim);
  font-weight: 700;
}

/* curseur "zoom" / cliquable sur les images des posts */
.photos img {
  cursor: zoom-in;
}

/* ===== Threads inline (sous un commentaire) ===== */
.thread {
  margin: 6px 0 0 0;
  padding-left: 56px;
  /* aligné sous le contenu, avatar à gauche (44px + gap) */
  border-left: 1px solid var(--line-soft);
}

.thread .post {
  border-bottom: none;
  padding: 10px 0;
}

.thread[hidden] {
  display: none;
}

.thread-toggle {
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
}

.thread-toggle:hover {
  background: #0b0d10;
  color: var(--text);
}

.inline-reply {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0b0d;
}

.inline-reply .ir-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.inline-reply textarea {
  flex: 1;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #0a0b0d;
  color: var(--text);
}

.inline-reply .ir-send {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.inline-reply .ir-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.inline-reply .ir-msg {
  display: inline-block;
  margin-left: 8px;
  color: var(--text-dim);
}

.inline-reply {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0b0d;

  /* ✅ anti-débordement */
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Optionnel : sur mobile, on force à prendre toute la largeur */
@media (max-width: 600px) {
  .inline-reply {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }
}

.inline-reply textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.inline-reply .ir-row {
  flex-wrap: wrap;
  /* pour que le bouton passe en dessous si ça serre trop */
}

/* ========== Responsive Threads / Inline Reply ========== */

/* Mobile-first : petites améliorations générales */
.thread {
  /* garde ton style mais autorise le contenu à mieux respirer */
  padding-left: clamp(32px, 7vw, 56px);
  /* 32→56 selon largeur */
  border-left: 1px solid var(--line-soft);
}

.thread .post {
  padding: 10px 0;
}

/* Touch targets + lisibilité */
.inline-reply .ir-send {
  min-height: 40px;
  /* bouton touch-friendly */
  padding: 10px 14px;
  font-weight: 700;
}

/* ===== ≤ 900px : tablettes en portrait / petits laptops ===== */
@media (max-width: 900px) {
  .thread {
    padding-left: 44px;
    /* avatar + petit décalage */
    border-left-color: var(--line);
    /* un peu plus visible */
  }

  .inline-reply textarea {
    min-height: 72px;
    /* un peu plus de place pour taper */
  }
}

/* ===== ≤ 600px : smartphones standards ===== */
@media (max-width: 600px) {
  .thread {
    padding-left: 36px;
    /* réduit le décalage pour tenir dans l'écran */
    margin-left: 6px;
    /* léger offset pour garder le guide visuel */
    border-left-width: 1px;
  }

  .thread .post {
    padding: 8px 0;
  }

  .inline-reply {
    padding: 8px;
    /* compacter un peu */
  }

  .inline-reply .ir-row {
    gap: 6px;
  }

  .inline-reply textarea {
    min-height: 80px;
    /* zone plus confortable sur mobile */
    font-size: 14px;
  }

  .inline-reply .ir-send {
    padding: 10px 12px;
    font-size: 14px;
  }

  .inline-reply .ir-msg {
    display: block;
    /* passe sous la rangée */
    margin: 6px 2px 0;
  }
}

/* ===== ≤ 420px : petits smartphones ===== */
@media (max-width: 420px) {
  .thread {
    padding-left: 28px;
    /* encore plus compact */
    margin-left: 4px;
  }

  /* Empile le bouton sous le textarea si trop étroit */
  .inline-reply .ir-row {
    flex-wrap: wrap;
  }

  .inline-reply textarea {
    flex: 1 1 100%;
    min-height: 88px;
  }

  .inline-reply .ir-send {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 6px;
    text-align: center;
  }
}

/* ===== Accessibilité / confort (optionnel mais recommandé) ===== */

/* Réduire les animations si l'utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  .inline-reply .ir-send,
  .thread,
  .inline-reply textarea {
    transition: none !important;
  }
}

/* Contraste renforcé (si tu utilises un thème HC un jour) */
@media (prefers-contrast: more) {
  .thread {
    border-left-color: #6b7280;
  }

  /* gris plus clair */
}

#repliesBody .meta {
  display: block;
}

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

.chip.danger:hover {
  background: #1a0b0d;
  color: #ff6b72;
}

.chip.danger.act-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ef4444;
  /* red-500 */
  color: #fff;
  border: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.chip.danger.act-delete:hover {
  filter: brightness(0.95);
}

/* Kebab menu dans la barre meta */
.post .meta {
  position: relative;
}

.post-more {
  margin-left: auto;
  /* pousse à droite */
  margin-right: -6px;
  position: relative;
}

.more-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.more-btn:hover {
  filter: brightness(1.06);
}

.post-menu {
  position: absolute;
  top: 36px;
  right: 0;
  min-width: 180px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 5;
}

.post-menu[hidden] {
  display: none;
}

.post-menu .menu-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.post-menu .menu-item:hover {
  background: #101317;
}

.post-menu .menu-item.act-delete {
  color: var(--danger);
}

/* ===== Global Page Loader ===== */
#globalLoader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  z-index: 9999;
  transition: opacity 0.3s ease;
}

#globalLoader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* spinner cercle */
#globalLoader .loader {
  width: 42px;
  height: 42px;
  border: 4px solid var(--line);
  border-top-color: #ff9900;
  /* 🎨 couleur Softadastra */
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
:root {
  --accent: #ff9900;
}

.sw-card {
  padding: 12px;
  margin-top: 12px;
}

.sw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sw-head strong {
  font-size: 15px;
  font-weight: 700;
}

.sw-seeall {
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
}

.sw-seeall:hover {
  text-decoration: underline;
}

.sw-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.sw-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #0b0d10;
  border: 1px solid var(--line);
}

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

.sw-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-title {
  font-size: 13px;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sw-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.sw-price {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.sw-brand {
  color: var(--text-dim);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skel {
  position: relative;
  overflow: hidden;
  background: #101217;
  border: 1px solid var(--line);
  border-radius: 12px;
  height: 72px;
}

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
  border-radius: inherit;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* seulement sur desktop */
@media (max-width: 900px) {
  #shopWidget {
    display: none !important;
  }
}

.sw-item:hover {
  background: #0a0b0d;
}

/* Sidebar gauche scrollable (desktop seulement) */
aside.left {
  position: sticky;
  /* reste fixée dans la page */
  top: 64px;
  /* aligne sous ta topbar */
  align-self: start;
  /* important dans un grid */
  height: calc(100vh - 64px);
  /* occupe la hauteur dispo */
  overflow-y: auto;
  /* active le scroll vertical */
  overflow-x: hidden;
  padding-right: 6px;
  /* espace pour la scrollbar */
  -webkit-overflow-scrolling: touch;
  /* inertie fluide */
  overscroll-behavior: contain;
  /* pas d'effet rebond sur la page */
}

/* Affine la scrollbar (optionnel) */
aside.left::-webkit-scrollbar {
  width: 8px;
}

aside.left::-webkit-scrollbar-thumb {
  background: #1f2327;
  border-radius: 8px;
  border: 2px solid #0a0b0d;
}

/* Évite que des éléments internes forcent l’overflow horizontal */
aside.left .nav,
aside.left .sw-list,
aside.left .card,
aside.left .widget {
  min-width: 0;
}

/* Sur mobile, on cache déjà la colonne — au cas où : */
@media (max-width: 900px) {
  aside.left {
    display: none;
  }
}
aside.right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card.widget {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.widget-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.card.widget p {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg, #fff0);
  color: var(--text);
  font-size: 14px;
}

.search-input:focus {
  border-color: var(--accent, #1da1f2);
  outline: none;
  box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.2);
}

/* ===== Uploader bar ===== */
.dz-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0a0b0d;
}

.dz-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.06s ease;
}

.dz-btn:hover {
  background: #101217;
}

.dz-btn:active {
  transform: translateY(1px);
}

.dz-btn svg {
  flex: 0 0 auto;
}

.dz-help {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  /* autorise le texte à se réduire */
  color: var(--text-dim);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dz-help .sep {
  opacity: 0.6;
}

.dz-count {
  justify-self: end;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .dz-bar {
    grid-template-columns: 1fr auto;
    row-gap: 10px;
  }

  .dz-btn {
    justify-self: start;
  }

  .dz-help {
    grid-column: 1 / -1;
    /* passe sur la ligne suivante */
    font-size: 12.8px;
    white-space: normal;
    /* autorise retour à la ligne */
  }

  .dz-count {
    justify-self: end;
  }
}

/* (optionnel) état drag actif hérite de ta .dropzone.drag */
.dropzone.drag .dz-bar {
  outline: 2px solid var(--brand);
  outline-offset: -4px;
  background: #0b1220;
}

@media (max-width: 991px) {
  .dz-help {
    display: none !important;
  }
}
/* ===== Composer (modal) – look & feel X-like ===== */
#modalComposer .sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

#modalComposer .hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

#modalComposer .hd strong {
  font-size: 16px;
  font-weight: 800;
}

#modalComposer .bd {
  padding: 14px 16px;
}

/* Textarea */
#txtBody {
  width: 100%;
  min-height: 140px;
  background: #0a0b0d;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#txtBody::placeholder {
  color: var(--text-dim);
}

#txtBody:focus {
  border-color: var(--brand);
  background: #0b0f14;
}

/* Row (uploader + visibilité) */
#modalComposer .row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 12px;
}

@media (max-width: 720px) {
  #modalComposer .row {
    grid-template-columns: 1fr;
  }
}

/* Uploader / Dropzone */
.dropzone {
  position: relative;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #0a0b0d;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.dropzone.drag {
  outline: 2px solid var(--brand);
  outline-offset: -4px;
  background: #0b1220;
}

.dz-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.dz-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dz-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.dz-btn:hover {
  filter: brightness(1.06);
}

.dz-help {
  color: var(--text-dim);
  font-size: 13px;
}

.dz-help b {
  color: var(--text);
}

/* Previews grid */
.previews {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
  .previews {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  .previews {
    grid-template-columns: repeat(2, 1fr);
  }
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0d10;
}

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

.thumb .rm {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.thumb .rm:hover {
  background: rgba(0, 0, 0, 0.75);
}

/* Visibility select (pill) */
.label-small {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

#selVisibility {
  display: block;
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
}

/* Actions row */
.actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.actions-left,
.actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter {
  font-size: 13px;
  color: var(--text-dim);
}

#composerMsg {
  color: var(--text-dim);
}

/* Primary button */
#btnPublish.topbtn.primary {
  background: var(--brand);
  border-color: transparent;
  color: #000;
  font-weight: 900;
}

#btnPublish.topbtn.primary:hover {
  background: var(--brand-press);
}

/* Small icon button (circle) */
.iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.iconbtn:hover {
  filter: brightness(1.06);
}

.iconbtn svg {
  width: 18px;
  height: 18px;
}

.user-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.user-cover {
  position: relative;
  height: 100px;
  background: var(--line);
}

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

.user-main {
  display: flex;
  padding: 14px;
  gap: 12px;
  position: relative;
}

.user-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--panel);
  object-fit: cover;
  flex-shrink: 0;
  margin-top: -36px;
  /* chevauche la cover */
  background: #fff;
}

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

.user-name {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.user-username {
  font-size: 14px;
  color: var(--muted);
}

.user-bio {
  margin: 6px 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.user-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  font-size: 13px;
  margin-top: 8px;
}

.user-meta span {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-weight: 500;
}

.user-meta svg {
  margin-right: 4px;
  opacity: 0.75;
}

.user-meta em {
  font-style: normal;
  opacity: 0.8;
  margin-left: 2px;
  font-weight: 400;
}

/* Mobile adaptatif */
@media (max-width: 480px) {
  .user-meta {
    grid-template-columns: 1fr;
  }
}

.user-card .user-info {
  padding-left: 0 !important;
  min-height: 40px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #16a34a;
  /* vert succès par défaut */
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2000;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#toast.error {
  background: #dc2626;
  /* rouge */
}

#toast svg {
  flex: none;
}

/* ===== Skeleton feed (façon X) ===== */
.feed-skeleton {
  padding: 0;
}

.sk-post {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.sk-avatar,
.sk-line,
.sk-photo {
  position: relative;
  overflow: hidden;
  background: #0e1113;
  /* base */
  border-radius: 8px;
}

.sk-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
}

.sk-line {
  height: 12px;
}

.sk-line.sm {
  width: 35%;
}

.sk-line.md {
  width: 60%;
}

.sk-line.lg {
  width: 90%;
  height: 14px;
}

.sk-gap {
  height: 8px;
}

.sk-photo {
  border-radius: 16px;
  height: 180px;
  border: 1px solid var(--line);
}

/* shimmer */
.sk-avatar::after,
.sk-line::after,
.sk-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0)
  );
  transform: translateX(-100%);
  animation: sk-shimmer 1.2s infinite;
}

@keyframes sk-shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ===== Bouton Load more : état chargement ===== */
.topbtn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.topbtn .btn-spin {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: btnspin 0.7s linear infinite;
}

@keyframes btnspin {
  to {
    transform: rotate(360deg);
  }
}
/* ===== Modal Delete (variables globales) ===== */
.sa-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.sa-modal.open {
  display: block;
}

/* Backdrop */
.sa-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sa-modal.open .sa-modal__backdrop {
  opacity: 1;
}

/* Panel (bottom sheet par défaut / centré en desktop) */
.sa-modal__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  color: var(--text);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.sa-modal.open .sa-modal__panel {
  transform: translateY(0);
}

/* Handle (mobile uniquement) */
.sa-modal__handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 8px auto;
  opacity: 0.6;
}

/* Head / body / foot */
.sa-modal__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 16px;
}

.sa-modal__body {
  padding: 14px 16px;
  color: var(--text);
}

.sa-modal__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Error block */
.sa-modal__error {
  margin-top: 8px;
  background: #2a1b1c;
  border: 1px solid #6b1f24;
  color: #ffb4b8;
  padding: 8px;
  border-radius: 8px;
}

/* Buttons */
.btn {
  border: 1px solid var(--line);
  background: #0b0d10;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.1);
}

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

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 8px;
  animation: none;
}

.spinner[hidden] {
  display: none !important;
}

.btn-loading .spinner {
  animation: spin 0.7s linear infinite;
}

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

/* Desktop: centré */
@media (min-width: 768px) {
  .sa-modal__panel {
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    width: min(420px, 92vw);
    border-radius: var(--radius);
    transform: translate(-50%, -48%) scale(0.97);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .sa-modal.open .sa-modal__panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  .sa-modal__handle {
    display: none;
  }
}

@media (max-width: 991px) {
  aside.right {
    display: none !important;
  }
}

.wrap {
  padding-bottom: 50px;
}

.spinner {
  animation: none;
}

.spinner[hidden] {
  display: none !important;
}

.btn-loading .spinner {
  animation: spin 0.7s linear infinite;
}
#repliesBody .meta {
  display: flex;
}
