/* Órbita · lenguaje de Nebur OS 0.6: papel marfil, tinta midnight, tarjetas grises sin borde, píldoras.
   El color dice estado: el acento (rojo Nebur por defecto, el de la marca del cliente si lo hay) solo late:
   urgentes, menciones, no leídos. Todo lo demás es tinta y papel. */

@font-face { font-family: "Archivo"; src: url("../fonts/Archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  --acento: #c63131;
  --bg: #f6f5f1; --bg-2: #efede8; --bg-3: #e9e7e1; --card: #fbfaf7; --white: #fff;
  --ink: #0b0f1a; --ink-2: rgba(11, 15, 26, .64); --ink-3: rgba(11, 15, 26, .42); --ink-4: rgba(11, 15, 26, .22); --ink-5: rgba(11, 15, 26, .06);
  --line: rgba(11, 15, 26, .09); --line-2: rgba(11, 15, 26, .14);
  --red: var(--acento);
  --red-soft: color-mix(in srgb, var(--acento) 10%, transparent);
  --red-halo: color-mix(in srgb, var(--acento) 16%, transparent);
  --red-deep: color-mix(in srgb, var(--acento) 55%, #000);
  --ok: #2c7a52; --ok-soft: rgba(44, 122, 82, .10); --ok-bright: #7fd1a3;
  --warn: #a8670f; --warn-soft: rgba(168, 103, 15, .11);
  --space: #04060c; --space-ink: #eef0f6; --space-2: rgba(238, 240, 246, .62); --space-3: rgba(238, 240, 246, .4);
  --f: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.23, 1, .32, 1); --ease-io: cubic-bezier(.65, 0, .35, 1);
  --r-card: 22px; --r-in: 12px;
  --side-w: 256px;
  --shadow-win: 0 18px 40px -30px rgba(11, 15, 26, .45);
  --shadow-pop: 0 24px 60px -24px rgba(11, 15, 26, .35), 0 1px 0 rgba(11, 15, 26, .04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden; touch-action: manipulation; }
::selection { background: var(--ink); color: var(--bg); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 520; letter-spacing: -.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(11, 15, 26, .14); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(11, 15, 26, .24); }
::-webkit-scrollbar-track { background: transparent; }
.ico { width: 18px; height: 18px; flex: none; }

/* ═════════════ kit ═════════════ */
.n-mono { font-family: var(--mono); font-size: .8em; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.n-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.n-soft { color: var(--ink-3); }
.n-muted { color: var(--ink-2); }
.n-h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.04; letter-spacing: -.034em; font-weight: 520; }
.n-h3 { font-size: 16px; line-height: 1.25; letter-spacing: -.012em; font-weight: 560; }
.n-lede { font-size: 15.5px; color: var(--ink-2); max-width: 62ch; }

.n-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; font: 500 14px/1 var(--f); white-space: nowrap; cursor: pointer;
  transition: transform .16s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease); }
.n-btn:active { transform: scale(.97); }
.n-btn:disabled { opacity: .45; cursor: default; transform: none; }
.n-btn--dark { background: var(--ink); color: var(--bg); }
.n-btn--dark:hover:not(:disabled) { background: #1c2233; }
.n-btn--soft { background: var(--ink-5); color: var(--ink); }
.n-btn--soft:hover:not(:disabled) { background: rgba(11, 15, 26, .1); }
.n-btn--ghost { color: var(--ink-2); }
.n-btn--ghost:hover:not(:disabled) { background: var(--ink-5); color: var(--ink); }
.n-btn--danger { color: var(--red); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acento) 30%, transparent); }
.n-btn--danger:hover:not(:disabled) { background: var(--red-soft); }
.n-btn--sm { height: 32px; padding: 0 13px; font-size: 13px; }
.n-btn--xs { height: 26px; padding: 0 10px; font-size: 12px; }
.n-btn .ico { width: 16px; height: 16px; }

