/* Panel de validacion de Trend or Trash: unico archivo de estilos del panel.
   Tokens del design system como variables CSS; las plantillas no llevan colores sueltos.
   Se sirve en /ui/panel.css (las fuentes y el logo, en /ui/ al lado). */

@font-face {
  font-family: "Inter";
  src: url("inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Coolvetica";
  src: url("coolvetica.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* superficies */
  --canvas: #F4F3F0;
  --surface: #FAFAF8;
  --card: #FFFFFF;
  --line: #E4E2DD;
  /* texto */
  --ink: #000000;
  --ink-muted: #5F5E5A;
  /* primario */
  --brand-strong: #054D9E;
  --on-brand: #FFFFFF;
  /* veredicto y estados */
  --trend-bg: #E9F4EC;
  --trend-ink: #0F5D20;
  --trash-bg: #FDEBEA;
  --trash-ink: #A02519;
  --alert: #ED1C24;
  --posted-bg: #ECF2FF;
  --posted-ink: #054D9E;
  --neutral-bg: #EFEEEA;
  --neutral-ink: #5F5E5A;
  /* "por revisar": ambar suave (la paleta base no trae un tono de aviso) */
  --review-bg: #FFF4DA;
  --review-ink: #7A4D00;
  --review-line: #EFCB7B;
  /* log de corrida */
  --log-bg: #000000;
  --log-ink: #E9E7E2;
  /* forma */
  --r-input: 10px;
  --r-card: 16px;
  --r-pill: 999px;
  --shadow-card: 0 1px 2px rgba(23, 24, 28, .06), 0 6px 20px rgba(23, 24, 28, .06);
  --shadow-float: 0 1px 2px rgba(23, 24, 28, .08), 0 10px 32px rgba(23, 24, 28, .14);
  /* tipografia */
  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Coolvetica", "Inter", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/22px var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-strong); text-underline-offset: 2px; }
p { margin: 0; }
img, video { max-width: 100%; }
:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 2px; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 84px; }   /* anclas (#carrusel, #runbox) por debajo de la cabecera fija */

/* escala tipografica */
h1, .h1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.6px; margin: 0; }
h2, .h2 { font-size: 18px; line-height: 24px; font-weight: 650; letter-spacing: -0.2px; margin: 0; }
.kpi { font-size: 34px; line-height: 38px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.label { font-size: 13px; line-height: 18px; font-weight: 550; }
.caption { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.2px; }
.muted { color: var(--ink-muted); }
.spacer { flex: 1; }
.inline { display: inline; margin: 0; }

/* ---------- cabecera ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1280px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.brand span { font-family: var(--font-display); font-size: 22px; line-height: 1; padding-top: 2px; }
.topbar .sub { color: var(--ink-muted); padding-left: 12px; border-left: 1px solid var(--line); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 24px 48px; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--brand-strong); color: var(--on-brand);
  font: 550 13px/18px var(--font);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, border-color .12s, filter .12s;
}
.btn:hover { filter: brightness(1.12); }
.btn.secondary { background: var(--ink); color: #FFFFFF; }
.btn.secondary:hover { filter: none; background: #2A2A2A; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { filter: none; background: var(--surface); border-color: #CFCCC5; }
.btn:disabled, .btn[disabled] {
  background: var(--line); color: var(--ink-muted); border-color: var(--line);
  cursor: not-allowed; filter: none;
}
.btn.block { width: 100%; }
label.btn { user-select: none; }
label.btn:focus-within { outline: 3px solid var(--brand-strong); outline-offset: 2px; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--neutral-bg); color: var(--neutral-ink);
  font: 550 12px/16px var(--font); letter-spacing: 0.2px; white-space: nowrap;
}
.chip.trend, .chip.ok, .chip.st-approved { background: var(--trend-bg); color: var(--trend-ink); }
.chip.trash, .chip.bad, .chip.st-blocked { background: var(--trash-bg); color: var(--trash-ink); }
.chip.info, .chip.st-posted { background: var(--posted-bg); color: var(--posted-ink); }
.chip.warn, .chip.st-review { background: var(--review-bg); color: var(--review-ink); }
.chip.st-pending { background: var(--neutral-bg); color: var(--neutral-ink); }
.chip.st-discarded { background: var(--neutral-bg); color: var(--neutral-ink); text-decoration: line-through; }
.chip.trend, .chip.trash { font-weight: 700; letter-spacing: 0.6px; }
.chip.o-auto { background: var(--posted-bg); color: var(--posted-ink); }
.chip.o-manual { background: var(--neutral-bg); color: var(--neutral-ink); }
.chip.o-falta { background: var(--trash-bg); color: var(--trash-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- tabs pill ---------- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--card); border-radius: var(--r-pill); box-shadow: var(--shadow-card);
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none; font: 550 13px/18px var(--font);
}
.tab:hover { background: var(--surface); }
.tab .n { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tab.active { background: var(--brand-strong); color: var(--on-brand); }
.tab.active .n { color: rgba(255, 255, 255, .78); }

/* segmentado (formato de publicacion): radios con aspecto de tabs */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px;
  border-radius: var(--r-pill); font: 550 13px/18px var(--font); color: var(--ink-muted);
}
.seg input:checked + span { background: var(--brand-strong); color: var(--on-brand); }
.seg input:focus-visible + span { outline: 3px solid var(--brand-strong); outline-offset: 2px; }

/* ---------- tarjetas y avisos ---------- */
.panel {
  background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  padding: 20px;
}
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head:last-child { margin-bottom: 0; }

.flash {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-card);
  padding: 12px 16px; margin-bottom: 12px;
}
.flash::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--brand-strong); }

