@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,SOFT,WONK,wght@9..144,0..100,0..1,400..900&family=Outfit:wght@300..800&family=DM+Mono:wght@400;500&display=swap');

/* ============================================================
   ESTELA — dirección visual "SOCIAL VIVO"
   Tema claro · cálido · la foto manda · el estado se lee de un vistazo
   ============================================================ */

:root{
  /* --- lienzo --- */
  --bg:        #FFF6F1;
  --bg-warm:   #FFEDE4;
  --surface:   #FFFFFF;
  --surface-2: #FDF7F4;

  /* --- tinta --- */
  --ink:   #2C1A23;
  --ink-2: #6B5560;
  --ink-3: #9C8791;

  /* --- líneas --- */
  --line:   #F3E4DE;
  --line-2: #E7D3CB;

  /* --- marca: una familia (atardecer), acentos escasos --- */
  --brand:      #E1216B;
  --brand-deep: #B00E52;
  --brand-soft: #FFEBF2;
  --mandarina:  #FF8A3D;
  --grad: linear-gradient(118deg, #FF8A3D 0%, #E1216B 52%, #9B3CF0 100%);

  /* --- semántica de estado (funcional, no decorativa) --- */
  --red:      #C41F2B;
  --red-dim:  #F0AEB3;
  --red-bg:   #FFEFF0;
  --green:    #0B7D51;
  --green-dim:#9EDCC1;
  --green-bg: #E8F9F1;
  --amber:    #9A5B00;
  --amber-dot:#F59E0B;
  --amber-dim:#F6D79B;
  --amber-bg: #FFF5E3;
  --violet:   #5B34D6;
  --violet-dim:#CBBDF7;
  --violet-bg:#F2EEFF;
  --muted:    #7E6A74;
  --muted-dim:#E4D6DC;
  --muted-bg: #F6F0F2;
  --blue:     #1F5FC0;
  --blue-bg:  #ECF3FE;

  /* --- profundidad blanda --- */
  --sh-1: 0 1px 2px rgba(70,26,45,.05), 0 2px 6px rgba(70,26,45,.05);
  --sh-2: 0 2px 4px rgba(70,26,45,.05), 0 8px 20px -6px rgba(70,26,45,.13);
  --sh-3: 0 4px 8px rgba(70,26,45,.06), 0 18px 38px -10px rgba(70,26,45,.22);

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 26px;

  --font: 'Outfit', 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;
}

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

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

body{
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 34rem at 8% -6%,  rgba(255,138,61,.20), transparent 62%),
    radial-gradient(52rem 30rem at 92% -4%, rgba(225,33,107,.14), transparent 60%),
    radial-gradient(60rem 40rem at 60% 108%, rgba(155,60,240,.10), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* El CRT se apaga: aquí no hay tubo de rayos catódicos. */
.fx, .fx.bloom, .fx.flick, .fx.scan, .fx.grain, .fx.vig{ display: none !important; }

#app{ min-height: 100vh; }

::selection{ background: var(--brand-soft); color: var(--brand-deep); }

:focus-visible{
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* contenedores de página */
#app > div:not([class]){
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px 24px 56px;
}
.wrap{
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px 56px;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar{
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px;
  background: rgba(255,252,250,.88);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 6px 20px -14px rgba(70,26,45,.4);
}
.tb-cell{ display: flex; align-items: center; gap: 8px; }
.tb-spacer{ flex: 1; }
.tb-right{ gap: 12px; }

.logo{
  font-family: var(--display);
  font-variation-settings: 'SOFT' 70, 'WONK' 1, 'opsz' 90;
  font-weight: 900;
  font-size: 21px;
  letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo .dia{
  font-size: 13px;
  -webkit-text-fill-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}

.ver{
  position: relative;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--muted-bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 2px 9px;
  cursor: help;
}
.ver .tip{
  display: none;
  position: absolute; top: calc(100% + 9px); left: 0; z-index: 60;
  width: max-content; max-width: 260px;
  font-family: var(--font); font-size: 12px; line-height: 1.45;
  color: #FFF3F7;
  background: #3A2029;
  border: none; border-radius: var(--r-m);
  padding: 9px 12px;
  box-shadow: var(--sh-3);
}
.ver .tip b{ color: #FFC9DC; }
.ver:hover .tip, .ver:focus-within .tip{ display: block; }

.nav{ gap: 4px; }
.nav a{
  font-size: 13.5px; font-weight: 500;
  color: var(--ink-2);
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.nav a:hover{ background: var(--muted-bg); color: var(--ink); }
.nav a.on{
  color: #fff;
  background: var(--grad);
  box-shadow: 0 4px 12px -3px rgba(225,33,107,.5);
}

.clk{
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 10px;
}
.user{ font-size: 12.5px; color: var(--ink-3); }
.user b{ color: var(--ink); font-weight: 600; }

.salir{
  font-family: var(--font); font-size: 12.5px; font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all .16s ease;
}
.salir:hover{ color: var(--red); border-color: var(--red-dim); background: var(--red-bg); }

/* ============================================================
   STATUS STRIP
   ============================================================ */
.statusstrip{
  position: sticky; top: 52px; z-index: 30;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 22px;
  background: rgba(255,246,241,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.ss-cell{
  display: inline-flex; align-items: center; gap: 6px;
  flex: none;
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-2);
  background: rgba(255,255,255,.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}
.ss-cell b{ color: var(--ink); font-weight: 700; font-family: var(--mono); font-size: 11px; }
.dot-ok{
  width: 7px; height: 7px; border-radius: 50%;
  background: #12B981;
  box-shadow: 0 0 0 3px rgba(18,185,129,.18);
  display: inline-block;
}
.ss-marq{
  flex: 1; min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 88%, transparent);
}
.marq{
  display: inline-block;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--ink-3);
  padding-left: 100%;
  animation: marq 34s linear infinite;
}
@keyframes marq{ to{ transform: translateX(-100%); } }

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar{
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar h2{
  font-family: var(--display);
  font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 120;
  font-weight: 800;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 8px 0 0;
  color: var(--ink);
}
.boardfilter{
  flex: 1 1 260px; max-width: 420px;
  font-family: var(--font); font-size: 13.5px;
  color: var(--ink);
  background: var(--surface) no-repeat 13px center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%239C8791' stroke-width='2.4' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.6-3.6'/></svg>");
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 9px 15px 9px 36px;
  box-shadow: var(--sh-1);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.boardfilter::placeholder{ color: var(--ink-3); }
.boardfilter:focus{
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(225,33,107,.13);
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  line-height: 1;
  color: #fff;
  background: var(--grad);
  background-size: 150% 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(225,33,107,.18), 0 8px 18px -6px rgba(225,33,107,.5);
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4), box-shadow .16s ease, background-position .3s ease;
}
.btn:hover{
  transform: translateY(-1.5px);
  background-position: 100% 0;
  box-shadow: 0 3px 6px rgba(225,33,107,.2), 0 14px 26px -8px rgba(225,33,107,.6);
}
.btn:active{ transform: translateY(0) scale(.985); }

.btn.sm{ font-size: 12.5px; padding: 7px 13px; }

.btn.ghost{
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  box-shadow: var(--sh-1);
}
.btn.ghost:hover{
  color: var(--brand-deep);
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 6px 14px -6px rgba(225,33,107,.45);
}

.btn.primary{
  background: var(--grad);
  color: #fff;
  border: none;
}

.btn.amber{
  background: linear-gradient(118deg, #FFB020, #F97316);
  color: #4A2400;
  border: none;
  box-shadow: 0 2px 4px rgba(249,115,22,.2), 0 8px 18px -6px rgba(249,115,22,.5);
}
.btn.amber:hover{ box-shadow: 0 3px 6px rgba(249,115,22,.24), 0 14px 26px -8px rgba(249,115,22,.6); }

/* botón cuadrado de ayuda "?" */
.toolbar .btn.ghost.sm[aria-label]{
  width: 32px; height: 32px; padding: 0;
  border-radius: 50%;
  font-weight: 700; font-size: 14px;
  color: var(--ink-2);
}

/* ============================================================
   NOTA DE ARRASTRE
   ============================================================ */
.dragnote{
  position: relative;
  display: grid; gap: 4px;
  font-size: 12.5px; line-height: 1.55;
  color: var(--ink-2);
  background: linear-gradient(100deg, #FFF3EC, #FFF7FA 60%, #F7F2FF);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 12px 16px 12px 44px;
  margin-bottom: 16px;
  box-shadow: var(--sh-1);
}
.dragnote::before{
  content: '✋';
  position: absolute; left: 14px; top: 11px;
  font-size: 17px;
  filter: saturate(1.1);
}
.dragnote b{ color: var(--ink); font-weight: 700; }
.dragnote div:first-child b:nth-of-type(2){ color: var(--brand-deep); }

/* ============================================================
   TABLERO
   ============================================================ */
.board{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.col{
  display: flex; flex-direction: column;
  min-width: 0;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--r-xl);
  padding: 10px;
  box-shadow: var(--sh-1);
}
.col-head{
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px 11px;
}
.col-title{
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 60, 'WONK' 0, 'opsz' 40;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--ink);
}
.tick{
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 500;
  color: var(--ink-3);
  background: var(--muted-bg);
  border-radius: 6px;
  padding: 1px 5px;
}
.count{
  margin-left: auto;
  min-width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0 6px;
}
.col-body{
  display: flex; flex-direction: column; gap: 12px;
  min-height: 96px;
}

/* color por columna = la semántica del tablero */
.col:nth-child(1){ background: linear-gradient(180deg, rgba(246,240,242,.9), rgba(255,255,255,.5)); }
.col:nth-child(1) .tick{ background: var(--muted-bg); color: var(--muted); }
.col:nth-child(2){ background: linear-gradient(180deg, rgba(255,245,227,.95), rgba(255,255,255,.5)); }
.col:nth-child(2) .tick{ background: var(--amber-bg); color: var(--amber); }
.col:nth-child(2) .col-title{ color: #7A4A05; }
.col:nth-child(3){ background: linear-gradient(180deg, rgba(242,238,255,.95), rgba(255,255,255,.5)); }
.col:nth-child(3) .tick{ background: var(--violet-bg); color: var(--violet); }
.col:nth-child(3) .col-title{ color: #3F2298; }
.col:nth-child(4){ background: linear-gradient(180deg, rgba(232,249,241,.95), rgba(255,255,255,.5)); }
.col:nth-child(4) .tick{ background: var(--green-bg); color: var(--green); }
.col:nth-child(4) .col-title{ color: #085C3C; }

.empty-hint{
  display: flex; align-items: center; justify-content: center;
  min-height: 92px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-3);
  background: rgba(255,255,255,.35);
  border: 2px dashed var(--line-2);
  border-radius: var(--r-l);
}

/* ============================================================
   TARJETA — la foto manda
   ============================================================ */
.card{
  position: relative;
  display: flex; flex-direction: column;
  padding: 0 0 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  box-shadow: var(--sh-2);
  transition: transform .18s cubic-bezier(.2,.9,.3,1.3), box-shadow .18s ease;
}
.card[draggable="true"]{ cursor: grab; }
.card[draggable="true"]:active{ cursor: grabbing; }
.card:hover{
  transform: translateY(-3px);
  box-shadow: var(--sh-3);
}
.card > *:not(.media-mini){
  margin-left: 13px;
  margin-right: 13px;
}
.card .c-bar{ margin-top: 12px; }

/* aristas de estado */
.card.rededge{ box-shadow: inset 4px 0 0 var(--red), var(--sh-2); border-color: var(--red-dim); }
.card.rededge:hover{ box-shadow: inset 4px 0 0 var(--red), var(--sh-3); }
.card.violetedge{ box-shadow: inset 4px 0 0 var(--violet), var(--sh-2); border-color: var(--violet-dim); }
.card.violetedge:hover{ box-shadow: inset 4px 0 0 var(--violet), var(--sh-3); }
.card.rededge > *:not(.media-mini), .card.violetedge > *:not(.media-mini){ margin-left: 15px; }
.card.rededge .media-mini, .card.violetedge .media-mini{ margin-left: 4px; }

.c-bar{
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.c-ref{ display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
/* el #ref es un identificador, no un estado: color de marca pero SIN forma de
   chip, para que nunca compita con los badges de estado de al lado */
.hash{
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--brand);
  letter-spacing: -.02em;
}
.proj{
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.open-link{
  flex: none;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--ink-3);
  background: var(--muted-bg);
  border: none; border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.open-link:hover{ color: #fff; background: var(--brand); transform: scale(1.1); }

.c-title{
  font-family: var(--display);
  font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 60;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.24;
  letter-spacing: -.005em;
  margin: 0 0 9px;
  color: var(--ink);
}

/* --- la foto: a sangre, arriba del todo --- */
.media-mini{
  order: -1;
  position: relative;
  display: grid;
  gap: 3px;
  aspect-ratio: 16 / 10;
  margin: 0 0 11px;
  background: var(--muted-bg);
  overflow: hidden;
}
.media-mini img{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background: var(--muted-bg);
  transition: transform .5s cubic-bezier(.2,.8,.3,1);
}
.card:hover .media-mini img{ transform: scale(1.045); }

/* una sola foto: más aire, es la protagonista absoluta */
.media-mini:not(:has(img:nth-child(2))){ aspect-ratio: 4 / 3; }
/* 2 medios */
.media-mini:has(img:nth-child(2)){ grid-template-columns: 1fr 1fr; }
/* 3 o más: la primera manda (en IG el recorte lo decide la primera) */
.media-mini:has(img:nth-child(3)){
  grid-template-columns: 2.1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.media-mini:has(img:nth-child(3)) img:first-child{ grid-row: span 2; }
.media-mini img:nth-child(n+4){ display: none; }

/* chivato de carrusel */
.media-mini:has(img:nth-child(2))::after{
  content: '⧉ carrusel';
  position: absolute; top: 9px; right: 9px;
  font-family: var(--font); font-size: 10.5px; font-weight: 600;
  color: #fff;
  background: rgba(28,12,18,.62);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 3px 9px;
  letter-spacing: .01em;
  pointer-events: none;
}
/* velo suave bajo la foto para que el borde no corte en seco */
.media-mini::before{
  content: '';
  position: absolute; inset: auto 0 0 0; height: 34%;
  background: linear-gradient(to top, rgba(44,26,35,.22), transparent);
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   BADGES — semántica de estado
   ============================================================ */
.badge{
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  line-height: 1.35;
  border-radius: 999px;
  padding: 3px 9px 3px 7px;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
}
.badge > .b{
  width: 6px; height: 6px; border-radius: 50%;
  flex: none;
  background: currentColor;
}
a.badge{ transition: transform .14s ease, filter .14s ease; }
a.badge:hover{ transform: translateY(-1px); filter: brightness(.94); }

.badge.muted{ color: var(--muted); background: var(--muted-bg); border-color: var(--muted-dim); }
.badge.err{ color: var(--red); background: var(--red-bg); border-color: var(--red-dim); }
.badge.done{ color: var(--green); background: var(--green-bg); border-color: var(--green-dim); }
.badge.violet{ color: var(--violet); background: var(--violet-bg); border-color: var(--violet-dim); }
.badge.amber{ color: var(--amber); background: var(--amber-bg); border-color: var(--amber-dim); }
.badge.err > .b{ box-shadow: 0 0 0 3px rgba(196,31,43,.16); }

.chans{
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 9px;
}

/* ============================================================
   PUBLICACIÓN PARCIAL — el momento en que algo ha ido mal
   ============================================================ */
.partial{
  position: relative;
  margin-bottom: 9px;
  padding: 9px 11px 9px 12px;
  background: linear-gradient(100deg, var(--amber-bg), #FFF9F0);
  border: 1px solid var(--amber-dim);
  border-left: 3px solid var(--amber-dot);
  border-radius: var(--r-s);
}
.ptxt{
  font-size: 12.2px; line-height: 1.45;
  color: #5C3600;
}
.ptxt b{ color: #8A3D12; font-weight: 700; }
.pfoot{
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed var(--amber-dim);
  font-size: 11px; line-height: 1.4;
  color: #85662E;
}

/* ============================================================
   RESTO DE LA TARJETA
   ============================================================ */
.snippet{
  font-size: 12.8px;
  line-height: 1.5;
  color: var(--ink-2);
}
.row{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .row > .btn{ flex: 1; }

.wait-foot{
  display: inline-flex; align-items: center; gap: 5px;
  align-self: flex-start;
  font-size: 11.5px; font-weight: 600;
  color: var(--violet);
  background: var(--violet-bg);
  border: 1px solid var(--violet-dim);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 9px;
}
.done-foot{
  display: flex; align-items: center; gap: 7px;
  font-size: 11.8px;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-dim);
  border-radius: var(--r-s);
  padding: 6px 10px;
  margin-bottom: 9px;
}
.done-foot .ck{
  width: 16px; height: 16px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: #fff;
  background: #12A16A;
  border-radius: 50%;
}
.done-foot a{ color: var(--green); font-weight: 600; }

.metrics{
  display: flex; gap: 10px; flex-wrap: wrap;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.metrics .m{ font-size: 11px; color: var(--ink-3); }
.metrics .m b{ color: var(--ink-2); font-weight: 600; }

/* ============================================================
   DETALLE — cabecera
   ============================================================ */
.ticket-page .frame:first-child .c-bar{ align-items: flex-start; }
.ticket-page h2{
  font-family: var(--display);
  font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 130;
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--ink);
}
.ref{
  font-family: var(--mono); font-weight: 500;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
  padding: 2px 8px;
}

.frame{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px;
  box-shadow: var(--sh-2);
}
.frame-lbl{
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-3);
  margin-bottom: 9px;
}

.pills{ display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill{
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-2);
  background: var(--muted-bg);
  border: 1px solid var(--muted-dim);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.pill.col{ color: var(--violet); background: var(--violet-bg); border-color: var(--violet-dim); }
.pill.info{ color: var(--brand-deep); background: var(--brand-soft); border-color: #FBCBDD; }

.ticket-page .frame:first-child .chans{ margin: 11px 0 0; }
.ticket-page .partial{ margin: 11px 0 0; }
.ticket-page .frame:first-child .row{ margin-top: 13px; }

.twocol{
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.stack{ display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.pre{
  font-family: var(--font);
  font-size: 14.5px; line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  background: linear-gradient(100deg, #FFF7F3, #FDF4F8);
  border: 1px solid var(--line);
  border-left: 3px solid var(--mandarina);
  border-radius: var(--r-s);
  padding: 12px 14px;
  margin: 0;
}
.cred-meta{
  font-size: 11.8px; line-height: 1.45;
  color: var(--ink-3);
}

/* medios del detalle */
.media-strip{ display: flex; flex-wrap: wrap; gap: 11px; }
.media-item{
  position: relative;
  width: 152px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  overflow: hidden;
  box-shadow: var(--sh-1);
  cursor: grab;
  transition: transform .16s ease, box-shadow .16s ease;
}
.media-item:hover{ transform: translateY(-2px); box-shadow: var(--sh-2); }
.media-pos{
  position: absolute; top: 7px; left: 7px; z-index: 2;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: #fff;
  background: rgba(28,12,18,.66);
  backdrop-filter: blur(6px);
  border-radius: 50%;
}
.media-thumb{
  display: block;
  width: 100%; height: 118px;
  object-fit: cover;
  background: var(--muted-bg);
}
.media-meta{
  font-size: 11px;
  color: var(--ink-3);
  padding: 6px 9px 7px;
  border-top: 1px solid var(--line);
}
.media-meta b{ color: var(--ink-2); font-weight: 600; }

/* texto por canal (acordeón) */
.ov{
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--surface-2);
}
.ov + .ov{ margin-top: 8px; }
.ov-head{
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  font-family: var(--font); font-size: 13px;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease;
}
.ov-head:hover{ background: var(--brand-soft); }
.ov-head > span:first-child{ color: var(--ink-3); font-size: 11px; }
.ov-head .cn{ font-weight: 600; }
.ov-head .tag{
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--muted-bg);
  border: 1px solid var(--muted-dim);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* destinos */
.chan-pick{ display: flex; flex-direction: column; gap: 8px; }
.chan-opt{
  display: flex; align-items: flex-start; gap: 10px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-m);
  padding: 10px 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.chan-opt:hover{ border-color: var(--brand); }
.chan-opt input{
  margin: 2px 0 0;
  accent-color: var(--brand);
  width: 15px; height: 15px;
  flex: none;
}
.chan-opt .cn{
  display: block;
  font-size: 13.5px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.chan-opt .ch{
  display: block;
  font-size: 11.6px; line-height: 1.45;
  color: var(--ink-3);
}
.chan-opt.on{
  border-color: var(--brand);
  background: linear-gradient(100deg, var(--brand-soft), #FFF6F1);
}
.chan-opt.on .cn{ color: var(--brand-deep); }
.chan-opt.dis{ cursor: default; opacity: .8; }
.chan-opt.dis:hover{ border-color: var(--line-2); }
.chan-opt.on.dis{ opacity: 1; }
.chan-opt.on.dis:hover{ border-color: var(--brand); }

/* estado por canal */
.tgt{
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  padding: 10px 12px;
  background: var(--surface-2);
}
.tgt + .tgt{ margin-top: 9px; }
.tgt-bar{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tgt.error{ background: linear-gradient(100deg, var(--red-bg), #FFF7F7); border-color: var(--red-dim); border-left: 3px solid var(--red); }
.tgt.published{ background: linear-gradient(100deg, var(--green-bg), #F6FDFA); border-color: var(--green-dim); border-left: 3px solid #12A16A; }
.att, .date{
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3);
}
.date{ margin-left: auto; }
.tgt-err{
  margin-top: 8px;
  font-size: 12.3px; line-height: 1.5;
  color: #8E1620;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--red-dim);
  border-radius: var(--r-s);
  padding: 8px 10px;
}
.tgt-link{
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono); font-size: 11px;
  color: var(--blue);
  word-break: break-all;
  text-decoration: none;
  border-bottom: 1px dashed var(--blue);
}
.tgt-link:hover{ color: var(--brand); border-color: var(--brand); }

.subhead{
  font-family: var(--display);
  font-variation-settings: 'SOFT' 60, 'WONK' 0, 'opsz' 40;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 10px;
}

/* ============================================================
   TIMELINE — denso y legible, pero de este siglo y de este tema
   ============================================================ */
.term{
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-l);
  overflow: hidden;
  box-shadow: var(--sh-2);
}
.term-bar{
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px;
  background: linear-gradient(180deg, #FFF9F6, #FBF1F4);
  border-bottom: 1px solid var(--line);
}
.dots{ display: flex; gap: 5px; flex: none; }
.dots i{ width: 9px; height: 9px; border-radius: 50%; display: block; }
.td-r{ background: #FF7A85; }
.td-y{ background: #FFCC5C; }
.td-g{ background: #57D497; }
.tt{
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.st-pill{
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  color: var(--muted);
  background: var(--muted-bg);
  border: 1px solid var(--muted-dim);
}
.st-pill > .b{ width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.st-pill.red{ color: var(--red); background: var(--red-bg); border-color: var(--red-dim); }
.st-pill.green{ color: var(--green); background: var(--green-bg); border-color: var(--green-dim); }
.st-pill.amber{ color: var(--amber); background: var(--amber-bg); border-color: var(--amber-dim); }

.term-body{
  font-family: var(--mono);
  font-size: 12.2px;
  line-height: 1.5;
  padding: 8px;
  background: #FEFBFC;
  max-height: 560px;
  overflow: auto;
}
.term-body.full{ max-height: none; }
.ln{
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 4px 9px;
  border-radius: 7px;
}
.ln:nth-child(odd){ background: #FAF5F8; }
.ln .t{ color: var(--ink-3); font-size: 11.2px; padding-top: 1px; }
.ln > .b{ min-width: 0; word-break: break-word; color: var(--ink-2); }
.ln b{ color: var(--ink); font-weight: 600; }
.ln .evt{
  display: inline-block;
  font-family: var(--font);
  font-size: 9.6px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 5px;
  margin-right: 7px;
  vertical-align: 1px;
}
.ln .mut{ color: var(--ink-2); }
.ln .a{ color: #A85C00; }
.ln .bl{ color: var(--blue); }
.ln .rd{ color: var(--red); font-weight: 500; }
.ln .g{ color: var(--green); font-weight: 500; }
.ln a{ color: var(--blue); word-break: break-all; }
.ln a:hover{ color: var(--brand); }
.ln.err{
  background: var(--red-bg);
  box-shadow: inset 2.5px 0 0 var(--red);
}
.ln.err .t{ color: #B4646B; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px){
  .twocol{ grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px){
  .topbar{ padding: 9px 14px; flex-wrap: wrap; }
  /* la tira de estado se desliza entera en vez de cortar celdas a medias */
  .statusstrip{ top: auto; position: static; overflow-x: auto; scrollbar-width: none; }
  .statusstrip::-webkit-scrollbar{ display: none; }
  .ss-cell.opt{ display: none; }
  .ss-marq{ display: none; }
  #app > div:not([class]), .wrap{ padding: 16px 12px 48px; }

  /* el tablero se desliza */
  .board{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .col{ scroll-snap-align: center; }
  .toolbar h2{ font-size: 25px; }
  .ticket-page h2{ font-size: 21px !important; }
  .ln{ grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (max-width: 560px){
  .board{ grid-auto-columns: 90%; }
  .media-item{ width: calc(50% - 6px); }
}

/* ============================================================
   MOVIMIENTO REDUCIDO
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .marq{ animation: none; padding-left: 0; }
  .card:hover{ transform: none; }
  .card:hover .media-mini img{ transform: none; }
  .btn:hover{ transform: none; }
}

/* ============================================================
   MODAL DE CONFIRMACIÓN + FORMULARIOS
   El modal solo existe tras pulsar "Publicar", así que no aparecía en las capturas estáticas
   con las que se diseñó el resto: sin estos estilos caía al final de la página como texto suelto.
   Y es justo la última barrera antes de una acción irreversible (§5.3) — tiene que interrumpir.
   ============================================================ */

.modal{
  position:fixed;inset:0;z-index:10000;
  display:flex;align-items:center;justify-content:center;padding:20px;
  background:rgba(44,26,35,.5);backdrop-filter:blur(8px) saturate(1.2);
  animation:modal-in .18s ease-out;
}
@keyframes modal-in{from{opacity:0}to{opacity:1}}
.modal-card{
  width:100%;max-width:520px;max-height:88vh;overflow:auto;
  background:var(--surface);border-radius:22px;
  box-shadow:0 32px 80px -20px rgba(44,26,35,.45), 0 0 0 1px var(--line);
  animation:card-in .22s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes card-in{from{opacity:0;transform:translateY(14px) scale(.97)}to{opacity:1;transform:none}}
/* El degradado de marca corona el diálogo: es la acción principal del producto. */
.modal-card::before{content:"";display:block;height:5px;background:var(--grad);border-radius:22px 22px 0 0}

.modal-head{display:flex;align-items:flex-start;gap:12px;padding:20px 22px 0}
.modal-head h3{
  flex:1;margin:0;font-family:var(--font-disp);font-weight:600;
  font-size:23px;line-height:1.2;letter-spacing:-.02em;color:var(--ink);
}
.modal-body{padding:16px 22px 22px;display:flex;flex-direction:column;gap:14px}

/* El aviso de irreversibilidad: ámbar, no rojo. Nada ha fallado — es una advertencia, no un error. */
.modal-warn{
  display:flex;gap:10px;align-items:flex-start;
  background:var(--amber-bg);border:1px solid var(--amber-dim);
  border-radius:14px;padding:12px 14px;font-size:13.5px;line-height:1.5;color:var(--amber);
}
.modal-warn b{color:#7A4700}
.modal-warn .wi{flex:0 0 auto;font-size:15px;line-height:1.35}

.modal-lbl{
  font-size:11px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;
  color:var(--ink-3);margin-bottom:-4px;
}
.modal-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.modal-list li{
  display:flex;gap:10px;align-items:flex-start;
  background:var(--surface-2);border:1px solid var(--line);
  border-radius:12px;padding:10px 12px;font-size:14px;line-height:1.45;color:var(--ink-2);
}
.modal-list li b{color:var(--ink);font-weight:650}
/* Lo que SÍ sale, en verde; lo que se salta, apagado. La diferencia se ve sin leer. */
.modal-list li:has(.go){background:var(--green-bg);border-color:var(--green-dim)}
.modal-list li:has(.go) b{color:var(--green)}
.modal-list .go{color:var(--green);font-weight:700;flex:0 0 auto}
.modal-list .skip{color:var(--ink-3);flex:0 0 auto}
.modal-list li:has(.skip){opacity:.85}
.modal-list .pf-warn,.modal-list .tgt-why{
  display:block;margin-top:4px;font-size:12.5px;line-height:1.45;color:var(--ink-3);
}
.modal-foot{display:flex;gap:10px;padding:0 22px 22px}
.modal-foot .btn,.modal-foot button{flex:1}
.modal .cred-meta{font-size:12.5px;color:var(--ink-3)}
.modal .cred-meta b{color:var(--ink-2)}

/* --- Campos de formulario --- */
.field{display:flex;flex-direction:column;gap:7px;margin-bottom:15px}
.field>label,.flabel{
  font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);
}
input[type=text],input[type=email],input[type=search],input[type=datetime-local],
input[type=date],input[type=url],input:not([type]),textarea,select,
.field input,.field textarea,.field select{
  width:100%;font-family:inherit;font-size:14.5px;color:var(--ink);
  background:var(--surface);border:1.5px solid var(--line-2);border-radius:12px;
  padding:11px 13px;outline:none;transition:border-color .16s,box-shadow .16s;
}
textarea,.field textarea{min-height:96px;line-height:1.6;resize:vertical}
input::placeholder,textarea::placeholder{color:var(--ink-3)}
input:focus,textarea:focus,select:focus{
  border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-soft);
}
input:disabled,textarea:disabled,select:disabled{background:var(--surface-2);color:var(--ink-3);cursor:not-allowed}
.field .hint,.hint{font-size:12px;color:var(--ink-3);letter-spacing:0;text-transform:none;font-weight:400}
select{
  appearance:none;cursor:pointer;padding-right:34px;
  background-image:linear-gradient(45deg,transparent 50%,var(--ink-3) 50%),linear-gradient(135deg,var(--ink-3) 50%,transparent 50%);
  background-position:calc(100% - 17px) calc(50% - 2px),calc(100% - 12px) calc(50% - 2px);
  background-size:5px 5px,5px 5px;background-repeat:no-repeat;
}
/* En móvil, cualquier fuente < 16px hace que iOS haga zoom al enfocar el campo. */
@media(max-width:640px){
  input,textarea,select,.field input,.field textarea,.field select{font-size:16px}
  /* Hoja inferior: en el móvil el pulgar llega abajo, no al centro. */
  .modal{padding:0;align-items:flex-end}
  .modal-card{max-width:none;border-radius:22px 22px 0 0;max-height:92vh}
  /* 44px es el mínimo táctil de Apple, y esta es LA pantalla donde un toque publica de verdad:
     un botón de 36px aquí es un fat-finger esperando a pasar (§5.3). */
  .modal-foot .btn,.modal-foot button{min-height:48px;font-size:14px}
  .modal-head .ic-btn{width:44px;height:44px;font-size:17px}
  /* Y el descuido inverso: que Cancelar sea más fácil de acertar que Publicar. Mismo tamaño. */
  .modal-foot{gap:12px;padding-bottom:calc(22px + env(safe-area-inset-bottom))}
}
@media (prefers-reduced-motion: reduce){
  .modal,.modal-card{animation:none!important}
}

/* ============================================================
   LOGIN — la primera pantalla, y la única sin sesión
   Se rediseñó styles.css sobre una captura CON sesión iniciada, así que esta pantalla se quedó
   SIN estilos (caía como HTML desnudo). Es la primera impresión: merece carácter, no un formulario
   a secas. Sobre el degradado de marca a pantalla completa, una tarjeta flotante centrada.
   ============================================================ */

.login-wrap{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  padding:24px;position:relative;overflow:hidden;
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(255,138,61,.32), transparent 55%),
    radial-gradient(120% 90% at 105% 8%, rgba(155,60,240,.30), transparent 52%),
    radial-gradient(90% 80% at 50% 115%, rgba(225,33,107,.24), transparent 55%),
    var(--bg-warm);
}
/* Grano sutil para que el degradado no quede plástico. */
.login-wrap::after{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.5;mix-blend-mode:soft-light;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.login-card{
  position:relative;z-index:1;width:100%;max-width:410px;
  background:var(--surface);border-radius:26px;padding:38px 34px 34px;
  box-shadow:0 40px 90px -30px rgba(44,26,35,.5), 0 0 0 1px rgba(255,255,255,.6) inset;
  animation:login-in .4s cubic-bezier(.2,.9,.3,1.05);
}
@keyframes login-in{from{opacity:0;transform:translateY(18px) scale(.97)}to{opacity:1;transform:none}}
/* Filo de marca arriba, como el modal: es la misma familia. */
.login-card::before{content:"";position:absolute;top:0;left:34px;right:34px;height:4px;border-radius:0 0 4px 4px;background:var(--grad)}

.login-card .lh{display:flex;align-items:baseline;gap:12px;margin-bottom:6px}
.login-card .logo{
  font-family:var(--font-disp);font-weight:600;font-size:30px;letter-spacing:-.01em;
  color:var(--ink);display:inline-flex;align-items:center;gap:8px;text-transform:none;
}
.login-card .logo .dia{
  font-size:19px;background:var(--grad);-webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;filter:none;
}
.login-card .ver{
  font-family:var(--font-mono);font-size:11px;font-weight:500;color:var(--brand);
  background:var(--brand-soft);border-radius:20px;padding:2px 9px;letter-spacing:0;
}
.login-card .lsub{color:var(--ink-2);font-size:14px;margin-bottom:26px;line-height:1.5}
.login-card .field{margin-bottom:16px}
.login-card .field>label{margin-bottom:2px}
.login-card .btn.wide{
  width:100%;justify-content:center;font-size:15px;padding:13px;border-radius:14px;
  background:var(--grad);color:#fff;border:none;font-weight:650;
  box-shadow:0 12px 28px -12px rgba(225,33,107,.7);
}
.login-card .btn.wide:hover{filter:brightness(1.05);transform:translateY(-1px)}
.login-card .btn.wide:active{transform:none}
.login-sent{
  background:var(--green-bg);border:1px solid var(--green-dim);color:#0A5C3D;
  border-radius:16px;padding:16px 18px;font-size:14px;line-height:1.6;
}
@media(max-width:640px){
  .login-card{padding:32px 24px 28px}
  .login-card .btn.wide{font-size:16px}
}
@media (prefers-reduced-motion: reduce){ .login-card{animation:none} }

/* ============================================================
   FORMULARIO DE CREDENCIAL (.qbox) + AVISOS (.cred-warn)
   El panel §9 de la vista de proyecto. Sin estos estilos el formulario de "Configurar credencial"
   heredaba un `background:#0a0f0c` hardcodeado en el JS (el negro CRT de Simon) → caja negra sobre
   el tema claro. Quitado ese hex de app.js; aquí el bloque toma su forma del tema claro.
   ============================================================ */

.qbox{
  margin-top:14px;padding:16px;border-radius:16px;
  background:var(--surface-2);border:1px solid var(--line-2);
}
.qlabel{
  font-family:var(--font-disp);font-weight:600;font-size:15px;color:var(--ink);
  margin-bottom:12px;display:flex;align-items:center;gap:7px;
}
.qbox .field:last-of-type{margin-bottom:12px}
.qbox .row{display:flex;gap:9px;margin-top:2px}

/* El aviso de que reemplazar sustituye la credencial entera, y demás avisos del panel.
   Ámbar: es una advertencia (ojo con esto), no un error (algo ha fallado). */
.cred-warn{
  display:flex;gap:9px;align-items:flex-start;margin:10px 0;
  background:var(--amber-bg);border:1px solid var(--amber-dim);border-radius:12px;
  padding:11px 13px;font-size:13px;line-height:1.5;color:var(--amber);
}
.cred-warn b{color:#7A4700}
.cred-warn .wi{flex:0 0 auto;font-size:14px;line-height:1.35}

/* ════════════════════════════════════════════════════════════════════════
   REMATE DE MAQUETACIÓN — estados que solo aparecen al interactuar
   (Se escribieron sobre una captura de UN estado; estos componentes solo
   se ven al abrir, subir, arrastrar, ampliar o publicar.) Todo reutiliza los
   tokens de :root; ni un color suelto. Los translúcidos van con color-mix
   sobre --ink / --brand / --red para no hardcodear rgba().
   ════════════════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────────────────
   1 · MARKDOWN RENDERIZADO (.md, .tbl)  ·  vista previa del cuerpo (blog)
   El cuerpo lleva titulares, listas, negritas y tablas. Debe LEERSE: titulares
   en Fraunces, listas con sangría, tablas con líneas, código en monoespaciada.
   marked envuelve cada <table> en <div class="tbl"> para el scroll horizontal.
   ──────────────────────────────────────────────────────────────────────── */
.md{ color:var(--ink); font-family:var(--font); line-height:1.6; word-break:break-word; }
.md > *:first-child{ margin-top:0; }
.md > *:last-child{ margin-bottom:0; }

.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{
  font-family:var(--display); font-weight:600; color:var(--ink);
  line-height:1.2; letter-spacing:-.01em; margin:1.15em 0 .4em;
}
.md h1{ font-size:1.5em; } .md h2{ font-size:1.3em; } .md h3{ font-size:1.12em; }
.md h4,.md h5,.md h6{ font-size:1em; }

.md p{ margin:.55em 0; }
.md strong,.md b{ font-weight:700; color:var(--ink); }
.md em{ font-style:italic; }
.md del{ color:var(--ink-3); }
.md a{ color:var(--brand-deep); font-weight:600; text-decoration:none;
  border-bottom:1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  transition:border-color .14s ease; }
.md a:hover{ border-bottom-color:currentColor; }

.md ul,.md ol{ margin:.55em 0; padding-left:1.45em; }
.md li{ margin:.22em 0; }
.md li::marker{ color:var(--brand); }
.md li > p{ margin:.15em 0; }                 /* listas "loose": quita el hueco de <p> */
.md li > ul,.md li > ol{ margin:.15em 0; }

.md blockquote{ margin:.7em 0; padding:.3em 0 .3em 14px; color:var(--ink-2);
  border-left:3px solid var(--line-2); }
.md hr{ border:none; border-top:1px solid var(--line); margin:1.1em 0; }

.md code{ font-family:var(--mono); font-size:.86em; color:var(--brand-deep);
  background:var(--brand-soft); border:1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius:6px; padding:.08em .38em; }
.md pre{ margin:.7em 0; padding:12px 14px; overflow-x:auto;
  background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-s); }
.md pre code{ background:none; border:none; padding:0; color:var(--ink); font-size:.86em; }

.md img{ max-width:100%; height:auto; border-radius:var(--r-s); cursor:zoom-in; }

/* Tablas: el .tbl aporta el scroll horizontal y el marco; la tabla, las líneas. */
.tbl{ overflow-x:auto; margin:.75em 0; border:1px solid var(--line);
  border-radius:var(--r-s); }
.md table,.tbl table{ border-collapse:collapse; width:100%; font-size:.92em; }
.md th,.md td,.tbl th,.tbl td{ padding:8px 12px; text-align:left;
  border-bottom:1px solid var(--line); white-space:nowrap; }
.md th,.tbl th{ font-weight:700; color:var(--ink); background:var(--surface-2); }
.md td,.tbl td{ color:var(--ink-2); }
.md tbody tr:last-child td,.tbl tbody tr:last-child td{ border-bottom:none; }

/* "ver completo" / "vista previa (markdown)" — botón nativo → enlace de marca. */
.see-more{ font-family:var(--font); font-size:12px; font-weight:600;
  color:var(--brand-deep); background:none; border:none; padding:0; cursor:pointer;
  transition:color .14s ease; }
.see-more:hover{ color:var(--brand); text-decoration:underline; }

/* ────────────────────────────────────────────────────────────────────────
   2 · CONTROLES DE CADA MEDIO (detalle · sección MEDIOS)
   La miniatura es .media-item (position:relative). Encima: quitar (.media-x)
   arriba a la derecha; el número (.media-pos) ya va arriba a la izquierda.
   Debajo: reordenar (.media-move ◀▶). Placeholder y badge de vídeo ocupan el
   hueco de la miniatura. Táctiles: ≥28px.
   ──────────────────────────────────────────────────────────────────────── */
.media-item .media-x{
  position:absolute; top:6px; right:6px; z-index:3;
  width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center;
  font-size:12px; line-height:1; color:#fff;
  background:color-mix(in srgb, var(--ink) 66%, transparent);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  border:none; border-radius:50%; cursor:pointer;
  transition:background .15s ease, transform .15s ease;
}
.media-item .media-x:hover{ background:var(--red); transform:scale(1.06); }
.media-item .media-x:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

/* El hueco de la miniatura cuando es vídeo (badge ▶) o no cargó (placeholder ▨).
   Misma altura que .media-thumb (118px). */
.media-vid,.media-ph{
  display:flex; align-items:center; justify-content:center;
  width:100%; height:118px;
}
.media-vid{ color:#fff; font-size:26px; cursor:pointer;
  background:linear-gradient(140deg, var(--ink-2), var(--ink));
  transition:filter .15s ease; }
.media-vid:hover{ filter:brightness(1.1); }
.media-ph{ color:var(--ink-3); font-size:24px; background:var(--muted-bg); }

/* Reordenar el carrusel: ◀ ▶ debajo de los metadatos. */
.media-move{ display:flex; gap:6px; padding:0 9px 9px; }
.media-move button{
  flex:1; min-height:28px; display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--font); font-size:12px; color:var(--ink-2);
  background:var(--surface-2); border:1px solid var(--line-2); border-radius:8px;
  cursor:pointer; transition:color .14s ease, border-color .14s ease, background .14s ease;
}
.media-move button:hover:not(:disabled){
  color:var(--brand-deep); border-color:var(--brand); background:var(--brand-soft);
}
.media-move button:disabled{ opacity:.4; cursor:not-allowed; }
.media-move button:focus-visible{ outline:2px solid var(--brand); outline-offset:1px; }

/* Aviso "el orden decide el encuadre" — advertencia (ámbar), no error. */
.media-note{
  display:flex; gap:9px; align-items:flex-start; margin:11px 0 2px;
  background:var(--amber-bg); border:1px solid var(--amber-dim); border-radius:12px;
  padding:11px 13px; font-size:13px; line-height:1.5; color:var(--amber);
}
.media-note .wi{ flex:0 0 auto; font-size:14px; line-height:1.35; }
.media-note b{ font-weight:700; }

/* ────────────────────────────────────────────────────────────────────────
   3 · BARRA DE SUBIDA (.up)  ·  se llena al subir un fichero (vídeos ≤300 MB)
   ──────────────────────────────────────────────────────────────────────── */
.up{ margin-top:11px; padding:10px 12px;
  background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-m); }
.up-name{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  font-size:12.5px; margin-bottom:7px; }
.up-name .nm{ color:var(--ink); font-weight:500; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.up-name .pct{ flex:none; font-family:var(--mono); font-size:11.5px; font-weight:500;
  color:var(--ink-2); }
.up-bar{ height:7px; border-radius:999px; background:var(--muted-dim); overflow:hidden; }
.up-bar > i{ display:block; height:100%; border-radius:999px;
  background:var(--grad); transition:width .2s ease; }

/* ────────────────────────────────────────────────────────────────────────
   4 · BUSCADOR DE PROYECTO (.combo)  ·  desplegable de "+ Nueva publicación"
   El <input> ya lo estila `.field input`; aquí va solo el desplegable.
   ──────────────────────────────────────────────────────────────────────── */
.combo{ position:relative; }
.combo-list{
  position:absolute; z-index:50; left:0; right:0; top:calc(100% + 5px);
  padding:5px; max-height:244px; overflow-y:auto;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-m);
  box-shadow:var(--sh-3);
}
.combo-item{
  padding:9px 11px; border-radius:9px; font-size:14px; color:var(--ink);
  cursor:pointer; transition:background .12s ease, color .12s ease;
}
.combo-item:hover{ background:var(--brand-soft); color:var(--brand-deep); }
.combo-item.on{ background:var(--brand-soft); color:var(--brand-deep); font-weight:600; }
.combo-item.on::after{ content:"✓"; float:right; color:var(--brand); }

/* ────────────────────────────────────────────────────────────────────────
   5 · LIGHTBOX (.lightbox)  ·  ampliar una foto (miniatura o imagen del md)
   ──────────────────────────────────────────────────────────────────────── */
.lightbox{
  position:fixed; inset:0; z-index:11000;
  display:flex; align-items:center; justify-content:center; padding:24px;
  background:color-mix(in srgb, var(--ink) 82%, transparent);
  -webkit-backdrop-filter:blur(10px) saturate(1.2); backdrop-filter:blur(10px) saturate(1.2);
  cursor:zoom-out; animation:lb-in .18s ease-out;
}
.lightbox-inner{ position:relative; max-width:94vw; max-height:92vh; cursor:default;
  display:flex; align-items:center; justify-content:center; }
.lightbox-inner img{ display:block; max-width:94vw; max-height:92vh;
  border-radius:var(--r-m);
  box-shadow:0 30px 80px -20px color-mix(in srgb, var(--ink) 60%, transparent); }
.lightbox-close{
  position:fixed; top:18px; right:20px; z-index:11001;
  width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center;
  font-size:18px; color:var(--ink); background:var(--surface);
  border:none; border-radius:50%; cursor:pointer; box-shadow:var(--sh-2);
  transition:background .15s ease, color .15s ease, transform .15s ease;
}
.lightbox-close:hover{ background:var(--brand); color:#fff; transform:scale(1.08); }
@keyframes lb-in{ from{ opacity:0; } to{ opacity:1; } }

/* ────────────────────────────────────────────────────────────────────────
   6 · CHIPS DE FILTRO (.chips, .chip)  ·  tablero y alta de tarea
   Píldoras clicables; activa = relleno de marca suave + borde de marca.
   ──────────────────────────────────────────────────────────────────────── */
.chips{ display:flex; flex-wrap:wrap; gap:7px; margin:0 0 2px; }
.chip{
  font-family:var(--font); font-size:12.5px; font-weight:500; color:var(--ink-2);
  background:var(--surface); border:1.5px solid var(--line-2); border-radius:999px;
  padding:5px 13px; cursor:pointer; white-space:nowrap;
  transition:color .14s ease, border-color .14s ease, background .14s ease;
}
.chip:hover{ color:var(--brand-deep); border-color:var(--brand); background:var(--brand-soft); }
.chip.on{ color:var(--brand-deep); background:var(--brand-soft); border-color:var(--brand);
  font-weight:600; }
.chip:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

/* ────────────────────────────────────────────────────────────────────────
   7 · SUB-ESTRUCTURA DE CREDENCIALES (.cred-bar, .cred-sub, .cred-steps)
   La barra: etiqueta a la izquierda, badge + botones a la derecha (.sp8 empuja).
   Los pasos: lista numerada con badge de marca por número.
   ──────────────────────────────────────────────────────────────────────── */
.cred-bar{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.cred-bar .frame-lbl{ margin-bottom:0; margin-right:2px; }
.sp8{ flex:1 1 auto; }                         /* separador: empuja los botones a la derecha */

.cred-sub{ font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--ink-3); margin:13px 0 8px; }
.cred-steps{ margin:0 0 4px; padding-left:0; list-style:none; counter-reset:cs;
  display:flex; flex-direction:column; gap:8px; }
.cred-steps li{ counter-increment:cs; position:relative; padding-left:30px;
  font-size:13.5px; line-height:1.5; color:var(--ink-2); }
.cred-steps li b{ color:var(--ink); }
.cred-steps li::before{
  content:counter(cs); position:absolute; left:0; top:1px;
  width:21px; height:21px; display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--mono); font-size:11px; font-weight:500; color:#fff;
  background:var(--brand); border-radius:50%;
}

/* ────────────────────────────────────────────────────────────────────────
   8 · DETALLES SUELTOS
   ──────────────────────────────────────────────────────────────────────── */
/* Botón de borrado "armado" (§useArm): el 2º clic borra de verdad → rojo, peligroso. */
.btn.ghost.arm-red{
  color:#fff; background:var(--red); border-color:var(--red);
  animation:arm-pulse 1.15s ease-in-out infinite;
}
.btn.ghost.arm-red:hover{
  color:#fff; background:var(--red); border-color:var(--red); filter:brightness(1.07);
}
@keyframes arm-pulse{
  0%,100%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--red) 42%, transparent); }
  55%{ box-shadow:0 0 0 5px color-mix(in srgb, var(--red) 0%, transparent); }
}

/* Enlaces inline clicables (no <a href>, sino acciones). */
.linkish{ color:var(--brand-deep); font-weight:600; cursor:pointer; text-decoration:none;
  border-bottom:1px solid transparent; transition:border-color .14s ease; }
.linkish:hover{ border-bottom-color:currentColor; }

/* Etiqueta "PUBLICANDO" del timeline, con punto rojo que late. */
.live-tag{ display:inline-flex; align-items:center; gap:6px;
  font-family:var(--mono); font-size:10.5px; font-weight:500; letter-spacing:.06em;
  color:var(--red); background:var(--red-bg); border:1px solid var(--red-dim);
  border-radius:999px; padding:3px 9px 3px 8px; white-space:nowrap; }
.live-tag .rec{ width:7px; height:7px; border-radius:50%; background:var(--red);
  animation:rec-pulse 1.3s ease-out infinite; }
@keyframes rec-pulse{
  0%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); }
  70%,100%{ box-shadow:0 0 0 6px color-mix(in srgb, var(--red) 0%, transparent); }
}

/* Barra de progreso indeterminada del timeline mientras publica (el .term la recorta). */
.term-prog{ height:3px; background:var(--line); overflow:hidden; position:relative; }
.term-prog > i{ position:absolute; top:0; left:-40%; height:100%; width:40%;
  border-radius:999px; background:var(--grad);
  animation:term-slide 1.2s ease-in-out infinite; }
@keyframes term-slide{ 0%{ left:-40%; } 100%{ left:100%; } }

/* Tarjeta destacada: la tarea en cola / publicando lleva la consola en vivo embebida.
   amberedge completa la familia .rededge/.violetedge (borde interior de estado). */
.card.amberedge{ box-shadow:inset 4px 0 0 var(--amber-dot), var(--sh-2);
  border-color:var(--amber-dim); }
.card.amberedge:hover{ box-shadow:inset 4px 0 0 var(--amber-dot), var(--sh-3); }
.card.amberedge > *:not(.media-mini){ margin-left:15px; }
.star-head{ display:flex; flex-direction:column; gap:7px; }
.star-head .c-title{ margin:0; }
.star-meta{ display:flex; flex-direction:column; gap:9px; margin:11px 0; }

/* ────────────────────────────────────────────────────────────────────────
   MÓVIL (≤640px): nada desborda; los controles siguen siendo táctiles.
   ──────────────────────────────────────────────────────────────────────── */
@media (max-width:640px){
  .lightbox{ padding:12px; }
  .lightbox-close{ top:12px; right:12px; }
  .combo-list{ max-height:200px; }
  .cred-bar .btn.sm{ flex:1 1 auto; }          /* botones de la barra de credencial a lo ancho */
  .md th,.md td,.tbl th,.tbl td{ white-space:normal; }
}

/* Movimiento reducido: congela lo que late/desliza (el global ya baja duraciones;
   esto lo deja explícitamente quieto). */
@media (prefers-reduced-motion: reduce){
  .btn.ghost.arm-red,.live-tag .rec,.term-prog > i{ animation:none; }
  .lightbox{ animation:none; }
}
