/* HPCI CRM.
   - Lo propio del diseno: el aro del avatar marca cuanto queda de las 24 horas de WhatsApp.
   - Relieve: los paneles flotan sobre el fondo y los botones se hunden al pulsarlos.
   - Tema: claro u oscuro a eleccion del usuario (data-theme en <html>); sin eleccion, el del sistema. */
:root {
  --bg: #eceaf0; --panel: #ffffff; --raised: #ffffff; --sunk: #f3f1f6; --ink: #1e1b22; --muted: #6f6a78;
  --line: #e4e1e8; --accent: #25d366; --accent-hi: #4fe38a; --accent-lo: #128c5e; --accent-ink: #06301a; --accent-soft: #dcf8e6;
  --out: #d9fdd3; --in: #ffffff; --hot: #d23a5a; --hot-soft: #fbe1e6; --hot-ink: #a3243f; --danger: #b3261e;
  --cool: #0e7a6c; --tick: #1c9bd8; --note: #fde6ea; --ok: #2f9e5b; --chat-dot: rgba(30, 27, 34, .055);
  --lift: 0 1px 2px rgba(30, 27, 34, .06), 0 10px 28px -12px rgba(30, 27, 34, .22);
  --lift-sm: 0 1px 1px rgba(30, 27, 34, .07), 0 5px 12px -7px rgba(30, 27, 34, .25);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .85);
  --inset: inset 0 1px 2px rgba(30, 27, 34, .09);
  --c-sent: #128c5e; --c-recv: #5d63a8;   /* series de los graficos, validadas contra el fondo claro */
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111015; --panel: #1c1a21; --raised: #27242e; --sunk: #15131a; --ink: #f1eff4; --muted: #a39eae;
    --line: #322e3b; --accent: #25d366; --accent-hi: #4fe38a; --accent-lo: #0e7a50; --accent-ink: #06301a; --accent-soft: #10392a;
    --out: #005c4b; --in: #2a2731; --hot: #f0607e; --hot-soft: #45202a; --hot-ink: #ff9db2; --danger: #ff8a7d;
    --cool: #5cd6b8; --tick: #53bdeb; --note: #40242b; --ok: #58c783; --chat-dot: rgba(241, 239, 244, .05);
    --lift: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -12px rgba(0, 0, 0, .7);
    --lift-sm: 0 1px 1px rgba(0, 0, 0, .4), 0 6px 14px -8px rgba(0, 0, 0, .7);
    --edge: inset 0 1px 0 rgba(255, 255, 255, .07);
    --inset: inset 0 1px 2px rgba(0, 0, 0, .45);
    --c-sent: #1fa855; --c-recv: #6f78d6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111015; --panel: #1c1a21; --raised: #27242e; --sunk: #15131a; --ink: #f1eff4; --muted: #a39eae;
  --line: #322e3b; --accent: #25d366; --accent-hi: #4fe38a; --accent-lo: #0e7a50; --accent-ink: #06301a; --accent-soft: #10392a;
  --out: #005c4b; --in: #2a2731; --hot: #f0607e; --hot-soft: #45202a; --hot-ink: #ff9db2; --danger: #ff8a7d;
  --cool: #5cd6b8; --tick: #53bdeb; --note: #40242b; --ok: #58c783; --chat-dot: rgba(241, 239, 244, .05);
  --lift: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -12px rgba(0, 0, 0, .7);
  --lift-sm: 0 1px 1px rgba(0, 0, 0, .4), 0 6px 14px -8px rgba(0, 0, 0, .7);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .07);
  --inset: inset 0 1px 2px rgba(0, 0, 0, .45);
  --c-sent: #1fa855; --c-recv: #6f78d6;   /* validadas contra el fondo oscuro */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; display: block; flex: none; }
input, select, textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--sunk); box-shadow: var(--inset); }
textarea { resize: none; }
:focus-visible { outline: 2px solid var(--cool); outline-offset: 2px; }
label { display: block; margin-bottom: 14px; }
label > span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
.num { font-variant-numeric: tabular-nums; }

/* Botones con relieve: borde inferior mas oscuro, se hunden al pulsar */
.btn { padding: 10px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); font-weight: 600;
  box-shadow: var(--edge), 0 2px 0 var(--line), var(--lift-sm); transition: translate .06s, box-shadow .06s; }
.btn.primary { border-color: var(--accent-lo); color: var(--accent-ink);
  background: linear-gradient(var(--accent-hi), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 3px 0 var(--accent-lo), var(--lift-sm); }
.btn:active:not(:disabled) { translate: 0 2px; box-shadow: var(--edge), 0 0 0 var(--line); }
.btn.primary:active:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 0 var(--accent-lo); }
.btn.wide { width: 100%; padding: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 2px 4px; color: var(--cool); font-weight: 600; border-radius: 6px; }
.link.quiet { color: var(--muted); font-weight: 500; }
.icon-btn { background: none; border: 0; padding: 9px; border-radius: 12px; color: var(--muted); }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.err { color: var(--danger); min-height: 1.3em; margin-bottom: 8px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }

/* Avatar y aro de tiempo */
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 600 14px/1 var(--body); font-style: normal; color: #fff; background-color: #6f6a78; letter-spacing: .01em;
  background-image: linear-gradient(155deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .14)); }
