/* ============================================================
   CONEXA — El tablón (dentro de la app)
   ------------------------------------------------------------
   La cabecera, la barra de abajo y las pantallas de Tablón y Carnet:
   un tablón de fieltro con papeles clavados (el pósit de la pregunta
   del día, las respuestas, la cartilla de sellos, hojas con listas).
   Se apoya en carnet.css (letras, botones, el carnet, ventanas).
   Va enlazado después de los estilos de dashboard.html.
   ============================================================ */

:root {
  --cx-fieltro:   #0B2C73;
  --cx-marco:     #071C4D;   /* cabecera, barra y columna de iconos */
  --cx-hoja:      #FFFFFF;   /* papel blanco */
  --cx-crema:     #FBF8F1;   /* cartulina */
  --cx-impreso:   #0B2C73;   /* tinta azul de imprenta */
  --cx-tinta-2:   #46557A;   /* texto secundario sobre papel */
  --cx-regla:     #9AA5BF;   /* líneas de puntos y perforaciones */
  --cx-postit:    #FFE45C;
  --cx-p-cielo:   #BCDBFF;
  --cx-p-menta:   #A9EBCF;
  --cx-p-salmon:  #FFC9B5;
  --cx-tampon:    #D43D25;   /* tinta de los sellos */
  --cx-celo:      rgba(255, 244, 214, 0.94);
  --cx-claro-2:   #B9CCF5;   /* texto secundario sobre el fieltro */
  --cx-sombra-papel: 0 1px 1px rgba(0, 0, 0, 0.2), 0 12px 20px -6px rgba(0, 0, 0, 0.5);
  --cab-h:        52px;      /* cabecera en móvil */
}
body.dark {
  --cx-fieltro:   #071B4A;
  --cx-marco:     #040F2B;
  --cx-hoja:      #EFECE5;
  --cx-crema:     #E9E4D8;
  --cx-regla:     #8D97B0;
  --cx-postit:    #F2D84E;
  --cx-p-cielo:   #A9CBF2;
  --cx-p-menta:   #98DDBF;
  --cx-p-salmon:  #F2BBA6;
  --cx-celo:      rgba(236, 224, 194, 0.94);
  --cx-claro-2:   #9FB2DD;
}

/* ── Toda la app con la misma letra ──────────────────────────── */
body { font-family: var(--cx-letra); }
.cx-fuera { display: none !important; }