.n-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--red-soft); color: var(--red-deep); font-weight: 600; white-space: nowrap; letter-spacing: .01em; }
.n-tag--ink { background: var(--ink-5); color: var(--ink-2); }
.n-tag--ok { background: var(--ok-soft); color: var(--ok); }
.n-tag--warn { background: var(--warn-soft); color: var(--warn); }
.n-tag .ico { width: 12px; height: 12px; }
.n-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-halo); flex: none; display: inline-block; }
.n-dot--beat { animation: n-beat 1.8s var(--ease-io) infinite; }
@keyframes n-beat { 0%, 100% { box-shadow: 0 0 0 3px var(--red-halo) } 50% { box-shadow: 0 0 0 7px transparent } }
@keyframes n-fade { from { opacity: 0 } }
@keyframes n-up { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

.n-card { background: var(--bg-2); border-radius: var(--r-card); padding: 20px 22px; min-width: 0; }

/* campos */
.n-field { display: grid; gap: 6px; }
.n-field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.n-input { width: 100%; height: 42px; padding: 0 14px; border-radius: var(--r-in); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 14.5px; transition: border-color .15s, box-shadow .15s; }
textarea.n-input { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.n-input:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 4px rgba(11, 15, 26, .06); }
.n-input::placeholder { color: var(--ink-3); }
select.n-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0f1a' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }
.n-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; line-height: 1.4; }
.n-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.n-check small { display: block; color: var(--ink-3); font-size: 12.5px; }
.n-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--ink-5); }
.n-seg > button { padding: 6px 13px; border-radius: 999px; font-size: 13px; color: var(--ink-2); transition: background-color .15s, color .15s; }
.n-seg > button:hover { color: var(--ink); }
.n-seg > button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 560; box-shadow: 0 1px 2px rgba(11, 15, 26, .08), 0 0 0 1px var(--line); }

/* avatar: iniciales sobre el color de la persona */
.av { --c: var(--ink); width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; position: relative;
  background: color-mix(in srgb, var(--c) 16%, var(--card)); color: color-mix(in srgb, var(--c) 78%, #000); font-size: 13px; font-weight: 600; letter-spacing: -.01em; user-select: none; }
.av--sm { width: 24px; height: 24px; font-size: 10px; }
.av--xs { width: 22px; height: 22px; font-size: 8.5px; letter-spacing: -.03em; }
.av--lg { width: 48px; height: 48px; font-size: 17px; }
.av[data-on]::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 8px; min-height: 8px; border-radius: 50%; background: var(--ink-4); border: 2px solid var(--bg); }
.av[data-on="1"]::after { background: #3fb873; }

/* ═════════════ acceso ═════════════ */
.acc { height: 100%; display: grid; place-items: center; padding: 24px; overflow: auto; }
.acc__box { width: min(400px, 100%); display: grid; gap: 22px; animation: n-up .4s var(--ease) both; }
.acc__brand { display: flex; align-items: center; gap: 12px; }
.acc__brand b { display: block; font-size: 15px; font-weight: 600; }
.acc__brand small { display: block; font-size: 12px; color: var(--ink-3); }
.acc form { display: grid; gap: 14px; }
.acc .n-btn { width: 100%; height: 44px; }
.acc__err { color: var(--red-deep); background: var(--red-soft); padding: 9px 13px; border-radius: 12px; font-size: 13.5px; }
.marca { width: 38px; height: 38px; border-radius: 11px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 640; font-size: 16px; flex: none; position: relative; }
.marca::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }

/* ═════════════ armazón ═════════════ */
.sh { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100%; min-width: 0; }
.sh-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }

