/* =====================================================================
   Portal de contenido · André Giraldo Studio
   Mobile-first. Tema oscuro de marca por defecto + modo claro.
   ===================================================================== */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0f;
  --surface: #14141a;
  --surface-2: #1c1c25;
  --border: #2a2a36;
  --text: #f3f3f6;
  --muted: #9b9bab;
  --accent: #e6007e;          /* magenta de marca */
  --accent-hover: #ff2896;
  --accent-soft: rgba(230, 0, 126, .14);
  --on-accent: #ffffff;
  --focus: #ff5cb0;
  --ok: #22c55e;
  --warn: #f5a524;
  --danger: #ef4444;
  --info: #38bdf8;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #efeff3;
  --border: #dcdce3;
  --text: #121217;
  --muted: #5e5e6d;
  --accent: #c8006e;          /* más oscuro para contraste AA sobre blanco */
  --accent-hover: #a8005c;
  --accent-soft: rgba(200, 0, 110, .10);
  --on-accent: #ffffff;
  --focus: #c8006e;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
  --info: #0369a1;
  --shadow: 0 8px 24px rgba(20, 20, 30, .08);
}

/* Colores de estado (mismo tono en ambos temas, legibles sobre fondo oscuro y claro) */
:root {
  --st-draft: #8b8b99;
  --st-internal_review: #a78bfa;
  --st-in_review: #f5a524;
  --st-changes_requested: #f05252;
  --st-in_correction: #fb923c;
  --st-new_version: #38bdf8;
  --st-approved: #22c55e;
  --st-scheduled: #2dd4bf;
  --st-published: #818cf8;
  --st-rejected: #6b7280;

  --radius: 14px;
  --radius-sm: 10px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --gutter: 16px;
  --tap: 44px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); }
h2 { font-size: 1.25rem; }
.display { font-size: 1.8rem; }