/* ── Cabecera ─────────────────────────────────────────────────── */
nav.cx-cab { background: var(--cx-marco); box-shadow: none; }
body.dark nav.cx-cab { background: var(--cx-marco); border-bottom: 0; }
nav.cx-cab .logo { font-weight: 900; font-stretch: 125%; font-size: 19px; letter-spacing: 0.01em; gap: 9px; }
nav.cx-cab .logo span { color: var(--cx-amarillo); }
.nav-stripe, body.dark .nav-stripe { background: var(--cx-amarillo); }
.cx-cab-btn {
  position: relative; width: 44px; height: 44px; border: 0; border-radius: 14px; background: none; color: #fff;
  display: none; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.cx-cab-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
nav.cx-cab .notif-bell { border: 0; background: none; font: inherit; color: #fff; }
nav.cx-cab .notif-bell:hover, nav.cx-cab .theme-toggle:hover { background: rgba(255, 255, 255, 0.14); transform: none; }
nav.cx-cab .notif-bell svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav.cx-cab .notif-count { background: var(--cx-tampon); border-color: var(--cx-marco); font-family: var(--cx-num); font-weight: 400; }
nav.cx-cab .theme-toggle {
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
nav.cx-cab .theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav.cx-cab :focus-visible, .cx-barra :focus-visible, .sidebar-icons :focus-visible { outline: 3px solid var(--cx-amarillo); outline-offset: 2px; }

/* ── Barra de abajo (solo en móvil) ───────────────────────────── */
.cx-barra { display: none; }
.cx-pestana {
  position: relative; min-width: 0; border: 0; background: none; cursor: pointer; padding: 0 0 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  color: var(--cx-claro-2); font: 800 11px/1 var(--cx-letra); font-stretch: 78%; letter-spacing: 0.12em; text-transform: uppercase;
}
.cx-pestana svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-pestana.active { color: var(--cx-amarillo); }
.cx-pestana.active::before { content: ""; position: absolute; top: 0; width: 30px; height: 4px; border-radius: 0 0 4px 4px; background: var(--cx-amarillo); }
.cx-pestana .nav-badge {
  position: absolute; top: 7px; left: calc(50% + 5px); display: none; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--cx-tampon); color: #fff; font: 400 12px/20px var(--cx-num); letter-spacing: 0; text-align: center;
}
.cx-pestana .nav-badge.show { display: block; }

/* Privados / Grupos: los dos viven en la pestaña Chats */
.cx-conmutador { display: none; }

@media (max-width: 768px) {
  nav.cx-cab {
    height: calc(var(--cab-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 6px 0 16px;
  }
  .nav-stripe { display: none; }
  nav.cx-cab .nav-user { gap: 0; }
  nav.cx-cab .nav-avatar, nav.cx-cab .nav-user-name, nav.cx-cab .btn-logout, nav.cx-cab .theme-toggle { display: none; }
  nav.cx-cab .notif-bell { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
  nav.cx-cab .notif-bell svg { width: 23px; height: 23px; stroke-width: 2.2; }
  nav.cx-cab .notif-count { top: 5px; right: 3px; }
  .cx-cab-btn { display: flex; }

  body { padding-top: calc(var(--cab-h) + env(safe-area-inset-top, 0px)); }
  .app-layout {
    height: calc(100vh - var(--cab-h) - env(safe-area-inset-top, 0px) - var(--bottom-nav-h) - var(--safe-bottom));
    height: calc(100dvh - var(--cab-h) - env(safe-area-inset-top, 0px) - var(--bottom-nav-h) - var(--safe-bottom));
  }

  .cx-barra {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    background: var(--cx-marco); padding-bottom: var(--safe-bottom);
  }
  .cx-barra-in { height: var(--bottom-nav-h); max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* Dentro de una conversación, toda la pantalla es para el chat */
  body.chat-open, body.grupo-open { padding-top: 0; padding-bottom: 0 !important; }
  body.chat-open nav.cx-cab, body.grupo-open nav.cx-cab,
  body.chat-open .cx-barra, body.grupo-open .cx-barra { display: none; }
  body.chat-open .app-layout, body.grupo-open .app-layout { height: 100vh; height: 100dvh; }
  body.chat-open .chat-input-bar, body.grupo-open .chat-input-bar { padding-bottom: calc(10px + var(--safe-bottom)); }

  .cx-conmutador {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 12px 14px 4px; flex: none;
  }
  .cx-conmutador button {
    position: relative; height: 44px; border-radius: 12px; border: 2px solid var(--cx-borde); background: var(--cx-papel); color: var(--cx-tinta);
    font: 800 14px var(--cx-letra); font-stretch: 90%; cursor: pointer;
  }
  .cx-conmutador button[aria-pressed="true"] { background: var(--cx-noche); color: #fff; border-color: var(--cx-noche); }
  body.dark .cx-conmutador button[aria-pressed="true"] { background: var(--cx-amarillo); color: var(--cx-noche); border-color: var(--cx-amarillo); }
  .cx-conmutador i {
    position: absolute; top: -8px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: var(--cx-tampon); color: #fff; border: 2px solid var(--surface); font: 400 11px/16px var(--cx-num); font-style: normal;
  }
  .cx-conmutador i:empty { display: none; }
}

/* ── Escritorio: la columna de iconos, del mismo marco ────────── */
.sidebar-icons { background: var(--cx-marco); border-right: 0; }
.sidebar-icon { flex: none; border: 0; background: none; padding: 0; font: inherit; color: var(--cx-claro-2); }
.sidebar-icon:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sidebar-icon.active { background: var(--cx-amarillo); color: var(--cx-noche); }
.sidebar-icon .badge { background: var(--cx-tampon); }
.cx-sep { flex: none; width: 28px; height: 2px; margin: 6px 0; border-radius: 1px; background: rgba(255, 255, 255, 0.16); }

/* ── Avisos flotantes ─────────────────────────────────────────── */
.toast {
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; border: 2px solid #fff;
  background: var(--cx-noche); color: #fff; font: 600 14.5px/1.35 var(--cx-letra); white-space: normal; text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.toast.error { background: #B42318; }
.toast.success { background: #0F6E56; }

/* El cajón de notificaciones solo da sombra cuando está abierto
   (cerrado asomaba una franja gris por el borde derecho) */
.notif-drawer { box-shadow: none; visibility: hidden; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.3s; }
.notif-drawer.open { box-shadow: -4px 0 32px rgba(0, 0, 0, 0.18); visibility: visible; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* ══════════════════════════════════════════════════════════════
   EL TABLÓN
   ══════════════════════════════════════════════════════════════ */
#view-inicio, #view-myprofile { background: var(--cx-fieltro); }
.cx-tb { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; color: #fff; }
body.dark .cx-tb { background-color: var(--cx-fieltro); }
.cx-tb-col { max-width: 500px; margin: 0 auto; padding: 18px 16px 44px; display: flex; flex-direction: column; gap: 22px; }
.cx-tb-zona { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.cx-tb :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cx-tb h2, .cx-tb h3, .cx-tb p { margin: 0; }
@media (min-width: 1000px) {
  .cx-tb-col.dos { max-width: 1020px; flex-direction: row; align-items: flex-start; gap: 52px; padding: 30px 32px 60px; }
  .cx-tb-col.dos > .cx-tb-zona { flex: 1 1 0; }
  .cx-tb-col.dos > .cx-tb-zona + .cx-tb-zona { flex: 0.82 1 0; }
}

/* Rótulo de sección: un trozo de cinta de carrocero */
.cx-cinta-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: -6px; }
.cx-cinta {
  align-self: flex-start; margin: 4px 0 -6px -2px; padding: 8px 18px 7px; background: var(--cx-celo); color: var(--cx-impreso);
  font-weight: 900; font-stretch: 66%; font-size: 16px; line-height: 1; letter-spacing: 0.2em; text-transform: uppercase;
  transform: rotate(-2deg);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 14%, calc(100% - 4px) 28%, 100% 42%, calc(100% - 4px) 56%, 100% 70%, calc(100% - 4px) 84%, 100% 100%,
                     4px 100%, 0 86%, 4px 72%, 0 58%, 4px 44%, 0 30%, 4px 16%, 0 2%);
}
.cx-cinta-fila .cx-cinta { margin-bottom: 0; }
/* La fecha, estampada con un sello de goma */
.cx-fecha { flex: none; padding: 5px 9px 3px; border: 2px solid var(--cx-coral); border-radius: 7px; color: var(--cx-coral); font: 400 13px/1.1 var(--cx-num); letter-spacing: 0.05em; text-transform: uppercase; transform: rotate(3deg); }
.cx-bloque { display: flex; flex-direction: column; gap: 14px; }
.cx-pie-nota { font-size: 13px; line-height: 1.4; color: var(--cx-claro-2); text-align: center; }
.cx-pie-nota.izq { text-align: left; }
.cx-btn-claro {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.55);
  background: transparent; color: #fff; font: 700 15px var(--cx-letra); cursor: pointer;
}
.cx-tb .cx-btn { box-shadow: 0 4px 0 #04102E; }
.cx-tb .cx-btn:active { box-shadow: 0 1px 0 #04102E; }
.cx-chincheta.amarilla { background: radial-gradient(circle at 35% 30%, #FFF3B8 0 18%, #FFC421 45%, #9A6A00 100%); }
.cx-chincheta.azul { background: radial-gradient(circle at 35% 30%, #C9DEFF 0 18%, #3D7BE0 45%, #12357E 100%); }

/* ── La pregunta de hoy ───────────────────────────────────────── */
.cx-pregunta {
  position: relative; padding: 30px 22px 28px; transform: rotate(-1.4deg); color: var(--cx-impreso);
  background: linear-gradient(172deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 36%), var(--cx-postit);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 22px 22px -14px rgba(0, 0, 0, 0.6);
}
.cx-pregunta-et { display: flex; justify-content: space-between; gap: 12px; font-weight: 800; font-stretch: 72%; font-size: 12.5px; line-height: 1.2; letter-spacing: 0.16em; text-transform: uppercase; }
.cx-pregunta h3 { margin-top: 12px; font-family: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive; font-weight: 700; font-size: clamp(31px, 9.4vw, 40px); line-height: 1; text-wrap: balance; overflow-wrap: anywhere; }
.cx-abanico { display: flex; justify-content: center; margin: -32px 0 2px; position: relative; pointer-events: none; min-height: 34px; }
.cx-abanico span {
  flex: none; width: 60px; height: 60px; margin: 0 -10px; display: grid; place-items: center;
  background: linear-gradient(172deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 40%), var(--c);
  color: rgba(11, 27, 63, 0.34); font: 400 22px var(--cx-num);
  transform: translateY(var(--y)) rotate(var(--r)); box-shadow: 0 8px 10px -5px rgba(0, 0, 0, 0.55);
}
.cx-notas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; padding: 6px 2px 0; }
.cx-nota {
  position: relative; min-width: 0; min-height: 136px; padding: 18px 12px 8px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(172deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 40%), var(--c);
  color: var(--cx-impreso); transform: rotate(var(--r)); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 14px 14px -9px rgba(0, 0, 0, 0.55);
}
.cx-nota > p { flex: 1; padding-right: 30px; font-family: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive; font-weight: 700; font-size: 21.5px; line-height: 1.04; overflow-wrap: anywhere; }
.cx-firma {
  max-width: 100%; min-height: 40px; margin-top: -4px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 7px; color: var(--cx-tinta-2);
  font: 800 11px/1.15 var(--cx-letra); font-stretch: 74%; letter-spacing: 0.1em; text-transform: uppercase;
}
div.cx-firma { cursor: default; }
.cx-firma-tx { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cx-firma-tx b, .cx-firma-tx i { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-firma-tx b { font-weight: inherit; font-size: 12px; color: var(--cx-impreso); }
.cx-firma-tx i { font-style: normal; font-size: 10.5px; }
.cx-retrato { flex: none; width: 26px; height: 32px; border-radius: 50%; overflow: hidden; border: 1.5px solid var(--cx-impreso); background: var(--cx-amarillo); color: var(--cx-noche); display: grid; place-items: center; font: 400 13px var(--cx-num); letter-spacing: 0; }
.cx-retrato img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cx-pin {
  position: absolute; top: 2px; right: 0; width: 44px; height: 46px; border: 0; background: none; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--cx-tinta-2);
}
.cx-pin i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; }
.cx-pin b { font: 400 11px/1 var(--cx-num); min-height: 11px; }
.cx-pin[aria-pressed="true"] i, .cx-pin.puesta i { border: 0; width: 18px; height: 18px; background: radial-gradient(circle at 35% 30%, #FF9A88 0 18%, #E0442B 45%, #8F1D0E 100%); box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.35); }
.cx-pin[aria-pressed="true"] b, .cx-pin.puesta b { color: var(--cx-impreso); }
span.cx-pin { cursor: default; }
.cx-nota.con-racha { padding-top: 30px; }
.cx-nota .cx-racha { position: absolute; top: 8px; left: 11px; }
#aviso-push:empty { display: none; }
.cx-tu {
  position: absolute; top: -10px; left: 12px; padding: 5px 10px 4px; background: var(--cx-celo); color: var(--cx-impreso);
  font-weight: 900; font-stretch: 70%; font-size: 11.5px; line-height: 1; letter-spacing: 0.16em; text-transform: uppercase; transform: rotate(-4deg);
}
.cx-quitar { position: absolute; right: 4px; bottom: 2px; width: 40px; height: 40px; border: 0; background: none; color: var(--cx-tinta-2); cursor: pointer; display: grid; place-items: center; padding: 0; }
.cx-quitar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cx-nota:has(.cx-quitar) .cx-firma { padding-right: 34px; }
.cx-racha { flex: none; padding: 2px 5px 1px; border: 1.5px solid var(--cx-tampon); border-radius: 4px; color: var(--cx-tampon); font: 400 10px/1.1 var(--cx-num); letter-spacing: 0.02em; transform: rotate(-4deg); }
.cx-notas.recien .cx-nota { animation: cxVoltea .44s cubic-bezier(.2, .8, .3, 1.1) both; animation-delay: calc(var(--i) * 85ms); }
.cx-tb .cx-nota :focus-visible, .cx-tb .cx-papel :focus-visible, .cx-tb .cx-cartilla :focus-visible { outline-color: var(--cx-impreso); }

/* ── Cartilla de sellos y lo de ayer ──────────────────────────── */
.cx-cartilla { position: relative; padding: 14px 16px; border-radius: 3px; background: var(--cx-crema) var(--cx-grano-papel); color: var(--cx-noche); transform: rotate(.7deg); box-shadow: var(--cx-sombra-papel); }
.cx-cartilla header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cx-cartilla h3 { font-weight: 900; font-stretch: 68%; font-size: 18px; line-height: 1.1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cx-impreso); }
.cx-cartilla header span { font-size: 13px; color: var(--cx-tinta-2); white-space: nowrap; }
.cx-cartilla header b { font: 400 16px var(--cx-num); color: var(--cx-tampon); }
.cx-dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 14px 0 12px; }
.cx-dia { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cx-hueco { position: relative; width: min(100%, 38px); aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--cx-regla); display: grid; place-items: center; font: 400 12px var(--cx-num); color: var(--cx-regla); }
.cx-dia.pasado .cx-hueco { border-style: dotted; }
.cx-dia.hoy .cx-hueco { border-style: solid; border-color: var(--cx-impreso); color: var(--cx-impreso); }
.cx-sello {
  position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--cx-tampon); color: var(--cx-tampon); background: var(--cx-crema);
  display: grid; place-items: center; font: 400 15px/1 var(--cx-num); font-style: normal; transform: rotate(var(--r));
}
.cx-sello::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; border: 1px solid var(--cx-tampon); }
.cx-sello.recien { animation: cxSella .5s cubic-bezier(.2, 1.6, .4, 1) .3s both; }
.cx-dia b { font-weight: 800; font-stretch: 74%; font-size: 11px; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cx-tinta-2); }
.cx-dia.hoy b { color: var(--cx-impreso); }
.cx-cartilla > p { font-size: 13px; line-height: 1.38; color: var(--cx-tinta-2); }
.cx-cartilla > p b { color: var(--cx-noche); }

.cx-et { font-weight: 800; font-stretch: 72%; font-size: 12px; line-height: 1.2; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cx-tinta-2); }
.cx-ayer { padding: 14px 16px 14px; background: var(--cx-hoja) var(--cx-grano-papel); color: var(--cx-noche); transform: rotate(-.9deg); box-shadow: var(--cx-sombra-papel); }
.cx-ayer h3 { margin-top: 5px; font-weight: 800; font-size: 16px; line-height: 1.25; }
.cx-ayer blockquote { margin: 10px 0 0; padding: 10px 12px 8px; background: var(--cx-postit); color: var(--cx-impreso); transform: rotate(.8deg); font-family: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive; font-weight: 700; font-size: 21px; line-height: 1.05; overflow-wrap: anywhere; }
.cx-ayer footer { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--cx-tinta-2); }
.cx-ayer footer b { color: var(--cx-noche); }

/* ── Hojas de papel con renglones (clase, avisos, ajustes) ────── */
.cx-papel { position: relative; background: var(--cx-hoja) var(--cx-grano-papel); color: var(--cx-noche); box-shadow: var(--cx-sombra-papel); transform: rotate(var(--r, -.4deg)); }
.cx-papel.crema { background-color: var(--cx-crema); }
.cx-renglon {
  width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-top: 1.5px dashed var(--cx-regla); background: none; color: inherit;
  display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; text-decoration: none;
}
.cx-renglon:first-child { border-top: 0; }
button.cx-renglon, a.cx-renglon { cursor: pointer; }
.cx-renglon-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; border: 1.5px solid var(--cx-impreso); color: var(--cx-impreso); display: grid; place-items: center; }
.cx-renglon-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-renglon-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-renglon-tx b { font-weight: 800; font-size: 16px; line-height: 1.2; color: var(--cx-noche); overflow-wrap: anywhere; }
.cx-renglon-tx small { font-size: 13.5px; line-height: 1.3; color: var(--cx-tinta-2); overflow-wrap: anywhere; }
.cx-renglon-fin { flex: none; display: flex; align-items: center; gap: 8px; font: 400 15px var(--cx-num); color: var(--cx-impreso); }
.cx-renglon-fin svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cx-renglon.peligro .cx-renglon-tx b { color: #B42318; }
.cx-globo { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--cx-tampon); color: #fff; font: 400 12px/22px var(--cx-num); text-align: center; }
.cx-mini { height: 40px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--cx-noche); background: var(--cx-amarillo); color: var(--cx-noche); font: 800 14px var(--cx-letra); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.cx-mini.sec { background: transparent; }
.cx-interruptor { flex: none; width: 56px; height: 32px; padding: 2px; border-radius: 16px; border: 2px solid var(--cx-noche); background: var(--cx-hoja); cursor: pointer; display: flex; }
.cx-interruptor i { width: 24px; height: 24px; border-radius: 50%; background: var(--cx-noche); transition: transform .18s ease; }
.cx-interruptor[aria-checked="true"] { background: var(--cx-amarillo); }
.cx-interruptor[aria-checked="true"] i { transform: translateX(24px); }
.cx-papel-cab { padding: 16px 16px 4px; }
.cx-papel-cab h3 { margin-top: 4px; font-weight: 900; font-stretch: 68%; font-size: 26px; line-height: 0.98; text-transform: uppercase; color: var(--cx-impreso); text-wrap: balance; overflow-wrap: anywhere; }
.cx-papel-cab p { margin-top: 7px; font-size: 14px; line-height: 1.4; color: var(--cx-tinta-2); }
.cx-papel-pie { padding: 12px 16px 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.cx-papel-pie .cx-btn { margin: 0; min-height: 50px; height: auto; flex: 1 1 150px; font-size: 16px; box-shadow: 0 3px 0 var(--cx-noche); }
.cx-papel-pie .cx-btn-sec { flex: 1 1 150px; height: 50px; border-color: var(--cx-noche); background: transparent; color: var(--cx-noche) !important; }
.cx-lleva { display: flex; align-items: center; gap: 16px; padding: 4px 0 2px 4px; }
.cx-vacio { padding: 18px 16px; font-size: 14px; line-height: 1.45; color: var(--cx-tinta-2); }
.cx-esqueleto { height: 220px; background: rgba(255, 255, 255, 0.07); transform: rotate(-1.4deg); }
.cx-esqueleto + .cx-esqueleto { height: 120px; transform: rotate(.7deg); }

/* ── Tu carnet (pestaña Carnet) ───────────────────────────────── */
.cx-carnet-zona { position: relative; display: flex; justify-content: center; padding: 6px 0 14px; }
.cx-carnet-zona .cx-cara { box-shadow: 0 0.6em 0 rgba(0, 16, 51, 0.4), inset 0 0 0 1.5px rgba(255, 255, 255, 0.26); }
/* Toda la foto se puede tocar para cambiarla; la cámara va en su esquina
   (abajo taparía el sello de "UFV verificado") */
.cx-foto-btn {
  position: absolute; left: calc(50% - 16.5em + 1.6em); top: calc(6px + 5.4em); width: 7.6em; height: 9.6em;
  font-size: min(10px, calc((100vw - 48px) / 33)); border: 0; border-radius: 1em; background: none; padding: 0; cursor: pointer;
}
.cx-foto-btn span {
  position: absolute; right: -9px; top: -9px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--cx-noche); background: var(--cx-amarillo); color: var(--cx-noche); box-shadow: 0 2px 0 #04102E;
}
.cx-foto-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Ventanas que suben desde abajo ───────────────────────────── */
.cx-modal-caja.cx-hoja { display: flex; flex-direction: column; gap: 14px; overflow-x: hidden; }
.cx-modal-caja.cx-hoja > * { flex: none; }
.cx-modal-caja.cx-hoja .cx-titulo { margin: 0; }
.cx-modal-caja.cx-hoja .cx-sub { margin: -6px 0 0; }
.cx-modal-caja.cx-hoja .cx-btn { margin-top: 0; }
.cx-modal-caja.cx-hoja .cx-error { margin: 0; }
.cx-modal-caja.cx-hoja .cx-legal { margin: 0; }
.cx-modal.abierta { display: flex; }
.cx-modal.abierta .cx-modal-caja { animation: cxSube .26s cubic-bezier(.2, .8, .2, 1); }
.cx-escribe {
  position: relative; margin: 6px 4px 2px; padding: 18px 16px 30px; transform: rotate(-1deg);
  background: linear-gradient(172deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 36%), var(--cx-postit);
  box-shadow: 0 16px 14px -10px rgba(0, 0, 0, 0.35);
}
.cx-escribe textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--cx-impreso); font: 700 29px/1.05 'Caveat', 'Segoe Print', 'Bradley Hand', cursive; }
.cx-escribe textarea::placeholder { color: rgba(11, 44, 115, 0.45); }
.cx-escribe:focus-within { outline: 3px solid var(--cx-borde); outline-offset: 3px; }
.cx-escribe span { position: absolute; right: 12px; bottom: 8px; font: 400 12px var(--cx-num); color: var(--cx-tinta-2); }
.cx-escribe.mal { animation: cxTiembla .3s; }
.cx-cita { padding: 14px 16px; border-radius: 16px; border: 2px dashed var(--cx-gris2); display: flex; flex-direction: column; gap: 4px; }
.cx-cita p { margin: 0; font-size: 14.5px; line-height: 1.4; color: var(--cx-gris); }
.cx-cita p.mano { font: 700 25px/1.05 'Caveat', 'Segoe Print', 'Bradley Hand', cursive; color: var(--cx-tinta); }
.cx-cita .cx-label { margin: 0; }
.cx-pegatinas { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-pegatinas span { padding: 5px 12px; border-radius: 99px; border: 2px solid var(--cx-noche); background: var(--cat, var(--cx-amarillo)); color: var(--cx-noche); font-weight: 800; font-stretch: 80%; font-size: 13px; line-height: 1.2; }
.cx-pegatinas span:nth-child(odd) { transform: rotate(-2deg); }
.cx-pegatinas span:nth-child(3n) { transform: rotate(2deg); }
.cx-invita { padding: 16px; border-radius: 16px; border: 2px solid var(--cx-borde); background: var(--cx-papel); font-size: 16px; line-height: 1.45; user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
.cx-menu { display: flex; flex-direction: column; margin: 0 -8px; }
.cx-menu .cx-renglon { border-top-color: var(--cx-linea); min-height: 58px; padding: 8px; color: var(--cx-tinta); border-radius: 0; }
.cx-menu .cx-renglon-ic { border-color: var(--cx-borde); color: var(--cx-tinta); }
.cx-menu .cx-renglon-tx b { color: var(--cx-tinta); }
.cx-menu .cx-renglon-tx small { color: var(--cx-gris); }
.cx-menu .cx-renglon-fin { color: var(--cx-tinta); }
.cx-menu .cx-renglon.peligro .cx-renglon-tx b { color: var(--cx-error); }
.cx-menu .cx-interruptor { border-color: var(--cx-borde); background: var(--cx-papel); }
.cx-menu .cx-interruptor i { background: var(--cx-borde); }
.cx-menu .cx-interruptor[aria-checked="true"] { background: var(--cx-amarillo); border-color: var(--cx-noche); }
.cx-menu .cx-interruptor[aria-checked="true"] i { background: var(--cx-noche); }
@media (min-width: 600px) {
  .cx-modal.abierta .cx-modal-caja { animation-name: cxEntra; }
}

@keyframes cxSube   { from { transform: translateY(40px); opacity: 0; } }
@keyframes cxVoltea { from { opacity: 0; transform: rotate(var(--r)) rotateY(86deg) scale(.92); } }
@keyframes cxSella  { from { opacity: 0; transform: rotate(calc(var(--r, 0deg) - 16deg)) scale(1.9); } }

/* ══════════════════════════════════════════════════════════════
   EL RESTO DE PANTALLAS: lo justo para que hablen igual que el tablón
   (se rediseñan en las siguientes fases)
   ══════════════════════════════════════════════════════════════ */

/* En el iPhone, tocar un campo con letra de menos de 16 px hace zoom en
   toda la pantalla y hay que deshacerlo a mano: en móvil, todos a 16 px. */
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
}

/* Chats: burbujas con borde; lo tuyo, en amarillo */
.chat-messages { background: var(--cx-fondo); }
.msg { max-width: 80%; border-radius: 16px; font-size: 15.5px; line-height: 1.38; }
.msg.mine { background: var(--cx-amarillo); color: var(--cx-noche); border: 2px solid var(--cx-noche); border-bottom-right-radius: 4px; }
.msg.theirs, body.dark .msg.theirs { background: var(--cx-papel); color: var(--cx-tinta); border: 2px solid var(--cx-borde); border-bottom-left-radius: 4px; }
.msg-time { opacity: 0.62; }
.msg-sender { color: var(--cx-enlace); }
.chat-header-name { font-weight: 800; font-size: 1.02rem; }
.chat-textarea { min-height: 46px; padding: 11px 16px; border: 2px solid var(--cx-borde); border-radius: 23px; background: var(--cx-papel); color: var(--cx-tinta); font-family: inherit; }
.chat-textarea:focus { border-color: var(--cx-borde); background: var(--cx-papel); box-shadow: 0 0 0 4px rgba(0, 48, 135, 0.18); }
.chat-send { width: 46px; height: 46px; background: var(--cx-amarillo); border: 2px solid var(--cx-noche); }
.chat-send:hover { background: var(--cx-amarillo); transform: none; }
.chat-send svg { stroke: var(--cx-noche); }

/* El cajón de avisos, a pantalla completa en móvil */
@media (max-width: 768px) {
  .notif-drawer { width: 100vw; max-width: 100vw; border-left: 0; }
  .notif-drawer-header { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
}

/* Gente: cada persona es su carnet */
.cx-personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 34px 22px; justify-items: center; padding: 10px 0 24px; }
.cx-persona { width: min(100%, 330px); display: flex; flex-direction: column; gap: 24px; }
.cx-persona-carnet { border: 0; background: none; padding: 0; cursor: pointer; display: flex; justify-content: center; text-align: left; font: inherit; }
.cx-persona-carnet:focus-visible { outline: 3px solid var(--cx-borde); outline-offset: 6px; border-radius: 16px; }
.cx-persona-pie { min-height: 40px; padding: 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; line-height: 1.3; color: var(--cx-gris); }
.cx-persona-pie b { font-weight: 800; font-size: 13.5px; color: var(--cx-tinta); }
.cx-personas .cx-mini { border-color: var(--cx-noche); }

/* ── El tablón: una columna en móvil (en este orden) y dos en ordenador ── */
.cx-tb-lado { display: contents; }
.cx-o1 { order: 1; } .cx-o2 { order: 2; } .cx-o3 { order: 3; } .cx-o4 { order: 4; }
.cx-tb-zona:empty { display: none; }
@media (min-width: 1000px) {
  .cx-tb-col.dos > .cx-tb-lado { display: flex; flex-direction: column; gap: 22px; min-width: 0; flex: 1 1 0; }
  .cx-tb-col.dos > .cx-tb-lado + .cx-tb-lado { flex: 0.82 1 0; }
}

/* ── Ventanas: piezas que comparten los anuncios, la orla y el finde ───── */
.cx-modal-caja.cx-hoja > .cx-label { margin: 0 0 -6px; }
.cx-modal-caja.cx-hoja > .cx-hoja-et { margin: 0 0 -8px; padding-right: 52px; }
.cx-modal-caja.cx-hoja .cx-titulo { overflow-wrap: anywhere; }
.cx-enlace.peligro { color: var(--cx-error); }
.cx-modal-caja.cx-hoja > .cx-enlace { align-self: center; }
.cx-menu div.cx-renglon { cursor: default; }
.cx-menu .cx-retrato { width: 32px; height: 40px; font-size: 14px; border-color: var(--cx-borde); }
.cx-confirma { padding: 14px 16px; border-radius: 16px; border: 2px dashed var(--cx-gris2); display: flex; flex-direction: column; gap: 12px; }
.cx-confirma p { margin: 0; font-size: 15px; line-height: 1.4; }
.cx-confirma > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cx-confirma .cx-btn, .cx-confirma .cx-btn-sec { height: 52px; padding: 0 10px; font-size: 15.5px; }
.cx-area { display: block; height: auto; padding: 14px 16px; line-height: 1.3; resize: none; }

/* Una línea de la app dentro de un chat: "Lucía ha arrancado una tira" */
.cx-msg-sis { align-self: center; max-width: 92%; padding: 6px 0; font-weight: 700; font-stretch: 80%; font-size: 12px; line-height: 1.35; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cx-gris); text-align: center; }