/* barra lateral */
.sb { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 12px 12px; background: var(--bg); border-right: 1px solid var(--line); scrollbar-width: none; }
.sb::-webkit-scrollbar { display: none; }
.sb__brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; min-width: 0; }
.sb__brand > div { min-width: 0; }
.sb__brand b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb__brand small { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.sb__search { display: flex; align-items: center; gap: 9px; height: 36px; width: 100%; margin: 0 0 10px; padding: 0 8px 0 11px; border-radius: 999px; background: var(--ink-5); color: var(--ink-3); font-size: 13.5px; transition: background-color .15s, color .15s; }
.sb__search:hover { background: rgba(11, 15, 26, .09); color: var(--ink-2); }
.sb__search .ico { width: 16px; height: 16px; }
.sb__search kbd { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); padding: 2px 6px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); }
.sb ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.sb__label { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 16px 6px 6px 12px; }
.sb__add { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); transition: background-color .15s, color .15s; }
.sb__add:hover { background: var(--ink-5); color: var(--ink); }
.sb__add .ico { width: 15px; height: 15px; }
.sb__item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-height: 34px; border-radius: 10px; color: var(--ink-2); font-size: 14px; text-align: left; transition: background-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease); text-decoration: none; }
.sb__item .ico { width: 18px; height: 18px; color: var(--ink-3); transition: color .18s; }
.sb__item:hover { background: var(--ink-5); color: var(--ink); }
.sb__item:hover .ico { color: var(--ink-2); }
.sb__item:active { transform: scale(.985); }
.sb__item[aria-current="page"] { background: var(--card); color: var(--ink); font-weight: 560; box-shadow: 0 1px 2px rgba(11, 15, 26, .06), 0 0 0 1px var(--line); }
.sb__item[aria-current="page"] .ico { color: var(--ink); }
.sb__item.is-unread { color: var(--ink); font-weight: 600; }
.sb__item.is-muted { opacity: .62; }
.sb__hash { width: 18px; text-align: center; color: var(--ink-3); font-size: 15px; flex: none; font-weight: 400; }
.sb__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__cnt { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 18px; text-align: right; font-weight: 400; }
.sb__cnt--hot { color: var(--red); display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.sb__cnt--hot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-halo); }
.sb__cnt--hot.is-beat::before { animation: n-beat 1.8s var(--ease-io) infinite; }
.sb__lock { width: 13px; height: 13px; color: var(--ink-3); }
.sb__foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid var(--line); }
.sb__me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; text-align: left; transition: background-color .15s; min-width: 0; }
.sb__me:hover { background: var(--ink-5); }
.sb__me > div { min-width: 0; flex: 1; }
.sb__me b { display: block; font-size: 13.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb__me small { display: block; font-size: 11.5px; color: var(--ink-3); }
.sb__me > .ico { color: var(--ink-3); }
.sb__clock { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 6px; }
.sb__hm { font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sb__dd { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.sb__net { font-family: var(--mono); font-size: 11px; color: var(--warn); display: flex; align-items: center; gap: 7px; padding: 0 6px; }
.sb__net::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* barra superior de cada vista */
.tb { flex: none; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 20px 0 24px; border-bottom: 1px solid var(--line); min-width: 0; }
.tb__back { display: none; width: 34px; height: 34px; border-radius: 50%; place-items: center; flex: none; background: var(--ink-5); color: var(--ink-2); }
.tb__back .ico { transform: rotate(180deg); width: 16px; height: 16px; }
.tb__title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; }
.tb__title .sb__hash { font-size: 18px; }
.tb__topic { color: var(--ink-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line-2); }
.tb__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.tb__icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background-color .15s, color .15s; }
.tb__icon:hover { background: var(--ink-5); color: var(--ink); }
.tb__icon[aria-pressed="true"] { color: var(--red); }
.tb__icon .ico { width: 17px; height: 17px; }
.stack { display: flex; align-items: center; padding: 3px 10px 3px 4px; border-radius: 999px; gap: 8px; transition: background-color .15s; font-size: 12.5px; color: var(--ink-2); }
.stack:hover { background: var(--ink-5); }
.stack > span { display: flex; }
.stack .av { box-shadow: 0 0 0 2px var(--bg); }
.stack .av + .av { margin-left: -7px; }

/* ═════════════ chat ═════════════ */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 0 10px; overscroll-behavior: contain; }
.msgs__start { padding: 26px 28px 18px; display: grid; gap: 8px; }
.msgs__start .marca { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; }
.msgs__start .marca::after { display: none; }
.msgs__more { display: flex; justify-content: center; padding: 6px 0 12px; }
.day { display: flex; align-items: center; gap: 14px; padding: 14px 28px 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.day::before, .day::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.new-line { display: flex; align-items: center; gap: 10px; padding: 8px 28px 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.new-line::after { content: ""; height: 1px; flex: 1; background: color-mix(in srgb, var(--acento) 45%, transparent); }

.m { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; padding: 6px 28px 4px; transition: background-color .2s; }
.m:hover { background: rgba(11, 15, 26, .025); }
.m.is-cont { padding-top: 1px; }
.m.is-cont > .av { visibility: hidden; height: 0; }
.m.is-flash { animation: m-flash 1.6s var(--ease) both; }
@keyframes m-flash { from { background: var(--warn-soft) } }
.m__head { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.m__who { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.m__time { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.m__side { position: absolute; left: 28px; width: 36px; text-align: center; top: 5px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); opacity: 0; transition: opacity .15s; }
.m.is-cont:hover .m__side { opacity: 1; }
.m__body { grid-column: 2; min-width: 0; }
.m__text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; line-height: 1.55; }
.m__text a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-4); }
.m__text a:hover { text-decoration-color: currentColor; }
.m__text .men { background: var(--ink-5); color: var(--ink); font-weight: 560; border-radius: 6px; padding: 0 4px; }
.m__text .men.is-me { background: var(--red-soft); color: var(--red-deep); }
.m__text.is-deleted { color: var(--ink-3); font-style: italic; }
.m__edited { font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.m.is-urgent { background: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); }
.m.is-mention:not(.is-urgent) { background: color-mix(in srgb, var(--acento) 5%, transparent); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--acento) 55%, transparent); }
.m__quote { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); margin: 0 0 4px; padding: 2px 0 2px 10px; border-left: 2px solid var(--line-2); cursor: pointer; min-width: 0; }
.m__quote b { font-weight: 560; color: var(--ink); flex: none; }
.m__quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m__seen { margin-top: 4px; font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.m__seen .ico { width: 14px; height: 14px; color: var(--ok); }
.m__seen.is-wait { color: var(--red-deep); }
.m__seen.is-wait .n-dot { width: 6px; height: 6px; }
.m__task { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--ink-2); padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--ink-5); transition: background-color .15s; }
.m__task:hover { background: rgba(11, 15, 26, .1); color: var(--ink); }
.m__task .ico { width: 14px; height: 14px; }
.m__img { display: block; margin-top: 6px; max-width: min(360px, 100%); max-height: 280px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); cursor: zoom-in; object-fit: cover; }
.m__file { display: inline-flex; align-items: center; gap: 11px; margin-top: 6px; padding: 9px 14px 9px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-decoration: none; max-width: 100%; transition: border-color .15s; }
.m__file:hover { border-color: var(--line-2); }
.m__file .ico { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--bg-2); color: var(--ink-2); }
.m__file b { display: block; font-size: 13.5px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.m__file small { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.react { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; transition: border-color .15s, background-color .15s, transform .12s var(--ease); }
.react b { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-2); }
.react:hover { border-color: var(--ink-4); }
.react:active { transform: scale(.94); }
.react.is-mine { background: var(--ink-5); border-color: var(--ink-3); }
.m__acts { position: absolute; right: 20px; top: -14px; display: none; gap: 1px; padding: 3px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-win); z-index: 3; }
.m:hover .m__acts, .m:focus-within .m__acts, .m.is-menu .m__acts { display: flex; }
.m__acts button { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); font-size: 15px; transition: background-color .12s, color .12s; }
.m__acts button:hover { background: var(--ink-5); color: var(--ink); }
.m__acts button.is-danger:hover { color: var(--red); background: var(--red-soft); }
.m__acts .ico { width: 16px; height: 16px; }
.picker { position: absolute; right: 20px; top: 20px; z-index: 5; display: flex; gap: 2px; padding: 5px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: n-up .18s var(--ease) both; }
.picker button { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; transition: background-color .12s, transform .12s var(--ease); }
.picker button:hover { background: var(--ink-5); transform: scale(1.12); }
.m__edit { display: grid; gap: 8px; margin-top: 4px; }
.m__edit textarea { min-height: 60px; }
.m__edit div { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); }