.note { border-radius: var(--r-input); padding: 10px 14px; font-size: 14px; line-height: 20px; margin-top: 12px; }
.note.warn { background: var(--review-bg); color: var(--review-ink); }
.note.err { background: var(--trash-bg); color: var(--trash-ink); }
.note.info { background: var(--posted-bg); color: var(--posted-ink); }
.note:first-child { margin-top: 0; }

/* ---------- log de corrida y progreso ---------- */
pre.log {
  background: var(--log-bg); color: var(--log-ink);
  font: 400 12px/18px var(--font-mono);
  border-radius: var(--r-input); padding: 14px 16px; margin: 12px 0 0;
  max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
pre.log:empty { display: none; }
.bar { height: 6px; background: var(--neutral-bg); border-radius: var(--r-pill); overflow: hidden; margin: 12px 0 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand-strong); border-radius: var(--r-pill); transition: width .3s; }

.runbox summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.runbox summary::-webkit-details-marker { display: none; }
.runbox summary::after { content: "▾"; color: var(--ink-muted); margin-left: auto; transition: transform .15s; }
.runbox:not([open]) summary::after { transform: rotate(-90deg); }
.runbox .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-muted); flex: none; }
.runbox.is-running .dot { background: var(--brand-strong); box-shadow: 0 0 0 4px var(--posted-bg); }

