/* Panel. Paleta: tinta #1d1a17, azul #2763d0 → cian #4ddafe, grises neutros.
   Reglas de base: texto de 14 px (nada por debajo de 12), contraste AA, objetivos de pulsación de 36 px o más. */
:root {
  --ink: #1d1a17;
  --ink-2: #3f434a;
  --muted: #5c6169;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --line: #e2e5ea;
  --line-2: #c9ced6;
  --blue: #2763d0;
  --blue-ink: #1f4fa8;
  --blue-soft: #e8f0fd;
  --cyan: #4ddafe;
  --cyan-soft: #dff6fe;
  --cyan-ink: #075a74;
  --grad: linear-gradient(135deg, #2763d0 0%, #3f9fea 60%, #4ddafe 100%);
  --amber: #8a5200;
  --amber-soft: #fff1d6;
  --green: #0b6b4a;
  --green-soft: #def3e8;
  --red: #b42f25;
  --red-soft: #fce8e5;
  --grey-soft: #eceef2;
  --r-s: 8px;
  --r-m: 10px;
  --r-l: 14px;
  --shadow-1: 0 1px 2px rgba(29, 26, 23, 0.06);
  --shadow-2: 0 4px 14px rgba(29, 26, 23, 0.1);
  --shadow-3: 0 18px 50px rgba(29, 26, 23, 0.2);
  --side: 216px;
  --right: 300px;
  --hit: 36px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body.login-page { overflow: auto; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font: 13px ui-monospace, Consolas, monospace; background: var(--grey-soft); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
kbd { font: 12px system-ui, sans-serif; padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.22); color: #fff; }
.ic { flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Foco visible siempre que se navega con teclado. */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.mark { flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--grad); }
.hint { color: var(--muted); font-size: 13px; }
.hint.tight { margin-top: -6px; margin-bottom: 12px; }
.hint.center, .center { text-align: center; }
.note { background: var(--grey-soft); color: var(--ink-2); border-radius: var(--r-s); padding: 10px 12px; }
.t-pend { color: var(--amber); }
.t-err { color: var(--red); }
.t-today { color: var(--blue); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.only-mobile { display: none !important; }

/* ── botones y campos ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--hit); padding: 0 14px; border-radius: var(--r-s);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 14px; line-height: 1.2; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: #f3f5f8; border-color: #aab1bc; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--grey-soft); }
.btn.danger { color: var(--red); }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.block { width: 100%; min-height: 44px; }
.btn.on { border-color: var(--blue); color: var(--blue-ink); background: var(--blue-soft); }
.btn[disabled] { background: var(--grey-soft); border-color: transparent; color: var(--muted); cursor: default; pointer-events: none; }
.icon-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--hit); height: var(--hit);
  border: 0; border-radius: var(--r-s); background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--grey-soft); }
.icon-btn.on { background: var(--blue-soft); color: var(--blue-ink); }
.icon-btn[disabled] { color: #a9aeb6; pointer-events: none; }
/* Acción de pieza: mismo tamaño en todos los estados. */
.btn.action { width: 100%; min-height: var(--hit); height: var(--hit); padding: 0 8px; }
.btn.action.quiet { border-color: var(--line); background: transparent; color: var(--ink-2); font-weight: 500; }
.btn.action.quiet:hover { background: var(--grey-soft); }
.lbl-short { display: none; }

input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="time"], input[type="datetime-local"], select, textarea {
  width: 100%; height: 40px; padding: 0 11px; border: 1px solid #9aa1ac; border-radius: var(--r-s);
  background: var(--surface); font-size: 14px; transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.45; display: block; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
input[disabled], select[disabled], textarea[disabled] { background: #f0f1f4; color: var(--muted); border-color: var(--line-2); }
input::placeholder, textarea::placeholder { color: #6b7078; }
select { padding-right: 28px; }
.field { display: block; margin-bottom: 16px; }
.field-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field-label small { font-weight: 400; color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.counts { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--grey-soft); border-radius: var(--r-m); }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--hit); padding: 0 12px;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.seg button[disabled] { color: var(--muted); cursor: default; }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }

.toggle { display: flex; align-items: center; gap: 10px; min-height: var(--hit); margin-bottom: 8px; font-weight: 500; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle i { flex: none; width: 40px; height: 22px; border-radius: 99px; background: #848b96; position: relative; transition: background 0.15s; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.toggle input:checked + i { background: var(--blue); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle input:focus-visible + i { outline: 3px solid var(--blue); outline-offset: 2px; }
.toggle.off { color: var(--muted); cursor: default; }

/* ── etiquetas ────────────────────────────────────────────────────────────── */
.kind { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.k-normal { background: var(--blue); color: #fff; }
.k-prueba { color: var(--cyan-ink); background: var(--cyan-soft); box-shadow: inset 0 0 0 1.5px var(--cyan-ink); }
.status { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; min-width: 0; }
.st-pendiente, .lead-parcial { color: var(--amber); }
.st-aprobado { color: var(--blue-ink); }
.st-publicando { color: var(--cyan-ink); }
.st-publicado, .lead-enviado { color: var(--green); }
.st-error, .lead-error { color: var(--red); }
.st-cancelado, .lead-omitido { color: var(--muted); }
.kw { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--grey-soft); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.kw.leads { background: var(--green-soft); color: var(--green); }
.chips { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.chips .kw { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.chips .kw:first-child { display: block; line-height: 22px; text-overflow: ellipsis; }
.chips .kw.more, .chips .kw.leads { flex: none; display: inline-flex; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 13px; font-weight: 500; }
.pill.sim { background: var(--cyan-soft); color: var(--cyan-ink); }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, #1f4fa8, #2763d0); color: #fff; font-weight: 600; line-height: 1; }
.avatar.big { width: 40px; height: 40px; font-size: 17px; }

/* ── esqueletos y vacíos ──────────────────────────────────────────────────── */
.sk { background: linear-gradient(90deg, #e6e9ee 25%, #f1f3f6 37%, #e6e9ee 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-line { height: 10px; margin: 6px 0; }
.sk-line.w30 { width: 30%; } .sk-line.w60 { width: 60%; }
.sk-block { height: 110px; margin-bottom: 14px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { color: var(--ink); font-weight: 600; font-size: 15px; }
.empty p { max-width: 400px; }
.empty .btn { margin-top: 8px; }
.empty-ic { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--grey-soft); color: var(--muted); margin-bottom: 4px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 20px 0; padding: 10px 12px; border-radius: var(--r-s); }
.banner.warn { background: var(--amber-soft); color: var(--amber); }
.banner.error { background: var(--red-soft); color: var(--red); }
.banner .btn { margin-left: auto; }
.boot { height: 100vh; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 600; }

/* ── armazón ──────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.app.has-right { grid-template-columns: var(--side) minmax(0, 1fr) var(--right); }
.app.side-collapsed { --side: 64px; }
.main { min-width: 0; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; }
.mtop, .mtabs { display: none; }

.sidebar { display: flex; flex-direction: column; gap: 14px; padding: 14px 12px; background: var(--surface); border-right: 1px solid var(--line); min-width: 0; overflow: hidden auto; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: var(--hit); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 15px; min-width: 0; text-decoration: none; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.create { min-height: 42px; justify-content: flex-start; font-weight: 600; box-shadow: 0 2px 8px rgba(39, 99, 208, 0.28); }
.create kbd { margin-left: auto; }
.side-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--r-s); color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap; }
.side-nav a:hover { background: var(--grey-soft); }
.side-nav a.on { background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.side-foot .pill { align-self: flex-start; margin-bottom: 4px; }
.side-disk, .side-link { display: flex; align-items: center; gap: 9px; min-height: var(--hit); padding: 0 10px; white-space: nowrap; }
.side-link { width: 100%; border: 0; background: none; border-radius: var(--r-s); color: var(--ink-2); font-size: 13px; }
.side-link:hover { background: var(--grey-soft); color: var(--ink); }
.side-foot form { margin: 0; }
.app.side-collapsed .sidebar { padding: 14px 10px; }
.app.side-collapsed .sidebar .brand-name, .app.side-collapsed .create span, .app.side-collapsed .create kbd,
.app.side-collapsed .side-nav span, .app.side-collapsed .side-foot span { display: none; }
.app.side-collapsed .side-top { flex-direction: column; gap: 8px; }
.app.side-collapsed .create, .app.side-collapsed .side-nav a, .app.side-collapsed .side-disk, .app.side-collapsed .side-link, .app.side-collapsed .side-foot .pill { justify-content: center; padding: 0; }
.app.side-collapsed .side-foot .pill { align-self: center; width: 30px; }

/* ── páginas ──────────────────────────────────────────────────────────────── */
.page { padding: 20px 24px 40px; width: 100%; max-width: 1100px; }
.page.narrow { max-width: 780px; }
.page.calendar { max-width: none; padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { color: var(--muted); margin-top: 2px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.panel.flush { padding: 4px 6px; }
.panel h2 { margin-bottom: 10px; }
.panel > .hint { margin-bottom: 14px; }
.panel-foot { display: flex; justify-content: flex-end; margin-top: 4px; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.tools select { width: auto; max-width: 100%; }
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search .ic { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search input { width: 200px; padding-left: 32px; }

.lday { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: var(--hit); padding: 0 2px 8px; }
.lday span { color: var(--muted); }
.lday .btn { margin-left: auto; }

/* Filas de pieza: todas iguales, a una línea. */
.rows { container: rows / inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-1); }
.lrow { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 12px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: #f8f9fb; }
.lrow-open { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 0 0 12px; border: 0; background: none; text-align: left; }
.lrow-open:focus-visible { outline-offset: -3px; }
.lrow .thumb { width: 28px; height: 50px; }
.lrow .time { flex: none; width: 46px; }
.lrow .kind { flex: none; }
.lrow .cap { flex: 1; min-width: 0; display: block; height: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 14px; }
.lrow .chips { flex: none; max-width: 200px; }
.lrow .status { flex: none; width: 104px; }
.lrow .btn.action { flex: none; width: 168px; }
.lrow.s-cancelado .cap, .lrow.s-cancelado .time { color: var(--muted); }
.lrow.s-error .cap { color: var(--red); }
.lrow.skeleton .lrow-open { gap: 12px; }
.lrow.skeleton .sk-line { flex: 1; }
.lrow.skeleton .sk-line.w30 { flex: none; width: 60px; }
@container rows (max-width: 820px) {
  .lrow .chips { display: none; }
  .lrow .btn.action { width: 112px; }
  .lrow .lbl-long { display: none; }
  .lrow .lbl-short { display: inline; }
}
@container rows (max-width: 560px) {
  .lrow .kind { display: none; }
  .lrow .status { width: auto; font-size: 0; gap: 0; }
  .lrow .btn.action { width: 104px; }
  .lrow-open { gap: 8px; }
}

/* ── calendario ───────────────────────────────────────────────────────────── */
.topbar { padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-main { display: flex; align-items: center; gap: 8px 12px; margin-bottom: 10px; min-width: 0; }
.topbar-main .seg { margin-left: auto; flex: none; }
.range { display: flex; align-items: center; gap: 10px; min-width: 0; }
.range h1 { white-space: nowrap; font-variant-numeric: tabular-nums; }
.range-nav { flex: none; display: flex; align-items: center; gap: 2px; }
.range-sum { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.calendar-body { container: cal / inline-size; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.calendar-body.v-lista, .calendar-body.v-cuadricula { padding: 18px 20px 40px; }

/* Siete columnas siempre dentro de la pantalla: se reparten el ancho. */
.board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 100%; }
.col { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); background: var(--bg); }
.col:last-child { border-right: 0; }
.col.past { background: #e9ebef; }
.col.today { background: #e9f1ff; }
.col.over { background: var(--blue-soft); box-shadow: inset 0 0 0 3px var(--blue); }
.col-head { position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 6px; padding: 8px 6px; background: inherit; border-bottom: 1px solid var(--line); }
.col-day { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 2px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.col-short { display: none; text-transform: capitalize; }
.col-num { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 99px; font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.col.today .col-num { background: var(--blue); color: #fff; }
.col.today .col-day { color: var(--blue-ink); font-weight: 600; }
.col-count { display: flex; align-items: center; height: var(--hit); padding: 0 2px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; }
.col-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 8px 6px 28px; }
.col-add { width: 100%; }
.drop-hint { padding: 14px 6px; border: 2px dashed var(--blue); border-radius: var(--r-m); color: var(--blue-ink); font-weight: 600; text-align: center; }

/* Tarjeta: mosaico. Altura fija, mismas casillas siempre. */
.card { display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); min-width: 0; transition: box-shadow 0.12s, border-color 0.12s; }
.card:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); }
.card.active { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.card.s-error { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red), var(--shadow-1); }
.card.s-cancelado { background: #f0f1f4; }
.card.s-cancelado .thumb img { filter: grayscale(1); }
.card.s-cancelado .time, .card.s-cancelado .cap { color: var(--muted); }
.card[draggable="true"] .card-open { cursor: grab; }
.card-open {
  display: grid; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: 22px 22px 22px 38px 22px;
  grid-template-areas: "thumb time" "thumb kind" "thumb status" "cap cap" "chips chips";
  gap: 6px 8px;
}
.calendar-body.multi .card-open { grid-template-rows: 18px 22px 22px 22px 38px 22px; grid-template-areas: "acc acc" "thumb time" "thumb kind" "thumb status" "cap cap" "chips chips"; }
.card-acc { grid-area: acc; display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; color: var(--muted); }
.card-acc span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { position: relative; flex: none; display: block; width: 44px; height: 78px; border-radius: 6px; overflow: hidden; background: #dfe3e9; }
.card-open .thumb { grid-area: thumb; }
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.time { font-size: 16px; font-weight: 700; line-height: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--ink); }
.card-open .time { grid-area: time; }
.card-open .kind { grid-area: kind; justify-self: start; align-self: center; }
.card-open .status { grid-area: status; align-self: center; }
.cap { color: var(--ink-2); overflow-wrap: break-word; }
.card-open .cap { grid-area: cap; font-size: 14px; line-height: 19px; height: 38px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-open .chips { grid-area: chips; height: 22px; }
.card.pending { border-style: dashed; }
.card.skeleton .card-open { cursor: default; }
.card.skeleton .sk-line { margin: 4px 0; height: 12px; }
.card.skeleton .time { grid-area: time; width: 60%; }
.card.skeleton .kind { grid-area: kind; width: 70%; height: 12px; padding: 0; }
.card.skeleton .status { grid-area: status; width: 80%; }
.card.skeleton .action { height: var(--hit); }

/* Variante compacta: cuando las columnas se estrechan, la tarjeta se reordena en vez de cortarse. */
@container cal (max-width: 1189px) {
  .board .card-open { grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: 29px 29px 22px 36px 22px; grid-template-areas: "thumb time" "thumb kind" "status status" "cap cap" "chips chips"; }
  .calendar-body.multi .board .card-open { grid-template-rows: 18px 29px 29px 22px 36px 22px; grid-template-areas: "acc acc" "thumb time" "thumb kind" "status status" "cap cap" "chips chips"; }
  .board .thumb { width: 36px; height: 64px; }
  .board .card-open .cap { font-size: 13px; line-height: 18px; height: 36px; }
  .board .lbl-long, .board .col-name { display: none; }
  .board .lbl-short, .board .col-short { display: inline; }
  .board .btn.action { padding: 0 4px; gap: 4px; }
  .board .card { padding: 7px; }
  .board .col-body, .board .col-head { padding-left: 5px; padding-right: 5px; }
  .month-head .col-name { display: none; }
  .month-head .col-short { display: inline; }
}
@container cal (max-width: 1030px) {
  .board .card .btn.action .ic { display: none; }
  .board .kind { padding: 0 6px; }
}

/* mes */
.month { display: flex; flex-direction: column; min-height: 100%; }
.month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); }
.month-head > span { padding: 9px 10px; color: var(--ink-2); font-size: 13px; font-weight: 500; overflow: hidden; }
.month-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(124px, 1fr); }
.mcell { display: grid; grid-template-rows: 28px 36px 18px; align-content: start; gap: 6px; padding: 8px 10px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; min-width: 0; overflow: hidden; }
.mcell:hover { background: #f1f5fb; }
.mcell:focus-visible { outline-offset: -3px; }
.mcell.past { background: #eceef1; }
.mcell.out .mnum { color: var(--muted); font-weight: 400; }
.mcell.out .mthumb { opacity: 0.5; }
.mnum { display: inline-flex; align-items: center; justify-content: center; justify-self: start; min-width: 28px; height: 28px; border-radius: 99px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mcell.today .mnum { background: var(--blue); color: #fff; }
.mthumbs { display: flex; gap: 3px; align-items: flex-end; min-width: 0; overflow: hidden; }
.mthumb { position: relative; flex: none; width: 20px; height: 36px; border-radius: 3px; overflow: hidden; background: #d9dde4; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #7a818c; }
.mthumb.st-pendiente::after { background: #d98a00; } .mthumb.st-aprobado::after { background: var(--blue); }
.mthumb.st-publicado::after { background: #17976a; } .mthumb.st-error::after { background: var(--red); } .mthumb.st-publicando::after { background: #1294bd; }
.mmore { font-size: 12px; color: var(--ink-2); align-self: center; margin-left: 2px; }
.mmeta { font-size: 12px; line-height: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmeta b { font-weight: 600; }

/* lista */
.listview { max-width: 1100px; }
.listview section { margin-bottom: 20px; }

/* perfil */
.profile { max-width: 520px; margin: 0 auto; }
.profile-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); overflow: hidden; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px; }
.profile-head > div:nth-child(2) { flex: 1; min-width: 160px; }
.profile-head p { color: var(--muted); font-size: 13px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.pcell { position: relative; aspect-ratio: 3 / 4; border: 0; padding: 0; background: #dfe3e9; overflow: hidden; display: block; }
.pcell:focus-visible { outline-offset: -3px; }
.pcell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcell.hollow { background: repeating-linear-gradient(135deg, #eceef2, #eceef2 8px, #e2e5ea 8px, #e2e5ea 16px); }
.pcell-n { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pcell-st { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 7px; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 12px; }

/* biblioteca: baldosas iguales */
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.libcell { position: relative; aspect-ratio: 9 / 16; border: 0; padding: 0; border-radius: var(--r-m); overflow: hidden; background: #dfe3e9; box-shadow: var(--shadow-1); display: block; }
.libcell .thumb { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.libcell:hover { box-shadow: var(--shadow-2); }
.lib-top { position: absolute; top: 8px; left: 8px; }
.lib-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; height: 58px; padding: 8px 9px; background: rgba(0, 0, 0, 0.74); color: #fff; font-size: 13px; text-align: left; }
.lib-bottom b { white-space: nowrap; }
.lib-bottom .status { color: #fff; }
.libcell.s-cancelado .thumb img { filter: grayscale(1); }

/* ajustes */
.accounts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); }
.account-main { flex: 1; min-width: 150px; display: flex; flex-direction: column; }
.account-main span { color: var(--muted); font-size: 13px; }
.account-meta { display: flex; flex-direction: column; font-size: 13px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 14px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.wide { margin-top: 0; }
.morelist { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; margin-bottom: 14px; }
.morelist a, .morelist button { display: flex; align-items: center; gap: 12px; width: 100%; height: 54px; padding: 0 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font-size: 16px; text-decoration: none; }
.morelist a:first-child { border-top: 0; }
.morelist span { flex: 1; text-align: left; }
.morelist form { margin: 0; }

/* tablas: el texto se parte en vez de salirse */
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 10px; color: var(--ink-2); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }
.lead-post { display: flex; align-items: center; gap: 8px; min-height: var(--hit); padding: 0 6px 0 0; border: 0; background: none; color: var(--blue-ink); text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.lead-post img { flex: none; width: 22px; height: 39px; object-fit: cover; border-radius: 3px; }
.lead-err { display: block; color: var(--muted); font-size: 12px; }

/* ── panel derecho ────────────────────────────────────────────────────────── */
.rightpanel { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-left: 1px solid var(--line); overflow: hidden; }
.rp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 6px 16px; }
.rp-head h2 { font-size: 15px; }
.rp-tabs { display: flex; gap: 2px; padding: 0 8px 10px; border-bottom: 1px solid var(--line); }
.rp-tab, .daytab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 52px; padding: 6px 0 5px; border: 0; border-radius: var(--r-s); background: none; color: var(--ink-2); font-size: 12px; min-width: 0; }
.rp-tab b, .daytab b { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.rp-tab:hover, .daytab:hover { background: var(--grey-soft); }
.rp-tab.on, .daytab.on { background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; box-shadow: inset 0 -3px 0 var(--blue); }
.rp-tab.on b, .daytab.on b { color: var(--blue-ink); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.dot.ok { background: #17976a; } .dot.pend { background: #d98a00; } .dot.err { background: var(--red); }
.rp-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 8px 24px; background: var(--bg); }

/* ── cajón ────────────────────────────────────────────────────────────────── */
/* Por defecto va por encima del contenido; solo empuja el tablero cuando sobra ancho para las siete columnas. */
.drawer { container: drawer / inline-size; position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, calc(100vw - 64px)); z-index: 40; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 36px rgba(29, 26, 23, 0.16); overflow: hidden; animation: slide-in 0.18s ease-out; }
.drawer:focus { outline: 0; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(29, 26, 23, 0.32); }
.app.drawer-push { grid-template-columns: var(--side) minmax(0, 1fr) 720px; }
.app.drawer-push .drawer { position: static; width: auto; z-index: 20; box-shadow: none; }
.app.drawer-push .drawer-scrim, .app.drawer-push .rightpanel { display: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.dr-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.dr-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.dr-pos { color: var(--muted); font-size: 13px; margin-right: 4px; white-space: nowrap; }
.dr-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.dr-preview { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px; background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; }
.dr-form { min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.tabs { flex: none; position: sticky; top: 0; z-index: 2; display: flex; gap: 2px; padding: 6px 12px 0; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { flex: none; min-height: 42px; padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--blue-ink); border-bottom-color: var(--blue); font-weight: 600; }
.tabs button:focus-visible { outline-offset: -3px; }
.pane { flex: none; padding: 16px 18px 28px; }
.pane > .hint, .pane > .note { margin-bottom: 14px; }
.dr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.dr-foot .btn { min-height: 40px; }
.dr-secondary, .dr-primary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dr-primary { gap: 10px; margin-left: auto; }
.dr-msg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px; text-align: center; color: var(--muted); }
.dr-msg strong { color: var(--ink); }
@container drawer (max-width: 659px) {
  /* Cajón estrecho (móvil): vista previa arriba, formulario debajo, un solo desplazamiento. */
  .dr-body { display: block; overflow-y: auto; }
  .dr-preview { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; padding: 16px 12px; }
  .dr-form { overflow: visible; }
  .phone { width: 216px; border-radius: 30px; }
  .phone-screen { border-radius: 23px; }
  .dr-secondary .btn span { display: none; }
  .dr-secondary .btn { width: 40px; padding: 0; }
  .pane { padding: 14px 14px 24px; }
}

.phone { flex: none; width: 262px; max-width: 100%; padding: 7px; border-radius: 34px; background: #16181d; box-shadow: var(--shadow-3); }
.phone-screen { position: relative; aspect-ratio: 9 / 16; border-radius: 27px; overflow: hidden; background: #000; color: #fff; }
.phone-screen > video, .phone-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-screen.sk { background-color: #d9dde4; }
.phone-screen.drop { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; background: #eef0f4; color: var(--ink-2); border: 2px dashed #8d95a1; cursor: pointer; font: inherit; }
.phone-screen.drop strong { color: var(--ink); font-size: 15px; }
.phone-screen.drop span { font-size: 13px; }
.phone-screen.drop.over, .phone-screen.drop:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); }
.phone-tap { position: absolute; inset: 0; width: 100%; border: 0; background: none; cursor: pointer; }
.phone-tap:focus-visible { outline-offset: -6px; border-radius: 24px; }
.ig-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 26px; font-weight: 700; font-size: 17px; background: linear-gradient(rgba(0, 0, 0, 0.45), transparent); pointer-events: none; }
.ig-sound { position: absolute; top: 44px; right: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; }
.ig-side { position: absolute; right: 8px; bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.ig-side span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ig-side small { font-size: 12px; font-weight: 600; }
.ig-disc { padding: 2px; border: 2px solid #fff; border-radius: 7px; }
.ig-disc .avatar { border-radius: 4px; }
.ig-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 52px 12px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); pointer-events: none; }
.ig-user { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 6px; }
.ig-user b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-follow { flex: none; padding: 2px 8px; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 7px; font-size: 12px; font-weight: 600; }
.ig-cap { margin: 0; padding: 0; border: 0; background: none; color: #fff; text-align: left; font: inherit; font-size: 13px; line-height: 1.35; pointer-events: auto; overflow-wrap: anywhere; white-space: pre-wrap; max-height: 150px; overflow: hidden; display: block; width: 100%; }
.ig-cap.open { overflow-y: auto; }
.ig-cap b { font-weight: 600; text-decoration: underline; }
.ig-audio { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.phone-progress { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(0, 0, 0, 0.7); font-weight: 600; }
.phone-progress div { width: 70%; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.phone-progress i { display: block; height: 100%; background: var(--cyan); transition: width 0.2s; }
.profile-mode { background: #fff; color: var(--ink); display: flex; flex-direction: column; }
.pm-head { display: flex; align-items: center; gap: 9px; padding: 16px 12px 12px; }
.pm-head div { display: flex; flex-direction: column; min-width: 0; }
.pm-head span { color: var(--muted); font-size: 12px; }
.pm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; overflow: hidden; }
.pm-cell { position: relative; aspect-ratio: 3 / 4; background: #e2e5ea; overflow: hidden; }
.pm-grid.tall .pm-cell { aspect-ratio: 9 / 16; }
.pm-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-cell.me::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--blue); }

.cover { display: flex; flex-direction: column; gap: 10px; }
.cover-empty { padding: 14px; border: 1px dashed #8d95a1; border-radius: var(--r-s); color: var(--muted); text-align: center; }
.frames { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.frame { position: relative; aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #dfe3e9; display: block; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--blue); }
.frame:hover:not(.on):not([disabled]) { box-shadow: 0 0 0 2px #8d95a1; }
.frame[disabled] { cursor: default; }
.frames .hint { grid-column: 1 / -1; }
.scrub { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-s); }
.scrub video { flex: none; width: 44px; height: 78px; object-fit: cover; border-radius: 5px; background: #000; }
.scrub-ctl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.scrub-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
input[type="range"] { width: 100%; height: 28px; accent-color: var(--blue); margin: 0; }

.timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 18px; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child { padding-bottom: 4px; }
.timeline li:last-child::before { display: none; }
.timeline i { flex: none; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #8d95a1; background: var(--surface); color: #fff; }
.timeline li.done { color: var(--ink); }
.timeline li.done i { background: var(--green); border-color: var(--green); }
.timeline li.done::before { background: var(--green); }
.timeline li.now i { background: var(--cyan-ink); border-color: var(--cyan-ink); }
.timeline li.bad i { background: var(--red); border-color: var(--red); }
.timeline b { font-weight: 600; }
.timeline time { margin-left: 8px; color: var(--muted); font-size: 13px; }
.timeline p { color: var(--red); margin-top: 3px; overflow-wrap: anywhere; }
.history { margin-top: 16px; font-size: 13px; }
.history summary { cursor: pointer; color: var(--ink-2); min-height: var(--hit); display: flex; align-items: center; }
.history ul { list-style: none; margin: 4px 0 0; padding: 0; }
.history li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.history time { color: var(--muted); margin-right: 6px; }
.history b { font-weight: 600; margin-right: 4px; }

/* ── avisos y diálogos ────────────────────────────────────────────────────── */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: var(--shadow-3); pointer-events: auto; animation: toast-in 0.18s ease-out; }
.toast.error { background: var(--red); }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: var(--hit); height: var(--hit); padding: 0 10px; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 7px; background: transparent; color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; }
.toast button:hover { background: rgba(255, 255, 255, 0.18); }
.toast .toast-x { border-color: transparent; padding: 0; }
.toast button:focus-visible { outline-color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.backdrop { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(29, 26, 23, 0.45); }
.dialog { width: min(420px, 100%); padding: 20px; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-3); }
.dialog h2 { margin-bottom: 6px; }
.dialog p { color: var(--ink-2); margin-bottom: 14px; overflow-wrap: anywhere; }
.dialog .field { margin-bottom: 10px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.dialog-foot .btn { min-height: 40px; }

/* ── acceso ───────────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: min(360px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-2); }
.login-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; margin-bottom: 22px; }
.login h1 { margin-bottom: 16px; }
.login label { display: block; font-weight: 600; margin-bottom: 6px; }
.login input { height: 44px; margin-bottom: 16px; font-size: 16px; }
.login-err { background: var(--red-soft); color: var(--red); border-radius: var(--r-s); padding: 10px 12px; margin-bottom: 14px; }

/* ── inicio ───────────────────────────────────────────────────────────────── */
.page { margin-inline: auto; }
.page.home { max-width: 1280px; padding-top: 28px; }
.home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.home-head h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; }
.home-head p { color: var(--muted); font-size: 16px; margin-top: 4px; }
.statline { display: flex; flex-wrap: wrap; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
.statline > div { display: flex; flex-direction: column; gap: 1px; padding: 10px 20px; border-left: 1px solid var(--line); min-width: 96px; }
.statline > div:first-child { border-left: 0; }
.statline dd { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.statline dt { color: var(--muted); font-size: 13px; white-space: nowrap; }
.statline .warn dd { color: var(--amber); }
.statline .bad dd { color: var(--red); }
.block { margin-bottom: 36px; }
.block-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.block-head h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; letter-spacing: -0.01em; }
.block-head p { color: var(--ink-2); font-size: 15px; margin-top: 3px; }
.block-head p.t-pend { color: var(--amber); font-weight: 600; }
.block-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.big { min-height: 44px; padding: 0 18px; font-size: 15px; font-weight: 600; }
.block.alert { padding: 16px; border: 1px solid #e6b4ae; border-radius: var(--r-l); background: #fff6f5; }
.block.alert h2 { color: var(--red); font-size: 17px; }
.daygroup { margin-bottom: 22px; }
.daygroup-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.daygroup-head h3 { font-size: 16px; }
.daygroup-head span { color: var(--muted); }
.daygroup-head .btn { margin-left: auto; }
.blank { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; padding: 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-l); }
.blank > div { flex: 1; min-width: 220px; }
.blank strong { font-size: 16px; }
.blank p { color: var(--muted); margin-top: 2px; }
.blank .empty-ic { margin: 0; }
.empty-ic.ok { background: var(--green-soft); color: var(--green); }

/* Piezas en horizontal: portada grande, texto a dos líneas, acción a la derecha. Todas iguales. */
.items { container: items / inline-size; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; }
.card.wide { flex-direction: row; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; }
.card.wide .card-open {
  flex: 1; grid-template-columns: 58px auto auto minmax(0, 1fr); grid-template-rows: 26px 40px 24px;
  grid-template-areas: "thumb time kind kind" "thumb cap cap cap" "thumb status status chips"; gap: 6px 10px;
}
.card.wide .thumb { width: 58px; height: 102px; border-radius: 8px; }
.card.wide .time { font-size: 20px; line-height: 26px; }
.card.wide .card-open .cap { font-size: 15px; line-height: 20px; height: 40px; }
.card.wide .card-open .cap.is-note { color: var(--red); }
.card.wide .card-open .status { font-size: 14px; }
.card.wide .card-open .chips { height: 24px; justify-content: flex-end; }
.card.wide .btn.action { flex: none; width: 150px; height: 42px; }
.card.wide .lbl-long { display: none; }
.card.wide .lbl-short { display: inline; }
.card.wide.skeleton .card-open { min-height: 102px; }
@container items (max-width: 520px) {
  /* En estrecho la acción baja a su propia fila, a todo el ancho. */
  .card.wide { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .card.wide .btn.action { width: 100%; }
  .card.wide .lbl-long { display: inline; }
  .card.wide .lbl-short { display: none; }
}

/* Aprobar una pieza: contorno azul. El azul sólido se reserva para aprobar un día entero. */
.btn.action.approve { background: var(--surface); border: 1.5px solid var(--blue); color: var(--blue-ink); font-weight: 600; }
.btn.action.approve:hover { background: var(--blue-soft); border-color: var(--blue-ink); }

/* Tablero con columnas muy anchas (monitores grandes): la portada crece y aprovecha el sitio. */
@container cal (min-width: 1900px) {
  .board .card { padding: 10px; }
  .board .card-open { grid-template-columns: 62px minmax(0, 1fr); grid-template-rows: 24px 22px 22px 22px 40px; grid-template-areas: "thumb time" "thumb kind" "thumb status" "thumb chips" "cap cap"; gap: 6px 10px; }
  .calendar-body.multi .board .card-open { grid-template-rows: 18px 24px 22px 22px 22px 40px; grid-template-areas: "acc acc" "thumb time" "thumb kind" "thumb status" "thumb chips" "cap cap"; }
  .board .thumb { width: 62px; height: 108px; border-radius: 8px; }
  .board .time { font-size: 18px; line-height: 24px; }
  .board .card-open .cap { font-size: 15px; line-height: 20px; height: 40px; }
  .board .btn.action { height: 40px; font-size: 15px; }
  .board .col-day { font-size: 16px; }
  .board .col-body, .board .col-head { padding-left: 8px; padding-right: 8px; }
}

/* ── organización, cuentas y equipo ───────────────────────────────────────── */
.orgname, .orgpick { margin: -6px 0 0; min-height: 28px; display: flex; align-items: center; padding: 0 2px; color: var(--muted); font-size: 13px; min-width: 0; }
.orgname span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orgpick select { height: 36px; font-size: 13px; }
.side-user { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.side-link { text-decoration: none; }
.app.side-collapsed .orgname, .app.side-collapsed .orgpick { display: none; }

.netbadge { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 28%; color: #fff; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.net-instagram { background: #1d1a17; }
.net-linkedin { background: #0a4a8f; }
.acc-avatar { position: relative; flex: none; display: inline-flex; }
.acc-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--grey-soft); }
.acc-avatar .netbadge { position: absolute; right: -4px; bottom: -4px; box-shadow: 0 0 0 2px var(--surface); }

.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-bottom: 16px; }
.acc-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); min-width: 0; }
.acc-card.acc-error { border-color: var(--red); }
.acc-card.acc-desconectada { background: #f6f7f9; }
.acc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acc-id { flex: 1; min-width: 0; }
.acc-id h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-id p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-facts { display: grid; gap: 8px; margin: 0; }
.acc-facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 24px; }
.acc-facts dt { color: var(--muted); font-size: 13px; }
.acc-facts dd { margin: 0; overflow-wrap: anywhere; }
.acc-facts code { white-space: nowrap; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.acc-actions .btn.ghost { margin-left: auto; }
.quota { display: flex; align-items: center; gap: 8px; }
.quota-bar { flex: none; display: block; width: 72px; height: 8px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; }
.quota-bar.wide { width: 100%; }
.quota-bar i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.quota-bar i.hot { background: var(--red); }
.form-err { background: var(--red-soft); color: var(--red); border-radius: var(--r-s); padding: 9px 12px; margin: 0 0 12px; overflow-wrap: anywhere; }

.dialog.wide { width: min(720px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.netchoice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; margin-bottom: 8px; }
.netopt { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--r-m); }
.netopt header { display: flex; gap: 10px; align-items: flex-start; }
.netopt h3 { font-size: 15px; }
.netopt header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.netopt .note { margin: 0; font-size: 13px; }
.netopt .hint { margin: 0; }
.picklist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: var(--r-m); cursor: pointer; }
.pick:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.pick input { flex: none; width: 20px; height: 20px; accent-color: var(--blue); margin: 0; }
.pick-main { display: flex; flex-direction: column; min-width: 0; }
.pick-main span { color: var(--ink-2); font-size: 13px; }
.btn.block-left { width: 100%; justify-content: flex-start; min-height: 44px; }
.subhead { margin: 22px 0 8px; font-size: 15px; font-weight: 600; }
.subhead:first-child { margin-top: 0; }

.page-tabs { position: static; padding: 0; margin-bottom: 14px; background: none; }
.people { list-style: none; margin: 0 0 8px; padding: 0; }
.people li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.people-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.people-main span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.people select { width: auto; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; gap: 0 12px; align-items: end; }
.inline-form .btn { margin-bottom: 16px; height: 40px; }
.copylink { display: flex; gap: 8px; align-items: center; flex: 1 1 260px; min-width: 0; }
.copylink input { min-width: 0; font-size: 13px; }
.note .copylink { margin-top: 8px; }
.org-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.org-logo img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.org-logo .avatar.big { width: 56px; height: 56px; border-radius: 12px; font-size: 22px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.plan-name { font-size: 16px; margin-bottom: 14px; }
.usages { display: grid; gap: 14px; margin-bottom: 14px; }
.usage-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.acct-line { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.acct-line span { color: var(--muted); }

/* Vista previa de LinkedIn */
.li-card { width: 100%; max-width: 280px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-2); }
.li-head { display: flex; gap: 10px; align-items: center; padding: 12px 12px 8px; }
.li-head div { display: flex; flex-direction: column; min-width: 0; }
.li-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-head span { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.li-text { display: block; width: 100%; margin: 0; padding: 0 12px 10px; border: 0; background: none; text-align: left; font: inherit; font-size: 14px; line-height: 1.4; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.li-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.li-text b { color: var(--muted); font-weight: 500; }
.li-media { position: relative; background: #000; aspect-ratio: 4 / 5; }
.li-media video, .li-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.li-drop { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed #8d95a1; background: #eef0f4; color: var(--ink-2); font: inherit; }
button.li-drop:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); }
.li-bar { display: flex; justify-content: space-around; gap: 4px; padding: 8px 6px; white-space: nowrap; overflow: hidden; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.li-bar span { display: flex; align-items: center; gap: 4px; }

/* Páginas de acceso */
.login-intro { color: var(--ink-2); margin-bottom: 14px; }
.login-ok { background: var(--green-soft); color: var(--green); border-radius: var(--r-s); padding: 10px 12px; margin-bottom: 14px; }
.login-hint { color: var(--muted); font-size: 13px; margin: -10px 0 14px; }
.login-links { margin-top: 16px; text-align: center; font-size: 14px; }
a.login-brand { color: var(--ink); text-decoration: none; }

/* ── pantallas medianas ───────────────────────────────────────────────────── */
@media (max-width: 1279px) {
  .search input { width: 170px; }
}

/* ── móvil y tableta (menos de 1024 px): pestañas abajo y un día por pantalla ── */
@media (max-width: 1023px) {
  .app, .app.has-right, .app.drawer-push { display: flex; flex-direction: column; }
  .sidebar, .rightpanel { display: none; }
  .only-mobile { display: inline-flex !important; }
  .mtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 50px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
  .mtabs { order: 10; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; flex: none; height: calc(62px + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .mtabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--ink-2); font-size: 12px; font-weight: 500; text-decoration: none; }
  .mtabs a.on { color: var(--blue-ink); font-weight: 700; }
  .mcreate { justify-self: center; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: 15px; background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(39, 99, 208, 0.4); }
  .main { flex: 1; min-height: 0; }
  .page { padding: 16px 14px 28px; }
  .banner { margin: 10px 14px 0; }
  .page.home { padding-top: 18px; }
  .home-head { margin-bottom: 20px; }
  .home-head h1 { font-size: 26px; }
  .statline { width: 100%; }
  .statline > div { flex: 1 1 40%; padding: 10px 14px; }
  .statline > div:nth-child(3) { border-left: 0; }
  .statline > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .block-actions { width: 100%; }
  .block-actions .btn { flex: 1; }
  .daygroup-head .btn { min-height: 42px; }

  .topbar { position: relative; padding: 10px 14px; }
  /* Tres filas que siempre caben: fechas y flechas; vistas; búsqueda y filtros. */
  .topbar-main { flex-wrap: wrap; margin-bottom: 8px; }
  .range { flex: 1 1 100%; justify-content: space-between; gap: 6px; }
  .range h1 { font-size: 18px; }
  .range-sum { display: none; }
  .topbar-main .seg { flex: 1 1 100%; display: flex; margin-left: 0; }
  .topbar .seg button { flex: 1; padding: 0 4px; min-width: 40px; }
  .tools { flex-wrap: nowrap; }
  .search { flex: 1; }
  .search input { width: 100%; font-size: 16px; height: 42px; }
  .filters { display: none; position: absolute; left: 14px; right: 14px; top: 100%; z-index: 6; flex-direction: column; padding: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); box-shadow: var(--shadow-2); }
  .filters.open { display: flex; }
  .filters select { width: 100%; height: 44px; font-size: 16px; }
  .calendar-body.v-lista, .calendar-body.v-cuadricula { padding: 14px 14px 28px; }

  .daylist { display: flex; flex-direction: column; min-height: 100%; }
  .daytabs { position: sticky; top: 0; z-index: 3; display: flex; gap: 2px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .daytab { min-height: 58px; font-size: 13px; }
  .daytab b { font-size: 17px; }
  .daytab.today:not(.on) b { color: var(--blue-ink); }
  .daylist-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 4px; }
  .daylist-head p { color: var(--muted); }
  .daylist-head .btn { min-height: 42px; }
  .daylist-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-content: start; gap: 10px; padding: 10px 14px 28px; }
  .daylist-body > .empty { grid-column: 1 / -1; }
  .daylist .card { padding: 12px; }
  .daylist .btn.action { height: 42px; }

  .month-grid { grid-auto-rows: minmax(92px, 1fr); }
  .mcell { padding: 5px 4px; gap: 4px; grid-template-rows: 28px 28px 16px; }
  .mthumb { width: 15px; height: 27px; }
  .mthumbs .mthumb:nth-child(n + 3) { display: none; }
  .mmore { display: none; }
  .mmeta { font-size: 12px; }
  .month-head > span { padding: 7px 4px; text-align: center; }
  .month-head .col-name { display: none; }
  .month-head .col-short { display: inline; }
  .libgrid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }

  /* El cajón es una hoja a pantalla completa. */
  .drawer { width: 100vw; border-left: 0; animation: sheet-in 0.2s ease-out; }
  .drawer-scrim { display: none; }
  .dr-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .dr-foot .btn { min-height: 44px; }
  input[type="text"], input[type="number"], input[type="time"], input[type="datetime-local"], select, textarea { font-size: 16px; height: 44px; }
  textarea { height: auto; }
  .toasts { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
@media (max-width: 479px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .inline-form { grid-template-columns: minmax(0, 1fr); }
  .acc-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .acc-actions .btn { flex: 1; }
  .frames { gap: 4px; }
  .dr-title h2 { font-size: 15px; }
}
@keyframes sheet-in { from { transform: translateY(30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── Ronda 6: cuentas, bandeja de leads, votación, análisis ─────────────────── */
.acc-stats { display: flex; gap: 22px; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); }
.acc-stats div { display: flex; flex-direction: column; min-width: 0; }
.acc-stats b { font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.acc-stats span { color: var(--muted); font-size: 13px; }
.nettiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; margin-bottom: 16px; }
.nettile { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink); text-align: left; font: inherit; min-width: 0; }
button.nettile { cursor: pointer; }
button.nettile:hover { border-color: var(--blue); background: var(--blue-soft); }
.nettile.soon { background: transparent; border-style: dashed; border-color: var(--line-2); }
.nettile .netbadge { flex: none; width: 32px; height: 32px; font-size: 14px; }
.nettile.soon .netbadge { background: var(--grey-soft); color: var(--ink-2); }
.nettile-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nettile-main { overflow-wrap: anywhere; }
.nettile-main > span { color: var(--muted); font-size: 13px; }
.net-facebook { background: #1b5fc9; color: #fff; }
.net-tiktok { background: #1d1a17; color: #fff; }
.net-youtube { background: #b3261e; color: #fff; }
.net-threads { background: #3f434a; color: #fff; }

.notices { border: 0; padding: 0; margin: 4px 0 12px; min-width: 0; }
.notices legend { padding: 0; margin-bottom: 6px; }
.panel-foot.start { justify-content: flex-start; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.stagebar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.stagebar button { display: inline-flex; align-items: center; gap: 8px; min-height: var(--hit); padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; cursor: pointer; }
.stagebar button b { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--grey-soft); color: var(--ink-2); font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.stagebar button:hover { border-color: var(--blue); color: var(--ink); }
.stagebar button.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; }
.stagebar button.on b { background: var(--blue); color: #fff; }

.leadlist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.lead { display: grid; grid-template-columns: 210px minmax(0, 1fr) 190px; gap: 14px; align-items: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.lead-s-nuevo { border-left-color: #c98a16; }
.lead-s-conversacion { border-left-color: var(--blue); }
.lead-s-llamada { border-left-color: var(--cyan-ink); }
.lead-s-cliente { border-left-color: var(--green); }
.lead-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lead-who .avatar { flex: none; width: 36px; height: 36px; font-size: 15px; }
.lead-id { display: flex; flex-direction: column; min-width: 0; }
.lead-id b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-id span { color: var(--muted); font-size: 13px; }
.lead-what { min-width: 0; }
.lead-text { margin: 0 0 6px; overflow-wrap: anywhere; }
.lead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0; }
.lead-note { margin: 6px 0 0; padding: 6px 10px; border-radius: var(--r-s); background: var(--amber-soft); color: var(--amber); overflow-wrap: anywhere; }
.lead-noteform { margin-top: 10px; }
.lead-noteform .panel-foot { gap: 8px; }
.lead-do { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lead-do .btn { justify-content: center; }
.stage-select { font-weight: 600; }
.clock { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.clock.soon { color: var(--amber); font-weight: 600; }
.clock.closed { color: var(--muted); }
.clock-bar { display: inline-block; width: 44px; height: 6px; border-radius: 3px; background: var(--grey-soft); overflow: hidden; }
.clock-bar i { display: block; height: 100%; background: var(--blue); }
.clock.soon .clock-bar i { background: #c98a16; }
@media (max-width: 1180px) {
  .lead { grid-template-columns: minmax(0, 1fr) 190px; }
  .lead-who { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead-do { flex-direction: row; flex-wrap: wrap; }
  .lead-do > * { flex: 1 1 140px; }
}

.vote-bars { display: grid; gap: 14px; margin: 14px 0; }
.vote-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.vote-top b { font-size: 16px; }
.vote-n { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.vote-bar { height: 14px; border-radius: 7px; background: var(--grey-soft); overflow: hidden; }
.vote-bar i { display: block; height: 100%; min-width: 2px; border-radius: 7px; background: var(--line-2); transition: width 0.3s; }
.vote-row.win .vote-bar i { background: var(--blue); }
.vote-row small { color: var(--muted); font-size: 13px; }
.topcomment { padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); margin-bottom: 12px; }
.topcomment p { margin: 4px 0; overflow-wrap: anywhere; }
.topcomment small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.votes .panel-foot { gap: 8px; }
.metrics { margin-top: 18px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); min-width: 0; }
.tile span { color: var(--muted); font-size: 13px; }
.tile b { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th[scope="row"] { border-bottom: 1px solid var(--line); color: var(--ink); }
.table tr:last-child th[scope="row"] { border-bottom: 0; }
.table.compact th, .table.compact td { padding: 7px 8px; }
.table tr.best td { background: var(--green-soft); }
.table td .kw { margin-left: 6px; vertical-align: middle; }
.th-sort { display: inline-flex; align-items: center; gap: 3px; min-height: var(--hit); padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.th-sort:hover, .th-sort.on { color: var(--blue-ink); }
.variants + .variants { margin-top: 16px; }
.variants h3 { margin: 0 0 4px; font-size: 14px; }

.simbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 8px 12px; border-radius: var(--r-s); background: var(--cyan-soft); color: var(--cyan-ink); }
.kw.day { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }

/* ── Ronda 7: lote, formatos, ideas, textos, búsqueda, gráficos, competencia ── */
.k-format { background: var(--ink); color: #fff; }
.linklike { display: inline; min-height: 0; padding: 0; border: 0; background: none; color: var(--blue-ink); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.gap-top { margin-top: 12px; }
.subhead small { font-weight: 400; color: var(--muted); font-size: 13px; }

/* elegir varias */
.tools-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.tools-end .btn.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: var(--r-m); background: var(--blue-soft); border: 1px solid var(--blue); }
.bulkbar b { color: var(--blue-ink); }
.bulk-move { display: inline-flex; gap: 4px; }
.card-open, .lrow-open { position: relative; }
.pick-mark { position: absolute; top: 6px; left: 6px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink-2); background: var(--surface); color: #fff; }
.pick-mark.on { background: var(--blue); border-color: var(--blue); }
.lrow-open .pick-mark { position: static; flex: none; }
.card.picked, .lrow.picked { outline: 3px solid var(--blue); outline-offset: -3px; }
.card.selecting .card-open { cursor: copy; }

/* archivos de un carrusel o una historia */
.filepick { align-self: flex-start; cursor: pointer; }
.filelist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.filelist li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-s); min-width: 0; }
.filelist img, .filelist .thumb-empty { flex: none; width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--grey-soft); display: flex; align-items: center; justify-content: center; }
.fname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fname small { display: block; color: var(--muted); font-size: 12px; }
.carousel-strip { list-style: none; display: flex; gap: 6px; margin: 10px 0 0; padding: 0; max-width: 100%; overflow-x: auto; }
.carousel-strip img { width: 54px; height: 54px; border-radius: 6px; object-fit: cover; display: block; }
.imp-rows { max-height: 260px; overflow-y: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: var(--r-s); }
.snip-pick small a { color: var(--blue-ink); }

/* búsqueda */
.side-search { display: flex; align-items: center; gap: 10px; min-height: var(--hit); padding: 0 10px; margin-bottom: 6px; border: 1px solid var(--line); cursor: pointer; }
.side-search kbd { margin-left: auto; font: inherit; font-size: 12px; color: var(--muted); }
.app.side-collapsed .side-search { justify-content: center; padding: 0; }
.app.side-collapsed .side-search span, .app.side-collapsed .side-search kbd { display: none; }
.search.big input { width: 100%; height: 44px; font-size: 16px; padding-left: 38px; }
.search.big { display: flex; }
.search-results { min-height: 120px; max-height: min(56vh, 520px); overflow-y: auto; margin: 12px 0; }
.search-results h3 { margin: 12px 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.search-results ul { list-style: none; margin: 0; padding: 0; }
.search-results li button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border: 0; border-radius: var(--r-s); background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.search-results li button:hover { background: var(--grey-soft); }
.search-results img { flex: none; width: 24px; height: 42px; object-fit: cover; border-radius: 4px; }
.sr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-main b, .sr-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-main small { color: var(--muted); font-size: 13px; }

/* textos guardados */
.snips { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.snips li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); }
.snip-main { flex: 1; min-width: 0; }
.snip-main b { margin-right: 8px; }
.snip-main p { margin: 6px 0 0; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.snip-do { display: flex; gap: 6px; flex: none; }
.snip-form { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--line); }

/* ideas */
.page.wide { max-width: 1500px; }
.idea-new { width: min(360px, 100%); }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; margin-bottom: 14px; }
.kcol { min-width: 0; padding: 8px; border-radius: var(--r-l); background: var(--grey-soft); border: 2px solid transparent; }
.kcol.over { border-color: var(--blue); background: var(--blue-soft); }
.kcol > header { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 6px 8px; }
.kcol h2 { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcol > header span { min-width: 24px; padding: 0 6px; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 12px; line-height: 20px; text-align: center; }
.kcol ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); min-width: 0; }
.kcard[draggable="true"] { cursor: grab; }
.kcard-open { display: flex; flex-direction: column; gap: 4px; width: 100%; min-height: 44px; padding: 10px 10px 6px; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.kcard-open > span { color: var(--muted); font-size: 13px; }
.kcard-open .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.kmove { display: block; padding: 0 8px 8px; }
.kmove select { width: 100%; min-height: var(--hit); font-size: 13px; padding-left: 8px; }
.kempty { margin: 0; padding: 14px 6px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 1023px) { .kanban { grid-template-columns: minmax(0, 1fr); } }

/* gráficos */
.chart { margin: 0; min-width: 0; }
.chart figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.chart figcaption span { color: var(--muted); font-size: 13px; }
.chart svg { display: block; max-width: 100%; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; }
.chart .lab { fill: var(--ink-2); font-size: 13px; }
.chart .lab.strong { fill: var(--ink); font-weight: 600; }
.chart .val { fill: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart .best-row { fill: var(--green-soft); }
.chart .cellv { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .cellv.inv { fill: #fff; }
.chart .empty-cell { opacity: 0.6; }
.chart-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .chart-pair { grid-template-columns: minmax(0, 1fr); } }
.chart-data { margin-top: 10px; }
.chart-data summary { display: inline-flex; align-items: center; min-height: var(--hit); color: var(--blue-ink); cursor: pointer; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel-head > div:first-child { flex: 1; min-width: 220px; }
.besttimes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.besttimes li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); }
.besttimes .rank { grid-row: span 2; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 600; }
.besttimes li > span:last-child { color: var(--muted); font-size: 13px; }
.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.heat-legend i { width: 18px; height: 12px; border-radius: 3px; }
.heat-legend i.none { background: var(--grey-soft); margin-left: 12px; }
.heat-legend span { margin: 0 4px; }

/* competencia */
.rivals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 12px; }
.rival { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-m); display: flex; flex-direction: column; gap: 10px; }
.rival > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rival h3 { margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rival-do { display: flex; flex: none; }
.rival-stats { display: grid; gap: 6px; margin: 0; }
.rival-stats > div { display: flex; justify-content: space-between; gap: 10px; }
.rival-stats dt { color: var(--muted); font-size: 13px; }
.rival-stats dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rival-stats small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.rival-stats small.up { color: var(--green); }
.rival-stats small.down { color: var(--red); }
.rival summary { display: inline-flex; align-items: center; min-height: var(--hit); color: var(--blue-ink); cursor: pointer; }
.rival-posts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.rival-posts li { overflow-wrap: anywhere; }
.rival-posts small { display: block; color: var(--muted); font-size: 12px; }
.rival-posts a { color: var(--blue-ink); }
.inline-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-add .field { flex: 1; min-width: 220px; margin-bottom: 0; }
