/* ==========================================================================
   Vonpy · Rediseño social (2026-10-25)
   Estética de red social (Facebook / Instagram) sobre las mismas funciones.
   Se carga después de style.css y vp-design.css: solo cambia la apariencia.
   ========================================================================== */

:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #050505;
  --muted: #65676b;
  --line: #e4e6eb;
  --line-strong: #ced0d4;
  --hover: #f2f2f2;
  --input: #f0f2f5;
  --accent: #fd5501;
  --accent-2: #e4405f;
  --accent-soft: #fff0e8;
  --link: #216fdb;
  --like: #1877f2;
  --up: #1877f2;
  --down: #e4405f;
  --ok-bg: #e7f6ec; --ok-text: #1d6b39;
  --err-bg: #fdecec; --err-text: #9b2222;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .12);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .16), 0 2px 4px rgba(0, 0, 0, .08);
  --ig: linear-gradient(45deg, #feda75 0%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 100%);
  --brand: linear-gradient(135deg, #ff8a3d 0%, #fd5501 50%, #e4405f 100%);
  --top-h: 56px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #18191a;
  --card: #242526;
  --text: #e4e6eb;
  --muted: #b0b3b8;
  --line: #393a3b;
  --line-strong: #3e4042;
  --hover: #3a3b3c;
  --input: #3a3b3c;
  --accent: #ff7a33;
  --accent-soft: #3a2418;
  --link: #4599ff;
  --like: #2d88ff;
  --up: #2d88ff;
  --down: #ff6b81;
  --ok-bg: #173323; --ok-text: #8fe0ab;
  --err-bg: #3a1c1c; --err-text: #ffaaaa;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .5);
  --vp-ring: rgba(255, 122, 51, .22);
  color-scheme: dark;
}

/* ---------- Base ---------- */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.sx {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, "Segoe UI", Helvetica, Arial, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.sx a { color: var(--link); }
body.sx a:hover { text-decoration: underline; }
body.sx h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
body.sx h2 { font-size: 1.15rem; font-weight: 700; }
body.sx h3 { font-size: 1.05rem; font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: rgba(253, 85, 1, .2); }

/* ---------- Tarjetas ---------- */
body.sx .card,
body.sx .post-card {
  background: var(--card); border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px;
}
body.sx .card { padding: 16px; }
body.sx .feed > .post-card:hover { transform: none; box-shadow: var(--shadow); }
body.sx .empty { text-align: center; padding: 32px 16px; color: var(--muted); }

/* ---------- Botones ---------- */
body.sx .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 6px; border: 0; background: var(--input); color: var(--text);
  font-weight: 600; padding: 8px 14px; font-size: .94rem; line-height: 1.25;
  text-decoration: none; cursor: pointer; transition: filter .12s ease, background .12s ease;
}
body.sx .btn:hover { filter: brightness(.95); text-decoration: none; }
body.sx .btn-primary, body.sx .btn.btn-primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] body.sx .btn-primary { color: #fff; }
body.sx .btn-primary:hover { filter: brightness(1.06); }
body.sx .btn-sm { padding: 6px 12px; font-size: .88rem; }
body.sx .btn-block { width: 100%; }
body.sx .btn.btn-danger { background: #e03131; color: #fff; }
body.sx .link { color: var(--muted); font-weight: 600; }
body.sx .link:hover { color: var(--text); text-decoration: underline; }

/* ---------- Formularios ---------- */
body.sx input[type=text], body.sx input[type=search], body.sx input[type=email], body.sx input[type=password],
body.sx input[type=url], body.sx input[type=number], body.sx input[type=tel], body.sx input[type=date],
body.sx input[type=time], body.sx input:not([type]), body.sx select, body.sx textarea {
  background: var(--input); color: var(--text); border: 1px solid transparent; border-radius: 8px;
  padding: 9px 12px; font: inherit;
}
body.sx input:focus, body.sx select:focus, body.sx textarea:focus {
  outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px rgba(253, 85, 1, .15);
}
body.sx .flash { border-radius: 8px; border: 0; box-shadow: var(--shadow); }

/* ==========================================================================
   Barra superior (estilo Facebook)
   ========================================================================== */
body.sx .topbar.sx-top {
  position: sticky; top: 0; z-index: 50; height: var(--top-h);
  background: var(--card); border-bottom: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}
.sx-top.sx-scrolled { box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.sx-top-in {
  height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 8px; padding: 0 16px; max-width: none;
}
.sx-top-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
body.sx .logo { color: var(--text); gap: 4px; flex: 0 0 auto; }
body.sx .logo:hover { text-decoration: none; }
body.sx .logo-mark { width: 40px; height: 40px; }
body.sx .logo-text { font-size: 1.55rem; font-weight: 800; letter-spacing: -.04em; color: var(--text); }
body.sx .logo-py { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

.sx-search {
  display: flex; align-items: center; gap: 8px; background: var(--input); border-radius: 999px;
  padding: 0 14px; height: 40px; width: 240px; max-width: 100%; color: var(--muted);
}
.sx-search input {
  border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important;
  width: 100%; height: 100%; color: var(--text); font-size: .95rem;
}
.sx-search input::placeholder { color: var(--muted); }

.sx-center { display: flex; align-items: stretch; height: var(--top-h); gap: 4px; }
.sx-center a {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 104px; margin: 4px 0; border-radius: 8px; color: var(--muted) !important; font-size: 1.35rem;
  transition: background .12s ease;
}
.sx-center a:hover { background: var(--hover); text-decoration: none; }
.sx-center a.on { color: var(--accent) !important; margin-bottom: 0; border-radius: 8px 8px 0 0; }
.sx-center a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); border-radius: 3px 3px 0 0; }
.sx-center a.on:hover { background: transparent; }

body.sx .nav.sx-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.sx-ic, body.sx .theme-toggle.sx-ic {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%; background: var(--input); color: var(--text) !important;
  border: 0; font-size: 1.05rem; cursor: pointer; transition: filter .12s ease; padding: 0;
}
.sx-ic:hover { filter: brightness(.93); text-decoration: none; }
.sx-ic .pill, body.sx .nav-msgs .pill, body.sx .nav-reports .pill {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: #e41e3f; color: #fff; font-size: .72rem; font-weight: 700; line-height: 19px; text-align: center;
  border: 2px solid var(--card); box-sizing: content-box;
}
.sx-search-m { display: none !important; }
.sx-publish { border-radius: 999px !important; }

body.sx .menu summary {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--input); font-weight: 600; color: var(--text);
}
body.sx .menu summary:hover { filter: brightness(.95); background: var(--input); }
body.sx .menu summary .av-sm { width: 32px; height: 32px; }
body.sx .menu-list {
  top: calc(100% + 8px); min-width: 280px; padding: 8px; border: 0; border-radius: 10px;
  background: var(--card); box-shadow: var(--shadow-lg); z-index: 60;
}
body.sx .menu-list a, body.sx .menu-list button {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; font-weight: 600; color: var(--text);
}
body.sx .menu-list a:hover, body.sx .menu-list button:hover { background: var(--hover); }
body.sx .menu-list i { width: 36px; height: 36px; border-radius: 50%; background: var(--input); display: inline-flex; align-items: center; justify-content: center; }
body.sx .menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.sx-menu-me { box-shadow: var(--shadow); margin-bottom: 4px; }
.sx-menu-me span { display: flex; flex-direction: column; }
.sx-menu-me small { color: var(--muted); font-weight: 400; }

body.sx .acting-bar { background: #fff4e5; color: #663c00; }
.sx-announce { padding: 10px 0; font-weight: 500; }
.sx-announce .wrap { display: flex; gap: 10px; align-items: baseline; }
.sx-announce-info { background: #e7f0ff; color: #0b3d91; }
.sx-announce-alert { background: #fff3cd; color: #6b4e00; }
:root[data-theme="dark"] .sx-announce-info { background: #13294b; color: #c6dbff; }
:root[data-theme="dark"] .sx-announce-alert { background: #3d3214; color: #ffe69c; }

/* ==========================================================================
   Barra lateral izquierda (atajos) — solo en pantallas anchas
   ========================================================================== */
.sx-sidebar {
  display: none; position: fixed; top: var(--top-h); left: 0; bottom: 0; width: 300px;
  padding: 16px 8px 24px; overflow-y: auto; scrollbar-width: thin; z-index: 5;
}
.sx-side-nav { display: grid; gap: 2px; }
.sx-side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px;
  color: var(--text) !important; font-weight: 600; font-size: .95rem;
}
.sx-side-nav a:hover { background: var(--hover); text-decoration: none; }
.sx-side-nav a.on { background: var(--accent-soft); }
.sx-side-nav .av-md { width: 36px; height: 36px; }
.sx-si {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--c, var(--accent)); color: #fff; font-size: 1rem; flex: 0 0 auto;
}
.sx-count { margin-left: auto; background: #e41e3f; color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 8px; }
.sx-side-sec { border-top: 1px solid var(--line); margin: 12px 8px 0; padding-top: 12px; }
.sx-side-sec .sx-side-nav { margin: 0 -8px; }
.sx-side-sec h4 { margin: 0 0 6px; color: var(--muted); font-size: 1.02rem; font-weight: 600; }
.sx-side-nav a.cmty .cmty-logo { width: 36px; height: 36px; font-size: 15px; box-shadow: none; border-radius: 10px; }
.sx-side-foot { color: var(--muted); font-size: .78rem; padding: 12px 8px; line-height: 1.6; }
.sx-side-foot a { color: var(--muted) !important; }

/* ==========================================================================
   Estructura de página
   ========================================================================== */
body.sx main.wrap { max-width: 1040px; padding-top: 20px; padding-bottom: 40px; }
body.sx .foot { max-width: 1040px; color: var(--muted); font-size: .82rem; border-top: 0; text-align: center; }
body.sx .foot a { color: var(--muted); }
body.sx .layout { grid-template-columns: minmax(0, 680px) 320px; justify-content: center; gap: 24px; }
body.sx .side { position: sticky; top: calc(var(--top-h) + 16px); }
body.sx .side .card h3 { font-size: 1.05rem; color: var(--text); }

@media (min-width: 1300px) {
  .sx-sidebar { display: block; }
  body.sx main.wrap, body.sx .foot { padding-left: 316px; max-width: 1380px; }
}
@media (max-width: 1100px) {
  .sx-center a { width: 72px; }
  .sx-search { width: 200px; }
  .sx-me-alias { display: none; }
  body.sx .menu summary { padding: 4px; }
}
@media (max-width: 1180px) {
  .sx-center { display: none; }
  .sx-top-in { grid-template-columns: minmax(0, 1fr) auto; }
  .sx-publish span { display: none; }
}
@media (max-width: 900px) {
  body.sx .layout { grid-template-columns: minmax(0, 680px); }
  body.sx .side { position: static; }
  .sx-search { width: 100%; max-width: 280px; }
}

/* ==========================================================================
   Historias (comunidades destacadas, estilo Instagram)
   ========================================================================== */
.sx-stories {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); justify-items: center;
  gap: 14px 8px; padding: 16px 12px 14px; margin-bottom: 16px; overflow: visible;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.sx-stories::-webkit-scrollbar { display: none; }
body.sx a.sx-story {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 84px; flex: 0 0 auto;
  color: var(--text) !important; font-weight: 500; font-size: .76rem; text-decoration: none;
}
body.sx a.sx-story:hover { text-decoration: none; }
.sx-story .cmty-logo, .sx-story-ring {
  width: 66px !important; height: 66px !important; font-size: 26px !important; border-radius: 50%;
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5.5px #d62976 !important;
  margin: 6px 0 2px;
}
.sx-story .cmty-logo { background-image: linear-gradient(135deg, var(--c1), var(--c2)); }
.sx-story:hover .cmty-logo { transform: scale(1.04); transition: transform .15s ease; }
.sx-story-label { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-story-ring { position: relative; display: inline-flex; box-shadow: 0 0 0 3px var(--card), 0 0 0 4.5px var(--line-strong) !important; }
.sx-story-ring .av { width: 66px; height: 66px; font-size: 26px; }
.sx-story-ring b {
  position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--like); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .75rem; border: 3px solid var(--card);
}
body.sx .vp-chips { display: none !important; }

/* ---------- Caja "¿Qué querés compartir?" ---------- */
body.sx .sx-composer { padding: 12px 16px 8px; }
.sx-composer-top { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sx-composer-top .av-md { width: 40px; height: 40px; }
body.sx a.sx-composer-input {
  flex: 1; background: var(--input); border-radius: 999px; padding: 10px 14px; color: var(--muted) !important; font-size: 1.02rem;
}
body.sx a.sx-composer-input:hover { filter: brightness(.96); text-decoration: none; }
.sx-composer-acts { display: flex; padding-top: 6px; }
body.sx .sx-composer-acts a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; border-radius: 8px;
  color: var(--muted) !important; font-weight: 600; font-size: .94rem;
}
body.sx .sx-composer-acts a:hover { background: var(--hover); text-decoration: none; }
.sx-composer-acts i { font-size: 1.35rem; }

/* ---------- Pestañas tipo filtro ---------- */
body.sx .tabs {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; margin: 0 0 16px; padding: 6px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 0; scrollbar-width: none;
}
body.sx .tabs::-webkit-scrollbar { display: none; }
body.sx .tabs a {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 600; background: transparent; border: 0; box-shadow: none; white-space: nowrap;
}
body.sx .tabs a:hover { background: var(--hover); text-decoration: none; color: var(--text); }
body.sx .tabs a.on { background: var(--accent-soft); color: var(--accent); box-shadow: none; }

/* ==========================================================================
   Publicaciones (tarjeta estilo Facebook)
   ========================================================================== */
body.sx .post-card.sx-post { display: block; padding: 0; overflow: hidden; }
.sx-post-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; }
.sx-post-av .av-md, .sx-post-av .av { width: 40px; height: 40px; font-size: 1rem; }
.sx-post-who { min-width: 0; flex: 1; display: block !important; margin: 0 !important; }
.sx-post-author { font-size: .95rem; line-height: 1.25; }
body.sx .sx-post-author .author { color: var(--text) !important; font-weight: 700; }
.sx-post-author .author .av { display: none; }
.sx-post-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: .8rem; margin-top: 2px; }
body.sx .sx-post-sub a { color: var(--muted) !important; }
body.sx .sx-post-sub a.cmty { font-weight: 600; gap: 4px; }
.sx-post-sub a.cmty .cmty-logo { width: 16px !important; height: 16px !important; font-size: 8px !important; box-shadow: none; }
.sx-post-sub .fa-earth-americas { font-size: .72rem; }

body.sx .sx-post .post-main { padding: 8px 16px 10px; }
body.sx .sx-post .post-title { font-size: 1.05rem; font-weight: 600; line-height: 1.38; margin: 0; }
body.sx .sx-post .post-title a { color: var(--text) !important; }
body.sx .sx-post .post-title a:hover { text-decoration: none; color: var(--link) !important; }
body.sx a.sx-link-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px;
  background: var(--input); color: var(--muted) !important; font-size: .82rem; font-weight: 600;
}
.sx-badges:empty { display: none; }
.sx-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
body.sx .reel-badge, body.sx .poll-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; margin: 0;
  font-size: .85rem; font-weight: 600; text-decoration: none;
}
body.sx .reel-badge { background: rgba(228, 64, 95, .1); color: #d62976 !important; }
body.sx .poll-badge { background: rgba(247, 185, 40, .16); color: #a26b00 !important; }
:root[data-theme="dark"] body.sx .poll-badge { color: #f7c948 !important; }

body.sx .sx-post .card-image.sx-media { display: block; margin: 0; border-radius: 0; background: #000; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
body.sx .sx-post .card-image.sx-media img { display: block; width: 100%; max-height: 640px; object-fit: contain; border-radius: 0; margin: 0 auto; }

.sx-stats {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; color: var(--muted); font-size: .9rem;
}
body.sx .sx-stats a { color: var(--muted) !important; }
.sx-react { display: inline-flex; align-items: center; gap: 6px; }
.sx-react-ic {
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #18afff, #0866ff); color: #fff; font-size: .62rem;
}
.sx-post:not(.sx-has-likes) .sx-react { opacity: .55; }

body.sx .actions.sx-actions {
  display: flex; align-items: stretch; gap: 4px; margin: 0 12px; padding: 4px 0; border-top: 1px solid var(--line);
}
body.sx .sx-actions > * { flex: 1 1 0; }
.sx-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 6px; border-radius: 6px;
  color: var(--muted) !important; font-weight: 600; font-size: .94rem; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.sx-act:hover { background: var(--hover); text-decoration: none !important; }
.sx-act i { font-size: 1.12rem; }

/* ---------- Botón "Me gusta" (votos) ---------- */
body.sx .vote {
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 2px;
  width: auto; min-width: 0; padding: 0; margin: 0; background: transparent; border: 0;
}
body.sx .vote button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border-radius: 6px;
  background: none; border: 0; color: var(--muted); font: 600 .94rem/1 inherit; font-family: inherit; cursor: pointer;
}
body.sx .vote button:hover { background: var(--hover); }
body.sx .vote button i { font-size: 1.1rem; }
body.sx .vote .up.active { color: var(--like); }
body.sx .vote .up.active i { animation: sx-pop .3s ease; }
body.sx .vote .down.active { color: var(--down); }
body.sx .vote .score { font-weight: 700; color: var(--muted); font-size: .9rem; min-width: 1ch; text-align: center; }
body.sx .sx-actions .vote .score { display: none; }
body.sx .sx-actions .vote .up { flex: 1; }
body.sx .sx-actions .vote .down { padding: 8px; }
@keyframes sx-pop { 0% { transform: scale(1); } 50% { transform: scale(1.35) rotate(-12deg); } 100% { transform: scale(1); } }

/* ---------- Negocio dentro del feed ---------- */
body.sx .sx-post .biz-mini { margin-top: 8px; }

/* ==========================================================================
   Detalle de publicación y comentarios
   ========================================================================== */
body.sx .post-full { padding: 0; overflow: hidden; }
body.sx .post-full > .post-card { display: flex; flex-direction: column; box-shadow: none; margin: 0; border-radius: 0; padding: 16px; }
body.sx .post-full > .post-card > .vote { order: 3; justify-content: flex-start; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }
body.sx .post-full .post-main { width: 100%; }
body.sx .post-full .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
body.sx .post-full .meta .author { color: var(--text) !important; font-weight: 700; font-size: .95rem; }
body.sx .post-full .meta .author .av-sm { width: 40px; height: 40px; }
body.sx .post-full .post-title { font-size: 1.4rem; line-height: 1.3; font-weight: 700; }
body.sx .post-full .body { font-size: 1rem; line-height: 1.6; }
body.sx .post-image img { border-radius: 8px; }

body.sx .comments h2 { font-size: 1.05rem; color: var(--muted); }
body.sx .comment { display: flex; gap: 8px; margin: 10px 0 0; padding: 0; border: 0; }
body.sx .comment-main { flex: 1; min-width: 0; }
body.sx .comment .meta {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); margin: 0 0 2px;
}
body.sx .comment .meta .author { color: var(--text) !important; font-weight: 700; font-size: .85rem; }
body.sx .comment .meta .author .av-sm { width: 32px; height: 32px; }
body.sx .comment .body {
  display: inline-block; max-width: 100%; background: var(--input); padding: 8px 12px; border-radius: 18px;
  font-size: .94rem; line-height: 1.45; margin-left: 38px;
}
body.sx .comment .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 0 46px; font-size: .8rem; }
body.sx .comment .actions .link, body.sx .comment .actions summary { font-size: .8rem; color: var(--muted); font-weight: 700; }
body.sx .comment .actions .vote button { padding: 3px 6px; font-size: .8rem; }
body.sx .comment .actions .vote button i { font-size: .85rem; }
body.sx .comment .actions .vote .vt { display: none; }
body.sx .comment .actions .vote .score { font-size: .8rem; }
body.sx .replies { margin-left: 38px; padding-left: 10px; border-left: 2px solid var(--line); }
body.sx .reply-form { margin-left: 46px; }
body.sx .comment-image img { border-radius: 14px !important; }

/* ==========================================================================
   Comunidades
   ========================================================================== */
body.sx .cmty-head { padding: 0 16px 16px !important; }
body.sx .cmty-head .vp-cover { height: 180px; border-radius: 0 0 10px 10px; }
body.sx .cmty-head .vp-head-row { margin-top: -50px; }
body.sx .cmty-head .cmty-logo.xl { width: 120px; height: 120px; font-size: 52px; box-shadow: 0 0 0 4px var(--card); border-radius: 22px; }
body.sx .cmty-head .vp-head-row h1 { font-size: 2rem; }
.sx-cmty-stats { color: var(--muted); font-size: .92rem; margin: 6px 0; }
body.sx a.card.cmty-item { box-shadow: var(--shadow); }
body.sx a.card.cmty-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
body.sx a.card.cmty-item .cmty-logo { border-radius: 16px; }
body.sx .vp-side-cmtys li a:hover { background: var(--hover); }
body.sx .vp-side-cmtys .cmty-logo.md { border-radius: 10px; }

/* ==========================================================================
   Perfil (estilo Instagram)
   ========================================================================== */
.sx-profile-page { max-width: 935px; margin: 0 auto; }
body.sx .sx-profile { display: block; padding: 0; overflow: hidden; }
.sx-cover {
  height: 220px;
  background:
    radial-gradient(circle at 15% 120%, rgba(255,255,255,.25) 0 28%, transparent 29%),
    radial-gradient(circle at 90% -10%, rgba(255,255,255,.18) 0 22%, transparent 23%),
    linear-gradient(120deg, hsl(var(--h, 20), 85%, 60%), hsl(calc(var(--h, 20) + 50), 75%, 45%));
}
.sx-profile-row { display: flex; gap: 28px; padding: 0 28px 22px; align-items: flex-start; }
.sx-profile-av { margin-top: -70px; flex: 0 0 auto; }
.sx-ring { display: inline-flex; padding: 4px; border-radius: 50%; background: var(--ig); }
.sx-ring .av { width: 152px; height: 152px; font-size: 60px; border: 4px solid var(--card); border-radius: 50%; display: inline-flex; }
.sx-profile-info { flex: 1; min-width: 0; padding-top: 14px; }
.sx-profile-name { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.sx-profile-name h1 { margin: 0; font-size: 1.6rem; display: flex; align-items: center; gap: 8px; }
.sx-profile-btns { display: flex; gap: 8px; }
.sx-profile-stats { display: flex; gap: 28px; list-style: none; margin: 14px 0; padding: 0; font-size: 1rem; }
.sx-profile-stats strong { font-weight: 700; }
.sx-profile-mod { font-size: .92rem; margin: 6px 0; }
body.sx .sx-ptabs { justify-content: center; }
.sx-profile-feed { max-width: 680px; margin: 0 auto; }
.sx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.sx-grid-item { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--line); border-radius: 4px; }
.sx-grid-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.sx-grid-over {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 22px;
  background: rgba(0, 0, 0, .38); color: #fff; font-weight: 700; opacity: 0; transition: opacity .15s ease;
}
.sx-grid-item:hover .sx-grid-over { opacity: 1; }
.sx-grid-item:hover img { transform: scale(1.03); }
body.sx .sx-pcomment { display: flex; gap: 10px; }
.sx-bubble { background: var(--input); border-radius: 18px; padding: 8px 12px; display: inline-block; max-width: 100%; }
.sx-pcomment .meta { font-size: .8rem; color: var(--muted); margin: 4px 0 0 12px; }

/* ==========================================================================
   Avatares
   ========================================================================== */
body.sx .av { border-radius: 50%; object-fit: cover; }
body.sx .av-letter { background: var(--brand); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.av-xs { width: 24px; height: 24px; font-size: .7rem; }
.av-md { width: 40px; height: 40px; font-size: 1rem; flex: 0 0 auto; }
body.sx .verified {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%;
  background: #1877f2; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; vertical-align: middle;
}

/* ==========================================================================
   Buscador
   ========================================================================== */
body.sx .sx-search-big { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.sx-search-big > i { color: var(--muted); padding-left: 6px; }
body.sx .sx-search-big input { flex: 1; border-radius: 999px; }
.sx-results h3 { margin-bottom: 8px; }
body.sx a.sx-result { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; color: var(--text) !important; }
body.sx a.sx-result:hover { background: var(--hover); text-decoration: none; }
.sx-result span { display: flex; flex-direction: column; min-width: 0; }
.sx-result small { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sx a.sx-result.cmty { font-weight: 400; }
body.sx a.sx-result.cmty .cmty-logo { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
.sx-more { display: block; text-align: center; padding: 8px; font-weight: 600; }
.sx-section-title { margin: 8px 4px 10px; }

/* ==========================================================================
   Otras secciones: negocios, mensajes, siguiendo
   ========================================================================== */
body.sx .dir-card { border: 0; box-shadow: var(--shadow); border-radius: var(--radius); }
body.sx .dir-card:hover { box-shadow: var(--shadow-lg); }
body.sx .chip { border-radius: 999px; }
body.sx .feed-update { padding: 14px 16px; }
body.sx .feed-update-img { border-radius: 8px; width: 100%; }
body.sx .msg.mine { background: var(--like); color: #fff; }
body.sx .msg.theirs { background: var(--input); }
body.sx .msg { border-radius: 18px; }
body.sx .admin-table th { color: var(--muted); font-weight: 600; }

/* ==========================================================================
   Barra inferior en el celular (estilo Instagram)
   ========================================================================== */
.sx-tabbar { display: none; }
@media (max-width: 760px) {
  :root { --top-h: 52px; }
  body.sx main.wrap { padding: 12px 0 90px; }
  body.sx .foot { padding-bottom: 80px; }
  body.sx .card, body.sx .post-card, .sx-stories, body.sx .tabs { border-radius: 0; margin-bottom: 8px; }
  body.sx .flash { margin: 0 8px 8px; }
  .sx-top-in { padding: 0 10px; }
  .sx-search { display: none; }
  .sx-search-m { display: inline-flex !important; }
  body.sx .logo-mark { width: 34px; height: 34px; }
  .sx-publish span, .sx-login { display: none !important; }
  .sx-publish { width: 40px; height: 40px; padding: 0 !important; }
  body.sx .nav.sx-right { gap: 6px; }
  body.sx .nav.sx-right .nav-msgs[href^="turnos"] { display: none; }
  body.sx h1 { font-size: 1.3rem; }
  .sx-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line);
  }
  .sx-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted) !important; font-size: .66rem; font-weight: 600; text-decoration: none !important;
  }
  .sx-tabbar a i { font-size: 1.3rem; }
  .sx-tabbar a.on { color: var(--text) !important; }
  .sx-tabbar a.on .av { box-shadow: 0 0 0 2px var(--text); }
  .sx-tabbar .sx-tab-add i {
    width: 44px; height: 32px; border-radius: 10px; background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  }
  .sx-profile-row { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 16px 18px; }
  .sx-profile-av { margin-top: -64px; }
  .sx-ring .av { width: 112px; height: 112px; font-size: 44px; }
  .sx-cover { height: 140px; }
  .sx-profile-name { justify-content: center; }
  .sx-profile-stats { justify-content: center; gap: 18px; font-size: .92rem; }
  .sx-grid { gap: 2px; }
  .sx-grid-item { border-radius: 0; }
  body.sx .cmty-head .vp-cover { height: 120px; }
  body.sx .cmty-head .cmty-logo.xl { width: 84px; height: 84px; font-size: 36px; }
  .sx-composer-acts span { font-size: .85rem; }
  .sx-act span { font-size: .88rem; }
  body.sx .sx-actions .vote .vt { display: none; }
}

/* ---------- Aviso flotante ---------- */
.sx-toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 100;
  background: #323436; color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600;
  box-shadow: var(--shadow-lg); transition: opacity .3s ease;
}
.sx-toast.out { opacity: 0; }

/* ==========================================================================
   Panel de administración
   ========================================================================== */
body.page-admin main.wrap { max-width: 1400px; }
@media (min-width: 1300px) { body.page-admin .sx-sidebar { display: none; } body.page-admin main.wrap { padding-left: 16px; } body.page-admin .foot { padding-left: 16px; } }
.adm { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.adm-nav { position: sticky; top: calc(var(--top-h) + 16px); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }
.adm-nav h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; margin: 0; }
.adm-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text) !important; font-weight: 600; font-size: .93rem; }
.adm-nav a:hover { background: var(--hover); text-decoration: none; }
.adm-nav a.on { background: var(--accent-soft); color: var(--accent) !important; }
.adm-nav a i { width: 20px; text-align: center; color: var(--muted); }
.adm-nav a.on i { color: var(--accent); }
.adm-nav a b { margin-left: auto; background: #e41e3f; color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 7px; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; gap: 12px; align-items: center; color: var(--text) !important; }
a.adm-kpi:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.adm-kpi .sx-si { width: 44px; height: 44px; font-size: 1.15rem; }
.adm-kpi strong { display: block; font-size: 1.45rem; line-height: 1.1; }
.adm-kpi small { color: var(--muted); font-weight: 600; }
.adm-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.adm-chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 10px 0 0; border-bottom: 1px solid var(--line); }
.adm-chart .col { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; position: relative; }
.adm-chart .bar { width: 30%; min-height: 2px; border-radius: 3px 3px 0 0; }
.adm-chart .b1 { background: #fd5501; } .adm-chart .b2 { background: #1877f2; } .adm-chart .b3 { background: #0aa36b; }
.adm-chart-x { display: flex; gap: 6px; font-size: .7rem; color: var(--muted); margin-top: 4px; }
.adm-chart-x span { flex: 1; text-align: center; }
.adm-legend { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.adm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.adm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.adm-toolbar input[type=search], .adm-toolbar input[type=text] { min-width: 220px; flex: 1; }
body.sx .adm table { width: 100%; border-collapse: collapse; font-size: .9rem; }
body.sx .adm th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; padding: 8px; border-bottom: 1px solid var(--line); }
body.sx .adm td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
body.sx .adm tr:hover td { background: color-mix(in srgb, var(--hover) 55%, transparent); }
.adm-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-who span { display: flex; flex-direction: column; min-width: 0; }
.adm-who small { color: var(--muted); }
.adm-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--input); color: var(--muted); margin: 1px 2px 1px 0; }
.adm-tag.red { background: #fdecec; color: #c92a2a; } .adm-tag.green { background: #e7f6ec; color: #1d6b39; }
.adm-tag.blue { background: #e7f0ff; color: #1155cc; } .adm-tag.orange { background: #fff0e6; color: #c24400; }
:root[data-theme="dark"] .adm-tag.red { background: #3a1c1c; color: #ffaaaa; }
:root[data-theme="dark"] .adm-tag.green { background: #173323; color: #8fe0ab; }
:root[data-theme="dark"] .adm-tag.blue { background: #13294b; color: #a9c8ff; }
:root[data-theme="dark"] .adm-tag.orange { background: #3a2418; color: #ffb58a; }
.adm-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-acts form { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
.adm-acts .btn { padding: 5px 10px; font-size: .8rem; }
.adm-acts select, .adm-acts input { padding: 5px 8px !important; font-size: .82rem !important; max-width: 160px; }
.adm details.adm-more > summary { cursor: pointer; font-weight: 600; color: var(--link); list-style: none; font-size: .82rem; }
.adm details.adm-more > summary::-webkit-details-marker { display: none; }
.adm details.adm-more[open] > div { margin-top: 8px; display: grid; gap: 8px; }
.adm-pager { display: flex; justify-content: space-between; margin-top: 12px; }
.adm-form { display: grid; gap: 10px; max-width: 640px; }
.adm-form label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.adm-feed li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.adm-feed li:last-child { border-bottom: 0; }
.adm-feed small { color: var(--muted); }
.adm-empty { color: var(--muted); padding: 16px 0; text-align: center; }
@media (max-width: 1000px) {
  .adm { grid-template-columns: 1fr; }
  .adm-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 6px; scrollbar-width: none; }
  .adm-nav h2 { display: none; }
  .adm-nav a { flex: 0 0 auto; white-space: nowrap; }
  .adm-grid2 { grid-template-columns: 1fr; }
}

/* Historias: todas visibles y completas (2026-10-25) */
@media (max-width: 760px) {
  .sx-stories { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px 4px; padding: 14px 8px 12px; }
  body.sx a.sx-story { width: 72px; }
  .sx-story-label { max-width: 72px; }
  .sx-story .cmty-logo, .sx-story-ring { width: 58px !important; height: 58px !important; font-size: 22px !important; }
  .sx-story-ring .av { width: 58px; height: 58px; font-size: 22px; }
}

/* Historias en UNA sola fila, siempre completas: se ven N por vez y se desplazan de a una con flechas (2026-10-25) */
.sx-stories-wrap { position: relative; margin-bottom: 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.sx-stories-wrap .sx-stories { margin: 0; box-shadow: none; background: transparent; }
.sx-stories {
  --n: 7; --g: 8px;
  display: grid !important; grid-auto-flow: column; grid-template-columns: none !important;
  grid-auto-columns: calc((100% - (var(--n) - 1) * var(--g)) / var(--n));
  gap: 0 var(--g) !important; overflow-x: auto !important; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
  padding: 16px 12px 14px !important;
}
.sx-stories::-webkit-scrollbar { display: none; }
body.sx a.sx-story { width: 100% !important; min-width: 0; scroll-snap-align: start; }
.sx-story-label { max-width: 100% !important; }
.sx-story .cmty-logo, .sx-story-ring { width: 64px !important; height: 64px !important; font-size: 25px !important; }
.sx-story-ring .av { width: 64px; height: 64px; font-size: 25px; }
.sx-st-btn {
  position: absolute; top: 44px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.22); display: flex; align-items: center; justify-content: center;
  transition: opacity .15s ease;
}
.sx-st-btn:hover { background: var(--hover); }
.sx-st-prev { left: -10px; } .sx-st-next { right: -10px; }
.sx-st-btn[hidden] { display: none !important; }
@media (max-width: 760px) {
  .sx-stories { --n: 5; --g: 4px; padding: 14px 8px 12px !important; }
  .sx-story .cmty-logo, .sx-story-ring { width: 56px !important; height: 56px !important; font-size: 21px !important; }
  .sx-story-ring .av { width: 56px; height: 56px; font-size: 21px; }
  .sx-st-prev { left: 4px; } .sx-st-next { right: 4px; }
}
@media (max-width: 380px) { .sx-stories { --n: 4; } }

/* Ajuste: el área visible es exactamente N columnas (sin relleno lateral dentro del carrusel) */
.sx-stories-wrap { padding: 0 14px; }
.sx-stories { padding: 16px 0 14px !important; }
.sx-story .cmty-logo, .sx-story-ring { width: min(64px, calc(100% - 14px)) !important; height: auto !important; aspect-ratio: 1 / 1; }
.sx-story-ring .av { width: 100%; height: 100%; }
@media (max-width: 760px) {
  .sx-stories-wrap { padding: 0 8px; }
  .sx-stories { padding: 14px 0 12px !important; }
  .sx-story .cmty-logo, .sx-story-ring { width: min(56px, calc(100% - 12px)) !important; }
}