/* ---------- grilla ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--ink-muted); }

.overview { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; margin: 0 0 24px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi-card + .kpi-card { margin-top: 0; }
.split { margin-top: 0 !important; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.split-head { display: flex; align-items: baseline; gap: 8px; }
.sbar { display: flex; height: 12px; border-radius: var(--r-pill); overflow: hidden; background: var(--neutral-bg); gap: 2px; }
.sbar i { display: block; height: 100%; }
.sbar i.t { background: var(--trend-ink); }
.sbar i.x { background: var(--alert); }
.sbar i.peg { background: #CFCCC5; }
.sbar i.pol { background: var(--ink); }
/* tipo de eleccion (M2 pick_type): pegado = blanco con linea; polemico = negro */
.chip.pick-pegado { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.chip.pick-polemico { background: var(--ink); color: #FFFFFF; }
.post .thumb .chip.pick-pegado { box-shadow: inset 0 0 0 1px var(--line), 0 1px 3px rgba(23, 24, 28, .18); }
.split-legend { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

/* 4 columnas en escritorio, 2 en pantallas medianas, 1 en movil */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.post {
  display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.post:hover { box-shadow: var(--shadow-float); transform: translateY(-1px); }
.post .thumb { position: relative; display: block; aspect-ratio: 9 / 16; background: var(--neutral-bg); }
.post .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post .thumb .tags { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.post .thumb .chip { box-shadow: 0 1px 3px rgba(23, 24, 28, .18); }
.post .noimg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center; color: var(--ink-muted);
}
.post.is-muted .thumb img { filter: grayscale(1); opacity: .55; }
.post.is-blocked .noimg { color: var(--trash-ink); background: var(--trash-bg); }
.post .body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.post .title {
  font-size: 15px; line-height: 20px; font-weight: 650; letter-spacing: -0.1px;
  color: var(--ink); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post .title:hover { text-decoration: underline; }
.post .foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px; }
.post .foot .caption { white-space: nowrap; }
.post form { margin-top: 6px; }
.empty-state { color: var(--ink-muted); padding: 24px 0; }

/* ---------- vista de producto ---------- */
.pv-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.pv-head .back { align-self: flex-start; }
.pv-head .src { color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.pv-head .src b { color: var(--ink); font-weight: 550; }

.pv { display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.pv-media, .pv-main { min-width: 0; }

.v916 { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; background: #000000; }
.v916.empty { display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--ink-muted); border: 1px dashed var(--line); }
.media-help { margin-top: 12px; }

.slides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.slides img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: #000000; }

/* casillas de archivos */
.slots { display: flex; flex-direction: column; gap: 12px; }
.slot { border-radius: 12px; background: var(--surface); padding: 12px; }
.slot.flag { background: var(--review-bg); box-shadow: inset 0 0 0 1px var(--review-line); }
.slot-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.slot-main { display: flex; gap: 12px; align-items: flex-start; }
.slot-prev { display: flex; gap: 6px; flex: none; }
.prev { display: block; width: 84px; height: 84px; object-fit: contain; border-radius: 10px; background: #000000; }
.prev.tall { width: 72px; height: 96px; object-fit: cover; }
.prev.checker {
  background-color: #FFFFFF;
  background-image: conic-gradient(#D9D7D2 25%, transparent 0 50%, #D9D7D2 0 75%, transparent 0);
  background-size: 16px 16px;
}
.prev.yellow { background: #F2C543; }
.slot-prev.cut .prev { width: 64px; height: 84px; }
.prev-empty {
  width: 84px; height: 84px; border-radius: 10px; border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--ink-muted); background: var(--card);
}
.slot-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.slot-info .file { overflow-wrap: anywhere; }
.slot-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-actions form { margin: 0; }
.slot audio { width: 100%; margin-top: 4px; }

/* bloqueos de aprobacion */
.blockers ul { margin: 0; padding-left: 18px; color: var(--review-ink); }
.blockers li + li { margin-top: 6px; }
.blockers { background: var(--review-bg); box-shadow: none; }

/* calificaciones */
.rating-body { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.rating-score { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.rating-score .score { display: flex; align-items: baseline; gap: 6px; }
.rating-score .star { color: var(--brand-strong); font-size: 22px; }
.hist { flex: 1; min-width: 220px; display: grid; grid-template-columns: 26px minmax(0, 1fr) 40px; gap: 8px 10px; align-items: center; }
.hbar { height: 8px; background: var(--neutral-bg); border-radius: var(--r-pill); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--brand-strong); border-radius: var(--r-pill); }
.hbar i.low { background: var(--alert); }
.hist .pct { text-align: right; font-variant-numeric: tabular-nums; }
.why { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }

/* textos */
.field { padding: 16px 0; border-top: 1px solid var(--line); }
.field:first-child { border-top: 0; padding-top: 0; }
.field.flag {
  background: var(--review-bg); border-top-color: var(--review-line);
  margin: 0 -20px; padding: 16px 20px;
}
.field.flag:first-child { padding-top: 16px; }
.field-head { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin-bottom: 8px; }
.field-head .where { color: var(--ink-muted); }
.cnt { margin-left: auto; font: 500 12px/16px var(--font-mono); color: var(--ink-muted); }
.cnt.over { color: var(--alert); font-weight: 700; }
input[type=text], input[type=password], textarea {
  width: 100%; display: block;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-input);
  padding: 9px 12px; font: 400 15px/22px var(--font);
}
input[type=text]:hover, textarea:hover { border-color: #CFCCC5; }
input[type=text]:focus-visible, textarea:focus-visible { border-color: var(--brand-strong); }
input::placeholder, textarea::placeholder { color: #A3A19B; }
textarea { resize: vertical; min-height: 68px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-strong); width: 16px; height: 16px; margin: 0; flex: none; }

.item + .item { margin-top: 14px; }
.item-line { display: flex; gap: 10px; align-items: center; }
.item-line .cnt { min-width: 40px; text-align: right; }
q.quote {
  display: block; margin-top: 8px; padding: 8px 12px;
  background: var(--surface); border-radius: var(--r-input);
  font-size: 13px; line-height: 19px; font-style: italic; color: var(--ink);
}
.cite { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; line-height: 16px; font-weight: 500; }
.cite::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.cite.ok { color: var(--trend-ink); }
.cite.ok::before { background: var(--trend-ink); }
.cite.bad { color: var(--review-ink); }
.cite.bad::before { background: var(--review-ink); }
details.ctx { margin-top: 6px; font-size: 13px; line-height: 19px; color: var(--ink-muted); }
details.ctx summary { cursor: pointer; width: fit-content; }
details.ctx p { margin-top: 6px; padding: 10px 12px; background: var(--surface); border-radius: var(--r-input); color: var(--ink); white-space: pre-line; }
details.ctx mark { background: #FFE3A3; color: var(--ink); padding: 0 2px; border-radius: 3px; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; line-height: 18px; font-weight: 550; color: var(--review-ink); cursor: pointer; }
.reason { display: block; margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--review-ink); }
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

pre.caption-text {
  margin: 0; padding: 14px 16px; background: var(--surface); border-radius: var(--r-input);
  font: 400 14px/21px var(--font); white-space: pre-wrap; word-break: break-word;
}

/* acciones fijas al pie de la columna derecha */
.actionbar {
  position: sticky; bottom: 16px; z-index: 10;
  margin-top: 16px; padding: 10px 10px 10px 18px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-card); box-shadow: var(--shadow-float);
}
.actionbar form { margin: 0; }
.steps { display: flex; align-items: center; gap: 6px; color: var(--ink-muted); margin-right: auto; }
.steps b { color: var(--ink); font-weight: 650; }

/* bloqueados y descartados */
.held { max-width: 760px; }
.held-card .panel-head h2 { flex: 1; }
.held-card.is-blocked { box-shadow: var(--shadow-card), inset 0 3px 0 var(--alert); }
.held-card p + p { margin-top: 10px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.facts div { background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.facts dt { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.2px; color: var(--ink-muted); }
.facts dd { margin: 2px 0 0; font-size: 18px; line-height: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.held-card form { margin-top: 16px; }

/* ---------- navegacion de la cabecera ---------- */
.nav { display: flex; gap: 4px; margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  color: var(--ink-muted); text-decoration: none; font: 550 13px/18px var(--font);
}
.nav a:hover { color: var(--ink); background: var(--card); }
.nav a.active { color: var(--ink); background: var(--card); box-shadow: var(--shadow-card); }

/* ---------- acciones destructivas ---------- */
.btn.danger { background: var(--alert); color: #FFFFFF; }
.btn.ghost.danger-text { color: var(--trash-ink); }
.btn.ghost.danger-text:hover { background: var(--trash-bg); border-color: var(--trash-bg); }

/* ---------- seleccion multiple y acciones en lote (grilla) ---------- */
.post { position: relative; }
.select {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(23, 24, 28, .2); cursor: pointer;
}
.select input { width: 18px; height: 18px; cursor: pointer; }
.post.selected { box-shadow: 0 0 0 3px var(--brand-strong), var(--shadow-card); }
.post .thumb img.contain { object-fit: contain; background: #FFFFFF; }
.bulkbar {
  position: fixed; left: 0; right: 0; bottom: 20px; z-index: 40; margin: 0 auto;
  width: max-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 8px 8px 8px 20px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-pill); box-shadow: var(--shadow-float);
}
.bulkbar .label { margin-right: 6px; }
.modeform { display: flex; align-items: center; gap: 10px; margin: 0; }

/* ---------- filas desplazables (armado y biblioteca) ---------- */
.strip {
  display: flex; gap: 10px; overflow-x: auto; margin: 0; padding: 4px 2px 10px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.strip > * { flex: none; scroll-snap-align: start; }
.pick {
  position: relative; width: 84px; height: 104px; padding: 0; border: 0; cursor: pointer; overflow: hidden;
  border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.pick img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pick.photo img { object-fit: cover; }
.pick:hover { box-shadow: inset 0 0 0 2px var(--ink-muted); }
.pick.chosen { box-shadow: inset 0 0 0 3px var(--brand-strong); }
.tick {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--brand-strong); color: var(--on-brand); font: 700 12px/1 var(--font);
}
.chosen > .tick { display: flex; }

/* ---------- armado del post ---------- */
.build-step { padding: 16px 0; border-top: 1px solid var(--line); }
.build-step:first-of-type { border-top: 0; padding-top: 4px; }
.build-step-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.build .note { margin: 0 0 12px; }
.photo-step { display: flex; gap: 14px; align-items: flex-start; margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--surface); }
.photo-step.flag { background: var(--review-bg); box-shadow: inset 0 0 0 1px var(--review-line); }
.photo-prev { display: block; width: 96px; height: 128px; object-fit: cover; border-radius: 10px; background: #000000; flex: none; }
.photo-prev.empty { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; background: var(--card); color: var(--ink-muted); border: 1px dashed var(--line); }
.photo-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.photo-info .note { margin: 0; }
.color-rows { display: flex; flex-direction: column; gap: 10px; }
.color-row { display: flex; align-items: center; gap: 10px; margin: 0; }
.color-row > .caption { width: 52px; }
.swatch {
  position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.swatch.chosen { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--brand-strong); }
.swatch .tick { top: 7px; right: 7px; background: transparent; color: #FFFFFF; font-size: 15px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
#colors-repeat { margin: 12px 0 0; }
.build-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.build-actions form { margin: 0; }
.pv-top { display: flex; align-items: center; gap: 8px; }
.pv-top form { margin: 0; }

/* ---------- biblioteca ---------- */
.page-head { flex-direction: column; align-items: flex-start; gap: 6px; }
.page-head p { max-width: 720px; }
.lib-cat + .lib-cat { margin-top: 16px; }
.lib-strip { gap: 14px; }
.lib-item { margin: 0; width: 150px; display: flex; flex-direction: column; gap: 8px; }
.lib-img { display: block; width: 150px; height: 188px; border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.lib-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lib-img.photo img { object-fit: cover; }
.lib-name { overflow-wrap: anywhere; }

/* ---------- indicador de corrida (cabecera) ---------- */
.runstate {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--card); box-shadow: var(--shadow-card); color: var(--ink); text-decoration: none;
  font: 550 13px/18px var(--font); white-space: nowrap;
}
.runstate .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-muted); flex: none; }
.runstate.running .dot { background: var(--brand-strong); animation: rs-pulse 1.4s ease-out infinite; }
.runstate.error { background: var(--trash-bg); color: var(--trash-ink); box-shadow: none; }
.runstate.error .dot { background: var(--alert); }
@keyframes rs-pulse { 0% { box-shadow: 0 0 0 0 rgba(5, 77, 158, .45); } 100% { box-shadow: 0 0 0 8px rgba(5, 77, 158, 0); } }
@media (prefers-reduced-motion: reduce) { .runstate.running .dot { animation: none; box-shadow: 0 0 0 4px var(--posted-bg); } }

/* ---------- corridas y configuracion ---------- */
.runs-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.runs-top .panel + .panel { margin-top: 0; }
.runs-top .facts { margin: 4px 0 8px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; margin-top: 18px; }
.field-block { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.field-block.wide { grid-column: 1 / -1; }
input.num {
  width: 140px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--card); color: var(--ink); font: 400 15px/22px var(--font);
}
input.num:focus-visible { border-color: var(--brand-strong); }
.mixrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mixrow input.num { width: 96px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 28px; border-radius: var(--r-pill); background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(23, 24, 28, .2); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand-strong); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--brand-strong); outline-offset: 2px; }
.daypills { display: flex; gap: 6px; flex-wrap: wrap; }
.daypills label { position: relative; cursor: pointer; }
.daypills input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.daypills span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 36px; padding: 0 12px;
  border-radius: var(--r-pill); background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  font: 550 13px/18px var(--font); color: var(--ink-muted);
}
.daypills input:checked + span { background: var(--brand-strong); color: var(--on-brand); box-shadow: none; }
.daypills input:focus-visible + span { outline: 3px solid var(--brand-strong); outline-offset: 2px; }
.tablewrap { overflow-x: auto; }
table.runs { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
table.runs th { text-align: left; font: 550 12px/16px var(--font); letter-spacing: .2px; color: var(--ink-muted); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.runs td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
table.runs td.err-cell { white-space: normal; color: var(--trash-ink); font-size: 13px; min-width: 220px; }
.chip.run-ok { background: var(--trend-bg); color: var(--trend-ink); }
.chip.run-error, .chip.run-lost { background: var(--trash-bg); color: var(--trash-ink); }
.chip.run-running { background: var(--posted-bg); color: var(--posted-ink); }
.chip.run-saltada { background: var(--neutral-bg); color: var(--neutral-ink); }
code { font: 400 12px/18px var(--font-mono); background: var(--surface); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .overview { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runs-top { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .pv { grid-template-columns: 1fr; }
  .pv-media .media { max-width: 420px; }
}
@media (max-width: 640px) {
  .topbar-in { padding: 10px 16px; gap: 10px; }
  .topbar .sub { display: none; }
  .brand span { font-size: 20px; }
  .wrap { padding: 20px 16px 40px; }
  .panel { padding: 16px; }
  .field.flag { margin: 0 -16px; padding: 16px; }
  .kpi-card { padding: 12px 14px; }
  .kpi { font-size: 28px; line-height: 32px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .post .body { padding: 10px 12px 12px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 0 8px; }
  .pv-media .media { max-width: none; }
  .actionbar { bottom: 10px; padding: 8px; }
  .actionbar .steps { display: none; }
  .actionbar form { flex: 1; }
  .actionbar .btn { width: 100%; padding: 0 12px; }
  .rating-body { gap: 16px; }
  .topbar-in { flex-wrap: wrap; row-gap: 6px; }
  .nav { order: 3; width: 100%; margin: 0; padding: 0; border-left: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; padding: 0 10px; }
  .runstate .rs-label { display: none; }
  .runstate { padding: 0 10px; }
  .form-grid { grid-template-columns: 1fr; }
  [id] { scroll-margin-top: 120px; }
  .modeform { width: 100%; justify-content: space-between; }
  .bulkbar { bottom: 12px; border-radius: var(--r-card); padding: 8px; }
  .bulkbar .label { width: 100%; text-align: center; margin: 0; }
  .lib-item { width: 128px; }
  .lib-img { width: 128px; height: 160px; }
}

/* login (panel con contrasena, servidor) */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.login-card form { display: grid; gap: 8px; }
.login-card input[type=password] { width: 100%; }
.logout { margin: 0; }
.logout button { background: none; border: 0; padding: 0 4px; font: inherit; font-size: 13px; color: var(--ink-muted); cursor: pointer; }
.logout button:hover { color: var(--ink); text-decoration: underline; }

/* pie: version desplegada (commit corto) */
.pie { text-align: center; font-size: 12px; line-height: 16px; color: var(--ink-muted); padding: 24px 16px 40px; }
.pie code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.login-wrap .pie { padding: 0; }