/* barra de escribir (la de Sylvanas) */
.cb-dock { flex: none; padding: 6px 24px 16px; position: relative; }
.cb-typing { height: 18px; padding: 0 14px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.cb-typing i { display: inline-flex; gap: 3px; }
.cb-typing i b { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); animation: n-typing 1.2s var(--ease-io) infinite; }
.cb-typing i b:nth-child(2) { animation-delay: .15s; }
.cb-typing i b:nth-child(3) { animation-delay: .3s; }
@keyframes n-typing { 0%, 60%, 100% { opacity: .3; transform: none } 30% { opacity: 1; transform: translateY(-2px) } }
.cb-ctx { display: flex; align-items: center; gap: 10px; margin: 0 18px -1px; padding: 8px 8px 8px 14px; border-radius: 16px 16px 0 0; background: var(--bg-2); font-size: 12.5px; color: var(--ink-2); min-width: 0; animation: n-up .2s var(--ease) both; }
.cb-ctx span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-ctx b { color: var(--ink); font-weight: 560; }
.cb-ctx .ico { width: 15px; height: 15px; }
.cb-ctx button { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.cb-ctx button:hover { background: var(--ink-5); }
.cb-pill { display: flex; align-items: flex-end; gap: 8px; min-height: 54px; padding: 7px 7px 7px 8px; border-radius: 27px; background: var(--card); border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgba(11, 15, 26, .04), 0 14px 32px -22px rgba(11, 15, 26, .35); transition: box-shadow .2s var(--ease), border-color .2s var(--ease); }
.cb-pill:focus-within { border-color: var(--ink-3); box-shadow: 0 0 0 4px rgba(11, 15, 26, .06), 0 14px 32px -22px rgba(11, 15, 26, .35); }
.cb-pill.is-urgent { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-halo); }
.cb-pill textarea { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; resize: none; padding: 9px 4px; font-size: 14.5px; line-height: 1.45; max-height: 200px; height: 40px; }
.cb-pill textarea::placeholder { color: var(--ink-3); }
.cb-round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--ink-2); background: var(--bg-2); transition: background-color .15s, color .15s, transform .16s var(--ease); }
.cb-round:hover { background: var(--bg-3); color: var(--ink); }
.cb-round:active { transform: scale(.93); }
.cb-round .ico { width: 18px; height: 18px; }
.cb-chip { height: 40px; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 0 13px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; flex: none; transition: background-color .15s, color .15s, transform .16s var(--ease); }
.cb-chip:hover { background: var(--bg-3); color: var(--ink); }
.cb-chip:active { transform: scale(.97); }
.cb-chip[aria-pressed="true"] { background: var(--red); color: #fff; }
.cb-chip[aria-pressed="true"] .n-dot { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .3); }
.cb-send { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; transition: transform .16s var(--ease), opacity .2s, background-color .18s; }
.cb-send:disabled { opacity: .22; cursor: default; }
.cb-send:not(:disabled):hover { background: #1c2233; }
.cb-send:not(:disabled):active { transform: scale(.93); }
.cb-send .ico { width: 17px; height: 17px; }
.cb-pill.is-urgent .cb-send:not(:disabled) { background: var(--red); }
.cb-up { position: absolute; left: 32px; bottom: 76px; display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-win); font-size: 12.5px; color: var(--ink-2); }
.cb-up i { display: block; width: 90px; height: 4px; border-radius: 999px; background: var(--ink-5); overflow: hidden; }
.cb-up i b { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }
.mention-pop { position: absolute; left: 32px; bottom: 76px; width: min(320px, calc(100% - 64px)); background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop); padding: 6px; display: grid; gap: 1px; z-index: 6; animation: n-up .16s var(--ease) both; }
.mention-pop button { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 10px; text-align: left; font-size: 13.5px; }
.mention-pop button small { color: var(--ink-3); margin-left: auto; font-size: 12px; }
.mention-pop button[aria-selected="true"], .mention-pop button:hover { background: var(--ink-5); }
.jump { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 4; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-win); animation: n-up .2s var(--ease) both; }
.jump .ico { width: 14px; height: 14px; transform: rotate(90deg); }

