/* ===== Caprilele — sistema de diseño ===== */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap');

:root {
  --bg: #eceae4;          /* gris cálido de fondo */
  --panel: #ffffff;        /* tarjetas */
  --panel-2: #f6f5f1;      /* tarjetas secundarias / inputs */
  --ink: #1b1a18;          /* texto principal */
  --muted: #8d8a82;        /* texto secundario */
  --line: #e7e4dc;         /* bordes suaves */
  --accent: #ff7f00;       /* naranja Caprilele */
  --accent-ink: #ffffff;
  --accent-soft: #fff2e3;  /* naranja muy claro */
  --accent-soft-2: #ffe7cc;
  --ok: #2bb673;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(27,26,24,.04), 0 10px 30px rgba(27,26,24,.06);
  --shadow-sm: 0 1px 2px rgba(27,26,24,.05), 0 4px 14px rgba(27,26,24,.05);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
img { display: block; }

/* ---- utilidades ---- */
.btn {
  border: 0; border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #efede8; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { background: var(--panel-2); }

/* ===== LOGIN ===== */
.auth {
  min-height: 100%; display: grid; grid-template-columns: 1.05fr 1fr; padding: 18px; gap: 18px;
}
.auth__brandpane {
  background: linear-gradient(150deg, #ff7f00, #ff9f3a 60%, #ffb866);
  border-radius: 28px; position: relative; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 44px;
}
.auth__brandpane::after {
  content: ''; position: absolute; right: -80px; bottom: -80px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%);
}
.auth__logo-ico { width: 56px; height: 56px; }
.auth__tagline { font-size: 40px; font-weight: 900; line-height: 1.05; letter-spacing: -.5px; max-width: 12ch; }
.auth__sub { font-size: 16px; font-weight: 400; opacity: .92; margin-top: 14px; max-width: 34ch; }
.auth__dots { display: flex; gap: 10px; }
.auth__dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.45); }
.auth__dots span:first-child { background: #fff; width: 26px; border-radius: 999px; }

.auth__formpane { display: grid; place-items: center; }
.auth__card { width: min(380px, 92%); }
.auth__card h1 { font-size: 26px; font-weight: 900; margin: 0 0 4px; letter-spacing: -.3px; }
.auth__card p.lead { color: var(--muted); margin: 0 0 26px; font-size: 15px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: #5a584f; }
.field input {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel-2); font-size: 15px; font-family: inherit; color: var(--ink); transition: .15s;
}
.field input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.auth__card .btn-primary { width: 100%; justify-content: center; margin-top: 8px; }
.auth__foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 13px; }
.auth__foot a { color: var(--accent); text-decoration: none; font-weight: 700; }

/* ===== APP SHELL ===== */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
}
.topbar__logo { height: 26px; }
.topbar__search {
  flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px;
  color: var(--muted); font-size: 14px; box-shadow: var(--shadow-sm);
}
.topbar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 900; font-size: 15px;
}

.workspace { flex: 1; display: flex; gap: 16px; padding: 0 16px 16px; min-height: 0; }

/* ---- Sidebar biblioteca ---- */
.library {
  width: 290px; flex-shrink: 0; background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.library__head { padding: 18px 18px 12px; display: flex; align-items: center; justify-content: space-between; }
.library__head h2 { font-size: 15px; font-weight: 900; margin: 0; }
.chips { display: flex; gap: 7px; padding: 0 18px 14px; flex-wrap: wrap; }
.chip {
  font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: var(--panel-2); color: #5a584f; border: 1px solid transparent; cursor: pointer; transition: .12s;
}
.chip.active { background: var(--ink); color: #fff; }
.library__list { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.lib-item {
  display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 14px; cursor: pointer; transition: .12s;
}
.lib-item:hover { background: var(--panel-2); }
.lib-item.active { background: var(--accent-soft); }
.lib-item__ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--panel-2); font-size: 18px; overflow: hidden;
}
.lib-item.active .lib-item__ico { background: #fff; }
.lib-item__tx { min-width: 0; }
.lib-item__tx b { font-size: 14px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-item__tx span { font-size: 12px; color: var(--muted); }
.library__divider { height: 1px; background: var(--line); margin: 8px 16px; }
.library__foot { padding: 6px 10px 12px; }

/* ---- Main / workspace ---- */
.main {
  flex: 1; min-width: 0; background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-y: auto;
}
.main__inner { padding: 28px 32px 40px; max-width: 1180px; margin: 0 auto; }
.main__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.main__head h1 { font-size: 28px; font-weight: 900; margin: 0; letter-spacing: -.4px; }
.main__head p { color: var(--muted); margin: 5px 0 0; font-size: 15px; }
.brand-pill {
  display: inline-flex; align-items: center; gap: 8px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px 7px 8px; font-weight: 700; font-size: 13px;
}
.brand-pill .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); }

/* stepper */
.stepper { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 9px; padding: 9px 15px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--muted);
}
.step b { width: 22px; height: 22px; border-radius: 50%; background: #dedbd2; color: #fff; display: grid; place-items: center; font-size: 12px; }
.step.done { color: var(--ink); } .step.done b { background: var(--ok); }
.step.active { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); } .step.active b { background: var(--accent); }