p { margin: 0 0 1em; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
code { font-size: .9em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; }
.accent { color: var(--accent); }
.eyebrow {
  font: 600 .78rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: .9em;
}

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px; z-index: 10;
}
.skip-link:focus { left: 8px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.brand-name { font: 600 1rem var(--font-display); letter-spacing: -.01em; }
.brand-studio { color: var(--muted); font-weight: 500; }
.brand { min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.brand-ag { height: 29px; width: auto; flex: none; }
/* El logo es blanco/gris: en modo claro se invierte para que se vea sobre fondo claro. */
:root[data-theme="light"] .brand-ag { filter: invert(1); }
@media (max-width: 559px) { .brand-x { display: none; } }
.topbar-actions { display: flex; gap: 8px; }

.main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px var(--gutter) calc(48px + env(safe-area-inset-bottom));
}

.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 24px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.hero { padding: 8vh 0 4vh; max-width: 720px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.center-card, .auth-card {
  max-width: 440px; margin: 6vh auto 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 22px; box-shadow: var(--shadow);
}
.center-card { text-align: center; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 .95rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--muted); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: 0 24px; }
.btn-approve { background: var(--ok); color: #fff; }
.btn-changes { background: var(--surface-2); color: var(--text); border-color: var(--warn); }

.decision-bar { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .decision-bar { grid-template-columns: 1fr 1fr; } }

.icon-btn {
  width: var(--tap); height: var(--tap); display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
:root[data-theme="dark"] .i-moon, :root:not([data-theme]) .i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }

/* ---------- Estados ---------- */
.status {
  --c: var(--st-draft);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font: 600 .78rem/1.3 var(--font-body);
  color: var(--text);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.status-draft { --c: var(--st-draft); }
.status-internal_review { --c: var(--st-internal_review); }
.status-in_review { --c: var(--st-in_review); }
.status-changes_requested { --c: var(--st-changes_requested); }
.status-in_correction { --c: var(--st-in_correction); }
.status-new_version { --c: var(--st-new_version); }
.status-approved { --c: var(--st-approved); }
.status-scheduled { --c: var(--st-scheduled); }
.status-published { --c: var(--st-published); }
.status-rejected { --c: var(--st-rejected); }

/* ---------- Calendario ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { text-align: center; font: 600 .75rem var(--font-display); color: var(--muted); padding: 4px 0; }
.cal-day {
  position: relative; aspect-ratio: 1 / 1.15; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); overflow: hidden;
}
.cal-num { position: absolute; top: 4px; left: 6px; font-size: .72rem; color: var(--muted); z-index: 1; }
.cal-thumb {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 40%, var(--surface-2)), var(--surface-2));
}
.has-post .cal-num { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.cal-dot {
  position: absolute; right: 5px; bottom: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--c, var(--st-draft)); box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 500; font-size: .92rem; }
.field input, .field textarea, .field select {
  width: 100%; min-height: var(--tap);
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: 400 16px/1.4 var(--font-body); /* 16px evita el zoom automático en iPhone */
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.hint { color: var(--muted); font-size: .82rem; }
.field-error { color: var(--danger); font-size: .85rem; margin: 0; }

/* ---------- Avisos ---------- */
.alert {
  --c: var(--info);
  padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.alert-success { --c: var(--ok); }
.alert-error { --c: var(--danger); }
.alert-info { --c: var(--info); }

.debug {
  text-align: left; white-space: pre-wrap; font-size: .75rem; max-height: 50vh; overflow: auto;
  background: var(--surface-2); padding: 12px; border-radius: 8px;
}


/* ---------- Navegación ---------- */
.nav {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 8px var(--gutter); border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
@media (min-width: 768px) { .nav { padding-left: var(--gutter); } }

/* ---------- Páginas ---------- */
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: .2em; }
.page-head p { margin: 0; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.crumbs { margin: 0 0 8px; font-size: .9rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.auth-foot { margin: 18px 0 0; text-align: center; font-size: .92rem; }
.auth-card .form { margin-top: 18px; }
.empty { text-align: center; padding: 40px 20px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
[hidden] { display: none !important; }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none;
}
.list-item:hover { border-color: var(--muted); color: var(--text); }
.list-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.list-main > * { overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font: 600 1rem var(--font-display);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters .field { flex: 1 1 180px; }

/* Estadísticas */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: grid; gap: 4px; }
.stat-num { font: 600 2rem/1 var(--font-display); }

/* Opciones (radio/checkbox) */
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { font-weight: 500; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.choice + .choice { margin-top: 8px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input, .check input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: var(--tap); padding-top: 8px; cursor: pointer; }

/* Invitación */
.copy-row { display: flex; gap: 8px; margin: 12px 0; }
.copy-row input {
  flex: 1; min-width: 0; min-height: var(--tap); padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .85rem;
}
.btn-whatsapp { background: #25d366; color: #06301a; }
.btn-whatsapp:hover { background: #1fbd5a; color: #06301a; }

/* 2FA */
.steps { padding-left: 1.2em; margin: 12px 0; }
.steps li + li { margin-top: 4px; }
.qr { width: 220px; max-width: 100%; margin: 16px auto; background: #fff; border-radius: 12px; padding: 6px; }
.qr svg { display: block; width: 100%; height: auto; }
.manual-key { margin: 8px 0 4px; font-size: .9rem; }
.manual-key summary { cursor: pointer; color: var(--muted); }
.secret { display: block; margin-top: 8px; padding: 10px; font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.code-input { font: 600 1.4rem/1 var(--font-display) !important; letter-spacing: .3em; text-align: center; }
.codes { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.codes code { font-size: 1rem; }

/* ---------- Fase 2: cronogramas y posts ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.chip-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.ok-text { color: var(--ok); }
.warn { color: var(--warn); }
.lock-note { font-size: .78rem; font-weight: 500; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.action-card .row-wrap { align-items: center; }
.action-card .hint { margin: 10px 0 0; }
.return-box { margin-top: 12px; }
.return-box summary { cursor: pointer; color: var(--muted); }
.return-box .form { margin-top: 10px; }
.inline-date { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Barra de estados del cronograma */
.mini-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 6px; max-width: 320px; }
.mini-seg { flex: 1 1 0; background: var(--c, var(--st-draft)); }

/* Lista de posts */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.post-row {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.post-row:hover { border-color: var(--muted); color: var(--text); }
.post-row-status { display: grid; gap: 4px; justify-items: end; text-align: right; }
.post-thumb {
  position: relative; flex: none; width: 64px; height: 80px; border-radius: 8px; overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb-empty { color: var(--muted); font-size: 1.4rem; }
.thumb-count {
  position: absolute; top: 4px; right: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: rgba(0,0,0,.65); color: #fff; font-size: .7rem; display: grid; place-items: center;
}
@media (max-width: 479px) {
  .post-row { flex-wrap: wrap; }
  .post-row-status { width: 100%; justify-items: start; text-align: left; padding-left: 76px; }
}

/* Formulario de post */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label, .chip-check { position: relative; cursor: pointer; }
.segmented input, .chip-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span, .chip-check span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); font-size: .9rem;
}
.segmented input:checked + span, .chip-check input:checked + span {
  border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600;
}
.segmented input:focus-visible + span, .chip-check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.segmented input:disabled + span, .chip-check input:disabled + span { opacity: .6; cursor: default; }
.net-grid { display: grid; gap: 10px; }
.net-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.net-platform { width: 84px; font-size: .82rem; font-weight: 600; color: var(--muted); }
@media (max-width: 479px) { .net-platform { width: 100%; } }
.field textarea:disabled, .field input:disabled { opacity: .75; }

/* Slides */
.slides { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.slide { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.slide-media { position: relative; aspect-ratio: 4 / 5; background: #000; }
.slide-media img, .slide-media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.is-sortable .slide-media { cursor: grab; touch-action: pan-y; }
.slide-num, .drag-handle {
  position: absolute; top: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: rgba(0,0,0,.7); color: #fff; font-size: .75rem; display: grid; place-items: center;
}
.slide-num { left: 6px; }
.drag-handle { right: 6px; font-size: 1rem; }
.slide-info { padding: 8px 10px 10px; display: grid; gap: 3px; min-width: 0; }
.slide-actions { margin-top: 4px; gap: 4px; }
.is-ghost { opacity: .4; }
.slides.is-saved { outline: 2px solid var(--ok); outline-offset: 4px; border-radius: var(--radius-sm); }

/* Zona de subida */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center;
  display: grid; gap: 8px; justify-items: center; transition: border-color .15s, background-color .15s;
}
.dropzone p { margin: 0; }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.up-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; text-align: left; }
.up-list li { display: grid; gap: 4px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.up-list progress { width: 100%; height: 6px; accent-color: var(--accent); }
.up-name { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-list .is-done .up-status { color: var(--ok); }
.up-list .has-warn .up-status { color: var(--warn); }
.up-list .is-error .up-status { color: var(--danger); }

/* Notas y actividad */
.notes, .timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notes p { margin: 4px 0 0; }
.timeline li { padding-left: 14px; border-left: 2px solid var(--border); font-size: .92rem; }
.list.compact .list-item { min-height: 0; }

.media-full { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; background: #000; }
.caption { white-space: pre-wrap; }

/* ---------- Fase 3: portal del cliente ---------- */
.xsmall { font-size: .72rem; letter-spacing: .02em; }
.link { color: var(--accent); cursor: pointer; }
.chip-on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.section-title { margin-top: 24px; }

.month-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.month-card {
  display: grid; gap: 8px; align-content: start; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.month-card:hover { border-color: var(--muted); color: var(--text); }
.month-card.is-current { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.month-card .eyebrow { margin: 0; }
.month-card .btn { justify-self: start; margin-top: 6px; }
.month-title { font: 600 1.5rem/1.1 var(--font-display); }
.countdown { color: var(--muted); display: grid; gap: 2px; }

.deadline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 16px;
  border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.deadline .ic { width: 18px; height: 18px; }
.deadline > span { flex: 1 1 180px; }
.countdown-text { margin-left: auto; color: var(--accent); }
.is-soon .countdown-text { color: var(--warn); }
.is-late .countdown-text { color: var(--danger); }

.view-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 16px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; width: max-content; max-width: 100%; }
.view-tabs a { flex: none; padding: 8px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .92rem; }
.view-tabs a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }

/* Calendario */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar .cal-head { text-align: center; font: 600 .72rem var(--font-display); color: var(--muted); padding: 2px 0 6px; }
.cal-cell {
  min-height: 64px; padding: 4px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.cal-cell.is-blank { background: transparent; border-color: transparent; }
.cal-cell.is-today { border-color: var(--accent); }
.cal-cell .cal-date { font-size: .72rem; color: var(--muted); line-height: 1; }
.cal-cell.is-today .cal-date { color: var(--accent); font-weight: 700; }
.cal-posts { display: grid; gap: 3px; flex: 1; min-height: 24px; }
.cal-post { position: relative; display: block; border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface-2); }
.cal-post img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-post-empty { display: block; width: 100%; height: 100%; }
.cal-post .cal-dot { right: 3px; bottom: 3px; width: 9px; height: 9px; }
.cal-time { display: none; position: absolute; left: 3px; top: 3px; padding: 1px 4px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: .62rem; }
.is-editable .cal-post { cursor: grab; }
.cal-post.is-saving { opacity: .5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
@media (min-width: 768px) {
  .calendar { gap: 6px; }
  .cal-cell { min-height: 120px; padding: 6px; }
  .cal-posts { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); align-content: start; }
  .cal-time { display: block; }
}

/* Grid de Instagram */
.ig-profile { max-width: 520px; margin: 0 auto; }
.ig-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.ig-head p { margin: 0; }
.ig-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ig-cell { position: relative; aspect-ratio: 3 / 4; background: var(--surface-2); overflow: hidden; }
.ig-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-badge { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.ig-date { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: .66rem; }
.ig-cell .cal-dot { right: 5px; bottom: 5px; }

/* Página del post */
.post-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.crumbs-link { color: var(--muted); text-decoration: none; font-size: .9rem; }
.post-pager { display: flex; align-items: center; gap: 8px; }
.post-pager .icon-btn { width: 36px; height: 36px; text-decoration: none; font-size: 1.3rem; }
.post-layout { display: grid; gap: 24px; }
.post-title { font-size: 1.5rem; margin: 0; }
.post-side h2 { font-size: 1.05rem; }
@media (min-width: 900px) {
  .post-layout { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); align-items: start; }
  .post-preview { position: sticky; top: 76px; }
}
.suggestion { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.preview-card summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.preview-card summary::-webkit-details-marker { display: none; }
.preview-card summary h2 { margin: 0; }
.preview-card[open] summary { margin-bottom: 16px; }

/* ---------- Previsualización realista ---------- */
.pv-switch { max-width: 420px; margin: 0 auto; }
.pv-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.pv-tab {
  flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; font: 500 .82rem var(--font-body);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.pv-tab[aria-selected="true"], .pv-tab[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.pv-note { text-align: center; font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-xs { width: 14px; height: 14px; vertical-align: -2px; }

.pv {
  --pv-bg: var(--surface); --pv-text: var(--text); --pv-dim: var(--muted);
  position: relative; background: var(--pv-bg); color: var(--pv-text); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; font: 400 14px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.pv p { margin: 0; }
.pv strong { font-weight: 600; }
.pv-dim { color: var(--pv-dim); }
.pv-grow { flex: 1; }
.pv-pad { padding: 0 12px 10px; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pv-head > div { line-height: 1.2; }
.pv-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.pv-avatar-txt { display: inline-grid; place-items: center; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.pv-actions { display: flex; align-items: center; gap: 14px; padding: 10px 12px 6px; }
.pv-body { padding: 0 12px 12px; display: grid; gap: 4px; }
.pv-cap { word-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pv-cap.is-open { -webkit-line-clamp: unset; display: block; }
.pv-tag { color: #4c9aff; }
.pv-more { background: none; border: 0; padding: 0; color: var(--pv-dim); font: inherit; cursor: pointer; justify-self: start; }

.pv-media { position: relative; aspect-ratio: 4 / 5; background: #000; overflow: hidden; }
.pv-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pv-track::-webkit-scrollbar { display: none; }
.pv-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.pv-slide img, .pv-slide video { width: 100%; height: 100%; display: block; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fit-cover .pv-slide img, .fit-cover .pv-slide video { object-fit: cover; }
.fit-contain .pv-slide img, .fit-contain .pv-slide video { object-fit: contain; }
.pv-empty { height: 100%; display: grid; place-items: center; color: #999; }
.pv-counter { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; z-index: 2; }
.pv-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; z-index: 2;
  background: rgba(255,255,255,.85); color: #111; font-size: 1.2rem; line-height: 1; cursor: pointer; display: none;
}
.pv-nav.prev { left: 8px; } .pv-nav.next { right: 8px; }
@media (hover: hover) { .pv-media[data-carousel]:hover .pv-nav { display: block; } }
.pv-dots { display: flex; justify-content: center; gap: 4px; padding-top: 8px; }
.pv-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.pv-dots span.on { background: #4c9aff; }
.pv-play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; border: 0; z-index: 2;
  background: rgba(0,0,0,.45); color: #fff; font-size: 1.6rem; cursor: pointer;
}
/* Marca de agua sobre videos no aprobados (las imágenes ya vienen marcadas desde el servidor) */
.pv-wm {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='160'%3E%3Ctext x='10' y='100' transform='rotate(-30 130 80)' font-family='Arial' font-weight='700' font-size='26' fill='white' fill-opacity='0.35'%3EBORRADOR%3C/text%3E%3C/svg%3E");
}

/* Facebook / LinkedIn */
.pv-fb-stats { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.pv-fb-actions { display: flex; justify-content: space-around; padding: 4px 4px; font-size: .82rem; font-weight: 600; color: var(--pv-dim); }
.pv-fb-actions span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 6px; }
.pv-fb-actions .ic { width: 18px; height: 18px; }
.pv-li-follow { color: #4c9aff; font-weight: 600; font-size: .85rem; }
.pv-li .pv-media, .pv-fb .pv-media { max-height: 520px; }

/* Threads */
.pv-th { padding: 12px; }
.pv-th-grid { display: grid; grid-template-columns: 36px 1fr; gap: 10px; }
.pv-th-main { display: grid; gap: 8px; min-width: 0; }
.pv-row { display: flex; align-items: center; gap: 8px; }
.pv-th .pv-media { border-radius: 10px; border: 1px solid var(--border); max-height: 420px; }
.pv-th .pv-actions { padding: 0; }
.pv-th .pv-actions .ic { width: 20px; height: 20px; }

/* YouTube */
.pv-yt .pv-body { padding: 12px; gap: 8px; }
.pv-yt-title { font: 600 1rem/1.3 -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; }
.pv-yt .pv-who { display: flex; align-items: center; gap: 10px; }
.pv-sub { background: var(--text); color: var(--bg); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: .82rem; }
.pv-yt-desc { background: var(--surface-2); border-radius: 10px; padding: 10px; }

/* Formatos verticales (Reels, TikTok, Shorts, Stories): siempre sobre fondo oscuro */
.pv-phone { border-radius: 22px; background: #000; color: #fff; border-color: #222; max-width: 360px; margin: 0 auto; }
.pv-phone .pv-media { aspect-ratio: 9 / 16 !important; }
.pv-phone .pv-dim { color: rgba(255,255,255,.75); }
.pv-ui { position: absolute; inset: 0; pointer-events: none; z-index: 3; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.pv-ui .ic { filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.pv-top { display: flex; align-items: center; gap: 12px; font-size: 1rem; }
.pv-side { position: absolute; right: 8px; bottom: 110px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pv-side span { display: grid; justify-items: center; gap: 2px; }
.pv-side small { font-size: .7rem; }
.pv-side .ic { width: 28px; height: 28px; }
.pv-side-avatar .pv-avatar { width: 42px; height: 42px; border: 2px solid #fff; }
.pv-bottom { display: grid; gap: 6px; padding-right: 56px; }
.pv-who { display: flex; align-items: center; gap: 8px; }
.pv-who .pv-avatar { width: 30px; height: 30px; }
.pv-follow { border: 1px solid rgba(255,255,255,.8); border-radius: 8px; padding: 2px 8px; font-size: .78rem; font-weight: 600; }
.pv-phone .pv-cap { -webkit-line-clamp: 2; }
.pv-phone .pv-tag { color: #fff; font-weight: 600; }
.pv-audio { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.pv-audio .ic { width: 14px; height: 14px; }
.pv-phone .pv-play { z-index: 4; }
.pv-phone video { cursor: pointer; }
/* Story */
.pv-bars { display: flex; gap: 3px; }
.pv-bars span { flex: 1; height: 2px; border-radius: 1px; background: rgba(255,255,255,.4); }
.pv-bars span.on { background: #fff; }
.pv-story-head { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .88rem; }
.pv-story-head .pv-avatar { width: 30px; height: 30px; }
.pv-story-foot { display: flex; align-items: center; gap: 12px; }
.pv-reply { flex: 1; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 8px 14px; font-size: .85rem; }

/* Zonas seguras: lo sombreado lo tapa la interfaz de la app */
.pv-safe { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.pv-safe span {
  position: absolute; display: grid; place-items: center; text-align: center; padding: 4px;
  font: 600 .68rem var(--font-body); color: #fff; text-shadow: 0 1px 2px #000;
  background: repeating-linear-gradient(-45deg, rgba(230,0,126,.38) 0 8px, rgba(230,0,126,.18) 8px 16px);
  outline: 1px dashed rgba(255,255,255,.8); outline-offset: -1px;
}
.pv-safe .top { top: 0; left: 0; right: 0; height: 12%; }
.pv-safe .right { top: 12%; right: 0; bottom: 22%; width: 16%; writing-mode: vertical-rl; }
.pv-safe .bottom { left: 0; right: 0; bottom: 0; height: 22%; }
.pv-safe-tiktok .top { height: 10%; } .pv-safe-tiktok .bottom { height: 24%; } .pv-safe-tiktok .right { width: 18%; top: 10%; bottom: 24%; }
.pv-safe-yt_short .bottom { height: 26%; } .pv-safe-yt_short .right { bottom: 26%; }
.pv-safe-story .top { height: 14%; } .pv-safe-story .bottom { height: 18%; }
.show-safe .pv-ui { opacity: .35; }

/* ---------- Fase 4: revisión ---------- */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.mode-tab { min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 .9rem var(--font-body); cursor: pointer; }
.mode-tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

.review { display: grid; gap: 10px; }
.rv-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.rv-thumb { position: relative; flex: none; width: 52px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); cursor: pointer; }
.rv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-thumb span { position: absolute; left: 3px; top: 2px; font-size: .65rem; color: #fff; text-shadow: 0 1px 2px #000; }
.rv-thumb[aria-selected="true"] { border-color: var(--accent); }
.rv-count:not(:empty) { position: absolute; right: 2px; bottom: 2px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--accent); color: #fff; font: 700 .6rem/16px var(--font-body); font-style: normal; }
.rv-stage-wrap { background: #0a0a0d; border-radius: var(--radius-sm); padding: 8px; display: grid; place-items: center; }
.rv-stage { width: 100%; display: grid; place-items: center; }
.rv-canvas { position: relative; width: 100%; margin: 0 auto; -webkit-user-select: none; user-select: none; }
.rv-canvas[hidden] { display: none; }
.rv-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.rv-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rv-layer.can-draw { cursor: crosshair; touch-action: none; }
.rv-shape { cursor: pointer; }
.rv-shape.is-flash { animation: flash 1s ease 2; }
@keyframes flash { 50% { opacity: .2; } }
.rv-video { position: relative; display: flex; align-items: center; gap: 8px; }
.rv-video input[type="range"] { flex: 1; accent-color: var(--accent); }
.rv-video .icon-btn { width: 40px; height: 40px; flex: none; }
.rv-video .icon-btn.is-on { border-color: var(--accent); }
.rv-time { font-size: .8rem; min-width: 48px; text-align: right; }
.rv-ticks { position: absolute; left: 56px; right: 104px; top: -6px; height: 8px; pointer-events: none; }
.rv-tick { position: absolute; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); pointer-events: auto; cursor: pointer; padding: 0; }
.rv-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rv-tool-group { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.rv-tool { min-width: 44px; min-height: 44px; padding: 2px 8px; border-radius: 9px; border: 0; background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 1.05rem; line-height: 1; }
.rv-tool span { font-size: .62rem; color: var(--muted); margin-top: 2px; }
.rv-tool[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.rv-tool:disabled { opacity: .35; cursor: default; }
.rv-color { width: 30px; height: 30px; margin: 7px 3px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.rv-color[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.rv-color.c0 { background: #e6007e; } .rv-color.c1 { background: #ff3b30; } .rv-color.c2 { background: #ffcc00; }
.rv-color.c3 { background: #34c759; } .rv-color.c4 { background: #0a84ff; } .rv-color.c5 { background: #ffffff; } .rv-color.c6 { background: #111111; }
.rv-help { margin: 0; }
.rv-pop { padding: 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow); display: grid; gap: 10px; }

/* Conversación */
.comments { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.comment { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 6px; }
.comment header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.comment.by-staff { border-left: 3px solid var(--accent); }
.comment.is-internal, .reply.is-internal { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 10px, color-mix(in srgb, var(--warn) 6%, var(--surface-2)) 10px 20px); }
.comment.is-resolved { opacity: .7; }
.comment.is-flash { animation: flash-bg 1.2s ease 2; }
@keyframes flash-bg { 50% { box-shadow: 0 0 0 3px var(--accent); } }
.comment[data-annotation] .cm-body { cursor: pointer; }
.cm-body, .reply p { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
.cm-kind { font-size: .95rem; }
.cm-pin { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: var(--accent); color: #fff; font: 700 .7rem var(--font-body); }
.cm-time { justify-self: start; border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 10px; font: 600 .8rem var(--font-body); cursor: pointer; }
.cm-quote { margin: 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; font-style: italic; }
.cm-suggest { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.cm-suggest p { margin: 2px 0 0; white-space: pre-wrap; }
.reply { margin-left: 12px; padding: 8px 10px; border-left: 2px solid var(--border); display: grid; gap: 2px; }
.cm-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent); font: 500 .85rem var(--font-body); cursor: pointer; }
.reply-form { display: grid; gap: 8px; }
.mention-list { position: absolute; z-index: 50; list-style: none; margin: 0; padding: 4px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.mention-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.mention-list li:hover { background: var(--accent-soft); }

/* Checklist */
.progress { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-2); margin: 8px 0 12px; }
.progress span { background: var(--ok); flex: 0 0 auto; }
.progress i { flex: 1 1 auto; }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.task p { margin: 0; }
.task-check { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--border); background: transparent; color: #fff; display: grid; place-items: center; font-size: .8rem; padding: 0; cursor: pointer; }
span.task-check { cursor: default; }
.task.is-done .task-check { background: var(--ok); border-color: var(--ok); }
.task.is-done p:first-child { text-decoration: line-through; color: var(--muted); }

/* Copy */
.copy-text { white-space: pre-wrap; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.6; -webkit-user-select: text; user-select: text; }
.copy-tags { color: #4c9aff; margin: 8px 0 0; word-wrap: break-word; }
.copy-fab { position: sticky; bottom: 80px; margin-top: 8px; }
.copy-form { margin-top: 12px; }

/* Decisión */
.decision .decision-bar { margin-top: 4px; }
.changes-box { margin-top: 12px; }
.reject-box { margin-top: 12px; }
.reject-box summary { cursor: pointer; }
.reject-box .form { margin-top: 10px; }
.approvals-log { margin-top: 12px; }
.approvals-log summary { cursor: pointer; color: var(--muted); }
.approvals-log .timeline { margin-top: 10px; }
.official-item { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); margin-top: 10px; }
.official-item p { margin: 0; white-space: pre-wrap; }
.approve-all { margin: 0 0 12px; }
.decide-fab {
  position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20;
  display: grid; place-items: center; min-height: 52px; border-radius: 999px; background: var(--accent); color: #fff;
  font-weight: 700; text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.decide-fab:hover { color: #fff; }
@media (min-width: 900px) { .decide-fab { display: none; } }
.submit-bar {
  position: relative; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; margin-bottom: 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow);
}
.submit-bar p { margin: 0; }
@media (min-width: 900px) { .submit-bar { position: sticky; top: 76px; } }

/* Avisos flotantes */
.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow); transition: opacity .4s, transform .4s; max-width: calc(100% - 32px);
}
.toast-error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translate(-50%, 10px); }

/* Comparador */
.compare-pick { align-items: center; margin-top: 8px; }
.compare-pick .field { min-width: 150px; }
.cmp-slider { position: relative; width: 100%; max-width: 560px; margin: 0 auto; overflow: hidden; border-radius: var(--radius-sm); background: #000; touch-action: pan-y; cursor: ew-resize; -webkit-user-select: none; user-select: none; }
.cmp-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cmp-b-wrap { position: absolute; inset: 0; }
.cmp-handle { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.5); pointer-events: none; }
.cmp-handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-weight: 700; }
.cmp-label { position: absolute; top: 8px; padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; }
.cmp-label.l { left: 8px; } .cmp-label.r { right: 8px; }
.cmp-range { position: absolute; left: 0; right: 0; bottom: 6px; width: 100%; opacity: 0; }
.cmp-side { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp-side figure { margin: 0; display: grid; gap: 4px; }
.cmp-side img, .cmp-side video { width: 100%; border-radius: 8px; background: #000; }
.cmp-side figcaption { text-align: center; font-size: .8rem; color: var(--muted); }
.cmp-missing { aspect-ratio: 4 / 5; border-radius: 8px; background: var(--surface-2); }
.cmp-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-copy p { margin: 0; }

/* ---------- Fase 5: notificaciones ---------- */
.bell { position: relative; text-decoration: none; }
.ic-bell { width: 20px; height: 20px; }
.bell-count {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: #fff; font: 700 .65rem/18px var(--font-body); text-align: center; box-shadow: 0 0 0 2px var(--bg);
}
.notif { min-height: 56px; }
.notif-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.notif.is-unread { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.notif.is-unread .notif-dot { background: var(--accent); }
@media (max-width: 380px) { .topbar-actions { gap: 4px; } .topbar-actions .icon-btn { width: 40px; height: 40px; } }

/* ---------- Fase 6: panel, buscador, solicitudes, papelera ---------- */
a.stat { color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--muted); color: var(--text); }
.stat-alert { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.stat-alert .stat-num { color: var(--warn); }
.panel-grid { display: grid; gap: 16px; margin-bottom: 20px; }
@media (min-width: 900px) { .panel-grid { grid-template-columns: 1fr 1fr; } }
.table-wrap { overflow-x: auto; margin: 0 calc(-1 * 20px); padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.table th { text-align: left; font: 600 .72rem var(--font-display); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table a { color: var(--text); text-decoration: none; }
.search-form { margin-bottom: 16px; }
.filters-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.chips-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.file-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.file-tile { display: grid; gap: 4px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none; min-width: 0; }
.file-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.file-ext { display: grid; place-items: center; aspect-ratio: 1; border-radius: 6px; background: var(--surface); font: 700 1.1rem var(--font-display); color: var(--muted); }
.logo-preview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }

/* ---------- Fase 7: legal y pie ---------- */
.site-footer {
  max-width: 1120px; margin: 0 auto; padding: 24px var(--gutter) calc(96px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--muted); }
.legal { max-width: 760px; }
.legal h2 { margin-top: 28px; font-size: 1.1rem; }
.legal ul { padding-left: 1.2em; }
.legal li + li { margin-top: 6px; }

/* ---------- Fase 8: estadísticas de redes ---------- */
.month-nav { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.month-nav .icon-btn { width: 36px; height: 36px; text-decoration: none; font-size: 1.2rem; }
.stat .small { margin-top: 2px; }
.insights ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.kpis > div { display: grid; gap: 2px; }
.kpi-num { font: 600 1.3rem/1.1 var(--font-display); }
.chart { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart .c-grid { stroke: var(--border); }
.chart .c-text { fill: var(--muted); font-family: var(--font-body); }
.chart .c-area { fill: var(--accent); opacity: .12; }
.chart .c-line { stroke: var(--accent); }
.chart .c-dot { fill: var(--accent); }
.chart .c-track { fill: var(--surface-2); }
.chart .c-bar { fill: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.chart .c-bar.is-top { fill: var(--accent); }
.sm-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sm-card { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.sm-thumb { position: relative; aspect-ratio: 4 / 5; background: var(--surface); display: grid; place-items: center; }
.sm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sm-ph { color: var(--muted); font-size: .8rem; }
.sm-rank { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--accent); color: #fff; font: 700 .75rem/24px var(--font-body); text-align: center; }
.sm-net { position: absolute; top: 4px; right: 6px; font-size: 1rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.sm-body { padding: 8px 10px 10px; display: grid; gap: 4px; }
.sm-body p { margin: 0; }
.sm-metrics { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .82rem; }
.sm-links { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-form { display: grid; gap: 8px; width: 100%; }
.meta-form .field { min-width: 180px; }
.net-ico { font-size: 1.3rem; }
.client-group { margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.publish-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.publish-form .field { flex: 1 1 220px; }

@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .card { padding: 24px; }
  .cal { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