/* ═════════════ páginas (tareas, tablón, personas) ═════════════ */
.pg { flex: 1; min-height: 0; overflow-y: auto; }
.pg__in { max-width: 1180px; margin: 0 auto; padding: 34px 32px 48px; display: grid; gap: 26px; }
.pg__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.pg__head > div { display: grid; gap: 8px; }
.pg__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* tareas: tablero */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--bg-2); border-radius: var(--r-card); padding: 14px 12px 12px; display: grid; gap: 8px; min-height: 160px; transition: background-color .2s, box-shadow .2s; align-content: start; }
.col.is-over { background: var(--bg-3); box-shadow: inset 0 0 0 2px var(--ink-4); }
.col__head { display: flex; align-items: center; gap: 8px; padding: 2px 8px 6px; font-size: 13.5px; font-weight: 600; }
.col__head .n-mono { color: var(--ink-3); font-weight: 400; margin-left: auto; }
.col__head i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); }
.col[data-estado="en_curso"] .col__head i { background: var(--warn); }
.col[data-estado="hecha"] .col__head i { background: var(--ok); }
.col__empty { padding: 18px 10px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.tk { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 11px; padding: 12px 13px 11px 11px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); width: 100%; }
.tk:hover { border-color: var(--line-2); box-shadow: var(--shadow-win); }
.tk.is-dragging { opacity: .45; }
.tk.is-done .tk__title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.tk__check { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--ink-4); display: grid; place-items: center; margin-top: 1px; transition: border-color .15s, background-color .15s, transform .15s var(--ease); color: transparent; }
.tk__check:hover { border-color: var(--ok); color: var(--ok); }
.tk__check:active { transform: scale(.88); }
.tk.is-done .tk__check { background: var(--ok); border-color: var(--ok); color: #fff; }
.tk__check .ico { width: 13px; height: 13px; stroke-width: 2.4; }
.tk__title { font-size: 14px; font-weight: 520; line-height: 1.35; overflow-wrap: anywhere; }
.tk__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.tk__meta .n-mono { font-size: 11px; }
.tk__due { display: inline-flex; align-items: center; gap: 4px; }
.tk__due .ico { width: 13px; height: 13px; }
.tk__due.is-late { color: var(--red); font-weight: 500; }
.tk__due.is-today { color: var(--warn); font-weight: 500; }
.tk__who { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }

/* tablón */
.board-list { display: grid; gap: 14px; max-width: 820px; }
.an { background: var(--bg-2); border-radius: var(--r-card); padding: 22px 24px 18px; display: grid; gap: 12px; }
.an.is-unread { background: var(--card); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-win); }
.an.is-important.is-unread { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--acento) 45%, transparent), var(--shadow-win); }
.an__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an__top .n-eyebrow { margin-left: auto; }
.an h2 { font-size: 21px; line-height: 1.2; letter-spacing: -.022em; font-weight: 560; }
.an__text { white-space: pre-wrap; color: var(--ink-2); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.an__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.an__foot .grow { flex: 1; }
.an__reads { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); border-radius: 999px; padding: 3px 8px 3px 4px; transition: background-color .15s; }
.an__reads:hover { background: var(--ink-5); }
.an__reads > span { display: flex; }
.an__reads .av { box-shadow: 0 0 0 2px var(--bg-2); }
.an.is-unread .an__reads .av { box-shadow: 0 0 0 2px var(--card); }
.an__reads .av + .av { margin-left: -6px; }

