/* Lifeasnow web (escritorio). Tokens iguales a la app: lib/constants/app_theme.dart */
:root {
  --bg: #1C1C1E;
  --bg-deep: #141416;
  --surface: #26262A;
  --surface-high: #323238;
  --border: #3A3A40;
  --primary: #7959A1;
  --primary-hover: #8B6BB5;
  --primary-text: #B79CE0;
  --text: #FFFFFF;
  --text-2: #B3B3B8;
  --text-3: #8A8A90;
  --danger: #E5484D;
  --success: #4CAF50;
  --like: #FF3B5C;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Roboto', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
input, textarea { font: inherit; color: var(--text); }
p { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; }
.hidden, [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; border-radius: 6px; }
.noscript { color: #fff; text-align: center; margin-top: 20vh; }

/* utilidades */
.row { display: flex; align-items: center; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; gap: 8px; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.min0 { min-width: 0; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap24 { gap: 24px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack16 { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.strong { font-weight: 600; color: var(--text); }
.center { text-align: center; }
.pad { padding: 12px 16px; }
.pad16 { padding: 16px; }
.pad24 { padding: 24px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fine { color: var(--text-3); font-size: 12px; line-height: 1.6; }
.fine a { color: var(--text-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.list > * + * { border-top: 1px solid var(--border); }
.page-title { font-size: 22px; font-weight: 700; margin: 8px 0 16px; }
.sub { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; }
.clickable { cursor: pointer; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px; background: var(--surface-high); text-decoration: none !important; color: var(--text); transition: background .15s, opacity .15s; }
.btn:hover { background: #3c3c43; }
.btn.primary { background: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-high); }
.btn.danger { background: var(--danger); }
.btn.block { width: 100%; height: 44px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled, .icon-btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 6px; border-radius: 50%; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: rgba(255,255,255,.06); }
.icon-btn.tiny { padding: 4px; color: var(--text-3); }
.icon-btn.like.on { color: var(--like); }
.icon-btn.like.on svg { fill: var(--like); }
.icon-btn.like.on { animation: pop .25s ease; }
.icon-btn.repost.on { color: var(--success); }
.icon-btn.primary-ic { color: var(--primary-text); }
@keyframes pop { 50% { transform: scale(1.25); } }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--primary-text); font-size: 14px; text-align: left; display: inline-flex; align-items: center; gap: 4px; }
.linkish.muted { color: var(--text-3); }
.linkish.danger { color: var(--danger); }
.linkish.strong { font-weight: 600; }
.pill { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }

/* formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field > small { color: var(--text-3); font-size: 12px; }
.field input, .field textarea, .composer textarea, .create textarea, .chat-form textarea, .comment-form input, .reply-form input {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; outline: none; resize: vertical; width: 100%;
}
.field input:focus, .field textarea:focus, .composer textarea:focus, .create textarea:focus { border-color: var(--primary); }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; }
.form-error:empty, .form-ok:empty { display: none; }
.form-ok { color: var(--success); font-size: 13px; }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; color: var(--text-3); margin-bottom: 16px; }
.search-box input { flex: 1; background: none; border: 0; outline: 0; height: 46px; }
.search-box.sm { margin: 0; border-radius: 10px; }
.search-box.sm input { height: 38px; }
.search-box:focus-within { border-color: var(--primary); }

/* avatar */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; background: var(--surface-high); color: var(--text-2); font-weight: 600; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--border); }
.uname { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--text); }
.badge { color: var(--primary-text); }

/* arranque / estados */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--surface-high); border-top-color: var(--primary-text); border-radius: 50%; animation: spin .8s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px; color: var(--text-3); text-align: center; }
.empty p { max-width: 360px; }
.sentinel { min-height: 40px; padding: 8px 0 32px; }

/* toasts */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { background: var(--surface-high); border: 1px solid var(--border); padding: 10px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.4); transition: opacity .3s, transform .3s; }
.toast.error { border-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Estructura de 3 columnas ---------- */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr) 320px; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px; border-right: 1px solid var(--border); background: var(--bg); }
.nav-logo { display: flex; align-items: center; gap: 10px; padding: 8px 12px 24px; text-decoration: none !important; }
.nav-logo img { width: 34px; height: 34px; border-radius: 9px; }
.nav-logo span { font-weight: 800; font-size: 21px; letter-spacing: -.5px; color: var(--text); }
.nav-item { display: flex; align-items: center; gap: 16px; padding: 11px 12px; border-radius: 12px; color: var(--text); text-decoration: none !important; background: none; border: 0; cursor: pointer; font-size: 16px; text-align: left; width: 100%; }
.nav-item:hover { background: var(--surface); }
.nav-item.on { font-weight: 700; }
.nav-item.on .nav-ic { color: var(--primary-text); }
.nav-item.on .nav-ic .avatar { box-shadow: 0 0 0 2px var(--primary-text); }
.nav-ic { position: relative; display: inline-flex; }
.badge-dot { position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--bg); }
.main { padding: 24px 32px 48px; min-width: 0; }
.rightbar { padding: 32px 24px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.me-card { text-decoration: none !important; color: var(--text); }
.get-app { display: flex; flex-direction: column; gap: 8px; }
body[data-view="mensajes"] .shell { grid-template-columns: 244px minmax(0, 1fr); }
body[data-view="mensajes"] .main { padding: 0; }

@media (max-width: 1260px) {
  .shell { grid-template-columns: 244px minmax(0, 1fr); }
  .rightbar { display: none; }
}
@media (max-width: 1000px) {
  .shell, body[data-view="mensajes"] .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .nav-label, .nav-logo span { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-logo { justify-content: center; padding: 8px 0 24px; }
  .main { padding: 20px; }
}

/* ---------- Feed ---------- */
.feed { max-width: 560px; margin: 0 auto; }
.feed.narrow { max-width: 640px; }
.stories { display: flex; gap: 14px; padding: 16px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: thin; }
.story-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; width: 74px; flex-shrink: 0; padding: 4px 0; }
.story-chip span { font-size: 12px; color: var(--text-2); max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-chip.unseen .avatar.ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary-text); }
.post { overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.post-head .user-link { flex: 1; min-width: 0; text-decoration: none !important; }
.media-wrap { position: relative; background: #000; }
.media { aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-el { width: 100%; height: 100%; object-fit: cover; user-select: none; }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #111; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-arrow.left { left: 10px; } .nav-arrow.right { right: 10px; }
.dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.45); }
.dots span.on { background: #fff; }
.post-actions { display: flex; gap: 4px; padding: 6px 8px 0; }
.post-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.caption { color: var(--text); }
.caption a { color: var(--text); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 40px; animation: fade .15s ease; }
.modal.dark { background: rgba(10,10,12,.96); }
@keyframes fade { from { opacity: 0; } }
.modal-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; max-width: 480px; width: 100%; max-height: calc(100vh - 80px); overflow: auto; }
.modal-panel.wide { max-width: 1100px; width: auto; }
.modal.dark .modal-panel { background: transparent; border: 0; max-width: none; width: auto; overflow: visible; }
.modal-close { position: absolute; top: 14px; right: 18px; color: #fff; }
.modal-title { font-size: 16px; text-align: center; padding: 14px; border-bottom: 1px solid var(--border); }
.confirm { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.post-detail { display: flex; height: min(86vh, 780px); }
.pd-media { background: #000; display: flex; align-items: center; flex: 0 1 auto; }
.pd-media .media-wrap { height: 100%; }
.pd-media .media { height: 100%; aspect-ratio: 4 / 5; max-width: min(62vw, 624px); }
.pd-media .media-el { object-fit: contain; }
.pd-side { width: 400px; display: flex; flex-direction: column; border-left: 1px solid var(--border); flex-shrink: 0; }
.pd-side .post-head { border-bottom: 1px solid var(--border); }
.comments { flex: 1; overflow-y: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment p a { color: var(--text); }
.pd-foot { border-top: 1px solid var(--border); padding: 4px 14px 0; display: flex; flex-direction: column; gap: 6px; }
.pd-foot .post-actions { padding: 4px 0 0 0; margin-left: -6px; }
.comment-form { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); margin: 8px -14px 0; padding: 6px 14px; }
.comment-form input { border: 0; background: none; padding: 10px 0; }
.empty-small { padding: 24px 0; text-align: center; }

/* historias */
.story-viewer { display: flex; align-items: center; justify-content: center; gap: 24px; }
.sv-prev[hidden], .sv-next[hidden] { display: inline-flex !important; visibility: hidden; }
.sv-frame { position: relative; height: min(88vh, 860px); aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #111; }
.sv-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sv-media { width: 100%; height: 100%; object-fit: cover; }
.sv-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.sv-bars span { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; overflow: hidden; }
.sv-bars span i { display: block; height: 100%; width: 0; background: #fff; }
.sv-bars span.done i { width: 100%; }
.sv-head { position: absolute; top: 22px; left: 12px; right: 12px; z-index: 2; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.sv-head a { color: #fff; text-decoration: none; }
.sv-foot { position: absolute; bottom: 12px; right: 12px; z-index: 2; }
.sv-foot .icon-btn { color: #fff; background: rgba(0,0,0,.25); }
.sv-like.on { color: var(--like); }
.sv-like.on svg { fill: var(--like); }
.sv-caption { position: absolute; bottom: 70px; left: 16px; right: 16px; text-align: center; background: rgba(0,0,0,.45); padding: 8px 12px; border-radius: 10px; }
.sv-prev, .sv-next { color: #fff; background: rgba(255,255,255,.12); }

/* hilos */
.composer { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.composer textarea { border: 0; background: none; padding: 8px 0; resize: none; font-size: 16px; }
.thread { display: flex; gap: 12px; padding: 16px; }
.thread.clickable:hover { background: rgba(255,255,255,.02); }
.thread-av { text-decoration: none; }
.thread-text { white-space: pre-wrap; margin: 4px 0 8px; font-size: 15px; }
.thread-actions { display: flex; gap: 28px; color: var(--text-3); margin-left: -6px; }
.thread-actions .icon-btn { color: var(--text-3); }
.thread-actions .count { font-size: 13px; }
.thread-media { display: grid; gap: 4px; border-radius: 12px; overflow: hidden; margin-bottom: 8px; max-width: 480px; }
.thread-media.n2, .thread-media.n3, .thread-media.n4 { grid-template-columns: 1fr 1fr; }
.thread-media img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thread-media.n1 img { aspect-ratio: auto; max-height: 420px; }
.back { margin-bottom: 12px; }
.reply-form { padding: 12px 16px; }
.reply-form input { flex: 1; }
.list .sub { padding: 16px 16px 4px; margin: 0; }

/* perfil */
.profile { max-width: 935px; margin: 0 auto; }
.profile-head { display: flex; gap: 72px; align-items: center; padding: 16px 48px 36px; }
.profile-av { background: none; border: 0; padding: 4px; border-radius: 50%; cursor: default; }
.profile-av.has-stories { cursor: pointer; box-shadow: 0 0 0 3px var(--primary-text); }
.profile-name { font-size: 20px; font-weight: 500; }
.profile-name .uname { font-weight: 500; }
.stat { background: none; border: 0; padding: 0; cursor: pointer; font-size: 16px; color: var(--text); }
.stat span { color: var(--text-2); }
.bio { white-space: pre-wrap; color: var(--text-2); margin-top: 4px; }
.tabs { display: flex; justify-content: center; gap: 56px; border-top: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; border-top: 1px solid transparent; margin-top: -1px; padding: 16px 0; color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; }
.tab.on { color: var(--text); border-top-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.cell { position: relative; aspect-ratio: 4 / 5; background: var(--surface); border: 0; padding: 0; cursor: pointer; overflow: hidden; }
.cell img { width: 100%; height: 100%; object-fit: cover; }
.cell .multi { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.cell-hover { position: absolute; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 700; opacity: 0; transition: opacity .15s; white-space: pre; }
.cell-hover svg { fill: #fff; }
.cell:hover .cell-hover, .cell:focus-visible .cell-hover { opacity: 1; }
.people-modal { min-width: 400px; }
.people { max-height: 60vh; overflow: auto; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--text); text-decoration: none !important; }
.user-row:hover { background: rgba(255,255,255,.03); }

/* notificaciones */
.notif { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.notif.unread { background: rgba(121, 89, 161, .10); }
.notif.clickable:hover { background: rgba(255,255,255,.03); }
.notif p a { color: var(--text); }
.notif-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }

/* mensajes */
.messages { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: 100vh; }
.conv-col { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.conv-head { padding: 20px 16px 12px; }
.conv-head .page-title { margin: 4px 4px 14px; }
.conv-list { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 16px; background: none; border: 0; cursor: pointer; text-align: left; }
.conv:hover { background: var(--surface); }
.conv.on { background: var(--surface-high); }
.conv.unread strong { color: var(--text); }
.conv.unread .muted { color: var(--text); font-weight: 500; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; height: 100vh; }
.chat-pane > .empty { margin: auto; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.bubble { max-width: min(62%, 520px); background: var(--surface-high); border-radius: 18px; padding: 8px 12px 6px; display: flex; flex-direction: column; gap: 4px; }
.bubble.mine { background: var(--primary); }
.bubble p { white-space: pre-wrap; }
.bubble .time { color: rgba(255,255,255,.55); font-size: 11px; align-self: flex-end; }
.bubble .sender { color: var(--primary-text); font-weight: 600; }
.bubble.sticker { background: none; padding: 0; }
.msg-img { max-width: 320px; max-height: 360px; border-radius: 12px; cursor: zoom-in; object-fit: cover; }
.sticker-img { width: 140px; height: 140px; object-fit: contain; }
.zoom-img { max-height: 86vh; max-width: 90vw; }
.msg-audio { width: 260px; }
.day { align-self: center; color: var(--text-3); font-size: 12px; margin: 14px 0 6px; }
.day::first-letter { text-transform: uppercase; }
.sys { align-self: center; color: var(--text-3); font-size: 12px; margin: 8px 0; text-align: center; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-form textarea { resize: none; border-radius: 22px; padding: 10px 16px; max-height: 140px; line-height: 1.4; }

/* crear */
.create { width: min(1000px, 90vw); }
.create-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.create-head h2 { font-size: 16px; }
.create-body { display: flex; height: min(70vh, 640px); }
.create-left { flex: 1; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.create-stage { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--bg-deep); min-height: 0; transition: background .15s; }
.create-stage.over { background: rgba(121, 89, 161, .18); }
.create-preview { max-width: 100%; max-height: 100%; object-fit: contain; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--text-2); text-align: center; padding: 24px; }
.create-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.create-thumbs:empty { display: none; }
.cthumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex-shrink: 0; cursor: pointer; border: 2px solid transparent; background: var(--surface-high); }
.cthumb.on { border-color: var(--primary-text); }
.cthumb img { width: 100%; height: 100%; object-fit: cover; }
.cthumb.add { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); }
.cthumb-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.create-right { width: 340px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.create-right textarea { resize: none; }

/* ajustes */
.settings section { margin-bottom: 16px; }
.settings-av { flex-shrink: 0; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; max-width: 1080px; margin: 0 auto; padding: 32px; gap: 48px; }
.auth-art { display: flex; justify-content: center; }
.auth-phones { position: relative; width: 420px; height: 600px; }
.phone { position: absolute; width: 270px; border-radius: 32px; border: 6px solid #2b2b30; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.phone.p1 { left: 0; top: 0; transform: rotate(-4deg); }
.phone.p2 { right: 0; top: 60px; transform: rotate(4deg); }
.auth-side { max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.auth-logo { display: flex; align-items: center; gap: 12px; text-decoration: none !important; margin-bottom: 8px; }
.auth-logo img { width: 52px; height: 52px; border-radius: 14px; }
.auth-logo span { font-size: 32px; font-weight: 800; letter-spacing: -1px; color: var(--text); }
.auth-tagline { font-size: 24px; font-weight: 700; }
.auth-form { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-top: 16px; }
.auth-form h2 { font-size: 18px; }
.auth-switch { text-align: center; color: var(--text-2); font-size: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } .auth-side { margin: 0 auto; } }

/* ---------- Celulares ---------- */
.mobile-gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 40px 24px; max-width: 460px; margin: 0 auto; }
.mg-logo { width: 72px; height: 72px; border-radius: 18px; }
.mobile-gate h1 { font-size: 26px; line-height: 1.2; }
.mg-shot { width: 62%; max-width: 240px; border-radius: 24px; border: 5px solid #2b2b30; margin: 8px 0; }
.mobile-gate .stack { width: 100%; }
.mg-free { color: var(--primary-text); font-weight: 600; font-size: 14px; }

/* ---------- Mejoras v2 ---------- */
.mention { color: var(--primary-text); font-weight: 500; }
.hashtag { color: var(--primary-text); }
a.ext { color: var(--primary-text); text-decoration: underline; text-underline-offset: 2px; }
.caption .mention, .comment .mention, .thread-text .mention { color: var(--primary-text) !important; }

/* La foto del feed nunca ocupa más que la pantalla */
.feed .media { max-height: min(72vh, 700px); background: #000; }
.feed .media .media-el { object-fit: contain; }

/* menú ⋯ */
.menu-list { display: flex; flex-direction: column; min-width: 360px; }
.menu-item { background: none; border: 0; border-bottom: 1px solid var(--border); padding: 14px; font-size: 14px; cursor: pointer; text-align: center; }
.menu-item:last-child { border-bottom: 0; color: var(--text-2); }
.menu-item:hover { background: rgba(255,255,255,.04); }
.menu-item.danger { color: var(--danger); font-weight: 600; }
.menu-title { text-align: center; padding: 16px; font-weight: 600; border-bottom: 1px solid var(--border); }
.edit-form { min-width: 460px; }
.edit-form textarea { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; outline: none; resize: vertical; width: 100%; }

/* sugerencias */
.sugg { display: flex; flex-direction: column; gap: 12px; }
.sugg-title { color: var(--text-2); font-size: 14px; }
.sugg-list { display: flex; flex-direction: column; gap: 12px; }
.sugg-row { display: flex; align-items: center; gap: 10px; }
.sugg-row .user-link { text-decoration: none !important; }
.sentinel .sugg.card { max-width: 420px; margin: 0 auto; text-align: left; }

/* esqueletos */
.skeleton { pointer-events: none; }
.sk { display: block; background: linear-gradient(90deg, var(--surface-high) 25%, #3a3a41 50%, var(--surface-high) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 6px; }
.sk-circle { width: 36px; height: 36px; border-radius: 50%; }
.sk-line { height: 12px; }
.w30 { width: 30%; } .w40 { width: 40%; } .w70 { width: 70%; }
.sk-media { height: min(60vh, 560px); border-radius: 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* hilos con fotos */
.composer-media { display: flex; gap: 8px; }
.composer-media:empty { display: none; }
.thread-media img { cursor: zoom-in; }

/* respuesta a historias */
.sv-foot { left: 12px; display: flex; align-items: center; gap: 8px; }
.sv-reply-form { flex: 1; display: flex; align-items: center; gap: 4px; border: 1px solid rgba(255,255,255,.6); border-radius: 22px; padding: 0 4px 0 14px; background: rgba(0,0,0,.25); }
.sv-reply-form[hidden] { display: none !important; }
.sv-reply { flex: 1; background: none; border: 0; outline: 0; color: #fff; height: 40px; }
.sv-reply::placeholder { color: rgba(255,255,255,.8); }
.sv-foot .sv-like { margin-left: auto; }

/* nuevo mensaje */
.to-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.to-row input { flex: 1; background: none; border: 0; outline: 0; height: 36px; }
button.user-row { background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.conv-head .row.between { margin-bottom: 0; }
.conv-head .row.between .page-title { margin-bottom: 14px; }

/* atajos */
kbd { background: var(--surface-high); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 2px 8px; font: 600 12px/1.6 ui-monospace, Menlo, monospace; }
.sc-row { min-width: 320px; }
.feed .media { position: relative; width: 100%; }
.feed .media .media-el { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Estadísticas (solo admin) ---------- */
body[data-view="estadisticas"] .shell { grid-template-columns: 244px minmax(0, 1fr); }
@media (max-width: 1000px) { body[data-view="estadisticas"] .shell { grid-template-columns: 76px minmax(0, 1fr); } }
.stats { max-width: 1280px; margin: 0 auto; }
.stats-head { align-items: flex-start; margin-bottom: 8px; }
.stats-head .page-title { margin-bottom: 2px; }
.stats-section { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.stats-h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.stats-grid { display: grid; gap: 16px; }
.stats-grid.tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stats-grid.mini { grid-template-columns: 1fr 1fr; gap: 12px; }
.stats-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1300px) { .stats-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stats-grid.two, .stats-grid.three, .stats-grid.four { grid-template-columns: minmax(0, 1fr); } }
.stat-tile { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-tile.accent { border-color: var(--primary); background: linear-gradient(160deg, rgba(121,89,161,.22), var(--surface) 70%); }
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-tile small { font-size: 12px; }
.stats-card { padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.stats-card-head { display: flex; flex-direction: column; gap: 1px; }
.stats-card-head h3 { font-size: 15px; font-weight: 600; }
.stats-card-head small { font-size: 12px; }
.stats-note { margin-top: -4px; }
.stats-foot { margin: 32px 0 0; text-align: center; }

/* gráficos */
.viz { display: flex; flex-direction: column; gap: 8px; }
.viz-plot { position: relative; width: 100%; }
.viz-plot svg { display: block; overflow: visible; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); }
.viz-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.viz-key.line { height: 3px; width: 14px; border-radius: 2px; }
.viz-grid { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.viz-base { stroke: rgba(255,255,255,.22); stroke-width: 1; }
.viz-axis { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-cross { stroke: rgba(255,255,255,.28); stroke-width: 1; pointer-events: none; }
.viz-bar { transition: opacity .12s; }
.viz-bar.dim { opacity: .45; }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 140px; background: var(--surface-high); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.viz-tip-title { color: var(--text-2); margin-bottom: 4px; white-space: nowrap; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.viz-tip-row strong { font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hbar-label { color: var(--text-2); }
.hbar-track { height: 10px; background: rgba(255,255,255,.05); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 64px; }
.meters { display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.meter .row { margin-bottom: 5px; }
.meter-track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.meter-fill { height: 100%; background: #3987e5; border-radius: 4px; }
.stats-table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.stats-table td { padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,.05); }
.stats-table tr:last-child td { border-bottom: 0; }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-table.cohort td.heat { font-weight: 600; border: 2px solid var(--surface); border-radius: 6px; text-align: center; }
.top-list { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.top-list li::marker { color: var(--text-3); font-size: 12px; }
