/* ============================================================
   SkinnyProject - Lector de chats de WhatsApp
   Tokens del sitio + tema claro/oscuro. El área del chat usa
   los colores de WhatsApp, definidos por tema en .ct-chat.
   ============================================================ */

.ct-page { min-height: 100vh; background: var(--bg-main); }
.ct-upload[hidden], .ct-viewer[hidden] { display: none; } /* display de las clases anula [hidden] */

/* ── BREADCRUMB ───────────────────────────────────────────── */
.ct-breadcrumb { padding: var(--space-3) 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.ct-breadcrumb .breadcrumb-list { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); list-style: none; }
.ct-breadcrumb .breadcrumb-list a { color: var(--text-secondary); text-decoration: none; transition: color var(--transition); }
.ct-breadcrumb .breadcrumb-list a:hover { color: var(--accent); }
.ct-breadcrumb .breadcrumb-list [aria-current="page"] { color: var(--text-main); font-weight: var(--font-medium); }

/* ── HERO (mismo estilo que apps/imgmeta: diagonal, icono, subrayado ondulado) ── */
.ct-hero {
  position: relative; overflow: hidden; background: var(--surface);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4vw), 0 100%);
  padding: var(--space-12) 0 calc(var(--space-12) + 4vw); margin-bottom: -2vw;
}
.ct-hero::before {
  content: ''; position: absolute; top: -30%; right: -6%; width: 34%; height: 160%;
  background: var(--accent-soft); transform: rotate(14deg); pointer-events: none;
}
.ct-hero .container { position: relative; }
.ct-hero__inner { display: flex; align-items: flex-start; gap: var(--space-6); }
.ct-hero__icon {
  width: 80px; height: 80px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--border); color: var(--accent);
  border-radius: 22px 8px 22px 8px; transform: rotate(-6deg);
}
.ct-hero__badges { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.ct-hero h1 { width: fit-content; max-width: 100%; letter-spacing: -0.03em; margin: 0; }
.ct-hero h1::after {
  content: ''; display: block; width: 100%; height: 8px; margin-top: var(--space-3);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 4 Q6 0 12 4 T24 4' fill='none' stroke='%236c63ff' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left center / 24px 8px;
}
.ct-hero__sub { font-size: var(--text-lg); color: var(--text-secondary); margin: var(--space-3) 0 0; max-width: 620px; line-height: 1.7; }
@media (max-width: 768px) {
  .ct-hero::before { display: none; }
  .ct-hero__inner { flex-direction: column; gap: var(--space-4); }
  .ct-hero__icon { width: 56px; height: 56px; }
}

/* con un chat abierto el encabezado se oculta: el visor ocupa toda la pantalla */
.ct-hero.is-compact { display: none; }

.ct-section { padding: var(--space-6) 0; }
.ct-hint { font-size: var(--text-xs); color: var(--text-secondary); margin: 0; }

/* ── Aparición al hacer scroll ────────────────────────────── */
.ct-reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.2, .8, .2, 1); }
.ct-reveal.is-in { opacity: 1; transform: none; }
.ct-steps li:nth-child(2), .ct-tips__grid > :nth-child(2) { transition-delay: .1s; }
.ct-steps li:nth-child(3), .ct-tips__grid > :nth-child(3) { transition-delay: .2s; }

/* ── DESPLEGABLES (acordeón animado) ──────────────────────── */
.ct-acc { border-top: 1px solid var(--border); margin-top: var(--space-4); }
.ct-acc__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  background: none; border: 0; padding: var(--space-3) 0; cursor: pointer; font: inherit; font-weight: var(--font-semibold);
  font-size: var(--text-sm); color: var(--text-main); text-align: left; transition: color var(--transition);
}
.ct-acc__btn:hover { color: var(--accent); }
.ct-acc__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.ct-chev { flex: none; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.ct-acc.is-open .ct-chev { transform: rotate(180deg); }
.ct-acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.2, .8, .2, 1); }
.ct-acc.is-open .ct-acc__body { grid-template-rows: 1fr; }
.ct-acc__in { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: var(--space-3); opacity: 0; transition: opacity .3s; }
.ct-acc.is-open .ct-acc__in { opacity: 1; padding-bottom: var(--space-3); }
.ct-acc--flat { margin-top: 0; padding: 0 var(--space-4); }