/* personas */
.people { display: grid; gap: 2px; background: var(--bg-2); border-radius: var(--r-card); padding: 8px; }
.person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; text-align: left; transition: background-color .15s; width: 100%; }
.person:hover { background: var(--bg-3); }
.person b { display: block; font-weight: 560; font-size: 14.5px; }
.person small { display: block; color: var(--ink-3); font-size: 12.5px; }
.person.is-off { opacity: .55; }

/* vacío */
.empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 60px 20px; color: var(--ink-2); }
.empty .ico { width: 34px; height: 34px; color: var(--ink-4); }

/* ═════════════ diálogos ═════════════ */
.dlg-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(246, 245, 241, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: n-fade .2s var(--ease) both; }
.dlg { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow-pop); padding: 22px 24px 20px; display: grid; gap: 16px; animation: n-up .28s var(--ease) both; }
.dlg--wide { width: min(640px, 100%); }
.dlg__head { display: flex; align-items: center; gap: 12px; }
.dlg__head h2 { font-size: 19px; font-weight: 560; letter-spacing: -.02em; flex: 1; }
.dlg__x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.dlg__x:hover { background: var(--ink-5); color: var(--ink); }
.dlg__x .ico { width: 16px; height: 16px; }
.dlg form { display: grid; gap: 14px; }
.dlg__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg__foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding-top: 4px; flex-wrap: wrap; }
.dlg__foot .grow { flex: 1; }
.dlg__msg { font-size: 13px; color: var(--red-deep); }
.dlg__list { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; }
.dlg__list > * { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; font-size: 14px; text-align: left; }
.dlg__list > button:hover, .dlg__list > label:hover { background: var(--ink-5); }
.dlg__list small { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .15s var(--ease); }
.colors button:hover { transform: scale(1.1); }
.colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.switcher input { height: 48px; font-size: 16px; border-radius: 14px; }