.a0 { background-color: #c2553c; } .a1 { background-color: #8a5a9c; } .a2 { background-color: #2f8a82; } .a3 { background-color: #b07a1f; }
.a4 { background-color: #b34a76; } .a5 { background-color: #5f7f3a; } .a6 { background-color: #cc7436; } .a7 { background-color: #5d63a8; }
.ring { --left: 0; --tone: var(--accent); flex: none; padding: 3px; border-radius: 50%;
  background: conic-gradient(var(--tone) calc(var(--left) * 360deg), var(--line) 0); }
.ring.late { --tone: var(--hot); }
.ring.shut { background: none; outline: 1.5px dashed var(--line); outline-offset: -1.5px; }
.ring > .av { box-shadow: 0 0 0 2px var(--panel); }
.ring.big { padding: 4px; }
.ring.big > .av { width: 76px; height: 76px; font-size: 25px; }

/* Acceso */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; padding: 14px; }
.auth-art { background: linear-gradient(160deg, #4fe38a, #25d366 70%); color: #06301a; border-radius: 28px; padding: clamp(28px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(0, 0, 0, .1), var(--lift); }
.mark { font: 700 22px/1 var(--display); letter-spacing: -.02em; display: flex; gap: 6px; }
.mark b { color: #fff; font-weight: 700; }
.mark.dark { display: none; color: var(--ink); }
.mark.dark b { color: var(--accent-lo); }
.auth-art h1 { font: 700 clamp(34px, 4.6vw, 60px)/1.02 var(--display); letter-spacing: -.035em; max-width: 11ch; }
.demo { display: grid; gap: 12px; max-width: 430px; }
.demo-row { display: flex; align-items: flex-end; gap: 10px; }
.demo-row.me { justify-content: flex-end; }
.demo .ring { --line: rgba(6, 48, 26, .18); --tone: #06301a; }
.demo .ring.late { --tone: #d23a5a; }
.demo .ring > .av { box-shadow: 0 0 0 2px #33d972; }
.d { padding: 11px 15px; border-radius: 18px; max-width: 30ch; font-size: 15px; box-shadow: 0 1px 1px rgba(30, 27, 34, .1), 0 10px 20px -10px rgba(30, 27, 34, .45); }
.d.in { background: #fff; border-bottom-left-radius: 5px; }
.d.out { background: #06301a; color: #fff; border-bottom-right-radius: 5px; }
.art-foot { font-size: 14px; max-width: 44ch; opacity: .78; }
.auth-form { align-self: center; justify-self: center; width: min(420px, 100%); padding: 36px 32px; background: var(--panel);
  border-radius: 28px; box-shadow: var(--edge), var(--lift); }
.auth-form h2 { font: 700 30px/1.1 var(--display); letter-spacing: -.02em; margin-bottom: 24px; }
.switch { margin-top: 18px; color: var(--muted); font-size: 14px; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }

/* Estructura: paneles flotantes */
.app { height: 100%; display: flex; gap: 12px; padding: 12px; }
.rail, .list, .chat, .side { background: var(--panel); border-radius: 24px; box-shadow: var(--edge), var(--lift); }
.rail { width: 68px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; }
.rail-mark { width: 42px; height: 42px; border-radius: 14px; color: #06301a; display: grid; place-items: center; font: 700 21px/1 var(--display);
  margin-bottom: 14px; background: linear-gradient(var(--accent-hi), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 3px 0 var(--accent-lo), var(--lift-sm); }
.rail-btn { position: relative; width: 46px; height: 46px; border: 0; border-radius: 14px; background: none; color: var(--muted); display: grid; place-items: center; }
.rail-btn:hover { color: var(--ink); background: var(--sunk); }
.rail-btn.on { color: var(--ink); background: var(--accent-soft); box-shadow: var(--inset); }
.rail-btn.txt { font-size: 12px; font-weight: 700; }
.rail-btn .dot { position: absolute; top: 9px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 2px var(--panel); }
.rail-gap { flex: 1; }
.me-av { width: 38px; height: 38px; font-size: 13px; margin-top: 6px; box-shadow: var(--lift-sm); }

.list { width: 352px; flex: none; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.list-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 20px 12px; }
.list-head h1 { font: 700 25px/1.1 var(--display); letter-spacing: -.02em; }
.org { color: var(--muted); font-size: 13px; margin-top: 2px; }
.live { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); margin-top: 9px; }
.live.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.search { position: relative; margin: 0 16px 12px; }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; color: var(--muted); }
.search input { padding-left: 38px; border-color: transparent; }
.tabs { display: flex; margin: 0 16px; padding: 4px; background: var(--sunk); border-radius: 14px; box-shadow: var(--inset); }
.tabs button { flex: 1; background: none; border: 0; padding: 7px 4px; color: var(--muted); font-weight: 500; border-radius: 11px;
  display: flex; justify-content: center; gap: 6px; font-size: 14px; }
.tabs button.on { color: var(--ink); background: var(--raised); font-weight: 600; box-shadow: var(--edge), var(--lift-sm); }
.tabs b { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 10px; }
.chips button { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); white-space: nowrap; flex: none; }
/* el filtro por etiqueta va en su propia fila para no apretar los botones */
.chips .tag-filter { flex: 1 1 100%; max-width: none; margin: 2px 0 0; border-radius: 12px; padding: 7px 10px; }
.chips button.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.chips b { font-weight: 600; font-variant-numeric: tabular-nums; }
.convs { list-style: none; overflow-y: auto; flex: 1; padding: 2px 10px 10px; }
.conv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px;
  border-radius: 18px; cursor: pointer; border: 1px solid transparent; }
.conv:hover { background: var(--sunk); }
.conv.on { background: var(--raised); border-color: var(--line); box-shadow: var(--edge), var(--lift-sm), inset 3px 0 0 var(--accent); }
.conv .ring { grid-row: span 2; }
.conv .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .n { font-weight: 700; }
.conv .t { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.conv .p { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .p { color: var(--ink); }
.conv .x { display: flex; justify-content: flex-end; align-items: center; gap: 6px; min-height: 20px; }
.badge { background: var(--hot); color: #fff; border-radius: 10px; font-size: 12px; font-weight: 700; padding: 1px 7px; min-width: 20px;
  text-align: center; box-shadow: 0 2px 5px -1px color-mix(in srgb, var(--hot) 60%, transparent); }
.mini { width: 20px; height: 20px; font-size: 9px; }
.empty { color: var(--muted); text-align: center; padding: 40px 24px; }

.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-empty { margin: auto; text-align: center; padding: 24px; display: grid; justify-items: center; gap: 12px; max-width: 420px; }
.chat-empty h2 { font: 700 26px/1.15 var(--display); letter-spacing: -.02em; }
.chat-empty p { color: var(--muted); }
.chat-empty .av svg { width: 30px; height: 30px; }
.chat-box { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who strong { font: 700 17px/1.2 var(--display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 13px; color: var(--muted); font-weight: 500; }
.who span.late { color: var(--hot-ink); }
.seg3 { display: flex; background: var(--sunk); border-radius: 14px; padding: 4px; box-shadow: var(--inset); }
.seg3 button { border: 0; background: none; padding: 6px 13px; border-radius: 11px; font-size: 13px; color: var(--muted); font-weight: 500; }
.seg3 button.on { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: var(--edge), var(--lift-sm); }
.back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 18px clamp(14px, 4vw, 48px); display: flex; flex-direction: column; gap: 4px;
  background: radial-gradient(var(--chat-dot) 1.2px, transparent 1.2px) 0 0 / 18px 18px, var(--sunk); box-shadow: var(--inset); }
.msg { max-width: min(76%, 560px); padding: 9px 13px 6px; border-radius: 18px; background: var(--in); white-space: pre-wrap;
  overflow-wrap: anywhere; box-shadow: var(--edge), var(--lift-sm); border-bottom-left-radius: 5px; }
.msg.out { align-self: flex-end; background: var(--out); border-radius: 18px; border-bottom-right-radius: 5px; }
.msg.gap { margin-top: 10px; }
.msg.failed { box-shadow: 0 0 0 1.5px var(--danger); }
.meta { display: flex; justify-content: flex-end; gap: 5px; margin-top: 2px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg.out .meta { color: color-mix(in srgb, var(--ink) 62%, transparent); }
.meta .tick { letter-spacing: -.25em; padding-right: .25em; }
.meta .tick.read { color: var(--tick); }
.meta .bad { color: var(--danger); }
.day { align-self: center; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--raised); border-radius: 999px;
  padding: 3px 12px; margin: 10px 0 6px; box-shadow: var(--edge), var(--lift-sm); }
.warn { padding: 10px 18px; background: var(--hot-soft); color: var(--hot-ink); font-size: 14px; font-weight: 500; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.composer textarea { max-height: 140px; border-radius: 22px; padding: 12px 17px; border-color: transparent; }
.send { width: 46px; height: 46px; border: 1px solid var(--accent-lo); border-radius: 50%; color: var(--accent-ink); display: grid; place-items: center; flex: none;
  background: linear-gradient(var(--accent-hi), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 3px 0 var(--accent-lo), var(--lift-sm);
  transition: translate .06s, box-shadow .06s; }
.send:active:not(:disabled) { translate: 0 2px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 0 var(--accent-lo); }
.send:disabled { opacity: .45; cursor: default; }

.side { width: 324px; flex: none; display: flex; flex-direction: column; min-height: 0; padding: 20px; gap: 12px; overflow-y: auto; position: relative; }
.side-close { position: absolute; top: 12px; right: 12px; }
.card-contact { display: grid; justify-items: center; gap: 6px; padding: 14px 0 4px; text-align: center; }
.card-contact h2 { font: 700 21px/1.15 var(--display); letter-spacing: -.02em; margin-top: 6px; }
.card-contact p { color: var(--muted); }
.card-contact .av { box-shadow: 0 0 0 2px var(--panel), var(--lift-sm); }
.facts { display: grid; gap: 10px; padding: 14px; background: var(--sunk); border-radius: 18px; box-shadow: var(--inset); }
.facts div { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 8px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { font-weight: 500; }
.facts select { padding: 7px 9px; background: var(--raised); box-shadow: var(--lift-sm); }
.side h3 { font: 700 16px/1.2 var(--display); margin-top: 4px; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.note { background: var(--note); border-radius: 16px; padding: 10px 13px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--lift-sm); }
.note small { display: block; color: var(--muted); margin-top: 4px; }
.note-form { display: grid; gap: 10px; }

/* Etiquetas */
.tagchip { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--raised);
  border-radius: 999px; padding: 3px 10px 3px 8px; font-size: 13px; font-weight: 500; color: var(--ink); }
.tagchip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
button.tagchip { box-shadow: var(--lift-sm); }
button.tagchip:not(.on) { color: var(--muted); box-shadow: none; background: none; }
button.tagchip:not(.on)::before { opacity: .45; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-form { display: grid; grid-template-columns: minmax(0, 1fr) 44px auto; gap: 8px; align-items: center; }
.tag-form input[type="color"] { padding: 4px; height: 42px; }
.tag-form .btn { padding: 9px 12px; }
.tag-filter { width: auto; max-width: 220px; padding: 4px 10px; border-radius: 999px; font-size: 13px; margin-left: auto; }
.cfields label { margin-bottom: 10px; }
.cfields input, .facts input { padding: 8px 10px; }
.conv .tags { grid-column: 2 / -1; display: flex; gap: 4px; flex-wrap: wrap; }
.conv .tags .tagchip { font-size: 11px; padding: 1px 7px 1px 6px; }
.conv .tags .tagchip::before { width: 7px; height: 7px; }

/* Vistas de pagina completa: contactos y embudo */
.page { flex: 1; min-width: 0; background: var(--panel); border-radius: 24px; box-shadow: var(--edge), var(--lift); display: flex;
  flex-direction: column; overflow: hidden; }
.page-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px 14px; flex-wrap: wrap; }
.page-head h1 { font: 700 25px/1.1 var(--display); letter-spacing: -.02em; margin-right: auto; }
.page-head .search { margin: 0; width: min(380px, 100%); }
.page-head .tag-filter { margin: 0; padding: 9px 12px; border-radius: 14px; }
.app.view-contacts .list, .app.view-contacts .chat, .app.view-contacts .side,
.app.view-pipeline .list, .app.view-pipeline .chat, .app.view-pipeline .side,
.app.view-reports .list, .app.view-reports .chat, .app.view-reports .side,
.app.view-campaigns .list, .app.view-campaigns .chat, .app.view-campaigns .side,
.app.view-admin .list, .app.view-admin .chat, .app.view-admin .side { display: none; }
.ctable { overflow-y: auto; flex: 1; padding: 0 14px 14px; }
.crow { display: grid; grid-template-columns: 44px minmax(140px, 1.3fr) minmax(120px, 1fr) minmax(120px, 1.4fr) 110px; gap: 14px; align-items: center;
  padding: 10px 12px; border-radius: 18px; cursor: pointer; }
.crow:hover { background: var(--sunk); }
.crow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow small, .crow .when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .when { text-align: right; }
.crow .tags { display: flex; gap: 5px; flex-wrap: wrap; }
.board { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; padding: 4px 18px 18px; overflow-x: auto; min-height: 0; }
.col { background: var(--sunk); border-radius: 20px; box-shadow: var(--inset); display: flex; flex-direction: column; min-height: 0; border: 2px solid transparent; }
.col.over { border-color: var(--accent); }
.col-head { padding: 14px 14px 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; }
.col-head strong { font: 700 15px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-head b { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.col-head span { grid-column: 1 / -1; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.col.won .col-head strong { color: var(--accent-lo); }
.col.lost .col-head strong { color: var(--hot-ink); }
.col-body { flex: 1; overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--raised); border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--edge), var(--lift-sm); cursor: grab;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; }
.kcard.dragging { opacity: .45; }
.kcard .ring { grid-row: span 2; }
.kcard .ring .av { width: 34px; height: 34px; font-size: 12px; }
/* fila 1: nombre completo; fila 2: ultimo mensaje y monto */
.kcard .n { grid-column: 2 / -1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard .v { grid-column: 3; grid-row: 2; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.kcard .p { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 8px; }

/* Respuestas rapidas y automaticas */
.quick-pop { margin: 0 16px; background: var(--raised); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--edge), var(--lift);
  max-height: 240px; overflow-y: auto; padding: 6px; }
.quick-pop button { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 10px; border-radius: 12px; align-items: baseline; }
.quick-pop button.on, .quick-pop button:hover { background: var(--accent-soft); }
.quick-pop b { font-weight: 600; color: var(--cool); }
.quick-pop span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-pop p { color: var(--muted); padding: 10px; font-size: 14px; }
.meta .auto { background: var(--panel); border-radius: 999px; padding: 0 7px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; font-weight: 600; }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); box-shadow: none; padding: 0; }
.check span { margin: 0; font-size: 15px; color: var(--ink); }
.days { display: grid; gap: 6px; margin-bottom: 14px; }
.day-row { display: grid; grid-template-columns: 20px minmax(90px, 1fr) 150px 150px; gap: 10px; align-items: center; }
.day-row label::first-letter { text-transform: uppercase; }
.day-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); box-shadow: none; padding: 0; }
.day-row input[type="time"] { padding: 7px 9px; }
.day-row.off input[type="time"] { visibility: hidden; }
.day-row.off span { color: var(--muted); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.meta .auto.ia { background: var(--accent-soft); color: var(--ink); }
.qrow code { font: 600 13px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--cool); }

/* Reportes */
.rp-body { flex: 1; overflow-y: auto; padding: 0 24px 24px; display: grid; gap: 14px; align-content: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--sunk); border-radius: 18px; padding: 14px 16px; box-shadow: var(--inset); }
.tile strong { display: block; font: 700 28px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.alert strong { color: var(--hot-ink); }
.rp-card { background: var(--raised); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; box-shadow: var(--edge), var(--lift-sm); min-width: 0; }
.rp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.rp-head h2 { font: 700 16px/1.2 var(--display); margin-right: auto; }
.rp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 500 11px var(--body); font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--raised); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .lbl { fill: var(--ink); font: 600 12px var(--body); }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--panel); border-radius: 10px; padding: 7px 10px;
  font-size: 13px; line-height: 1.35; box-shadow: var(--lift); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tip b { font-weight: 600; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.rp-table table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.rp-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rp-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rp-table { max-height: 300px; overflow-y: auto; }
.hours { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin-top: 10px; }
.hours div { flex: 1; min-height: 2px; background: var(--c-recv); border-radius: 4px 4px 0 0; }
.hours div:hover { filter: brightness(1.15); }
.hours-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 10px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; font-size: 14px; }
.bar-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row .track { grid-column: 1 / -1; height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--c-sent); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row small { color: var(--muted); }
.bar-row.tagged .track i { background: var(--c); }
.buckets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0 12px; }
.bucket { background: var(--sunk); border-radius: 14px; padding: 9px 12px; box-shadow: var(--inset); }
.bucket strong { display: block; font: 700 20px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.bucket span { color: var(--muted); font-size: 12px; }
.bucket.hot strong { color: var(--hot-ink); }
.wait-list { display: grid; gap: 2px; }
.wait-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px;
  border-radius: 12px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.wait-row:hover { background: var(--sunk); }
.wait-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-row .who-w { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-row .t { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.wait-row .t.hot { color: var(--hot-ink); }
.wait-row small { display: block; color: var(--hot-ink); font-size: 12px; font-weight: 500; }
.rp-table.wide { max-height: none; overflow-x: auto; }
.rp-table.wide th, .rp-table.wide td { white-space: nowrap; }
.rp-table.wide td.num, .rp-table.wide th.num { text-align: right; }
.rp-table.wide tr.inactive td:first-child { color: var(--muted); }
.rp-table.wide td .hotv { color: var(--hot-ink); font-weight: 600; }

/* Grupos, roles y disponibilidad */
.me-wrap { position: relative; margin-top: 6px; }
.me-btn { position: relative; border: 0; background: none; padding: 0; border-radius: 50%; }
.me-btn .me-av { margin: 0; }
.status-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 0 2px var(--panel); }
.status-dot.busy { background: #e0a100; }
.status-dot.offline { background: var(--muted); }
.me-btn .status-dot { position: absolute; right: -1px; bottom: -1px; }
.me-menu { position: absolute; left: calc(100% + 14px); bottom: 0; z-index: 30; width: 250px; background: var(--raised);
  border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: var(--edge), var(--lift); display: grid; gap: 4px; }
.me-menu strong { padding: 2px 8px; }
.me-menu .hint { padding: 0 8px 6px; }
.me-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px; border-radius: 12px; text-align: left; }
.me-menu button:hover, .me-menu button.on { background: var(--sunk); }
.me-menu button.on { font-weight: 600; }
.viewers { margin: 0; padding: 7px 18px; background: var(--accent-soft); font-size: 13px; font-weight: 500; }
.dlg-tabs { display: flex; gap: 4px; padding: 10px 24px 0; border-bottom: 1px solid var(--line); position: sticky; top: 66px;
  background: var(--panel); z-index: 1; overflow-x: auto; }
.dlg-tabs button { border: 0; background: none; padding: 9px 12px 11px; color: var(--muted); font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dlg-tabs button.on { color: var(--ink); border-color: var(--ink); font-weight: 600; }
fieldset.pick { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 14px; }
fieldset.pick legend { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; padding: 0; }
fieldset.pick .check { margin: 4px 0; font-weight: 500; }
fieldset.pick .check span { font-size: 14px; }
#rlVis { grid-template-columns: 1fr; }
.row .chips-inline { display: flex; gap: 5px; flex-wrap: wrap; width: 100%; order: 10; }   /* los grupos van al final de la fila */
.row select.inline { width: auto; padding: 5px 8px; font-size: 13px; }
.row .online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.role-perms { width: 100%; color: var(--muted); font-size: 13px; }

/* Archivos en el chat */
.msg .m-img { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 12px; margin: -2px -6px 4px; cursor: zoom-in;
  background: var(--sunk); min-width: 120px; min-height: 80px; object-fit: cover; }
.msg video { display: block; max-width: min(340px, 100%); border-radius: 12px; margin-bottom: 4px; }
.msg audio { display: block; width: min(300px, 70vw); margin: 2px 0 4px; }
.file-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -4px 4px; border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 6%, transparent); min-width: 220px; }
.file-card svg { width: 26px; height: 26px; color: var(--muted); }
.file-card div { flex: 1; min-width: 0; }
.file-card strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card small { color: var(--muted); }
.file-card .link { white-space: nowrap; }
.msg .gone { display: block; color: var(--muted); font-style: italic; font-size: 14px; margin-bottom: 2px; }
.msg .cap { white-space: pre-wrap; }
.map-link { display: inline-flex; align-items: center; gap: 6px; color: var(--cool); font-weight: 600; }
.map-link svg { width: 18px; height: 18px; }
.attach-chip { display: flex; align-items: center; gap: 10px; margin: 0 16px; padding: 8px 8px 8px 14px; background: var(--sunk);
  border-radius: 14px 14px 0 0; box-shadow: var(--inset); font-size: 14px; }
.attach-chip span { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip small { color: var(--muted); font-variant-numeric: tabular-nums; }
.attach-chip svg { width: 18px; height: 18px; }
.chat-box.dropping .msgs { outline: 2px dashed var(--accent); outline-offset: -10px; }
dialog.viewer { width: auto; max-width: 94vw; padding: 0; background: #000; }
dialog.viewer img { display: block; max-width: 94vw; max-height: 90vh; }

/* Ajustes */
dialog { border: 0; border-radius: 28px; padding: 0; width: min(700px, calc(100% - 24px)); background: var(--panel); color: var(--ink);
  max-height: calc(100% - 24px); box-shadow: var(--edge), 0 30px 70px -10px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(17, 16, 21, .55); backdrop-filter: blur(3px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; position: sticky; top: 0;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1; }
.dlg-head h2 { font: 700 22px/1 var(--display); letter-spacing: -.02em; }
.dlg-body { padding: 4px 24px 26px; }
.dlg-body section { padding-top: 22px; }
.dlg-body h3 { font: 700 16px/1.2 var(--display); margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; background: var(--raised); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--edge), var(--lift-sm); margin-bottom: 8px; }
.row .grow { flex: 1; min-width: 150px; }
.row small { color: var(--muted); display: block; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.tag.owner { background: var(--accent-soft); color: var(--ink); }
.setup { width: 100%; background: var(--sunk); border-radius: 14px; padding: 12px 14px; font-size: 13px; display: grid; gap: 4px; box-shadow: var(--inset); }
.setup code { display: block; overflow-wrap: anywhere; user-select: all; margin-bottom: 8px; font: 500 13px/1.4 ui-monospace, Menlo, Consolas, monospace;
  background: var(--raised); border-radius: 10px; padding: 7px 9px; }
.theme-pick { display: flex; background: var(--sunk); border-radius: 14px; padding: 4px; box-shadow: var(--inset); max-width: 360px; }
.theme-pick button { flex: 1; border: 0; background: none; padding: 8px 10px; border-radius: 11px; color: var(--muted); font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 7px; }
.theme-pick button.on { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: var(--edge), var(--lift-sm); }
.theme-pick svg { width: 17px; height: 17px; }
.lang-pick { display: inline-flex; background: var(--sunk); border-radius: 14px; padding: 4px; box-shadow: var(--inset); }
.lang-pick button { border: 0; background: none; padding: 7px 12px; border-radius: 11px; color: var(--muted); font-weight: 500; font-size: 14px; }
.lang-pick button.on { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: var(--edge), var(--lift-sm); }
.dlg-body h3.sub { margin-top: 18px; }
.forgot { margin: -6px 0 12px; text-align: right; font-size: 14px; }
.info { background: var(--accent-soft); color: var(--ink); border-radius: 14px; padding: 10px 13px; margin-bottom: 12px; font-size: 14px; }
details { margin-top: 10px; }
summary { color: var(--cool); font-weight: 600; padding: 6px 0; cursor: pointer; }
.steps { margin: 8px 0 14px 20px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid .full { grid-column: 1 / -1; }

/* Etapa 2: avisos, posponer, prioridad, responder, lote, menciones y mapas de calor */
.pop-panel { position: absolute; z-index: 30; background: var(--raised); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--edge), var(--lift); padding: 8px; display: grid; gap: 2px; }
.bell-wrap, .snooze-wrap { position: relative; }
.rail-btn .count { position: absolute; top: 4px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--hot);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--panel); font-variant-numeric: tabular-nums; }
.notif-panel { left: calc(100% + 14px); top: 0; width: 340px; max-height: min(520px, 80vh); grid-template-rows: auto minmax(0, 1fr); padding: 0; }
.notif-panel header { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 8px 16px; }
.notif-panel header strong { font: 700 17px/1.2 var(--display); }
.notif-list { overflow-y: auto; padding: 0 8px 8px; }
.notif { display: grid; grid-template-columns: 34px minmax(0, 1fr) 8px; gap: 2px 10px; width: 100%; text-align: left; border: 0; background: none;
  padding: 9px 8px; border-radius: 14px; align-items: start; }
.notif:hover { background: var(--sunk); }
.notif .av { width: 34px; height: 34px; font-size: 12px; grid-row: span 2; }
.notif p { font-size: 14px; line-height: 1.35; }
.notif small { color: var(--muted); font-size: 12px; grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.notif.read p { color: var(--muted); }
.notif-list .hint { padding: 18px 10px; text-align: center; }
.head-tools { display: flex; align-items: center; gap: 10px; }
.head-tools .live { margin-top: 0; }
/* cuatro estados: el numero va debajo del nombre para que quepan sin cortarse */
.tabs button { font-size: 13px; padding: 6px 4px; gap: 0; min-width: 0; flex: 1 1 auto; flex-direction: column; align-items: center; line-height: 1.25; }
.tabs b { min-height: 1.25em; font-size: 12px; }
.tabs button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips .tag-filter { flex: 1 1 28%; min-width: 0; }
.conv .p mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.conv .p.match { color: var(--ink); }
.conv .p.snz { color: var(--cool); font-weight: 500; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.prio svg { width: 15px; height: 15px; }
.prio.high, .prio.urgent { color: var(--hot-ink); }
.prio.urgent { background: var(--hot-soft); border-radius: 999px; padding: 2px 9px 2px 6px; }
.conv .prio span { display: none; }
.conv.picking { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.conv.picking .ring { grid-row: span 2; }
.conv .pick { grid-row: span 2; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--panel); display: grid; place-items: center; }
.conv.picked .pick { background: var(--accent); border-color: var(--accent-lo); }
.conv.picked .pick::after { content: ""; width: 10px; height: 6px; border: solid var(--accent-ink); border-width: 0 0 2.5px 2.5px; rotate: -45deg; translate: 0 -1px; }
.conv.picked { background: var(--accent-soft); }
.conv.picking .tags { grid-column: 3 / -1; }
.bulk { border-top: 1px solid var(--line); padding: 10px 14px max(12px, env(safe-area-inset-bottom)); display: grid; gap: 8px; background: var(--panel); }
.bulk-top { display: flex; justify-content: space-between; align-items: center; }
.bulk-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bulk-acts select { padding: 8px 9px; font-size: 13px; border-radius: 12px; }
.bulk-acts select:disabled { opacity: .5; }
.snooze-menu { right: 0; top: calc(100% + 8px); width: 250px; }
.snooze-menu strong { padding: 4px 8px 6px; font: 700 15px/1.2 var(--display); }
.snooze-menu button[data-sn] { border: 0; background: none; text-align: left; padding: 8px; border-radius: 12px; }
.snooze-menu button[data-sn]:hover { background: var(--sunk); }
.snooze-menu label { margin: 6px 8px 6px; }
.snooze-menu .btn { margin: 0 8px 6px; }
#snoozeBtn.on { color: var(--cool); background: color-mix(in srgb, var(--cool) 14%, transparent); }
.snoozed-note { display: flex; align-items: center; gap: 8px; padding: 8px 18px; background: color-mix(in srgb, var(--cool) 12%, var(--panel)); font-size: 13px; font-weight: 500; }
.snoozed-note svg { width: 17px; height: 17px; color: var(--cool); }
.snoozed-note span { flex: 1; }
.msg { position: relative; }
.msg .reply-btn { position: absolute; top: 4px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--raised);
  color: var(--muted); display: grid; place-items: center; opacity: 0; box-shadow: var(--lift-sm); transition: opacity .12s; }
.msg.in .reply-btn { right: -38px; }
.msg.out .reply-btn { left: -38px; }
.msg .reply-btn svg { width: 16px; height: 16px; }
.msg:hover .reply-btn, .msg .reply-btn:focus-visible { opacity: 1; }
@media (hover: none) { .msg .reply-btn { opacity: .75; } }
.quote { display: block; width: 100%; text-align: left; border: 0; margin: -2px -5px 5px; padding: 6px 10px; border-radius: 10px; font-size: 13px;
  background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: inset 3px 0 0 var(--c, var(--cool)); white-space: normal; cursor: pointer; }
.quote b { display: block; color: var(--c, var(--cool)); font-size: 12px; }
.quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.quote.out { --c: var(--accent-lo); }
.msg.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } }
.reply-chip { display: flex; align-items: center; gap: 10px; margin: 0 16px; padding: 8px 8px 8px 14px; background: var(--sunk);
  border-radius: 14px 14px 0 0; box-shadow: var(--inset), inset 3px 0 0 var(--cool); font-size: 14px; }
.reply-chip > svg { width: 18px; height: 18px; color: var(--cool); }
.reply-chip div { flex: 1; min-width: 0; }
.reply-chip b { display: block; font-size: 12px; color: var(--cool); }
.reply-chip span { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-form { position: relative; }
.mention-pop { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; margin: 0; z-index: 4; }
.note .at { color: var(--cool); font-weight: 600; }
.note-form .hint { margin-top: -4px; }
.now-card .rp-head { justify-content: flex-start; gap: 10px; }
.now-card .rp-head .live { margin: 0; }
.pulse { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.pulse-chats { display: grid; gap: 14px; align-content: start; }
.pulse-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.pulse-big > strong { font: 700 52px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pulse-big > span { font-size: 16px; color: var(--muted); font-weight: 500; }
.pulse-side { display: flex; gap: 6px; margin-left: auto; }
.pill { background: var(--sunk); box-shadow: var(--inset); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); }
.pill b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.meter-top b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter .bar { height: 12px; border-radius: 999px; background: var(--sunk); box-shadow: var(--inset); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 999px; min-width: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.meter.hot .bar i { background: linear-gradient(var(--hot), color-mix(in srgb, var(--hot) 80%, #000)); }
.meter.hot .meter-top b { color: var(--hot-ink); }
.meter.cool .bar i { background: linear-gradient(color-mix(in srgb, var(--cool) 85%, #fff), var(--cool)); }
.pulse-team { display: grid; gap: 6px; background: var(--sunk); border-radius: 18px; padding: 12px 14px; box-shadow: var(--inset); align-content: start; }
.team-row { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 40px; }
.team-row + .team-row { border-top: 1px solid var(--line); padding-top: 6px; }
.team-head { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.team-head b { margin-left: auto; font-variant-numeric: tabular-nums; }
.faces { display: flex; flex-wrap: wrap; padding-left: 8px; }
.faces .av { width: 32px; height: 32px; font-size: 11px; margin-left: -8px; box-shadow: 0 0 0 2.5px var(--sunk); }
.faces .av.more { background: var(--raised); color: var(--muted); background-image: none; font-size: 11px; }
.team-row.offline .faces .av:not(.more) { filter: grayscale(.85); opacity: .6; }
.dots { display: grid; grid-template-columns: 70px repeat(24, minmax(0, 1fr)) 44px; gap: 2px; margin-top: 14px; align-items: center; }
.dots .day-l { font-size: 12px; color: var(--muted); line-height: 1.15; }
.dots .day-l b { display: block; color: var(--ink); font-weight: 600; }
.dots .cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; }
.dots .cell:hover { background: var(--sunk); }
.dots .cell i { width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 70%);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--c) 40%, transparent); }
.dots .cell.z i { width: 4px; height: 4px; background: var(--line); box-shadow: none; }
.dots .row-t { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dots .total-l { padding-top: 6px; }
.dots .col-t { height: 34px; display: flex; align-items: flex-end; justify-content: center; margin-top: 6px; }
.dots .col-t i { width: 62%; min-height: 2px; border-radius: 3px 3px 1px 1px; background: color-mix(in oklab, var(--c) 55%, var(--sunk)); }
.dots .hr { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* Administracion */
.adm-body { flex: 1; overflow-y: auto; padding: 0 24px 28px; }
.adm-body > section, .adm-body > .hint { max-width: 900px; }
.adm-body > section { padding-top: 18px; }
.adm-body h3 { font: 700 17px/1.2 var(--display); margin-bottom: 10px; }
.adm-body h3.sub { margin-top: 18px; }
.page-head #admTabs { flex-wrap: wrap; }
.group-card { background: var(--raised); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; box-shadow: var(--edge), var(--lift-sm); margin-bottom: 10px; }
.group-card > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.group-card > header strong { font: 700 17px/1.2 var(--display); margin-right: auto; }
.group-card .sup-line { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.group-card .sup-line b { color: var(--ink); font-weight: 600; }
.g-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.g-member { display: flex; align-items: center; gap: 8px; background: var(--sunk); border-radius: 14px; padding: 6px 8px 6px 6px; box-shadow: var(--inset); min-width: 0; }
.g-member .av { width: 30px; height: 30px; font-size: 11px; }
.g-member span.nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.g-member.sup { box-shadow: var(--inset), inset 0 0 0 1.5px color-mix(in srgb, var(--cool) 55%, transparent); }
.g-member .icon-btn { padding: 4px; }
.g-member .icon-btn svg { width: 15px; height: 15px; }
.tag.sup { background: color-mix(in srgb, var(--cool) 14%, transparent); color: var(--cool); }
.group-card select.inline { width: auto; max-width: 240px; padding: 6px 10px; font-size: 13px; margin-top: 8px; border-radius: 12px; }
fieldset.pick.members { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.m-row { display: flex; align-items: center; gap: 12px; }
.m-row .check { flex: 1; min-width: 0; }
.m-row .check.sup { flex: none; }
.m-row .check.sup span { font-size: 12px; color: var(--muted); }
.m-row .check.sup input { width: 16px; height: 16px; }
.level-fixed { border-style: dashed; }
.me-menu .menu-out { display: none; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; margin-top: 4px; padding-top: 10px; color: var(--muted); }
.me-menu .menu-out svg { width: 18px; height: 18px; }
.support-bar { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--ink); color: var(--panel); font-size: 13px; font-weight: 500; padding: 6px 14px; }
.support-bar .link { color: var(--accent-hi); }
body:has(.support-bar:not([hidden])) .app { height: calc(100% - 33px); }

/* Etapa 3: campanas y plantillas */
.cp-body { flex: 1; overflow-y: auto; padding: 0 24px 24px; display: grid; gap: 12px; align-content: start; }
.cp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cp-bar .btn { display: inline-flex; align-items: center; gap: 8px; }
.cp-bar .btn svg { width: 18px; height: 18px; }
.cp-bar .tag-filter { margin: 0; padding: 9px 12px; border-radius: 14px; max-width: 260px; }
.cp-list { display: grid; gap: 10px; }
.cp-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); gap: 8px 22px; align-items: center; width: 100%; text-align: left;
  background: var(--raised); border: 1px solid var(--line); border-radius: 20px; padding: 14px 18px; box-shadow: var(--edge), var(--lift-sm); }
.cp-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cp-row strong { font: 700 17px/1.2 var(--display); display: block; }
.cp-row small { color: var(--muted); font-size: 13px; display: block; margin-top: 3px; }
.cp-stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cp-stat { font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-stat b { display: block; font: 700 18px/1.15 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.cp-stat b { white-space: nowrap; }
.cp-stat b small { font: 500 12px var(--body); color: var(--muted); }
.cp-stat.bad b { color: var(--hot-ink); }
.cp-progress { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--sunk); box-shadow: var(--inset); overflow: hidden; display: flex; }
.cp-progress i { display: block; height: 100%; }
.cp-progress .p-read { background: var(--accent-lo); }
.cp-progress .p-del { background: var(--accent); }
.cp-progress .p-sent { background: color-mix(in srgb, var(--accent) 45%, var(--sunk)); }
.cp-progress .p-fail { background: var(--hot); }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; margin-left: 8px;
  background: var(--sunk); color: var(--muted); vertical-align: 2px; font-family: var(--body); }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state.running, .state.APPROVED { color: var(--accent-lo); background: var(--accent-soft); }
.state.scheduled, .state.PENDING, .state.IN_APPEAL { color: var(--cool); background: color-mix(in srgb, var(--cool) 13%, transparent); }
.state.paused, .state.REJECTED, .state.DISABLED, .state.PAUSED { color: var(--hot-ink); background: var(--hot-soft); }
.state.running::before { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.tpl-card { background: var(--raised); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: var(--edge), var(--lift-sm);
  display: grid; gap: 10px; align-content: start; }
.tpl-card header { display: flex; align-items: flex-start; gap: 8px; }
.tpl-card header div { flex: 1; min-width: 0; }
.tpl-card header strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.tpl-card header small { color: var(--muted); font-size: 12px; }
.tpl-card .state { margin: 4px 0 0; }
.tpl-card .why { font-size: 13px; color: var(--muted); background: var(--sunk); border-radius: 12px; padding: 8px 10px; }
.tpl-card .why.bad { color: var(--hot-ink); background: var(--hot-soft); }
/* vista previa: una burbuja de WhatsApp sobre el fondo del chat */
.phone { background: radial-gradient(var(--chat-dot) 1.2px, transparent 1.2px) 0 0 / 16px 16px, var(--sunk); box-shadow: var(--inset);
  border-radius: 18px; padding: 14px 12px; }
.tpl-bubble { background: var(--out); border-radius: 16px 16px 16px 5px; padding: 8px 12px 6px; box-shadow: var(--edge), var(--lift-sm); white-space: pre-wrap;
  overflow-wrap: anywhere; font-size: 14px; max-width: 100%; }
.tpl-bubble .h { font-weight: 700; margin-bottom: 4px; }
.tpl-bubble .f { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tpl-bubble mark { background: color-mix(in srgb, var(--cool) 22%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.tpl-bubble .empty-var { color: var(--hot-ink); }
.tpl-btns { display: grid; gap: 4px; margin-top: 4px; }
.tpl-btns span { background: var(--out); border-radius: 12px; text-align: center; padding: 7px; color: var(--tick); font-weight: 600; font-size: 14px; box-shadow: var(--lift-sm); }
.tpl-card .phone { padding: 10px; }
.msg.out.tpl-msg { border-top-left-radius: 18px; }
.msg .tpl-tag { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--cool); margin-bottom: 4px; }
.msg .tpl-tag svg { width: 13px; height: 13px; }
dialog.wide-dlg { width: min(940px, calc(100% - 24px)); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; padding-top: 18px; }
.col-preview { position: sticky; top: 84px; align-self: start; display: grid; gap: 10px; }
.col-form fieldset.pick { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 6px; margin: 0 0 14px; }
.col-form fieldset.pick legend { margin-bottom: 0; }
.col-form #cpTagPick { margin: 0 0 8px 30px; }
.pick legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.param { display: grid; gap: 4px; margin-bottom: 12px; }
.param label { margin: 0; }
.param .tok { display: flex; gap: 6px; }
.param .tok button { border: 1px solid var(--line); background: var(--raised); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--cool); font-weight: 600; }
.param .fb { margin-top: 2px; }
.aud { font-size: 14px; font-weight: 500; padding: 8px 0 10px; }
.aud small { display: block; color: var(--muted); font-weight: 400; }
.when-row { display: flex; gap: 18px; flex-wrap: wrap; }
.when-row .check { margin: 6px 0; }
#cpAt { margin-bottom: 12px; }
.btn3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-bottom: 10px; }
.cd-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.cd-stats div { background: var(--sunk); border-radius: 14px; padding: 10px 12px; box-shadow: var(--inset); }
.cd-stats b { display: block; font: 700 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.cd-stats span { font-size: 12px; color: var(--muted); }
#cdList td.st-failed { color: var(--hot-ink); }
#cdList td small { display: block; color: var(--muted); }
#cdList tr[data-conv] { cursor: pointer; }
#cdList tr[data-conv]:hover td { background: var(--sunk); }
.warn .link { color: var(--hot-ink); text-decoration: underline; padding: 0; }
.cfields .check { margin: 4px 0 2px; }
#stNew[hidden] { display: none; }

@media (max-width: 1180px) {
  .side { position: fixed; inset: 12px 12px 12px auto; z-index: 5; box-shadow: var(--edge), 0 30px 70px -10px rgba(0, 0, 0, .5); }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; padding: 0; }
  .auth-art { display: none; }
  .auth-form { box-shadow: none; border-radius: 0; background: none; }
  .mark.dark { display: flex; margin-bottom: 28px; }
  .app { flex-direction: column-reverse; gap: 0; padding: 0; }
  .rail, .list, .chat, .side { border-radius: 0; box-shadow: none; }
  .rail { width: 100%; flex-direction: row; padding: 6px 10px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; border-top: 1px solid var(--line); }
  .rail-mark, .rail-gap { display: none; }
  /* en el telefono el tema y el idioma quedan en Ajustes, para que quepa la campana */
  .rail .theme-toggle, .rail .lang-toggle, .rail #logoutBtn { display: none; }
  .rail-btn { width: 40px; }
  .me-menu .menu-out { display: flex; }
  .me-av { margin: 0; }
  .list { width: 100%; flex: 1; }
  .chat { display: none; }
  .app.chat-open .list, .app.chat-open .rail { display: none; }
  .app.chat-open .chat { display: flex; }
  .side { width: 100%; inset: 0; }
  .back { display: grid; }
  .page { border-radius: 0; box-shadow: none; }
  .page-head { padding: 16px 16px 10px; }
  .crow { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .crow .co, .crow .tags { display: none; }
  .rp-body { padding: 0 12px 16px; }
  .me-menu { left: auto; right: 0; bottom: calc(100% + 12px); }
  .dlg-tabs { padding: 8px 12px 0; }
  .rp-two { grid-template-columns: 1fr; }
  .cp-body { padding: 0 12px 16px; }
  .adm-body { padding: 0 12px 20px; }
  .page-head #admTabs { order: 5; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .page-head #admTabs button { flex: none; }
  .cp-row { grid-template-columns: 1fr; padding: 12px 14px; }
  .cp-stat b { font-size: 16px; }
  .cp-stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .two-col { grid-template-columns: 1fr; }
  .col-preview { position: static; }
  .cd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-head .seg3 { order: 0; width: auto; }
  .pulse { grid-template-columns: 1fr; }
  .pulse-big > strong { font-size: 42px; }
  .pulse-side { margin-left: 0; width: 100%; }
  .team-row { grid-template-columns: 100px minmax(0, 1fr); }
  .dots { grid-template-columns: 34px repeat(24, minmax(0, 1fr)) 26px; gap: 1px; }
  .dots .day-l small { display: none; }
  .dots .row-t { font-size: 11px; }
  .notif-panel { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); width: auto; }
  .bell-wrap { position: static; }
  .msg.in .reply-btn { right: -34px; }
  .msg.out .reply-btn { left: -34px; }
  .msg { max-width: calc(100% - 44px); }
  .buckets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wait-row { grid-template-columns: minmax(0, 1fr) auto; }
  .wait-row .who-w { grid-column: 1; grid-row: 2; }
  .wait-row .t { grid-row: 1 / span 2; grid-column: 2; }
  .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; padding: 4px 12px 12px; }
  .col { scroll-snap-align: center; }
  .app.view-contacts.chat-open .rail, .app.view-pipeline.chat-open .rail { display: flex; }
  /* en el telefono el estado baja a su propia fila para no aplastar el nombre */
  .chat-head { gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
  .chat-head .who { flex: 1 1 0; }
  .seg3 { order: 5; width: 100%; }
  .seg3 button { flex: 1; }
  .composer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: 1fr; }
  /* en el telefono: el dia en una fila y las dos horas debajo */
  .day-row { grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; margin-bottom: 6px; }
  .day-row label { grid-column: 2 / -1; }
  .day-row label + input { grid-column: 2; }
  .day-row input[type="time"] { min-width: 0; }
  .day-row.off input[type="time"] { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .msg.new { animation: pop .18s ease-out; }
  @keyframes pop { from { opacity: 0; translate: 0 6px; } }
}

/* ---- etapa 4: reglas, combos, compromisos de tiempo y encuesta ---- */
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.adm-head h3 { margin: 0; }
.flow-list { margin-top: 12px; }
.flow-card { background: var(--raised); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; box-shadow: var(--edge), var(--lift-sm); margin-bottom: 10px; }
.flow-card.off { opacity: .62; }
.flow-card > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.flow-card > header strong { font: 700 17px/1.2 var(--display); margin-right: auto; }
.flow-card dl { display: grid; gap: 4px; margin: 0; }
.flow-card dl div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.flow-card dt { color: var(--muted); font-size: 13px; }
.flow-card dd { margin: 0; font-size: 14.500px; line-height: 1.45; }
.flow-card > small { display: block; margin-top: 8px; color: var(--muted); font-size: 12.500px; }
.chip-soft { background: var(--accent-soft); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.tgl { position: relative; display: inline-flex; flex: none; margin: 0; cursor: pointer; }
.tgl input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tgl i { width: 38px; height: 22px; border-radius: 999px; background: var(--sunk); box-shadow: var(--inset); transition: background .15s; position: relative; }
.tgl i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--raised); box-shadow: var(--lift-sm); transition: transform .15s; }
.tgl input:checked + i { background: var(--accent); }
.tgl input:checked + i::after { transform: translateX(16px); }
.tgl input:focus-visible + i { outline: 2px solid var(--cool); outline-offset: 2px; }
.flow-form > label, .flow-form #flRuleOnly > label { display: block; margin-bottom: 12px; }
.flow-block { background: var(--sunk); border-radius: 18px; padding: 12px 12px 10px; margin-bottom: 12px; box-shadow: var(--inset); }
.flow-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.flow-block-head b { font: 700 15px/1.2 var(--display); }
.flow-block-head select { width: auto; padding: 5px 9px; font-size: 13px; }
.flow-steps:empty { display: none; }
.step { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.step select, .step input, .step textarea { background: var(--raised); }
.step .icon-btn { padding: 8px; }
.step .icon-btn svg { width: 16px; height: 16px; display: block; }
.dur { display: grid; grid-template-columns: 110px minmax(0, 170px); gap: 8px; }
.survey-form { max-width: 560px; }
.survey-form > label:not(.check) { display: block; margin-bottom: 12px; }
.combo-wrap { position: relative; }
.combo-menu { left: 0; bottom: calc(100% + 8px); width: 290px; display: flex; flex-direction: column; padding: 10px; max-height: 60vh; overflow-y: auto; }
.combo-menu[hidden] { display: none; }
.combo-menu > strong { padding: 4px 8px 6px; font: 700 15px/1.2 var(--display); }
.combo-menu #comboItems button { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 8px; border-radius: 12px; }
.combo-menu #comboItems button:hover { background: var(--sunk); }
.combo-menu #comboItems b { display: block; font-weight: 600; }
.combo-menu #comboItems small { display: block; color: var(--muted); font-size: 12.500px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-menu .hint { padding: 4px 8px 8px; }
.combo-menu .link { align-self: flex-start; margin: 4px 4px 2px; }
.sla-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 18px; font-size: 13px; font-weight: 500; background: color-mix(in srgb, var(--cool) 10%, var(--panel)); }
.sla-note svg { width: 16px; height: 16px; color: var(--cool); flex: none; }
.sla-note.late { background: var(--hot-soft); color: var(--hot-ink); }
.sla-note.late svg { color: var(--hot-ink); }
.slamini { display: inline-flex; align-items: center; gap: 3px; font-size: 11.500px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slamini svg { width: 13px; height: 13px; }
.slamini.late { color: var(--hot-ink); background: var(--hot-soft); border-radius: 999px; padding: 1px 7px 1px 5px; }
.stars { letter-spacing: 1px; color: var(--ink); }
.q-body .meter { margin-bottom: 10px; }
.meter.mid .bar i { background: linear-gradient(color-mix(in srgb, var(--muted) 70%, #fff), var(--muted)); }
.q-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.q-head strong { font: 700 34px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.q-head span { color: var(--muted); font-size: 13.500px; }
.q-head .stars { color: var(--ink); font-size: 16px; }
h3.q-sub { font: 700 14px/1.2 var(--display); margin: 16px 0 6px; }
.q-row { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 12px; color: inherit; }
button.q-row:hover { background: var(--sunk); }
.q-row b { display: block; font-weight: 600; font-size: 14px; }
.q-row small { display: block; color: var(--muted); font-size: 12.500px; }
#admTabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
#admTabs button { white-space: nowrap; flex: none; }
@media (max-width: 860px) {
  .step { grid-template-columns: minmax(0, 1fr) auto; }
  .step select:first-child { grid-column: 1; }
  .step .step-val { grid-column: 1; grid-row: 2; }
  .step .icon-btn { grid-column: 2; grid-row: 1; }
  .combo-menu { left: -50px; width: min(290px, calc(100vw - 32px)); }
}
#slaList .flow-card dl div { grid-template-columns: 150px minmax(0, 1fr); }
@media (max-width: 860px) {
  .composer { gap: 4px; padding: 10px; }
  .composer .icon-btn { padding: 7px; }
}

/* ---- etapa 5: filtros guardados, etiquetas del chat, campos propios, ficha, unir e importar ---- */
.filter-wrap { position: relative; }
.filter-wrap .icon-btn { position: relative; padding: 6px; }
.filter-wrap .icon-btn svg { width: 19px; height: 19px; }
.fdot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 2px var(--panel); }
.filter-menu { right: -34px; top: calc(100% + 8px); width: 300px; padding: 14px; gap: 10px; }
.filter-menu > strong { font: 700 16px/1.2 var(--display); }
.filter-menu label > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.filter-menu select { padding: 8px 10px; }
.filter-menu #fmClear { justify-self: start; }
.save-filter { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; }
.save-filter .hint { font-size: 12.500px; margin: 0; }
.save-filter input:not([type]) { padding: 8px 10px; }
.save-filter .check { margin: 2px 0; }
.save-filter .check span { font-size: 14px; font-weight: 500; }
.save-filter .err { min-height: 0; margin: 0; }

.saved-row { display: flex; gap: 6px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.saved-row::-webkit-scrollbar { display: none; }
.saved-chip { display: inline-flex; align-items: center; flex: none; border-radius: 10px; background: var(--sunk); box-shadow: var(--inset); }
.saved-chip button { border: 0; background: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font-size: 13px;
  font-weight: 600; color: var(--ink); border-radius: 10px; white-space: nowrap; }
.saved-chip button svg { width: 15px; height: 15px; color: var(--cool); }
.saved-chip.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-lo); }
.saved-chip.on button { color: var(--accent-ink); }
.saved-chip .x { padding: 5px 8px 5px 2px; color: var(--accent-ink); }
.saved-chip .x svg { width: 13px; height: 13px; color: inherit; }
:root[data-theme="dark"] .saved-chip.on button, :root[data-theme="dark"] .saved-chip .x { color: var(--accent-hi); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .saved-chip.on button, :root:not([data-theme="light"]) .saved-chip .x { color: var(--accent-hi); } }

/* etiquetas del chat: esquinas rectas y una barra en lugar del punto */
.tagchip.case { border-radius: 7px; }
.tagchip.case::before { width: 4px; height: 12px; border-radius: 2px; }
.conv .tags .tagchip.case::before { width: 3px; height: 9px; }
.tag-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.tag-head h3 { margin: 0; }
.seg3.mini { padding: 3px; border-radius: 11px; }
.seg3.mini button { padding: 4px 10px; font-size: 12.500px; border-radius: 8px; }
#tagScopeHint { font-size: 12.500px; margin: 6px 0 10px; }

/* campos propios */
#sFields .cf { margin-bottom: 10px; }
#sFields input, #sFields select { padding: 8px 10px; }
label.cf > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
label.cf .open { font-size: 12.500px; font-weight: 600; color: var(--cool); }
.card-contact #sSheet { margin-top: 6px; font-size: 13px; }

/* contactos: barra de herramientas */
.ct-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-tools .btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; }
.ct-tools .btn svg { width: 17px; height: 17px; }

/* ficha del contacto */
.ct-form > label, .ct-form > .grid { margin-bottom: 4px; }
.ct-form label { margin-bottom: 12px; }
.ct-id { display: flex; align-items: center; gap: 14px; padding: 4px 0 18px; }
.ct-id .av { width: 56px; height: 56px; font-size: 19px; box-shadow: var(--lift-sm); }
.ct-id strong { display: block; font: 700 19px/1.2 var(--display); }
.ct-id .num { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.ct-id small { display: block; color: var(--cool); font-size: 13px; margin-top: 2px; }
.ct-fields:empty { display: none; }
.ct-fields { padding: 12px 14px 0; margin: 2px 0 14px; border-radius: 16px; background: var(--sunk); box-shadow: var(--inset); }
.ct-form fieldset.pick { margin-bottom: 8px; }
.ct-actions { align-items: center; margin-top: 4px; }
.ct-actions .btn { display: inline-flex; align-items: center; gap: 7px; }
.ct-actions .btn svg { width: 17px; height: 17px; }
.ct-actions .danger { margin-left: auto; color: var(--danger); }

/* unir contactos */
#mergeDlg .search { margin: 10px 0 12px; }
.mg-list { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; }
.mg-row { display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 14px; color: var(--ink); }
.mg-row:hover, .mg-row:focus-visible { background: var(--sunk); }
.mg-row .av { width: 38px; height: 38px; font-size: 13px; }
.mg-row strong { display: block; font-weight: 600; }
.mg-row small { color: var(--muted); font-size: 13px; }
.mg-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; margin: 8px 0 16px; }
.mg-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 14px 14px; border-radius: 18px; min-width: 0; }
.mg-card .av { width: 42px; height: 42px; font-size: 14px; flex: none; }
.mg-card div { min-width: 0; }
.mg-card strong, .mg-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-card span { color: var(--muted); font-size: 13px; }
.mg-card .mg-word { position: absolute; top: -9px; left: 12px; font-size: 11.500px; font-weight: 700; padding: 1px 8px; border-radius: 8px; }
.mg-card.goes { border: 1.5px dashed var(--line); opacity: .8; }
.mg-card.goes .mg-word { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.mg-card.stays { background: var(--raised); box-shadow: var(--edge), var(--lift-sm), inset 0 0 0 1.5px var(--accent); }
.mg-card.stays .mg-word { background: var(--accent); color: var(--accent-ink); }
.mg-arrow { align-self: center; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); box-shadow: var(--inset); color: var(--cool); }
.mg-arrow svg { width: 18px; height: 18px; }
#mgPick fieldset.pick { margin-bottom: 6px; }

/* importar */
.drop { position: relative; display: grid; justify-items: center; gap: 6px; padding: 34px 20px; margin: 8px 0 14px; border-radius: 22px;
  border: 2px dashed var(--line); background: var(--sunk); box-shadow: var(--inset); text-align: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg { width: 34px; height: 34px; color: var(--cool); }
.drop strong { font: 700 17px/1.2 var(--display); }
.drop small { color: var(--muted); font-size: 13px; }
.imp-file { font-weight: 600; margin-bottom: 4px; }
.imp-map { display: grid; gap: 6px; margin: 12px 0 16px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.imp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 220px); gap: 14px; align-items: center; padding: 10px 12px;
  border-radius: 14px; background: var(--raised); border: 1px solid var(--line); }
.imp-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-row small { display: block; color: var(--muted); font-size: 12.500px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-row select { padding: 8px 10px; }
.imp-row.skip { background: none; border-style: dashed; }
.imp-row.skip strong { color: var(--muted); font-weight: 500; }
.imp-opts { align-items: end; margin-bottom: 4px; }
.imp-opts .check { margin: 0 0 12px; }
.imp-opts .check span { font-size: 14px; font-weight: 500; }
.imp-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 16px; }
.imp-num { padding: 16px; border-radius: 18px; background: var(--sunk); box-shadow: var(--inset); }
.imp-num b { display: block; font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.imp-num span { color: var(--muted); font-size: 14px; }
.imp-num.ok b { color: var(--accent-lo); }
.imp-num.warn b { color: var(--hot-ink); }
.imp-errors { display: grid; gap: 4px; margin-bottom: 16px; font-size: 14px; max-height: 30vh; overflow-y: auto; }
.imp-errors b { font-weight: 600; margin-right: 4px; }

@media (max-width: 860px) {
  .filter-menu { right: -60px; width: min(300px, calc(100vw - 32px)); }
  .ct-tools { width: 100%; }
  .ct-tools .btn { flex: 1 1 auto; justify-content: center; padding: 9px 10px; }
  .mg-pair { grid-template-columns: 1fr; }
  .mg-arrow { justify-self: center; rotate: 90deg; }
  .imp-row { grid-template-columns: 1fr; gap: 6px; }
  .imp-result b { font-size: 24px; }
  .ct-actions .danger { margin-left: 0; }
}
.tag-head .seg3 { width: auto; flex: none; order: 0; }
.tag-head .seg3 button { flex: none; white-space: nowrap; }
.saved-row { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 28px; }
.ct-form fieldset.pick { display: block; }
.list-head { position: relative; }
.filter-wrap { position: static; }
.filter-menu { left: 16px; right: 16px; width: auto; top: 64px; }
@media (max-width: 860px) { .filter-menu { left: 12px; right: 12px; width: auto; } }

/* ---- etapa 6: emojis, notas de voz, borrar mensajes, atajos, integraciones y registro ---- */
.emoji-wrap { position: relative; flex: none; }
.emoji-pop { left: -60px; bottom: calc(100% + 8px); width: 316px; padding: 8px; gap: 6px; }
.emoji-tabs { display: flex; gap: 2px; padding: 2px; border-radius: 12px; background: var(--sunk); box-shadow: var(--inset); }
.emoji-tabs button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 5px 0; font-size: 17px; filter: grayscale(.6); opacity: .7; }
.emoji-tabs button.on { background: var(--raised); box-shadow: var(--edge), var(--lift-sm); filter: none; opacity: 1; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 232px; overflow-y: auto; }
.emoji-grid button { border: 0; background: none; font-size: 23px; line-height: 1; padding: 6px 0; border-radius: 10px; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--sunk); }

.send.mic { background: var(--raised); color: var(--cool); border-color: var(--line); box-shadow: var(--edge), var(--lift-sm); }
.composer.recording > :not(.rec-bar) { display: none !important; }
.rec-bar { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.rec-bar .icon-btn { color: var(--danger); }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--hot); flex: none; animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 40px; }
.rec-wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 34px; min-width: 0; overflow: hidden; padding: 0 12px;
  border-radius: 17px; background: var(--sunk); box-shadow: var(--inset); }
.rec-wave i { flex: 1; min-width: 2px; height: 22px; border-radius: 2px; background: var(--accent-lo); transform: scaleY(.08); transition: transform .08s linear; }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } .rec-wave i { transition: none; } }

.msg.deleted { background: none !important; border: 1px dashed var(--line); box-shadow: none; }
.msg .del-text { font-style: italic; color: var(--muted); font-size: 14px; }
.msg .del-btn { top: 38px; }
.msg .del-btn:hover { color: var(--danger); }

.keys-open { display: inline-flex; align-items: center; gap: 8px; }
.keys-open svg { width: 19px; height: 19px; }
.keys-body { display: grid; gap: 18px; }
.keys-group h3 { margin-bottom: 6px; }
.key-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.key-row:last-child { border-bottom: 0; }
.keys { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.keys small { color: var(--muted); margin: 0 4px; }
kbd { font: 600 12.500px/1 var(--font, inherit); min-width: 26px; text-align: center; padding: 5px 7px; border-radius: 8px; background: var(--raised);
  border: 1px solid var(--line); box-shadow: 0 2px 0 var(--line); }

.inline-form { display: flex; gap: 10px; margin: 12px 0; }
.inline-form input { flex: 1; min-width: 0; }
.key-new { margin: 6px 0 14px; padding: 14px 16px; border-radius: 18px; background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-lo); }
.key-new p { margin-bottom: 8px; font-size: 14px; }
.key-new code, .hk-secret code { display: block; padding: 10px 12px; border-radius: 12px; background: var(--raised); font-size: 13.500px; word-break: break-all; margin-bottom: 10px; }
.key-list { display: grid; gap: 8px; margin-top: 6px; }
.key-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--edge), var(--lift-sm); }
.key-item > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.key-item code { font-size: 13px; color: var(--cool); }
.key-item small { color: var(--muted); font-size: 13px; }
.link.danger { color: var(--danger); }
.hook-state { font-size: 13.500px; font-weight: 600; margin: -2px 0 8px; display: flex; align-items: center; gap: 7px; color: var(--muted); }
.hook-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.hook-state.ok { color: var(--accent-lo); } .hook-state.ok::before { background: var(--accent); }
.hook-state.bad { color: var(--hot-ink); } .hook-state.bad::before { background: var(--hot); }
.hook-tools { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.hook-tools .btn { padding: 7px 14px; }
.flow-card dd { overflow-wrap: anywhere; }
.hk-secret { margin: 4px 0 12px; }
.hk-secret > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.hk-secret code { display: inline-block; margin: 0 10px 0 0; }
.whd-list { display: grid; gap: 6px; margin-top: 10px; }
.whd-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); }
.whd-row div { min-width: 0; display: grid; }
.whd-row small { color: var(--muted); font-size: 12.500px; overflow-wrap: anywhere; }
.whd-st { flex: none; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: var(--sunk); color: var(--muted); min-width: 76px; text-align: center; }
.whd-st.sent { background: var(--accent-soft); color: var(--accent-lo); }
.whd-st.failed { background: var(--hot-soft); color: var(--hot-ink); }
.api-guide { margin-top: 6px; }
.api-guide p { margin: 12px 0 6px; font-size: 14px; }
.api-guide pre { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--sunk); box-shadow: var(--inset); overflow-x: auto; font-size: 12.500px; line-height: 1.5; }

.audit-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.audit-filters select { width: auto; }
.audit-list { margin-top: 8px; }
.audit-day { font: 700 13px/1 var(--display); color: var(--muted); margin: 18px 0 8px; }
.audit-row { display: flex; gap: 12px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.audit-row .av { width: 34px; height: 34px; font-size: 12px; flex: none; }
.audit-row .av.hpci { background: var(--ink); color: var(--panel); display: grid; place-items: center; font-weight: 700; border-radius: 50%; }
.audit-row p { font-size: 14.500px; line-height: 1.4; overflow-wrap: anywhere; }
.audit-row small { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 12.500px; margin-top: 2px; }
.audit-row .ip { font-variant-numeric: tabular-nums; }
.audit-row.via-support { background: color-mix(in srgb, var(--hot-soft) 45%, transparent); border-radius: 12px; }
#auditMore { margin-top: 14px; }

@media (max-width: 860px) {
  .emoji-pop { left: -110px; width: min(316px, calc(100vw - 24px)); }
  .emoji-grid { grid-template-columns: repeat(7, 1fr); }
  .key-row { font-size: 14px; }
  .inline-form { flex-direction: column; }
  .audit-filters { width: 100%; }
  .audit-filters select { flex: 1; }
}
@media (max-width: 860px) {
  .composer { gap: 2px; padding-left: 8px; padding-right: 8px; }
  .composer > .icon-btn, .composer .combo-wrap > .icon-btn, .composer .emoji-wrap > .icon-btn { padding: 7px 5px; }
  .composer textarea { margin-left: 4px; margin-right: 4px; min-width: 0; }
}
#sendBody::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- etapa 7: Biblioteca (pagina publica de ayuda) ---- */
.app.view-help .list, .app.view-help .chat, .app.view-help .side { display: none; }
#hlMain { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#helpView .page-head .btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
#helpView .page-head .btn svg { width: 17px; height: 17px; }
.hl-body { flex: 1; overflow-y: auto; padding: 0 24px 24px; }
.hl-bar { margin-bottom: 14px; }
.hl-bar .search { margin: 0; flex: 1 1 220px; max-width: 340px; }
.hl-bar .chips { padding: 0; margin-right: auto; }
.hl-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 16px; border-radius: 18px;
  background: var(--hot-soft); color: var(--hot-ink); font-size: 14.5px; }
.hl-banner span { flex: 1 1 260px; }
.hl-banner .link { color: inherit; font-weight: 700; }

.hl-list { display: grid; gap: 8px; }
.hl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 104px; gap: 18px; align-items: center; width: 100%; text-align: left;
  padding: 14px 18px; border-radius: 18px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--edge), var(--lift-sm); }
.hl-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.hl-row-main { min-width: 0; display: grid; gap: 4px; }
.hl-row strong { font: 700 16.5px/1.25 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-row small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 13px; }
.hl-topic-chip { padding: 2px 9px; border-radius: 8px; background: var(--sunk); color: var(--ink); font-weight: 500; }
.hl-row-stats { display: grid; justify-items: end; gap: 2px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hl-row-stats .good { color: var(--accent-lo); font-weight: 600; }
.hl-st { justify-self: end; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 9px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.hl-st.published { background: var(--accent-soft); color: var(--accent-lo); }
.hl-st.archived { background: none; box-shadow: inset 0 0 0 1px var(--line); }
#hlEmpty { display: grid; justify-items: center; gap: 14px; max-width: 460px; margin: 0 auto; }
#hlEmpty[hidden] { display: none; }

/* editor */
.hl-editor { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.hl-editor[hidden] { display: none; }
.hl-ed-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.hl-ed-head .hl-saved { margin-right: auto; font-size: 13.5px; color: var(--muted); }
.hl-saved.bad { color: var(--danger); font-weight: 600; }
.hl-ed-head .btn { text-decoration: none; color: inherit; white-space: nowrap; }
.hl-ed-head .btn.primary { color: var(--accent-ink); }
.hl-ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; padding: 22px 24px 40px; align-items: start; }
.hl-ed-main { min-width: 0; max-width: 760px; }
.hl-title { font: 700 30px/1.2 var(--display); letter-spacing: -.01em; border: 0; background: none; box-shadow: none; padding: 4px 0; border-radius: 0; }
.hl-title:focus, .hl-summary:focus { outline: none; }
.hl-summary { font-size: 17px; color: var(--muted); border: 0; background: none; box-shadow: none; padding: 4px 0 12px; border-radius: 0;
  border-bottom: 1px solid var(--line); field-sizing: content; min-height: 2.4em; }
.hl-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 16px 0 8px; }
.hl-tools .seg3 { margin-right: 10px; flex: none; width: auto; height: auto; font-size: inherit; order: 0; }
.hl-tools .seg3 button { white-space: nowrap; }
.hl-tools > button { min-width: 36px; height: 34px; padding: 0 9px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--ink);
  font: 600 14px/1 var(--body); display: inline-grid; place-items: center; }
.hl-tools > button:hover { background: var(--sunk); border-color: var(--line); }
.hl-tools > button svg { width: 18px; height: 18px; }
.hl-tools.off > button { opacity: .35; pointer-events: none; }
.hl-tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.hl-body-input { min-height: 420px; font: 400 16px/1.65 var(--body); resize: vertical; field-sizing: content; }
.hl-preview { min-height: 420px; padding: 18px 22px; border-radius: 16px; border: 1px solid var(--line); font-size: 16.5px; line-height: 1.7; overflow-wrap: anywhere; }
.hl-preview > * + * { margin-top: 1em; }
.hl-preview h1, .hl-preview h2, .hl-preview h3 { font-family: var(--display); line-height: 1.25; margin-top: 1.5em; }
.hl-preview h2 { font-size: 22px; } .hl-preview h3 { font-size: 18px; } .hl-preview h1 { font-size: 25px; }
.hl-preview > :first-child { margin-top: 0; }
.hl-preview ul, .hl-preview ol { padding-left: 1.4em; }
.hl-preview a { color: var(--cool); }
.hl-preview img { max-width: 100%; border-radius: 14px; border: 1px solid var(--line); display: block; }
.hl-preview blockquote { padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); border-left: 4px solid var(--accent); }
.hl-preview code { font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--sunk); }
.hl-preview table { border-collapse: collapse; } .hl-preview th, .hl-preview td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.hl-ed-side { display: grid; gap: 4px; padding: 18px; border-radius: 20px; background: var(--raised); border: 1px solid var(--line);
  box-shadow: var(--edge), var(--lift-sm); position: sticky; top: 84px; }
.hl-ed-side .hl-st { justify-self: start; margin-bottom: 12px; }
.hl-ed-side label { margin-bottom: 12px; }
.slug-in { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--sunk); box-shadow: var(--inset); overflow: hidden; }
.slug-in span { padding: 0 2px 0 12px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 40px; }
.slug-in input { border: 0; background: none; box-shadow: none; padding-left: 0; border-radius: 0; flex: 1 0 90px; min-width: 0; }
.hl-ed-side .slug-in { display: block; }
.hl-ed-side .slug-in span { display: block; padding: 8px 12px 0; direction: ltr; font-size: 12px; }
.hl-ed-side .slug-in input { padding: 4px 12px 9px; width: 100%; }
.hl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.hl-stats[hidden] { display: none; }
.hl-stats div { padding: 10px 12px; border-radius: 14px; background: var(--sunk); box-shadow: var(--inset); display: grid; gap: 2px; }
.hl-stats b { font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.hl-stats span { font-size: 12px; color: var(--muted); }
.hl-who { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.hl-ed-side .link { justify-self: start; padding: 4px 0; }

/* temas */
.hl-topics { display: grid; gap: 8px; max-width: 860px; }
.hl-lang-h { font: 700 13px/1 var(--display); color: var(--muted); margin: 14px 0 2px; }
.hl-topic { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: var(--raised); border: 1px solid var(--line);
  box-shadow: var(--edge), var(--lift-sm); }
.hl-topic-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--sunk); box-shadow: var(--inset); flex: none; }
.hl-topic-ic.letter { font: 700 17px/1 var(--display); color: var(--cool); }
.hl-topic-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hl-topic-info small { color: var(--muted); font-size: 13px; }
.hl-topic-n { font-size: 13px; color: var(--muted); white-space: nowrap; }
.hl-topic-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.hl-topic-acts .mv { width: 32px; height: 32px; font-size: 16px; }
.hl-topic-acts .mv:disabled { opacity: .3; }
.hl-topic-acts .link { margin-left: 6px; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.emoji-row button { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; border: 1px solid transparent; background: var(--sunk); }
.emoji-row button.on { border-color: var(--accent-lo); background: var(--accent-soft); }
#tpEmoji { width: 84px; text-align: center; font-size: 20px; }

/* tu pagina */
.hl-site-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 32px; align-items: start; max-width: 1100px; }
.hl-site-state { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--sunk); box-shadow: var(--inset); margin-bottom: 6px; }
.hl-site-state > div { flex: 1; min-width: 0; display: grid; gap: 1px; }
.hl-site-state a, .hl-site-state span { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.hl-site-state a { color: var(--cool); }
.hl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); opacity: .5; flex: none; }
.hl-site-state.is-live .hl-dot { background: var(--accent); opacity: 1; box-shadow: 0 0 0 4px var(--accent-soft); }
.hl-site-state .btn { padding: 7px 14px; flex: none; }
.hl-site-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 14px; }
.hl-site-grid .full { grid-column: 1 / -1; }
.color-in { display: flex; align-items: center; gap: 10px; }
.color-in input[type=color] { width: 46px; height: 42px; padding: 3px; flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }
.hl-langs { border: 0; padding: 0; margin: 0 0 14px; }
.hl-langs legend { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 5px; padding: 0; }
.hl-langs .check { display: inline-flex; margin: 4px 16px 4px 0; font-weight: 500; }
.hl-preview-card { position: sticky; top: 0; }
.hl-preview-card > small { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.site-pv { --brand: #25d366; border-radius: 20px; border: 1px solid var(--line); background: var(--bg); overflow: hidden; box-shadow: var(--edge), var(--lift-sm); }
.site-pv-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font: 700 13px/1.2 var(--display); }
.site-pv-top i { width: 24px; height: 24px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 12px; }
.site-pv-hero { margin: 0 10px 10px; padding: 26px 16px 22px; border-radius: 16px; text-align: center;
  background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--brand) 22%, transparent) 1px, transparent 1.6px) 0 0 / 16px 16px, color-mix(in srgb, var(--brand) 11%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
.site-pv-hero b { display: block; font: 700 20px/1.2 var(--display); text-wrap: balance; }
.site-pv-hero p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.site-pv-search { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 5px 5px 5px 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: left; }
.site-pv-search em { font-style: normal; padding: 6px 10px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 600; }
.site-pv-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 4px 10px 14px; }
.site-pv-cards i { height: 54px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.ok { color: var(--accent-lo); font-weight: 600; font-size: 14px; margin-bottom: 8px; }

/* en el chat: mandar un articulo */
.hl-pick-wrap { position: relative; flex: none; }
.hl-pick { left: -100px; bottom: calc(100% + 8px); width: 340px; padding: 10px; display: grid; gap: 8px; }
.hl-pick[hidden] { display: none; }
.hl-pick .search { margin: 0; }
.hl-pick-list { display: grid; gap: 2px; max-height: 280px; overflow-y: auto; }
.hl-pick-list .hint, .hl-pick-list .err { padding: 10px 8px; }
.hl-pick-item { display: grid; gap: 1px; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 12px; }
.hl-pick-item:hover, .hl-pick-item:focus-visible { background: var(--sunk); }
.hl-pick-item b { font-weight: 600; font-size: 14.5px; }
.hl-pick-item span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1000px) {
  .hl-ed-grid { grid-template-columns: 1fr; }
  .hl-ed-side { position: static; }
  .hl-site-wrap { grid-template-columns: 1fr; }
  .hl-preview-card { position: static; order: -1; max-width: 420px; }
}
@media (max-width: 860px) {
  .hl-body { padding: 0 14px 20px; }
  .hl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; }
  .hl-row-stats { grid-column: 1; grid-row: 2; justify-items: start; display: flex; gap: 12px; }
  .hl-row .hl-st { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .hl-row strong { white-space: normal; }
  .hl-ed-head { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .hl-ed-head .btn { padding: 9px 12px; font-size: 14px; }
  .hl-ed-grid { padding: 16px 14px 32px; }
  .hl-title { font-size: 24px; }
  .hl-site-grid { grid-template-columns: 1fr; }
  .hl-topic { flex-wrap: wrap; }
  .hl-topic-info { flex: 1 1 60%; }
  .hl-topic-acts { margin-left: auto; }
  .hl-pick { left: -150px; width: min(340px, calc(100vw - 24px)); }
  .hl-bar .chips { flex: 1 1 100%; order: 5; }
  .rail { gap: 2px; padding-left: 6px; padding-right: 6px; }
  .rail-btn { width: auto; flex: 1 1 0; max-width: 44px; min-width: 0; }
  .hl-bar .search { max-width: none; flex-basis: 100%; }
}
@media (max-width: 600px) {
  /* el telefono ya trae emojis en su teclado: el lugar es para "Mandar un articulo" */
  .composer .emoji-wrap { display: none; }
}

/* Menu lateral con nombres: el mismo riel, abierto. En telefono sigue la barra de abajo. */
.rail-lbl, .rail-who, .rail-chev { display: none; }
.rail-top { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 8px; }
.rail-top .rail-mark { margin-bottom: 4px; }
.rail-foot { display: contents; }
.rail-sub[hidden] { display: none; }
@media (max-width: 860px) { .rail-top { display: none; } .rail-sub { display: none !important; } }
@media (min-width: 861px) {
  .app.rail-wide .rail { width: 236px; align-items: stretch; padding: 14px 12px; gap: 3px; overflow-y: auto; scrollbar-width: none; }
  .app.rail-wide .rail::-webkit-scrollbar { display: none; }
  .app.rail-wide .rail-top { flex-direction: row; gap: 10px; margin-bottom: 14px; padding-left: 2px; }
  .app.rail-wide .rail-top .rail-mark { margin: 0; flex: none; }
  .app.rail-wide .rail-who { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
  .app.rail-wide .rail-who strong { font: 700 15px/1.2 var(--display); letter-spacing: -.01em; }
  .app.rail-wide .rail-who span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app.rail-wide .rail-btn { width: auto; height: 42px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 12px;
    font: 500 14.5px/1 var(--body, inherit); text-align: left; flex: none; }
  .app.rail-wide .rail-btn > svg:first-child { flex: none; }
  .app.rail-wide .rail-btn.on { font-weight: 650; }
  .app.rail-wide .rail-lbl { display: block; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app.rail-wide .rail-toggle { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .app.rail-wide .rail-btn .dot { position: static; order: 3; box-shadow: none; }
  .app.rail-wide .rail-btn .count { position: static; order: 3; box-shadow: none; }
  .app.rail-wide .rail-chev { display: block; width: 16px; height: 16px; flex: none; opacity: .6; transition: transform .16s; }
  .app.rail-wide .rail-btn.open .rail-chev { transform: rotate(180deg); }
  /* las secciones de Administracion van en una bandeja hundida, no en una lista con linea */
  .rail-sub { display: grid; gap: 1px; margin: 2px 0 6px; padding: 6px; border-radius: 16px; background: var(--sunk); box-shadow: var(--inset); }
  .rail-sub button { border: 0; background: none; color: var(--muted); font-size: 13.5px; text-align: left; padding: 8px 10px 8px 14px; border-radius: 10px;
    display: flex; align-items: center; gap: 10px; }
  .rail-sub button::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; flex: none; }
  .rail-sub button:hover { color: var(--ink); }
  .rail-sub button.on { color: var(--ink); font-weight: 650; background: var(--panel); box-shadow: var(--lift-sm); }
  .rail-sub button.on::before { background: var(--accent); opacity: 1; }
  .rail-sub button[hidden] { display: none; }
  /* con el menu abierto las secciones ya estan a la izquierda: sobran las pestanas de arriba */
  .app.rail-wide #admTabs { display: none; }
  .app.rail-wide .rail-foot { display: flex; justify-content: space-between; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
  .app.rail-wide .rail-foot .rail-btn { width: 42px; padding: 0; justify-content: center; }
  .app.rail-wide .me-wrap { margin-top: 8px; }
  .app.rail-wide .me-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border-radius: 16px; text-align: left; }
  .app.rail-wide .me-btn:hover { background: var(--sunk); }
  .app.rail-wide .me-btn .status-dot { position: static; order: 3; }
  .app.rail-wide .me-name { font-weight: 600; font-size: 14px; }
  /* el riel ahora hace scroll: los paneles salen fijos para no quedar recortados */
  .app.rail-wide .notif-panel { position: fixed; left: 262px; top: 76px; }
  .app.rail-wide .me-menu { position: fixed; left: 262px; bottom: 16px; }
}
/* en pantallas medianas el menu abierto cede lugar al chat */
@media (min-width: 861px) and (max-width: 1640px) {
  .app.rail-wide .rail { width: 222px; padding-left: 10px; padding-right: 10px; }
  .app.rail-wide .rail-btn { font-size: 14px; gap: 10px; padding: 0 10px; }
  .app.rail-wide .list { width: 316px; }
  .app.rail-wide .side { width: 296px; }
  .app.rail-wide .notif-panel, .app.rail-wide .me-menu { left: 246px; }
}
/* menu abierto en pantallas bajas: la marca y el pie quedan fijos, se desliza solo la lista */
@media (min-width: 861px) {
  .app.rail-wide .rail-top, .app.rail-wide .rail-sub, .app.rail-wide .rail-foot, .app.rail-wide .me-wrap, .app.rail-wide .bell-wrap { flex: none; }
  .app.rail-wide .bell-wrap { display: grid; }
  .app.rail-wide .rail-top { position: sticky; top: -14px; z-index: 2; background: var(--panel); margin-top: -14px; padding-top: 14px; padding-bottom: 12px; margin-bottom: 2px; }
  .app.rail-wide .rail-foot { position: sticky; bottom: 58px; z-index: 2; background: var(--panel); padding-bottom: 2px; }
  .app.rail-wide .me-wrap { position: sticky; bottom: -14px; z-index: 2; background: var(--panel); margin: 0 0 -14px; padding: 8px 0 14px; }
}