/* setup card */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.card__t { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 14px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 920px) { .setup-grid { grid-template-columns: 1fr; } }

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.group-card {
  border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer; transition: .13s; background: var(--panel); position: relative;
}
.group-card:hover { border-color: var(--accent-soft-2); }
.group-card.on { border-color: var(--accent); background: var(--accent-soft); }
.group-card h4 { margin: 0 0 3px; font-size: 14.5px; font-weight: 800; }
.group-card span { font-size: 12px; color: var(--muted); }
.group-card .check { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.group-card.on .check { background: var(--accent); border-color: var(--accent); }
.group-card.on .check::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 900; }

/* dropzone */
.drop {
  border: 1.5px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; color: var(--muted);
  cursor: pointer; transition: .13s; background: var(--panel-2); font-size: 14px;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.drop b { color: var(--ink); display: block; margin-bottom: 2px; font-size: 14.5px; }
.drop.has { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }

.compose-bar { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.compose-bar .hint { color: var(--muted); font-size: 13px; }

/* results */
.results-group { margin-top: 26px; }
.results-group__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results-group__head h3 { margin: 0; font-size: 18px; font-weight: 900; }
.results-group__head .count { color: var(--muted); font-weight: 700; font-size: 13px; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.res-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); transition: .15s; }
.res-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.res-card__img { background: repeating-conic-gradient(#f0eee9 0 25%, #e9e7e1 0 50%) 0/18px 18px; display: grid; place-items: center; aspect-ratio: 1/1; overflow: hidden; }
.res-card__img img { width: 100%; height: 100%; object-fit: contain; }
.res-card.skeleton .res-card__img { position: relative; }
.res-card.skeleton .res-card__img::after { content:''; position:absolute; inset:0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: sheen 1.1s infinite; }
@keyframes sheen { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
.res-card__meta { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.res-card__meta b { font-size: 13px; font-weight: 800; } .res-card__meta small { color: var(--muted); font-size: 11.5px; display: block; }
.res-card__acts { display: flex; gap: 6px; }
.mini { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; cursor: pointer; transition: .12s; }
.mini:hover { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.res-card.err .res-card__img { color: #c0392b; font-size: 12px; padding: 14px; text-align: center; }

/* regen popover */
.regen { border-top: 1px solid var(--line); padding: 11px 13px; display: none; flex-direction: column; gap: 8px; }
.res-card.show-regen .regen { display: flex; }
.regen input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; font-family: inherit; }
.regen input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.regen button { width: 100%; justify-content: center; }
.regen .hint2 { font-size: 11px; color: var(--muted); }

/* tarjeta "nuevo grupo" */
.group-card.add { border-style: dashed; display: grid; place-items: center; min-height: 72px; color: var(--muted); font-weight: 800; cursor: pointer; }
.group-card.add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.group-card .edit-ico { position: absolute; top: 9px; right: 9px; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; opacity: 0; transition: .12s; }
.group-card:hover .edit-ico { opacity: 1; background: rgba(0,0,0,.05); }
.group-card .edit-ico:hover { background: var(--accent-soft); }

/* modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(27,26,24,.42); display: grid; place-items: center; z-index: 60; backdrop-filter: blur(2px); }
.modal { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); width: min(460px, 92%); max-height: 86vh; overflow-y: auto; padding: 24px; }
.modal h3 { margin: 0 0 4px; font-size: 20px; font-weight: 900; }
.modal p.sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.modal__row { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.modal__row input { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 13px; font-family: inherit; background: var(--panel-2); }
.modal__row input:focus { outline: none; border-color: var(--accent); background: #fff; }
.size-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; font-size: 13px; }
.size-row b { flex: 1; font-weight: 700; } .size-row .del { cursor: pointer; color: var(--muted); } .size-row .del:hover { color: #c0392b; }
.modal__foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; } /* con wrap: si los botones no caben en una fila bajan a otra, nunca quedan por fuera */
.modal__x { position: sticky; top: 0; float: right; z-index: 2; width: 32px; height: 32px; margin: -8px -8px 4px 10px; padding: 0; border: 0; border-radius: 50%; background: var(--panel-2); color: var(--muted); font-family: inherit; font-size: 24px; font-weight: 400; line-height: 30px; text-align: center; cursor: pointer; }
.modal__x:hover { background: var(--line); color: var(--ink); }

.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .big { width: 64px; height: 64px; margin: 0 auto 16px; opacity: .5; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow); transition: .25s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.title-row { display: flex; align-items: center; gap: 8px; }
.camp-title { outline: none; border-bottom: 2px dashed transparent; transition: .15s; display: inline-block; }
.camp-title:hover { border-color: var(--line); }
.camp-title:focus { border-color: var(--accent); border-style: solid; }
.title-edit { color: var(--muted); cursor: pointer; font-size: 18px; opacity: .6; transition: .12s; }
.title-edit:hover { opacity: 1; color: var(--accent); }
.group-hint { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }

/* biblioteca: editar/añadir grupos */
.lib-group { position: relative; }
.lib-edit { opacity: 0; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: .12s; flex-shrink: 0; }
.lib-group:hover .lib-edit { opacity: 1; }
.lib-edit:hover { background: var(--accent-soft); color: var(--accent); }
.lib-add .lib-item__ico { background: var(--accent-soft); color: var(--accent); font-weight: 900; }
.lib-muted { font-size: 12.5px; color: var(--muted); padding: 6px 12px 10px; }
.lib-camp { position: relative; }
.lib-del { opacity: 0; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; transition: .12s; flex-shrink: 0; cursor: pointer; }
.lib-camp:hover .lib-del { opacity: .8; }
.lib-del:hover { background: #fdecec; opacity: 1 !important; }

/* tabs por foto */
.set-tabs { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.set-tab { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 700; color: #5a584f; cursor: pointer; transition: .12s; }
.set-tab:hover { background: #efede8; }
.set-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* regenerar todo */
.regenall { margin-top: 30px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.regenall__in { display: flex; gap: 10px; }
.regenall__in input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-family: inherit; background: #fff; }
.regenall__in input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.regenall__hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.lib-sec { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 6px; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 6px; }
.pm-q { font-weight: 800; font-size: 13px; margin: 12px 0 8px; }
.pm-opts { display: flex; gap: 8px; }
.pm-opt { flex: 1; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; transition: .12s; }
.pm-opt:hover { border-color: var(--accent-soft-2); }
.pm-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.pm-opt b { display: block; font-size: 13px; } .pm-opt span { font-size: 11.5px; color: var(--muted); }
.set-title { font-size: 17px; font-weight: 900; margin: 28px 0 2px; display: flex; align-items: center; gap: 10px; }
.set-title .thumb { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); }
.set-title .tag { font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }

.hidden { display: none !important; }


/* ===== v2: bloques, CTA, configuración ===== */
.sel, .field select, .field textarea { width:100%; padding:13px 14px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--panel-2); font:inherit; color:var(--ink); outline:none; }
.field textarea { resize:vertical; line-height:1.45; }
.sel:focus, .field textarea:focus { border-color:var(--accent); background:#fff; }
.modal .sel { padding:10px 12px; }
.chk { display:flex; align-items:center; gap:8px; font-size:14px; cursor:pointer; }
.chk input { width:16px; height:16px; accent-color:var(--accent); }
.muted, .mutedline { color:var(--muted); font-size:13px; }
.okline { color:var(--ok); font-weight:700; font-size:13px; }
.badline { color:#c0392b; font-weight:700; font-size:13px; }
.warnline { color:#a85b00; font-size:13px; margin-top:6px; line-height:1.4; }
.warnline a, .inspect a { color:var(--accent); }

.inspect { margin-top:12px; padding:14px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--panel-2); font-size:13px; }
.inspect.err { color:#c0392b; font-weight:700; }
.inspect__t { font-weight:900; font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin-bottom:10px; }
.inspect .ab { display:flex; gap:12px; align-items:center; margin-bottom:10px; }
.inspect .ab img { width:64px; height:64px; object-fit:contain; background:#fff; border:1px solid var(--line); border-radius:10px; }
.chipsline { display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
.rchip { padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:700; background:#fff; border:1px solid var(--line); }
.rchip.r-logo { background:#e8f1ff; border-color:#cfe0ff; } .rchip.r-message { background:var(--accent-soft); border-color:var(--accent-soft-2); }
.rchip.r-legal { background:#eef6ee; border-color:#d6ebd6; } .rchip.r-cta { background:#f3e9ff; border-color:#e2d1fb; } .rchip.r-bg { color:var(--muted); font-weight:400; }
.fontline { margin-top:6px; } .fontline .ok { color:var(--ok); font-weight:700; margin-right:8px; } .fontline .bad { color:#c0392b; font-weight:700; margin-right:8px; }

.thumb-x { position:relative; display:inline-block; } .thumb-x i { position:absolute; top:-5px; right:-3px; width:17px; height:17px; border-radius:50%; background:var(--ink); color:#fff; font-size:10px; font-style:normal; display:grid; place-items:center; cursor:pointer; }
.cta-tag { display:inline-block; margin-top:6px; padding:2px 8px; border-radius:999px; background:var(--accent-soft); color:#a85b00 !important; font-size:11.5px !important; font-weight:700; }
.cta-box { margin:12px 0 4px; padding:14px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--panel-2); }
.cta-box .modal__row { margin-top:10px; margin-bottom:0; }
.ztag { margin-left:auto; margin-right:10px; font-size:11.5px; color:var(--muted); }
.size-row .del { margin-left:0; }

.dir-note { font-size:13px; color:#5c5a54; margin:-4px 0 12px; line-height:1.45; } .dir-note:empty { display:none; }
.res-note { font-size:12.5px; line-height:1.45; padding:9px 12px; margin:0 10px 10px; background:var(--accent-soft); border-radius:10px; color:#5c3a00; }
.warn-dot { color:#d98200; cursor:help; font-size:13px; }
.res-card__meta small { display:block; color:var(--muted); font-size:11.5px; }
.checker { background-image:linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%); background-size:16px 16px; background-position:0 0,0 8px,8px -8px,-8px 0; background-color:#f4f4f4; }
.results-toolbar .cost { margin-left:auto; margin-right:12px; font-size:13px; color:var(--muted); font-weight:700; }

.set-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; } @media (max-width:900px){ .set-grid { grid-template-columns:1fr; } }
.card .field { margin-bottom:14px; } .card .field label { display:block; font-size:13px; font-weight:700; margin-bottom:6px; }
.card .field input { width:100%; padding:13px 14px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--panel-2); font:inherit; outline:none; }
.card .field input:focus { border-color:var(--accent); background:#fff; }
.logo-row { display:flex; gap:12px; align-items:center; } .logo-prev { width:120px; height:52px; border:1px dashed var(--line); border-radius:12px; display:grid; place-items:center; background:#111; color:#888; font-size:12px; overflow:hidden; } .logo-prev img { max-width:86%; max-height:76%; }
.fontlist { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; } .fchip { padding:6px 12px; border-radius:999px; background:var(--panel-2); border:1px solid var(--line); font-size:13px; } .fchip i { font-style:normal; cursor:pointer; color:var(--muted); margin-left:6px; }
.usage { margin-top:14px; padding:12px 14px; background:var(--panel-2); border-radius:var(--radius-sm); font-size:13.5px; }
.prod-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:10px; margin-top:14px; } .prod { font-size:12px; line-height:1.3; } .prod img, .prod .noimg { width:100%; aspect-ratio:1; object-fit:cover; border-radius:12px; background:var(--panel-2); border:1px solid var(--line); display:grid; place-items:center; color:var(--muted); } .prod span { display:block; margin-top:5px; }

.ai-status { padding:14px 16px; border-radius:var(--radius-sm); margin-bottom:14px; border:1px solid var(--line); background:var(--panel-2); }
.ai-status b { display:block; font-size:15px; } .ai-status span { font-size:13px; color:var(--muted); }
.ai-status.on { background:#eef8f1; border-color:#cfe9d8; } .ai-status.on b { color:#1e8a55; }
.ai-status.off { background:var(--accent-soft); border-color:var(--accent-soft-2); } .ai-status.off b { color:#a85b00; }
.adv { margin-top:16px; font-size:13.5px; } .adv summary { cursor:pointer; color:var(--muted); font-weight:700; }

/* ---- canales de la marca ---- */
.ch-stats { display:flex; gap:8px; flex-wrap:wrap; margin:-8px 0 18px; }
.ch-stats span { background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:6px 14px; font-size:13px; font-weight:700; }
.ch-rules { display:flex; gap:22px; flex-wrap:wrap; align-items:center; }
.ch-num { display:flex; align-items:center; gap:8px; font-size:14px; }
.ch-num input { width:78px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); font:inherit; }
.ch-num input:disabled { opacity:.45; }
.pgroup { font-size:14px; font-weight:900; margin:16px 0 8px; } .pgroup span { font-weight:400; color:var(--muted); font-size:12.5px; margin-left:6px; }
.prow { display:grid; grid-template-columns:92px minmax(0,1.25fr) minmax(0,1fr) minmax(0,1.35fr) 78px; gap:12px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:12px; margin-bottom:6px; font-size:13px; }
.prow--head { border:0; padding:0 12px; margin-bottom:2px; font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.prow--mail { grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1.4fr) auto; }
.prow b { font-weight:700; overflow-wrap:anywhere; }
.pcell { display:flex; flex-wrap:wrap; gap:5px; }
.pextra { color:#5a584f; line-height:1.5; }
.pacts { display:flex; gap:12px; justify-content:flex-end; color:var(--muted); font-size:15px; } .pacts span { cursor:pointer; } .pacts span:hover { color:var(--accent); }
.fmt, .tagx, .slot { padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:700; border:1px solid var(--line); background:#fff; white-space:nowrap; }
.tagx { color:var(--muted); } .slot { background:var(--accent-soft); border-color:var(--accent-soft-2); }
.need { display:grid; grid-template-columns:92px minmax(0,1fr); gap:12px; padding:10px 0; border-top:1px solid var(--line); font-size:13.5px; } .need:first-of-type { border-top:0; padding-top:0; }
.need > div { display:flex; flex-wrap:wrap; gap:5px; align-items:center; } .needline { width:100%; } .needline a, .prow a { color:var(--accent); font-weight:700; text-decoration:none; margin-left:6px; }
.modal--wide { width:min(680px, 94%); }
.msec { font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:16px 0 8px; }
.vrow { display:grid; grid-template-columns:minmax(0,1fr) 96px 96px 22px; gap:8px; align-items:center; margin-bottom:10px; }
.vrow input { border:1px solid var(--line); border-radius:10px; padding:9px 11px; font-size:13px; font-family:inherit; background:var(--panel-2); min-width:0; } .vrow input:disabled { opacity:.4; }
.vrow .vfotos { grid-column:1 / -1; } .vrow .del { cursor:pointer; color:var(--muted); text-align:center; } .vrow .del:hover { color:#c0392b; }
.modal .field input { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); font:inherit; }
@media (max-width:900px){ .prow { grid-template-columns:1fr 1fr; } .prow--head { display:none; } }

/* ---- campañas por canales ---- */
.mode-tabs { display:inline-flex; background:var(--panel-2); border:1px solid var(--line); border-radius:999px; padding:4px; margin-bottom:14px; }
.mode-tabs button { border:0; background:transparent; padding:8px 16px; border-radius:999px; font-size:13.5px; font-weight:700; color:#5a584f; }
.mode-tabs button.on { background:var(--ink); color:#fff; }
.group-card.off { opacity:.5; cursor:default; }
.needsbox { margin-top:20px; padding-top:18px; border-top:1px solid var(--line); }
.needs__h { font-size:13px; font-weight:700; margin:4px 0 10px; color:#5a584f; } .needs__h a { color:var(--accent); font-weight:700; text-decoration:none; margin-left:10px; }
.slotgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:10px; margin-bottom:12px; }
.slotcell { display:flex; gap:10px; align-items:center; border:1px solid var(--line); border-radius:14px; padding:8px; background:#fff; }
.slotcell.empty { border-style:dashed; }
.slotcell__img { width:52px; height:64px; border-radius:9px; background:var(--panel-2); display:grid; place-items:center; color:var(--muted); overflow:hidden; flex:none; }
.slotcell__img img { width:100%; height:100%; object-fit:cover; }
.slotcell__tx { min-width:0; flex:1; } .slotcell__tx b { display:block; font-size:13px; margin-bottom:4px; }
.slotcell__tx select { width:100%; border:1px solid var(--line); border-radius:8px; padding:5px 6px; font:inherit; font-size:12px; background:var(--panel-2); }
.progress { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-sm); padding:14px 16px; margin-bottom:18px; }
.progress__bar { height:8px; background:var(--panel-2); border-radius:999px; overflow:hidden; } .progress__bar i { display:block; height:100%; background:var(--accent); transition:width .4s; }
.progress__tx { margin-top:8px; font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .progress__tx b { color:var(--ink); margin-right:8px; }
.res-card.pending .res-card__img { min-height:150px; display:grid; place-items:center; } .pend { color:var(--muted); font-size:13px; }
.res-card__img video { width:100%; height:100%; object-fit:contain; display:block; } .res-card__img { position:relative; }
.vtag { position:absolute; left:8px; bottom:8px; background:rgba(27,26,24,.72); color:#fff; font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px; }
a.mini { text-decoration:none; color:inherit; }


/* ===== Tamaño de vista de las piezas ===== */
.main__inner.wide { max-width: 1560px; }
.viewbar { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; font-size: 13px; color: var(--muted); font-weight: 700; }
.viewbar span { margin-right: 6px; }
.viewbar button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; font: inherit; font-weight: 700; color: var(--ink, #222); cursor: pointer; }
.viewbar button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
#results.sz-m .results { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
#results.sz-g .results { grid-template-columns: repeat(auto-fill, minmax(470px, 1fr)); }
#results.sz-f .results { grid-template-columns: 1fr; }
#results.sz-m .res-card__img, #results.sz-g .res-card__img, #results.sz-f .res-card__img { aspect-ratio: var(--ar, 1); }
#results.sz-f .res-card__img { max-height: 84vh; }
#results.sz-m .res-card__img video, #results.sz-g .res-card__img video, #results.sz-f .res-card__img video { width: 100%; height: 100%; object-fit: contain; }

/* ===== Editor en lienzo ===== */
.modal.modal--editor { width: min(1500px, 97vw); max-width: none; max-height: 96vh; padding: 20px 22px; display: flex; flex-direction: column; }
.ed-load { display: grid; place-items: center; gap: 14px; padding: 70px 20px; color: var(--muted); font-weight: 700; }
.ed-load .spin { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: edspin .8s linear infinite; }
@keyframes edspin { to { transform: rotate(360deg); } }
.ed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ed-head h3 { margin: 0; } .ed-head .sub { margin: 4px 0 0; }
.ed-zoom { font-size: 12px; font-weight: 800; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 5px 11px; white-space: nowrap; }
.ed-body { display: flex; gap: 18px; margin-top: 14px; min-height: 0; flex: 1; }
.ed-wrap { flex: 1; min-width: 0; display: grid; place-items: center; background: repeating-conic-gradient(#f0eee9 0 25%, #e9e7e1 0 50%) 0/18px 18px; border-radius: 14px; padding: 16px; overflow: auto; }
.ed-stage { position: relative; flex: none; box-shadow: 0 8px 30px rgba(0,0,0,.18); user-select: none; touch-action: none; overflow: hidden; background: #fff; }
.ed-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.ed-b { position: absolute; background-image: var(--fg); background-repeat: no-repeat; cursor: move; outline: 1px dashed rgba(255,255,255,.55); outline-offset: 1px; }
.ed-b:hover { outline: 1.5px dashed #ff3d8b; }
.ed-b.on { outline: 2px solid #ff3d8b; z-index: 5; }
.ed-h { display: none; position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid #ff3d8b; border-radius: 3px; }
.ed-b.on .ed-h { display: block; }
.ed-h[data-c="nw"] { left: -7px; top: -7px; cursor: nwse-resize; } .ed-h[data-c="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
.ed-h[data-c="ne"] { right: -7px; top: -7px; cursor: nesw-resize; } .ed-h[data-c="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.ed-guide { display: none; position: absolute; background: #ff3d8b; pointer-events: none; z-index: 9; }
.ed-guide.v { left: 50%; top: 0; bottom: 0; width: 1px; } .ed-guide.h { top: 50%; left: 0; right: 0; height: 1px; }
.ed-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.ed-side__t { font-size: 11px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.ed-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14px; margin-bottom: 6px; }
.ed-item span { font-size: 12px; color: var(--muted); font-weight: 700; }
.ed-item.on { border-color: #ff3d8b; background: #fff3f8; }
.ed-row { display: flex; gap: 8px; } .ed-row .btn { flex: 1; padding: 8px 10px; font-size: 13px; }
.ed-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ed-ask { margin-right: auto; display: flex; flex-direction: column; gap: 2px; max-width: 520px; }
.ed-ask b { font-size: 15px; } .ed-ask span { font-size: 12.5px; color: var(--muted); }
.ed-foot:has(.ed-ask) .ed-ask { flex-basis: 100%; max-width: none; margin-bottom: 4px; }

/* ===== Navegación por módulos ===== */
.modnav { display: flex; gap: 4px; margin-left: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.modnav button { border: 0; background: transparent; font: inherit; font-weight: 800; font-size: 14px; color: var(--muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.modnav button:hover { color: var(--ink); }
.modnav button.on { background: var(--ink); color: #fff; }
.modnav button i { font-style: normal; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 7px; margin-left: 4px; }
.brand-sel { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 800; color: var(--ink); max-width: 200px; cursor: pointer; }
.library.hidden { display: none; }
@media (max-width: 1100px) { .modnav { margin-left: 10px; overflow-x: auto; } .modnav button { padding: 8px 11px; font-size: 13px; } }

/* ===== Configuración: pestañas, marcas y usuarios ===== */
.set-tabs2 { display: flex; gap: 6px; margin: -4px 0 20px; border-bottom: 1px solid var(--line); }
.set-tabs2 button { border: 0; background: transparent; font: inherit; font-weight: 800; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.set-tabs2 button.on { color: var(--ink); border-bottom-color: var(--accent); }
.brandgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.brandcard { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.brandcard.on { border-color: var(--accent); background: var(--accent-soft); }
.brandcard__logo { width: 46px; height: 46px; border-radius: 12px; background: #111; color: #fff; display: grid; place-items: center; font-weight: 900; text-transform: lowercase; flex: none; overflow: hidden; }
.brandcard__logo img { width: 70%; height: 70%; object-fit: contain; }
.brandcard__tx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .brandcard__tx b { font-size: 15px; } .brandcard__tx span { font-size: 12.5px; color: var(--muted); }
.pilltag { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.utable { width: 100%; border-collapse: collapse; font-size: 14px; }
.utable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.utable td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; } .utable td small { display: block; color: var(--muted); font-size: 12px; }
.sel--sm { padding: 6px 10px; font-size: 13px; width: auto; } .btn--sm { padding: 6px 12px; font-size: 13px; }
.chkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 7px; font-size: 14px; line-height: 1.45; }
.rolegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.rolegrid div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; } .rolegrid span { font-size: 12.5px; color: var(--muted); }

/* ===== Videos de catálogo ===== */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 14px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.vcard__media { aspect-ratio: 9/16; background: #111; display: grid; place-items: center; color: #bbb; }
.vcard__media video { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.vcard__media .ed-load { color: #ddd; }
.vcard__tx { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; } .vcard__tx b { font-size: 15px; } .vcard__tx span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.vcard__acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }

/* ===== Audio de video ===== */
.audcard__grid { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.audcard__video { width: 100%; max-height: 420px; border-radius: 12px; background: #111; }
.audcard__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.audcard__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; } .audcard__head small { display: block; color: var(--muted); font-size: 12.5px; }
.audcard__acts { display: flex; gap: 10px; flex-wrap: wrap; }
.okline, .warnline, .badline { font-size: 13.5px; }
.audbox { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; } .audbox span { color: var(--muted); line-height: 1.45; }
.audbox__btns { display: flex; gap: 6px; flex-wrap: wrap; } .audbox__btns .btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.audout { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; } .audout span { color: var(--muted); font-size: 12.5px; margin-right: auto; }
.audprev { width: 200px; border-radius: 10px; background: #111; }
.audlib { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.audlib__col { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.track { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.track__tx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .track__tx b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .track__tx span { font-size: 12px; color: var(--muted); }
.track audio { height: 32px; width: 220px; flex: none; }
@media (max-width: 900px) { .audcard__grid, .audlib { grid-template-columns: 1fr; } .track { flex-wrap: wrap; } }
.field label.chk { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; color: var(--ink); margin: 4px 0; }
.field label.chk input { width: auto; flex: none; }

.audbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 14px; }
.audbar span { margin-right: auto; }

/* ===== Catálogo ===== */
.catbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.chips--sub { margin-top: 8px; } .chips__t { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); align-self: center; margin-right: 4px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pcard { background: var(--panel); border: 2px solid transparent; border-radius: 16px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: .12s; }
.pcard:hover { transform: translateY(-2px); } .pcard.on { border-color: var(--accent); } .pcard.out { opacity: .55; }
.pcard__img { position: relative; aspect-ratio: 2/3; background: #eee; } .pcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard__chk { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.9); border: 2px solid var(--line); display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #fff; }
.pcard.on .pcard__chk { background: var(--accent); border-color: var(--accent); }
.pcard__tag { position: absolute; left: 8px; bottom: 8px; background: #111; color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 9px; }
.pcard__tx { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 2px; } .pcard__tx b { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .pcard__tx span { font-size: 12px; color: var(--muted); }
.selbar { position: sticky; bottom: 10px; margin-top: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); z-index: 5; }
.selbar span { color: rgba(255,255,255,.7); font-size: 13px; margin-right: auto; }
.selbar__th { display: flex; } .selbar__th img { width: 34px; height: 46px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); margin-left: -8px; } .selbar__th img:first-child { margin-left: 0; }
.selbar--flat { position: static; background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: none; margin: 0 0 14px; } .selbar--flat span { color: var(--muted); } .selbar--flat .selbar__th img { border-color: var(--panel); }
.ccamps { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.ccamp { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 8px 12px 8px 8px; cursor: pointer; flex: none; max-width: 300px; }
.ccamp__img { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; flex: none; } .ccamp__img img { width: 100%; height: 100%; object-fit: cover; }
.ccamp b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; } .ccamp span { font-size: 12px; color: var(--muted); }
.chkgrid--2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.ed-busy { position: absolute; inset: 0; background: rgba(255,255,255,.45); display: grid; place-items: center; z-index: 20; }
.ed-busy .spin { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(0,0,0,.15); border-top-color: var(--accent); animation: edspin .8s linear infinite; }
.ed-stage { cursor: grab; } .ed-b { cursor: move; }

/* ===== Brief e instrucciones ===== */
.briefcard { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.briefcard > div:first-child { flex: 1; min-width: 260px; }
.briefcard__acts { display: flex; gap: 10px; flex-wrap: wrap; }
.briefhead { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.briefnote { background: var(--panel-2); border-radius: 10px; padding: 9px 12px; font-size: 13px; white-space: pre-wrap; margin-top: 6px; line-height: 1.45; }
.briefnote b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 2px; }
.campnotes { padding: 14px 18px; margin-bottom: 8px; } .campnotes summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; } .campnotes summary span { font-size: 13px; color: var(--muted); }
.ed-busy[hidden] { display: none; }


/* ===== Armador de correos ===== */
.emgrid { display: grid; grid-template-columns: 230px minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.emcol, .emprev { position: sticky; top: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.emprev__img { max-height: 68vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; } .emprev__img img { width: 100%; display: block; }
.emform { min-width: 0; display: flex; flex-direction: column; }
.emsec { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.emsec__h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; } .emsec__h span { font-size: 12px; color: var(--muted); margin-right: auto; }
.emprods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.emprod { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; min-width: 0; }
.emprod img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; cursor: pointer; background: #eee; }
.emprod input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; background: var(--panel-2); min-width: 0; }
.emprod__a { display: flex; justify-content: space-between; font-weight: 700; }
.emprod--add { align-items: center; justify-content: center; min-height: 150px; border-style: dashed; color: var(--muted); cursor: pointer; font-size: 26px; } .emprod--add span { font-size: 12.5px; font-weight: 700; }
.pgrid--sm { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; } .pgrid--sm .pcard__tx b { font-size: 12px; }
@media (max-width: 1200px) { .emgrid { grid-template-columns: 1fr; } .emcol, .emprev { position: static; } }

/* ---- editor: varios elementos a la vez y deshacer ---- */
.ed-hist { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ed-hist .btn { padding: 6px 12px; font-size: 13px; } .ed-hist .btn:disabled { opacity: .4; cursor: default; }
.ed-side__t a { float: right; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--accent); text-decoration: none; }
.ed-item { gap: 8px; } .ed-item input[type=checkbox] { margin: 0; accent-color: #ff3d8b; flex: none; } .ed-item b { flex: 1; }
.ed-b.multi { outline-style: solid; outline-color: #ff3d8b; box-shadow: 0 0 0 4px rgba(255,61,139,.18); }
/* ---- campaña: lo que pide el brief por canal ---- */
.pide { font-size: 12px; font-weight: 800; color: #a85b00; background: #fff4e0; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.pide.ok { color: var(--ok); background: #e9f7ee; }
.utable details summary { cursor: pointer; color: var(--accent); font-size: 13px; }

/* ---- videos base de la campaña ---- */
.cvrow { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.cvrow video { width: 150px; height: 96px; object-fit: cover; border-radius: 10px; background: #111; flex: none; }
.cvrow__tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; } .cvrow__tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvrow__ch { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; } .cvrow .chk { margin: 0; }

/* ---- subcanales dentro de un canal (pauta por línea del brief) ---- */
.subcanal { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.subcanal:first-of-type { margin-top: 4px; } .subcanal h4 { margin: 0; font-size: 15px; font-weight: 800; } .subcanal span { font-size: 12px; color: var(--muted); font-weight: 700; }

/* grupos de fotos y videos, logos de aliados */
.grp-chips { display: flex; gap: 8px; flex-wrap: wrap; } .grp-chip { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; } .grp-chip b { margin-right: 4px; }
.grp-row { padding: 12px 0; border-top: 1px solid var(--line); } .grp-row__h { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.grp-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.grp-th { position: relative; width: 78px; height: 104px; border-radius: 9px; overflow: hidden; background: #111; flex: none; }
.grp-th img, .grp-th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.grp-th em { position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.7); color: #fff; border-radius: 5px; padding: 1px 6px; }
.grp-th i { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; line-height: 18px; text-align: center; font-style: normal; font-size: 11px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; opacity: 0; } .grp-th:hover i { opacity: 1; }
.ali-logo { width: 150px; height: 76px; border-radius: 10px; background: repeating-conic-gradient(#ececec 0% 25%, #fafafa 0% 50%) 50% / 16px 16px; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.ali-logo img { max-width: 84%; max-height: 74%; } .ali-logo span { font-size: 12px; color: var(--muted); }
.thumb-x .thumb-v { display: inline-flex; width: 44px; height: 44px; vertical-align: top; align-items: center; justify-content: center; background: #111; color: #fff; font-size: 10px; border-radius: inherit; }
.thumb-x em { position: absolute; left: 3px; bottom: 3px; font-style: normal; font-size: 9px; font-weight: 700; background: rgba(0,0,0,.7); color: #fff; border-radius: 4px; padding: 0 5px; }