/* visor de imágenes */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(4, 6, 12, .86); display: grid; place-items: center; padding: 30px; cursor: zoom-out; animation: n-fade .2s both; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ═════════════ alerta a pantalla completa (urgentes en canales con alerta) ═════════════ */
.alarm { position: fixed; inset: 0; z-index: 80; background: var(--space); color: var(--space-ink); display: grid; place-items: center; padding: 28px; animation: n-fade .25s var(--ease) both; }
.alarm::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--acento) 32%, transparent), transparent 62%); animation: alarm-glow 2s var(--ease-io) infinite; pointer-events: none; }
@keyframes alarm-glow { 50% { opacity: .45 } }
.alarm__box { position: relative; width: min(760px, 100%); display: grid; gap: 22px; text-align: center; justify-items: center; }
.alarm__tag { display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--red); padding: 8px 18px; border-radius: 999px; }
.alarm__tag .n-dot { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); animation: none; }
.alarm__who { display: flex; align-items: center; gap: 12px; font-size: 18px; color: var(--space-2); }
.alarm__who b { color: var(--space-ink); font-weight: 560; }
.alarm__text { font-size: clamp(28px, 4.4vw, 54px); line-height: 1.12; letter-spacing: -.03em; font-weight: 520; overflow-wrap: anywhere; max-height: 46vh; overflow-y: auto; }
.alarm__acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.alarm__seen { height: 64px; padding: 0 44px; font-size: 19px; background: #fff; color: var(--ink); }
.alarm__seen:hover:not(:disabled) { background: var(--space-ink); }
.alarm__quick { height: 44px; background: rgba(238, 240, 246, .1); color: var(--space-ink); }
.alarm__quick:hover:not(:disabled) { background: rgba(238, 240, 246, .18); }
.alarm__more { font-size: 13px; color: var(--space-3); font-family: var(--mono); letter-spacing: .04em; }

/* avisos */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow-pop); animation: n-up .25s var(--ease) both; }
.toast.is-bad { background: var(--red); color: #fff; }

/* ═════════════ móvil ═════════════ */
@media (max-width: 760px) {
  .sh { grid-template-columns: minmax(0, 1fr); }
  .sb { border-right: 0; padding-top: max(16px, env(safe-area-inset-top)); }
  body:not(.is-lista) .sb { display: none; }
  body.is-lista .sh-main { display: none; }
  .tb { padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .tb__back { display: grid; }
  .tb__topic { display: none; }
  .m { padding-left: 14px; padding-right: 14px; column-gap: 11px; }
  .m__side { left: 14px; }
  .day, .new-line, .msgs__start { padding-left: 14px; padding-right: 14px; }
  .m__acts { right: 10px; }
  .cb-dock { padding: 4px 10px max(10px, env(safe-area-inset-bottom)); }
  .cb-chip span:not(.n-dot) { display: none; }
  .sb__search kbd { display: none; }
  .cb-chip { padding: 0 13px; }
  .pg__in { padding: 22px 16px 40px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .dlg__row { grid-template-columns: 1fr; }
  .sb__item { min-height: 42px; font-size: 15px; }
  .stack > b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