/* ── SUBIDA ───────────────────────────────────────────────── */
.ct-upload { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-5); animation: ct-rise .5s both; }
.ct-dropcard { padding: var(--space-5);  }
.ct-drop {
  position: relative; overflow: hidden; text-align: center; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-5);
    transition: border-color var(--transition), transform .25s, background .25s;
}
.ct-drop:hover, .ct-drop:focus-visible { border-color: var(--accent); outline: none; transform: translateY(-2px); }
.ct-drop.is-over { border-style: solid; border-color: var(--success); transform: scale(1.015); background: var(--accent-soft); }
.ct-drop__icon { width: 64px; height: 64px; margin: 0 auto var(--space-3); display: grid; place-items: center; font-size: 1.9rem; border-radius: 50%; background: var(--accent-soft); }
.ct-drop h2 { font-size: var(--text-xl); margin: 0 0 var(--space-1); }
.ct-drop p { color: var(--text-secondary); margin: 0 0 var(--space-4); font-size: var(--text-sm); }
.ct-drop__btns { display: flex; justify-content: center; gap: var(--space-3); flex-wrap: wrap; position: relative; }
.ct-paste__area { width: 100%; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--text-xs); }
.ct-acc__in .btn { align-self: flex-start; }
.ct-error { margin: var(--space-3) 0 0; padding: var(--space-3); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); animation: ct-shake .4s; }
@keyframes ct-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.ct-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.ct-steps li { position: relative; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.ct-steps__n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-bottom: var(--space-2); color: #fff; font-weight: var(--font-bold); font-size: var(--text-sm); background: var(--accent); }
.ct-steps h3 { margin: 0 0 var(--space-1); font-size: var(--text-base); }
.ct-steps p { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
.ct-privacy { text-align: center; }

/* ── VISOR ────────────────────────────────────────────────── */
.ct-viewer { max-width: 960px; margin: 0 auto; animation: ct-pop .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ct-pop { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.ct-app { padding: 0; overflow: hidden;  }
.ct-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ct-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: var(--font-bold); font-size: var(--text-lg); color: #fff; background: var(--accent); }
.ct-head__info { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.ct-head__info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-base); }
.ct-head__info small { color: var(--text-secondary); font-size: var(--text-xs); }
.ct-head__btns { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.ct-ibtn {
  display: inline-flex; align-items: center; gap: 6px; padding: .45rem .75rem; border-radius: var(--radius-full); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-main); font: inherit; font-size: var(--text-sm); font-weight: var(--font-medium);
  transition: transform .15s, border-color var(--transition), color var(--transition), background var(--transition);
}
.ct-ibtn:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.ct-ibtn:active { transform: scale(.96); }
.ct-ibtn svg { transition: transform .3s; }
.ct-ibtn:hover svg { transform: scale(1.12); }
.ct-ibtn--close:hover { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.ct-ibtn--close:hover svg { transform: rotate(90deg); }

.ct-tools { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.ct-field {
  display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); border-radius: var(--radius-full);
  background: var(--bg-main); border: 1.5px solid var(--border); color: var(--text-secondary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ct-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); color: var(--accent); }
.ct-field input { border: 0; background: transparent; outline: 0; color: var(--text-main); font: inherit; font-size: var(--text-sm); padding: .6rem 0; min-width: 0; width: 100%; color-scheme: light dark; }
[data-theme="dark"] .ct-field input { color-scheme: dark; }
[data-theme="light"] .ct-field input { color-scheme: light; }
.ct-field--search { flex: 1 1 220px; }
.ct-field--date { flex: 0 1 190px; }

/* Personas + estadísticas */
.ct-statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.ct-stat { padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-main); border: 1px solid var(--border); text-align: center; }
.ct-stat b { display: block; font-size: var(--text-2xl); line-height: 1.1; font-variant-numeric: tabular-nums; background: var(--accent); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ct-stat small { color: var(--text-secondary); font-size: var(--text-xs); }
.ct-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.ct-people li { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: var(--space-2) var(--space-3); }
.ct-people label { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); cursor: pointer; }
.ct-people input[type="radio"] { accent-color: var(--accent); }
.ct-people input[type="text"] { min-width: 0; }
.ct-people small { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ct-dot { width: 12px; height: 12px; border-radius: 50%; }
.ct-share { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.ct-share i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .8s cubic-bezier(.2, .8, .2, 1); }

/* buscador con contador, filtros y galería */
.ct-count { flex: none; font-size: var(--text-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ct-nav { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary); cursor: pointer; transition: background var(--transition), color var(--transition); }
.ct-nav:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); } .ct-nav:disabled { opacity: .35; cursor: default; }
.ct-filters { display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-4); overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.ct-chip, .ct-whosel { flex: none; padding: .35rem .8rem; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-main); font: inherit; font-size: var(--text-sm); cursor: pointer; transition: background var(--transition), border-color var(--transition), color var(--transition), transform .15s; }
.ct-chip:hover, .ct-whosel:hover { border-color: var(--accent); color: var(--accent); }
.ct-chip:active { transform: scale(.95); }
.ct-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ct-whosel { margin-left: auto; } .ct-whosel option { background: var(--surface); color: var(--text-main); }

.ct-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; padding: var(--space-3) var(--space-4); }
.ct-gcell { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: rgba(127, 127, 127, .2); }
.ct-gcell .ct-mbox, .ct-gcell .ct-mbox.is-stk { height: 100%; overflow: hidden; }
.ct-gcell .ct-img, .ct-gcell .ct-stk, .ct-gcell video, .ct-gcell .ct-mtile { width: 100%; height: 100%; max-height: none; min-height: 0; object-fit: cover; border-radius: 0; }
.ct-gcell .ct-mtile small { display: none; }
.ct-more { display: block; margin: var(--space-3) auto; padding: .45rem 1rem; border: 0; border-radius: var(--radius-full); background: var(--c-chip); color: var(--c-chip-text); font: inherit; font-size: 12.5px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.ct-more:hover { transform: translateY(-1px); }
.ct-bubble mark.is-cur { background: #ff9f1c; outline: 2px solid #ff9f1c66; }
.ct-quote[role="button"] { cursor: pointer; transition: background .15s; } .ct-quote[role="button"]:hover { background: rgba(127, 127, 127, .26); }
.ct-bubble.is-flash-b { animation: ct-bflash 1.6s ease; }
@keyframes ct-bflash { 15%, 55% { box-shadow: 0 0 0 3px #f5c518; } }

/* gráficos de estadísticas */
.ct-charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.ct-chartbox { padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-main); border: 1px solid var(--border); min-width: 0; }
.ct-chartbox--wide { grid-column: 1 / -1; }
.ct-chartbox h4 { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
.ct-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; overflow-x: auto; padding-top: 4px; }
.ct-bars > div { flex: 1 0 10px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 10px; }
.ct-bars i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--accent); transform-origin: bottom; animation: ct-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.ct-bars small { font-size: 9px; color: var(--text-secondary); margin-top: 3px; white-space: nowrap; }
@keyframes ct-grow { from { transform: scaleY(0); } }
.ct-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ct-rank li { display: grid; grid-template-columns: minmax(70px, auto) 1fr auto; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.ct-rank i { display: block; height: 8px; border-radius: 4px; background: var(--accent); opacity: .75; }
.ct-rank small { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ct-big { font-size: var(--text-xl); font-weight: var(--font-bold); } .ct-bigsub { color: var(--text-secondary); font-size: var(--text-xs); }

/* ── CHAT (colores de WhatsApp por tema) ─────────────────── */
.ct-chatwrap { position: relative; }
.ct-chat {
  --c-bg: #0b141a; --c-bubble-me: #005c4b; --c-bubble-other: #202c33; --c-text: #e9edef; --c-doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='white' stroke-opacity='.06' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 36c-4-7-13-3-10 4 3 5 10 9 10 9s7-4 10-9c3-7-6-11-10-4z'/%3E%3Cpath d='M88 14h26a6 6 0 0 1 6 6v14a6 6 0 0 1-6 6h-14l-8 8v-8h-4a6 6 0 0 1-6-6V20a6 6 0 0 1 6-6z'/%3E%3Cpath d='M30 90l4 8 9 1.2-6.6 6.2 1.7 8.8L30 110l-8 4.2 1.7-8.8L17 99.2 26 98z'/%3E%3Ccircle cx='112' cy='104' r='14'/%3E%3Ccircle cx='107' cy='100' r='1.2'/%3E%3Ccircle cx='117' cy='100' r='1.2'/%3E%3Cpath d='M105 108q7 7 14 0'/%3E%3Cpath d='M66 74v22a5 5 0 1 1-3-4.6V78l16-4v18a5 5 0 1 1-3-4.6V70z'/%3E%3Crect x='132' y='20' width='14' height='26' rx='3'/%3E%3Cpath d='M137 42h4'/%3E%3Ccircle cx='60' cy='134' r='8'/%3E%3Cpath d='M60 130v5l3 2'/%3E%3Cpath d='M120 140l14-6-14-6v5l9 1-9 1z'/%3E%3C/svg%3E");
  --c-time: rgba(233, 237, 239, .6); --c-chip: #182229; --c-chip-text: #8696a0; --c-line: #2a3942; --c-link: #53bdeb; --l: 66%;
  position: relative; height: min(70vh, 740px); overflow-y: auto; scroll-behavior: smooth; padding: var(--space-3) 0 var(--space-4);
  background-color: var(--c-bg); color: var(--c-text);
  background-image: var(--c-doodle); background-size: 260px 260px;
}
[data-theme="light"] .ct-chat {
  --c-bg: #efeae2; --c-bubble-me: #d9fdd3; --c-bubble-other: #ffffff; --c-text: #111b21; --c-doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='black' stroke-opacity='.07' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 36c-4-7-13-3-10 4 3 5 10 9 10 9s7-4 10-9c3-7-6-11-10-4z'/%3E%3Cpath d='M88 14h26a6 6 0 0 1 6 6v14a6 6 0 0 1-6 6h-14l-8 8v-8h-4a6 6 0 0 1-6-6V20a6 6 0 0 1 6-6z'/%3E%3Cpath d='M30 90l4 8 9 1.2-6.6 6.2 1.7 8.8L30 110l-8 4.2 1.7-8.8L17 99.2 26 98z'/%3E%3Ccircle cx='112' cy='104' r='14'/%3E%3Ccircle cx='107' cy='100' r='1.2'/%3E%3Ccircle cx='117' cy='100' r='1.2'/%3E%3Cpath d='M105 108q7 7 14 0'/%3E%3Cpath d='M66 74v22a5 5 0 1 1-3-4.6V78l16-4v18a5 5 0 1 1-3-4.6V70z'/%3E%3Crect x='132' y='20' width='14' height='26' rx='3'/%3E%3Cpath d='M137 42h4'/%3E%3Ccircle cx='60' cy='134' r='8'/%3E%3Cpath d='M60 130v5l3 2'/%3E%3Cpath d='M120 140l14-6-14-6v5l9 1-9 1z'/%3E%3C/svg%3E");
  --c-time: rgba(17, 27, 33, .55); --c-chip: #ffffff; --c-chip-text: #54656f; --c-line: #d1d7db; --c-link: #027eb5; --l: 34%;
}
.ct-chat:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ct-chat::-webkit-scrollbar { width: 8px; } .ct-chat::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--c-chip-text) 40%, transparent); border-radius: 4px; }
.ct-msgs { padding: 0 var(--space-4); }

.ct-date, .ct-sys { display: flex; justify-content: center; margin: var(--space-4) 0 var(--space-2); }
.ct-date { position: sticky; top: 6px; z-index: 3; pointer-events: none; }
.ct-date span, .ct-sys span {
  background: var(--c-chip); color: var(--c-chip-text); border: 1px solid var(--c-line);
  font-size: 11.5px; padding: 4px 12px; border-radius: 8px; text-align: center; max-width: 440px; line-height: 1.5; box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}
.ct-date span::first-letter { text-transform: uppercase; }
.ct-sys { margin: var(--space-2) 0; }
.ct-date.is-flash span { animation: ct-flash 1.4s ease; }
@keyframes ct-flash { 20%, 60% { background: #f5c518; color: #111; transform: scale(1.12); } }

.ct-row { display: flex; margin: 2px 0; content-visibility: auto; contain-intrinsic-size: auto 48px; }
.ct-row.is-me { justify-content: flex-end; }
.ct-row.is-in { animation: ct-msg .42s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 38ms); }
.ct-row.is-in:not(.is-me) { --x: -16px; } .ct-row.is-in.is-me { --x: 16px; }
@keyframes ct-msg { from { opacity: 0; transform: translate(var(--x, 0), 10px) scale(.94); } }
.ct-bubble {
  position: relative; max-width: min(68%, 560px); min-width: 72px; padding: 6px 9px 8px; border-radius: 8px; font-size: 14.5px; line-height: 1.45;
  word-break: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, .18); background: var(--c-bubble-other); color: var(--c-text);
}
.is-me .ct-bubble { background: var(--c-bubble-me); }
.ct-bubble.tail { margin-top: 6px; }
.is-me .ct-bubble.tail { border-top-right-radius: 0; } .ct-row:not(.is-me) .ct-bubble.tail { border-top-left-radius: 0; }
.ct-bubble.tail::before { content: ""; position: absolute; top: 0; width: 9px; height: 12px; background: inherit; }
.is-me .ct-bubble.tail::before { right: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.ct-row:not(.is-me) .ct-bubble.tail::before { left: -8px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.ct-who { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 2px; color: hsl(var(--h, 160) 62% var(--l)); }
.ct-text { white-space: pre-wrap; }
.ct-text a { color: var(--c-link); }
.ct-time { float: right; margin: 4px 0 -4px 10px; font-size: 10.5px; color: var(--c-time); white-space: nowrap; }
.ct-bubble mark { background: #f5c518; color: #111; border-radius: 2px; padding: 0 1px; }
.ct-media { display: flex; align-items: center; gap: 10px; min-width: 170px; padding: 10px 12px; border-radius: 8px; background: rgba(127, 127, 127, .16); font-size: 13px; }
.ct-media b { display: block; font-size: 13px; }
.ct-media small { display: block; color: var(--c-time); word-break: break-all; }
.ct-media__ico { font-size: 26px; line-height: 1; }
.ct-doc { cursor: pointer; } .ct-doc:hover { background: rgba(127, 127, 127, .26); }

/* foto / video / sticker */
.ct-bubble.is-visual { padding: 3px; }
.is-visual > .ct-text, .is-visual > .ct-quote { margin-left: 4px; margin-right: 4px; }
.is-visual > .ct-text { padding-top: 4px; }
.is-visual > .ct-who, .is-visual > .ct-fwd { padding: 2px 5px 0; }
.is-visual > .ct-time { margin-right: 5px; }
.ct-mbox { position: relative; display: block; border-radius: 6px; overflow: hidden; line-height: 0; }
.ct-img, .ct-mbox video { display: block; max-width: 100%; width: auto; max-height: 360px; min-width: 120px; min-height: 90px; object-fit: contain; background: rgba(127, 127, 127, .2); cursor: zoom-in; }
.ct-mbox video { cursor: default; background: #000; }
.ct-mtile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 230px; max-width: 100%; height: 170px; text-align: center; line-height: 1.3; background: rgba(127, 127, 127, .2); }
.ct-mtile__ico { font-size: 40px; opacity: .65; }
.ct-mtile b { font-size: 13px; } .ct-mtile small { font-size: 11px; color: var(--c-time); word-break: break-all; padding: 0 8px; }
.ct-bubble.is-sticker { background: transparent; box-shadow: none; padding: 0; }
.ct-bubble.is-sticker::before { display: none; }
.ct-mbox.is-stk { overflow: visible; background: none; }
.ct-stk { display: block; width: 150px; height: 150px; object-fit: contain; }
.is-stk .ct-mtile { width: 120px; height: 120px; border-radius: 50%; }
.is-stk .ct-mtile__ico { font-size: 34px; } .is-stk .ct-mtile small { display: none; }
.ct-time.is-over { position: absolute; right: 6px; bottom: 5px; float: none; margin: 0; padding: 2px 6px; border-radius: 10px; line-height: 1.3; color: #fff; background: rgba(0, 0, 0, .45); }
.ct-bubble.is-sticker .ct-time.is-over { right: 2px; bottom: 2px; }

/* nota de voz */
.ct-voice { display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 2px 0 6px; }
.ct-voice__play { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: var(--c-text); background: rgba(127, 127, 127, .22); transition: background .15s, transform .15s; }
.ct-voice__play:hover:not(:disabled) { background: rgba(127, 127, 127, .36); transform: scale(1.06); } .ct-voice__play:disabled { cursor: default; opacity: .6; }
.ct-voice__wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 28px; }
.ct-voice__wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--c-time); opacity: .55; transition: background .15s, opacity .15s; }
.ct-voice__wave i.is-on { background: #53bdeb; opacity: 1; }
.ct-voice__dur { flex: none; min-width: 34px; font-size: 11px; color: var(--c-time); font-variant-numeric: tabular-nums; }
.ct-voice.is-off .ct-voice__dur { min-width: 0; max-width: 90px; text-align: right; line-height: 1.2; }

/* respuestas, reenviados, editado, borrado */
.ct-quote { margin: 0 0 4px; padding: 4px 8px; border-left: 4px solid hsl(var(--h, 160) 62% var(--l)); border-radius: 4px; background: rgba(127, 127, 127, .16); font-size: 12.5px; line-height: 1.35; overflow: hidden; }
.ct-quote b { display: block; font-size: 12px; color: hsl(var(--h, 160) 62% var(--l)); }
.ct-quote span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--c-time); white-space: pre-wrap; }
.ct-fwd { margin-bottom: 2px; font-size: 12px; font-style: italic; color: var(--c-time); }
.ct-text.is-del { font-style: italic; color: var(--c-time); }
.ct-text.is-big { font-size: 44px; line-height: 1.15; }
.ct-tick { display: inline-block; margin-left: 3px; color: #53bdeb; vertical-align: -1px; }
.ct-time.is-over .ct-tick { color: #7fd6ff; }
.ct-sys.is-enc span { background: #182229; color: #ffd279; } .ct-sys.is-enc span::before { content: "🔒 "; }
[data-theme="light"] .ct-sys.is-enc span { background: #fff5c4; color: #54656f; }

/* visor de imagen */
.ct-lb { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(0, 0, 0, .88); cursor: zoom-out; animation: ct-pop .2s both; }
.ct-lb img { max-width: 94vw; max-height: 92vh; border-radius: 6px; }
.ct-lb__x { position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; border: 0; border-radius: 50%; font-size: 28px; line-height: 1; color: #fff; background: rgba(255, 255, 255, .15); cursor: pointer; }
.ct-empty { text-align: center; color: var(--c-chip-text); padding: var(--space-8) 0; }

.ct-fab {
  position: absolute; right: var(--space-4); bottom: var(--space-4); width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: var(--accent); box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  animation: ct-pop .25s both; transition: transform .15s;
}
.ct-fab[hidden] { display: none; } .ct-fab:hover { transform: translateY(-2px) scale(1.06); } .ct-fab:active { transform: scale(.94); }

/* ── CONSEJOS ─────────────────────────────────────────────── */
.ct-tips__title { text-align: center; font-size: var(--text-2xl); margin: var(--space-6) 0; }
.ct-tips__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.ct-tip { padding: var(--space-5); }
.ct-tip.is-in:hover { transform: translateY(-4px); border-color: var(--accent);  }
.ct-tip__ico { display: inline-block; font-size: 1.8rem; transition: transform .3s; }
.ct-tip:hover .ct-tip__ico { transform: scale(1.2) rotate(-8deg); }
.ct-tip h3 { margin: var(--space-2) 0 var(--space-1); font-size: var(--text-lg); }
.ct-tip p { margin: 0; color: var(--text-secondary); font-size: var(--text-sm); }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .ct-hero__inner { grid-template-columns: 1fr; text-align: center; padding-top: var(--space-6); padding-bottom: var(--space-6); }
  .ct-hero__sub { margin: 0 auto; }
  .ct-hero__art { max-width: 160px; order: -1; }
  .ct-tips__grid, .ct-steps { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ct-ibtn__t { display: none; } .ct-ibtn { padding: .55rem; }
  .ct-field--date { flex: 1 1 100%; }
  .ct-bubble { max-width: 86%; }
  .ct-msgs { padding: 0 var(--space-2); }
  .ct-people li { grid-template-columns: auto auto 1fr; } .ct-people small { display: none; }
  .ct-charts { grid-template-columns: 1fr; }
  .ct-count { display: none; }
  .ct-drop { padding: var(--space-8) var(--space-3); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .ct-reveal { opacity: 1; transform: none; }
}

/* ── IMPRESIÓN: solo la conversación completa ─────────────── */
@media print {
  .navbar, .ct-breadcrumb, .ct-hero, .ct-upload, .ct-head__btns, .ct-tools, .ct-filters, .ct-more, .ct-acc, .ct-fab, .ct-tips, .ad-container, footer { display: none !important; }
  .ct-page, .ct-section { padding: 0 !important; background: #fff !important; }
  main { padding-top: 0 !important; }
  .ct-app { box-shadow: none; border: 0; }
  .ct-chat { height: auto !important; overflow: visible !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ct-row { content-visibility: visible; break-inside: avoid; animation: none !important; }
}

/* ── VISOR A PANTALLA COMPLETA: barras fijas arriba, solo el chat hace scroll ── */
.ct-viewer .ct-app { display: flex; flex-direction: column; height: calc(100vh - var(--navbar-height) - 110px); height: calc(100dvh - var(--navbar-height) - 110px); min-height: 420px; }
.ct-viewer .ct-head, .ct-viewer .ct-tools, .ct-viewer .ct-filters, .ct-viewer .ct-panels { flex: none; }
.ct-viewer .ct-chatwrap { flex: 1; min-height: 0; display: flex; }
.ct-viewer .ct-chat { height: auto; flex: 1; }
.ct-panels { position: relative; display: flex; flex: none; border-bottom: 1px solid var(--border); }
.ct-panels .ct-acc { flex: 1; position: static; border-top: 0; padding: 0 var(--space-4); }
.ct-panels .ct-acc + .ct-acc { border-left: 1px solid var(--border); }
.ct-panels .ct-acc__btn { padding: var(--space-2) 0; }
/* los paneles se abren sobre el chat, sin empujarlo ni mover la pantalla */
.ct-panels .ct-acc__body { position: absolute; left: 0; right: 0; top: 100%; z-index: 8; background: var(--surface); box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .55); border-bottom: 1px solid var(--border); }
.ct-panels .ct-acc.is-open .ct-acc__body { border-top: 1px solid var(--border); }
.ct-panels .ct-acc__in { overflow-y: auto; max-height: 52vh; padding: 0 var(--space-4); scrollbar-width: thin; }
.ct-panels .ct-acc.is-open .ct-acc__in { padding: var(--space-3) var(--space-4) var(--space-4); }
body:has(.ct-viewer:not([hidden])) .ct-section { padding-top: var(--space-3); padding-bottom: var(--space-3); }
@media (max-width: 700px) {
  .ct-viewer .ct-app { height: calc(100dvh - var(--navbar-height) - 90px); }
  .ct-viewer .ct-head { padding: var(--space-2) var(--space-3); }
  .ct-viewer .ct-tools { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .ct-viewer .ct-field--date { flex: 1 1 100%; }
  .ct-viewer .ct-filters { padding: var(--space-2) var(--space-3); }
}
@media print { .ct-viewer .ct-app { height: auto !important; display: block; } .ct-viewer .ct-chatwrap { display: block; } .ct-viewer .ct-chat { height: auto !important; } }

.ct-viewer .ct-head { padding: var(--space-2) var(--space-4); }
.ct-viewer .ct-avatar { width: 38px; height: 38px; font-size: var(--text-base); }
.ct-viewer .ct-tools { padding: var(--space-2) var(--space-4); }
.ct-viewer .ct-filters { padding: var(--space-2) var(--space-4); }
.ct-viewer .ct-field input { padding: .45rem 0; }
@media print { .ct-panels { display: none !important; } }
