/* Teamwright · sistema visual en DESIGN.md */

:root {
  --bg: oklch(1 0 0);
  --rail: oklch(0.965 0.014 255);
  --sunken: oklch(0.972 0.01 255);
  --surface: oklch(1 0 0);
  --ink: oklch(0.24 0.035 262);
  --ink-2: oklch(0.45 0.03 260);
  --ink-3: oklch(0.58 0.025 260);
  --line: oklch(0.91 0.012 255);
  --line-strong: oklch(0.83 0.016 255);
  --hover: oklch(0.24 0.035 262 / 0.05);
  --hover-2: oklch(0.24 0.035 262 / 0.09);

  --brand: oklch(0.52 0.2 257);
  --brand-hover: oklch(0.46 0.2 257);
  --brand-soft: oklch(0.95 0.035 257);
  --brand-ink: oklch(0.42 0.17 257);
  --on-brand: oklch(1 0 0);
  --accent: oklch(0.72 0.17 48);
  --accent-soft: oklch(0.95 0.05 60);
  --accent-ink: oklch(0.48 0.14 45);
  --ai: oklch(0.6 0.11 185);
  --ai-soft: oklch(0.95 0.035 185);
  --ai-ink: oklch(0.42 0.08 185);
  --ok: oklch(0.6 0.14 150);
  --ok-soft: oklch(0.95 0.05 150);
  --ok-ink: oklch(0.4 0.1 150);
  --warn: oklch(0.8 0.15 82);
  --warn-soft: oklch(0.96 0.06 90);
  --warn-ink: oklch(0.46 0.1 70);
  --danger: oklch(0.58 0.2 27);
  --danger-soft: oklch(0.955 0.03 25);
  --danger-ink: oklch(0.47 0.17 27);

  --shadow-1: 0 1px 2px oklch(0.24 0.035 262 / 0.07), 0 0 0 1px oklch(0.24 0.035 262 / 0.07);
  --shadow-2: 0 10px 28px -8px oklch(0.24 0.035 262 / 0.22), 0 0 0 1px oklch(0.24 0.035 262 / 0.07);
  --shadow-3: 0 24px 60px -12px oklch(0.24 0.035 262 / 0.32), 0 0 0 1px oklch(0.24 0.035 262 / 0.08);
  --scrim: oklch(0.2 0.03 262 / 0.42);

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --ease: cubic-bezier(.25, 1, .5, 1);
  --t: 180ms;
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --z-sticky: 10; --z-rail: 20; --z-dropdown: 30; --z-backdrop: 40; --z-modal: 50; --z-toast: 60;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.18 0.014 262);
    --rail: oklch(0.155 0.014 262);
    --sunken: oklch(0.205 0.016 262);
    --surface: oklch(0.225 0.016 262);
    --ink: oklch(0.94 0.008 260);
    --ink-2: oklch(0.77 0.02 260);
    --ink-3: oklch(0.63 0.02 260);
    --line: oklch(0.3 0.02 262);
    --line-strong: oklch(0.4 0.022 262);
    --hover: oklch(0.94 0.008 260 / 0.06);
    --hover-2: oklch(0.94 0.008 260 / 0.1);
    --brand: oklch(0.68 0.17 257);
    --brand-hover: oklch(0.74 0.15 257);
    --brand-soft: oklch(0.3 0.07 257);
    --brand-ink: oklch(0.84 0.09 257);
    --on-brand: oklch(0.16 0.02 262);
    --accent: oklch(0.76 0.15 55);
    --accent-soft: oklch(0.32 0.06 55);
    --accent-ink: oklch(0.87 0.09 62);
    --ai: oklch(0.72 0.11 185);
    --ai-soft: oklch(0.3 0.05 185);
    --ai-ink: oklch(0.86 0.07 185);
    --ok: oklch(0.7 0.14 150);
    --ok-soft: oklch(0.3 0.06 150);
    --ok-ink: oklch(0.86 0.09 150);
    --warn: oklch(0.82 0.14 85);
    --warn-soft: oklch(0.33 0.06 85);
    --warn-ink: oklch(0.88 0.1 88);
    --danger: oklch(0.68 0.18 27);
    --danger-soft: oklch(0.32 0.08 27);
    --danger-ink: oklch(0.86 0.08 27);
    --shadow-1: 0 1px 2px oklch(0 0 0 / 0.4), 0 0 0 1px oklch(1 0 0 / 0.06);
    --shadow-2: 0 10px 28px -8px oklch(0 0 0 / 0.6), 0 0 0 1px oklch(1 0 0 / 0.07);
    --shadow-3: 0 24px 60px -12px oklch(0 0 0 / 0.7), 0 0 0 1px oklch(1 0 0 / 0.08);
    --scrim: oklch(0.08 0.01 262 / 0.6);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 400 15px/1.5 var(--font); font-optical-sizing: auto; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; letter-spacing: -0.012em; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 650; line-height: 1.25; }
h3 { font-size: 17px; font-weight: 650; }
h4 { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
p { margin: 0 0 .6rem; }
code { font: 0.88em var(--mono); background: var(--hover-2); padding: 1px 5px; border-radius: 4px; }
pre { font: 13px/1.5 var(--mono); background: var(--sunken); border: 1px solid var(--line); padding: .7rem .9rem; border-radius: var(--r-sm); overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: .4rem 0; }
pre code { background: none; padding: 0; }
.codigo { position: relative; }
.codigo pre { padding-right: 5.5rem; }
.codigo [data-act="copiar"] { position: absolute; top: .3rem; right: .3rem; }
.pasos { padding-left: 1.3rem; margin: .4rem 0 .8rem; }
.pasos li { margin: .25rem 0; }
.guia-mcp details { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .45rem .8rem; margin: .4rem 0; }
.guia-mcp summary { cursor: pointer; font-weight: 650; }
.guia-mcp details[open] summary { margin-bottom: .2rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
::selection { background: var(--brand-soft); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.vacio { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 1em; height: 1em; }

/* ---------- Botones y controles ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font: 550 14px/1 var(--font); color: var(--ink); text-decoration: none; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: .62rem .95rem; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.btn:hover { background: var(--sunken); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 1px 0 oklch(1 0 0 / .18) inset, 0 2px 6px -2px var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: oklch(0.2 0.03 45); }
.btn-accent:hover { filter: brightness(1.05); background: var(--accent); color: oklch(0.2 0.03 45); }
.btn-danger { color: var(--danger-ink); border-color: var(--danger); background: var(--danger-soft); }
.btn-danger:hover { background: var(--danger); color: oklch(1 0 0); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover-2); color: var(--ink); }
.btn-sm { font-size: 13px; padding: .38rem .6rem; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn-icon { padding: .4rem; border-radius: var(--r-sm); background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-icon:hover { background: var(--hover-2); color: var(--ink); }
.btn-mini {
  display: inline-flex; align-items: center; gap: .3em; font: 500 12.5px/1 var(--font); color: var(--ink-2);
  background: none; border: 0; border-radius: var(--r-sm); padding: .35rem .45rem; cursor: pointer; text-decoration: none;
}
.btn-mini:hover { background: var(--hover-2); color: var(--ink); }
.btn-mini.peligro:hover { color: var(--danger-ink); background: var(--danger-soft); }

input, textarea, select {
  font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: .5rem .65rem; max-width: 100%;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, textarea:hover, select:hover { border-color: var(--ink-3); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 1rem; height: 1rem; }
textarea { resize: vertical; line-height: 1.45; }
.form label, .grid-2 label { display: block; margin: .8rem 0; font-size: 13.5px; font-weight: 550; color: var(--ink); }
.form label input:not([type=checkbox]):not([type=radio]):not([type=color]), .form label textarea, .form label select,
.grid-2 label input, .grid-2 label select { display: block; width: 100%; margin-top: .35rem; font-weight: 400; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--r); margin: .8rem 0; padding: .5rem .8rem .7rem; max-height: 260px; overflow: auto; }
.form legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 .3rem; }
.form .acciones { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.opcion { display: flex !important; align-items: center; gap: .55rem; margin: .4rem 0 !important; font-weight: 400 !important; cursor: pointer; }
.opcion label { display: flex; align-items: center; gap: .5rem; flex: 1; cursor: pointer; margin: 0; }
.flash { background: var(--warn-soft); color: var(--warn-ink); border-radius: var(--r-sm); padding: .6rem .85rem; margin: .6rem 0; font-size: 14px; }
.flash-error { background: var(--danger-soft); color: var(--danger-ink); }
textarea.code { width: 100%; font: 12.5px/1.5 var(--mono); }
.checks { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .35rem; font-size: 14px; }
.checks .ok { color: var(--ok-ink); } .checks .bad { color: var(--danger-ink); } .checks .warn { color: var(--warn-ink); }

/* ---------- Marca ---------- */
.marca { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.025em; font-variation-settings: 'opsz' 48; }
.marca:hover { color: var(--ink); }
.marca svg { width: 28px; height: 28px; flex: none; transition: transform 260ms var(--ease); }
.marca .m-circ { fill: var(--accent); }
.marca .m-cuad { fill: var(--brand); }
.marca .m-cruce { fill: oklch(0.36 0.16 30); }
@media (prefers-color-scheme: dark) { .marca .m-cruce { fill: oklch(0.86 0.1 60); } }
.marca:hover svg { transform: rotate(-6deg); }

/* ---------- Páginas sueltas (entrada e instalación) ---------- */
.page { min-height: 100%; display: grid; place-items: center; padding: 6vh 16px; background: var(--rail); }
.page-box { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-2); padding: 2rem 2.2rem; width: 100%; max-width: 720px; }
.page-box.narrow { max-width: 400px; }
.page-box .marca { font-size: 24px; margin-bottom: 1.2rem; }
.page-box .marca svg { width: 38px; height: 38px; }
.page-box h1 { font-size: 24px; margin: .2rem 0 .4rem; }
.page-box h2 { margin-top: 1.4rem; }
.page-box .lema { color: var(--ink-2); margin-bottom: 1.2rem; }
.page-box .btn-primary { margin-top: .4rem; }

/* ---------- Estructura ---------- */
.topbar {
  height: 56px; position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: .75rem;
  padding: 0 .9rem; background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar form { margin: 0; }
.topbar-hueco { flex: 1; }
.buscador { flex: 0 1 420px; position: relative; }
.buscador .ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.buscador input { width: 100%; padding: .48rem .7rem .48rem 2.25rem; background: var(--sunken); border-color: transparent; border-radius: 999px; font-size: 14px; }
.buscador input:focus { background: var(--surface); }
.yo { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; font-weight: 550; font-size: 14px; padding: .25rem .6rem .25rem .25rem; border-radius: 999px; }
.yo:hover { background: var(--hover-2); color: var(--ink); }
.layout { display: flex; height: calc(100vh - 56px); }
.sidebar {
  width: 248px; flex: none; background: var(--rail); border-right: 1px solid var(--line);
  overflow-y: auto; padding: .7rem .55rem; display: flex; flex-direction: column; gap: 1px;
}
body.sin-lateral .sidebar { display: none; }
.nav {
  display: flex; align-items: center; gap: .6rem; color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: .45rem .6rem; border-radius: 8px; transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav > span:not(.badge):not(.avatar):not(.punto-proyecto) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav:hover { background: var(--hover-2); color: var(--ink); }
.nav.activo { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.nav.activo .ic { color: var(--brand); }
.sidebar-tit { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 650; color: var(--ink-3); padding: 1rem .6rem .3rem; }
.sidebar-tit .btn-icon { padding: .2rem; }
.sidebar-pie { margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--line); display: grid; gap: 1px; }
.sidebar .vacio { font-size: 13px; padding: .3rem .6rem; }
.punto-proyecto { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.main { flex: 1; min-width: 0; overflow: auto; display: flex; flex-direction: column; background: var(--bg); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 .4rem; font-size: 11.5px; font-weight: 650; border-radius: 999px; background: var(--hover-2); color: var(--ink-2); }
.badge.alerta { background: var(--accent); color: oklch(0.2 0.03 45); }
.badge.peligro { background: var(--danger); color: oklch(1 0 0); }
.solo-movil { display: none; }

.pagina { padding: 2rem 2.2rem 4rem; max-width: 860px; width: 100%; }
.pagina.ancha { max-width: 1120px; }
.pagina > header { margin-bottom: 1.6rem; }
.pagina > header p { color: var(--ink-2); max-width: 66ch; margin-top: .4rem; }
.seccion { margin-top: 2rem; }
.seccion > h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.lista-simple { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.lista-simple li + li { border-top: 1px solid var(--line); }
.lista-simple li > a { display: block; padding: .75rem 1rem; color: inherit; text-decoration: none; transition: background var(--t) var(--ease); }
.lista-simple li > a:hover { background: var(--sunken); }
.lista-simple .fila { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; gap: .6rem; }
.cab-item { font-size: 13.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; }
.cab-item strong { color: var(--ink); font-weight: 600; }
.extracto { color: var(--ink); margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: .8rem; font-size: 14px; }
.tabla th, .tabla td { text-align: left; padding: .6rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla th { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--sunken); }
.tabla .apagado { opacity: .55; }
.tabla select { padding: .25rem .4rem; font-size: 13px; }
.vacio-bonito { text-align: center; padding: 1.6rem 1rem; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--sunken); }
.vacio-bonito strong { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: .15rem; }

/* ---------- Avatares ---------- */
.avatar {
  --c: var(--brand); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: var(--c); color: oklch(1 0 0); font-size: 12px; font-weight: 700; letter-spacing: .02em; position: relative;
  text-shadow: 0 1px 1px oklch(0 0 0 / .2);
}
.avatar.ia { border-radius: 9px; }
.avatar.ia::after {
  content: ""; position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 3px;
  background: var(--ai); box-shadow: 0 0 0 2px var(--bg);
}
.avatar.mini { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.mini.ia { border-radius: 6px; }
.avatar.mini.ia::after { width: 8px; height: 8px; right: -2px; bottom: -2px; border-radius: 2px; }
.avatar.propietario { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.avatares { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.etq-ia { display: inline-flex; align-items: center; gap: .2rem; background: var(--ai-soft); color: var(--ai-ink); font-size: 11px; font-weight: 650; border-radius: 4px; padding: 1px 5px; vertical-align: 1px; }

/* ---------- Navegación del proyecto ---------- */
.chat { flex: 1; display: flex; min-height: 0; }
.canales { width: 240px; flex: none; background: var(--rail); border-right: 1px solid var(--line); padding: .7rem .5rem; overflow-y: auto; }
.nav-proy-cab { display: flex; justify-content: space-between; align-items: center; gap: .4rem; padding: .3rem .4rem .8rem .6rem; }
.nav-proy-cab strong { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canales-tit { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 650; color: var(--ink-3); padding: .9rem .6rem .25rem; }
.canales-tit .btn-icon { padding: .15rem; visibility: hidden; }
.canales-tit:hover .btn-icon, .canales-tit .btn-icon:focus-visible { visibility: visible; }
.canal {
  display: flex; align-items: center; gap: .55rem; padding: .38rem .6rem; border-radius: 7px; text-decoration: none;
  color: var(--ink-2); font-size: 14.5px; transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.canal > span:not(.badge):not(.avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canal:hover { background: var(--hover-2); color: var(--ink); }
.canal.activo { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.canal .ic { color: var(--ink-3); }
.canal.activo .ic { color: var(--brand); }
.canal.no-leido { color: var(--ink); font-weight: 650; }
.canales .vacio { font-size: 12.5px; padding: .1rem .6rem .3rem; }
.nav-proy-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.nav-proy-acc .btn-mini { justify-content: flex-start; }
.conversacion { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.conv-cab {
  display: flex; align-items: flex-start; gap: 1rem; padding: .85rem 1.3rem; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: var(--z-sticky);
}
.conv-cab > div:first-child { flex: 1; min-width: 0; }
.conv-cab h2 { display: flex; align-items: center; gap: .5rem; font-size: 18px; }
.conv-cab h2 .ic { color: var(--ink-3); }
.conv-cab p { margin: .15rem 0 0; font-size: 13.5px; color: var(--ink-2); }
.conv-acc { display: flex; gap: .3rem; align-items: center; flex: none; }
.interruptor { display: inline-flex; gap: .4rem; align-items: center; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }

/* ---------- Mensajes ---------- */
.mensajes { flex: 1; overflow-y: auto; padding: .8rem 1.3rem 1rem; }
.mensaje { display: flex; gap: .75rem; padding: .55rem .6rem; border-radius: var(--r); position: relative; transition: background var(--t) var(--ease); }
.mensaje:hover { background: var(--sunken); }
.mensaje.pendiente { background: var(--accent-soft); }
.mensaje.hecho .texto { color: var(--ink-2); }
.mensaje-cuerpo { flex: 1; min-width: 0; }
.mensaje-cab { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.mensaje-cab strong { font-weight: 650; }
.mensaje-cab .muted { font-size: 12.5px; }
.texto { overflow-wrap: anywhere; }
.cita { display: flex; gap: .4rem; align-items: baseline; background: var(--hover); border-radius: var(--r-sm); padding: .3rem .55rem; color: var(--ink-2); font-size: 13.5px; margin: .2rem 0 .3rem; }
.mensaje-acc {
  position: absolute; top: -12px; right: .6rem; display: flex; gap: 1px; padding: 2px; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.mensaje:hover .mensaje-acc, .mensaje:focus-within .mensaje-acc { opacity: 1; transform: none; pointer-events: auto; }
.estado { display: inline-flex; align-items: center; gap: .25rem; font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 1px 8px; }
.estado.pendiente { background: var(--accent); color: oklch(0.2 0.03 45); }
.estado.visto { background: var(--brand-soft); color: var(--brand-ink); }
.estado.hecho { background: var(--ok-soft); color: var(--ok-ink); }
.mencion { background: var(--brand-soft); color: var(--brand-ink); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mencion.mia { background: var(--accent-soft); color: var(--accent-ink); }
.redactar { padding: .7rem 1.3rem 1.1rem; background: var(--bg); }
.caja-redactar { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.caja-redactar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.caja-redactar textarea { display: block; width: 100%; border: 0; background: transparent; resize: none; padding: .75rem .9rem .3rem; min-height: 48px; max-height: 40vh; box-shadow: none; }
.caja-redactar textarea:focus, .caja-redactar textarea:hover { box-shadow: none; border: 0; }
.barra-redactar { display: flex; align-items: center; gap: .4rem; padding: .3rem .4rem .4rem .5rem; }
.barra-redactar .pista { font-size: 12px; color: var(--ink-3); margin-right: auto; }
.adjuntar { cursor: pointer; }
.adjunto-elegido { font-size: 12.5px; color: var(--brand-ink); }
.respondiendo { display: flex; align-items: center; gap: .4rem; font-size: 13px; color: var(--ink-2); background: var(--sunken); border-radius: var(--r) var(--r) 0 0; padding: .4rem .75rem; margin: 0 .4rem; border: 1px solid var(--line); border-bottom: 0; }
.adjuntos-msg { display: flex; flex-wrap: wrap; gap: .45rem; margin: .4rem 0; }
.adjuntos-msg img { max-width: 260px; max-height: 190px; border-radius: var(--r-sm); display: block; box-shadow: var(--shadow-1); }
.adjunto-chip { display: inline-flex; gap: .4rem; align-items: center; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .4rem .65rem; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.adjunto-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.reacciones { display: flex; flex-wrap: wrap; gap: .3rem; margin: .35rem 0 .1rem; }
.reaccion { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px .55rem; cursor: pointer; color: var(--ink); transition: border-color var(--t) var(--ease), transform var(--t) var(--ease); }
.reaccion:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.reaccion.mia { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.picker { display: inline-flex; gap: 1px; }
.picker .btn-mini { font-size: 16px; padding: .25rem .3rem; }
.enlace-hilo { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; font-weight: 600; margin-top: .25rem; text-decoration: none; padding: .15rem .45rem .15rem .3rem; border-radius: 6px; }
.enlace-hilo:hover { background: var(--brand-soft); }
.hilo { width: 400px; flex: none; border-left: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.hilo-cab { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.hilo-mensajes { flex: 1; overflow-y: auto; padding: .5rem .6rem; }
.hilo-sep { display: flex; align-items: center; gap: .6rem; font-size: 12px; color: var(--ink-3); margin: .5rem .6rem; }
.hilo-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- Tablero ---------- */
.filtros { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .6rem 1.3rem 0; }
.filtros input { width: 220px; }
.filtros input, .filtros select { padding: .35rem .55rem; font-size: 13.5px; border-radius: 8px; }
.tablero { flex: 1; display: flex; align-items: flex-start; gap: .85rem; padding: .85rem 1.3rem 1.3rem; overflow-x: auto; min-height: 0; background: var(--bg); }
.lista { width: 284px; flex: none; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .5rem; display: flex; flex-direction: column; max-height: 100%; }
.lista-cab { display: flex; align-items: center; gap: .3rem; cursor: grab; padding: 0 0 .35rem; }
.lista-nombre { flex: 1; font-weight: 650; font-size: 14.5px; border-color: transparent; background: transparent; padding: .3rem .45rem; cursor: pointer; }
.lista-nombre:hover { border-color: transparent; background: var(--hover); }
.lista-nombre:focus { background: var(--surface); cursor: text; }
.lista-titulo { flex: 1; padding: .3rem .45rem; font-weight: 650; }
.contador { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 0 .2rem; }
.tarjetas { overflow-y: auto; min-height: 8px; display: flex; flex-direction: column; gap: .5rem; padding: 2px; }
.tarjeta {
  display: block; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: .6rem .7rem;
  color: var(--ink); text-decoration: none; overflow: hidden;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}
.tarjeta:hover { color: var(--ink); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.tarjeta .portada { margin: -.6rem -.7rem .55rem; height: 30px; }
.tarjeta-titulo { overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.35; }
.fantasma { opacity: .4; }
.sortable-drag { transform: rotate(2deg); box-shadow: var(--shadow-3) !important; }
.etiquetas { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: .4rem; }
.etiqueta { display: inline-block; min-width: 38px; height: 18px; border-radius: 5px; font-size: 11.5px; font-weight: 650; color: oklch(0.22 0.03 262); padding: 0 .45rem; line-height: 18px; overflow: hidden; white-space: nowrap; max-width: 100%; text-overflow: ellipsis; }
.etiqueta.ancha { height: 28px; line-height: 28px; min-width: 50px; font-size: 13px; margin: 0 4px 4px 0; border-radius: 6px; }
.insignias { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .55rem; margin-top: .45rem; color: var(--ink-2); font-size: 12.5px; }
.insignia { display: inline-flex; align-items: center; gap: .2rem; border-radius: 5px; padding: 0 .25rem; }
.insignia.vence.pronto { background: var(--warn-soft); color: var(--warn-ink); }
.insignia.vence.vencida { background: var(--danger-soft); color: var(--danger-ink); }
.insignia.hecho { background: var(--ok-soft); color: var(--ok-ink); }
.insignia.puedo { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.tarjeta-miembros { margin-left: auto; display: flex; gap: 3px; align-items: center; }
.nueva-tarjeta { margin-top: .4rem; }
.nueva-tarjeta textarea { width: 100%; resize: none; background: transparent; border-color: transparent; font-size: 14px; }
.nueva-tarjeta textarea:hover { background: var(--hover); border-color: transparent; }
.nueva-tarjeta textarea:focus { background: var(--surface); }
.nueva-lista { background: transparent; border-style: dashed; }
.nueva-lista input { width: 100%; background: transparent; border-color: transparent; }
.nueva-lista input:focus { background: var(--surface); }

/* ---------- Ventanas ---------- */
.con-modal { overflow: hidden; }
.modal-fondo {
  position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-backdrop); display: flex; justify-content: center; align-items: flex-start;
  padding: 6vh 16px; overflow-y: auto; animation: fundido var(--t) var(--ease);
}
.modal {
  background: var(--bg); border-radius: 18px; width: 100%; max-width: 780px; position: relative; padding: 1.4rem 1.6rem 1.7rem;
  box-shadow: var(--shadow-3); z-index: var(--z-modal); animation: aparecer 220ms var(--ease);
}
.modal.pequeno { max-width: 520px; }
.modal > h2 { margin-bottom: .3rem; padding-right: 2.2rem; }
@keyframes fundido { from { opacity: 0; } }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.cerrar { position: absolute; right: .8rem; top: .8rem; z-index: 2; }
.portada-grande { height: 92px; margin: -1.4rem -1.6rem 1.1rem; border-radius: 18px 18px 0 0; }
.tarjeta-cab { padding-right: 2.4rem; }
.titulo-tarjeta { width: 100%; font: 650 21px/1.3 var(--font); letter-spacing: -0.012em; border-color: transparent; background: transparent; resize: none; overflow: hidden; padding: .2rem .35rem; margin-left: -.35rem; }
.titulo-tarjeta:hover { border-color: transparent; background: var(--hover); }
.titulo-tarjeta:focus { background: var(--surface); }
.tarjeta-cab p { margin: .15rem 0 .6rem; font-size: 13.5px; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.tarjeta-cab select { padding: .2rem .4rem; font-size: 13px; }
.tarjeta-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 188px; gap: 1.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.chips h4 { margin-bottom: .35rem; }
.vence-chip { display: inline-flex; gap: .45rem; align-items: center; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .3rem .6rem; font-size: 13.5px; }
.vence-chip.vencida { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.vence-chip.hecho { background: var(--ok-soft); color: var(--ok-ink); border-color: transparent; }
.vence-chip.pronto { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.bloque { margin-top: 1.5rem; }
.bloque > h3 { display: flex; align-items: center; gap: .45rem; margin-bottom: .55rem; font-size: 15px; }
.bloque > h3 .ic { color: var(--ink-3); }
.bloque-cab { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.bloque-cab h3 { flex: 1; display: flex; align-items: center; gap: .4rem; margin: 0; font-size: 15px; }
.descripcion { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .9rem; cursor: pointer; min-height: 52px; transition: border-color var(--t) var(--ease); }
.descripcion:hover { border-color: var(--line-strong); }
.descripcion.vacia { color: var(--ink-2); }
.descripcion.solo-leer { cursor: default; }
.descripcion p { margin: .2rem 0; }
#desc { width: 100%; }
input.inline { border-color: transparent; background: transparent; font-weight: 650; padding: .15rem .35rem; flex: 1; font-size: 15px; }
input.inline:hover { background: var(--hover); border-color: transparent; }
input.inline:focus { background: var(--surface); }
.progreso { display: flex; align-items: center; gap: .55rem; font-size: 12px; color: var(--ink-2); margin: .5rem 0; font-variant-numeric: tabular-nums; }
.barra { flex: 1; height: 7px; background: var(--hover-2); border-radius: 99px; overflow: hidden; }
.barra div { height: 100%; background: var(--brand); border-radius: 99px; transition: width 300ms var(--ease); }
.barra div.completa { background: var(--ok); }
.item { display: flex; align-items: center; justify-content: space-between; border-radius: var(--r-sm); padding: .25rem .3rem; }
.item:hover { background: var(--hover); }
.item { gap: .4rem; }
.item input.item-texto { font-weight: 400; font-size: 14.5px; }
.item.hecho .item-texto { text-decoration: line-through; color: var(--ink-2); }
.item .btn-icon { visibility: hidden; padding: .15rem; }
.item:hover .btn-icon { visibility: visible; }
form[data-form="nuevoItem"] input { width: 100%; margin-top: .4rem; background: transparent; }
.adjunto { display: flex; gap: .8rem; align-items: flex-start; margin: .55rem 0; }
.adjunto img, .adj-icono { width: 96px; height: 64px; object-fit: cover; border-radius: var(--r-sm); background: var(--sunken); display: flex; align-items: center; justify-content: center; flex: none; color: var(--ink-3); border: 1px solid var(--line); }
.comentar { display: flex; gap: .6rem; align-items: flex-start; flex-wrap: wrap; }
.comentar textarea { flex: 1; min-width: 200px; }
.comentario { display: flex; gap: .65rem; margin: .9rem 0; }
.comentario > div { flex: 1; min-width: 0; }
.caja { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r); padding: .55rem .75rem; margin: .3rem 0; }
.actividad { font-size: 13px; margin: .55rem 0 .55rem 2.6rem; color: var(--ink-2); }
.actividad strong { color: var(--ink); font-weight: 600; }
.origen { display: flex; align-items: center; gap: .45rem; background: var(--brand-soft); color: var(--brand-ink); border-radius: var(--r); padding: .5rem .75rem; margin: 1rem 0 0; font-size: 13.5px; }
.origen a { color: inherit; font-weight: 600; }
.tarjeta-lateral h4 { margin: 1rem 0 .4rem; }
.tarjeta-lateral h4:first-child { margin-top: 0; }
.btn-lateral {
  display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; font: 550 13.5px/1 var(--font); color: var(--ink);
  background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .65rem; margin-bottom: .35rem; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.btn-lateral .ic { color: var(--ink-2); }
.btn-lateral:hover, .btn-lateral.activo { background: var(--hover-2); border-color: var(--line-strong); }
.btn-lateral.peligro:hover { background: var(--danger-soft); color: var(--danger-ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: .6rem; margin: -.1rem 0 .7rem; }
.panel input:not([type=checkbox]):not([type=radio]) { width: 100%; margin-bottom: .45rem; }
.muestras { display: flex; flex-wrap: wrap; gap: 5px; margin: .35rem 0 .55rem; }
.muestras label { cursor: pointer; }
.muestras input { position: absolute; opacity: 0; }
.muestras label span, .muestra { display: block; width: 30px; height: 22px; border-radius: 5px; border: 0; cursor: pointer; }
.muestras input:checked + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.muestras input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Avisos y aviso flotante ---------- */
.campana { position: relative; }
.campana .badge { position: absolute; top: 0; right: -2px; min-width: 17px; height: 17px; font-size: 10.5px; padding: 0 .3rem; box-shadow: 0 0 0 2px var(--bg); }
.avisos-panel {
  position: fixed; right: 12px; top: 60px; width: min(400px, calc(100vw - 24px)); max-height: 72vh; overflow-y: auto;
  background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow-3); z-index: var(--z-dropdown); padding: .45rem;
  animation: aparecer var(--t) var(--ease);
}
.avisos-cab { display: flex; justify-content: space-between; align-items: center; padding: .4rem .5rem .6rem; }
.avisos-cab strong { font-size: 15px; }
.aviso-item { display: flex; gap: .6rem; padding: .6rem; border-radius: var(--r); color: var(--ink); text-decoration: none; font-size: 14px; }
.aviso-item:hover { background: var(--sunken); color: var(--ink); }
.aviso-item .punto { width: 8px; height: 8px; border-radius: 50%; margin-top: .45rem; flex: none; background: transparent; }
.aviso-item.nuevo .punto { background: var(--accent); }
.aviso-item.nuevo { background: var(--accent-soft); }
.permiso { display: flex; width: 100%; margin-bottom: .3rem; }
#aviso {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 160%); background: var(--ink); color: var(--bg); font-weight: 550; font-size: 14px;
  padding: .65rem 1.05rem; border-radius: 999px; box-shadow: var(--shadow-3); transition: transform 260ms var(--ease), visibility 260ms;
  z-index: var(--z-toast); max-width: calc(100% - 32px); visibility: hidden;
}
#aviso.visible { transform: translate(-50%, 0); visibility: visible; }
#aviso.error { background: var(--danger); color: oklch(1 0 0); }

/* ---------- Encargos ---------- */
.encargos-pag { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.enc-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 1.6rem 1.3rem .2rem; flex-wrap: wrap; }
.enc-cab p { margin: .35rem 0 0; max-width: 70ch; color: var(--ink-2); }
.enc-tablero .lista { width: 300px; }
.tarjeta.encargo .tarjeta-titulo { font-weight: 600; }
.enc-meta { display: flex; gap: .45rem; align-items: center; font-size: 12px; margin-bottom: .3rem; color: var(--ink-2); }
.enc-meta:empty { display: none; }
.prio { display: inline-flex; align-items: center; gap: .3rem; font-weight: 650; }
.prio::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.prio.urgente { color: var(--danger-ink); }
.prio.alta { color: var(--accent-ink); }
.prio.baja { color: var(--ink-3); }
.habilidades { display: flex; flex-wrap: wrap; gap: 4px; margin: .35rem 0; }
.habilidad { font-size: 11.5px; font-weight: 550; border-radius: 999px; padding: 1px .55rem; background: var(--hover-2); color: var(--ink-2); }
.habilidad.tengo { background: var(--ok-soft); color: var(--ok-ink); }
.estado-enc { display: inline-flex; align-items: center; font-weight: 650; font-size: 12px; border-radius: 999px; padding: 2px 9px; background: var(--hover-2); color: var(--ink-2); }
.estado-enc.abierto { background: var(--brand-soft); color: var(--brand-ink); }
.estado-enc.en_curso { background: var(--warn-soft); color: var(--warn-ink); }
.estado-enc.entregado { background: var(--accent-soft); color: var(--accent-ink); }
.estado-enc.hecho { background: var(--ok-soft); color: var(--ok-ink); }
.candidato { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.candidato .btn { margin-left: auto; }
.archivo { margin: .5rem 0; }
.archivo img { max-width: 280px; border-radius: var(--r-sm); box-shadow: var(--shadow-1); }
.archivo audio { width: 100%; max-width: 440px; margin-top: .3rem; }
.acciones-enc { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .9rem 1rem; }
.bloque.entrega .caja { background: var(--ok-soft); border-color: transparent; }
.fila-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }
.fila-form input { flex: 1; min-width: 180px; }

/* ---------- Control de IAs ---------- */
.aprob { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: .9rem 1rem; margin-bottom: .7rem; }
.aprob-cab { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.aprob-cab strong { font-size: 15.5px; }
.aprob details { margin-top: .5rem; font-size: 13px; }
.aprob summary { cursor: pointer; color: var(--ink-2); }
.aprob .acciones { display: flex; gap: .5rem; align-items: center; margin-top: .7rem; flex-wrap: wrap; }
.aprob .acciones input { flex: 1; min-width: 200px; }
.res { display: inline-flex; font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 1px 8px; background: var(--hover-2); color: var(--ink-2); }
.res.ok, .res.aprobada, .res.aceptada { background: var(--ok-soft); color: var(--ok-ink); }
.res.pendiente { background: var(--accent-soft); color: var(--accent-ink); }
.res.denegado, .res.rechazada, .res.error, .res.fallida, .res.limite { background: var(--danger-soft); color: var(--danger-ink); }
.permisos-tabla { width: 100%; border-collapse: collapse; font-size: 14px; margin: .5rem 0; }
.permisos-tabla td { padding: .5rem .3rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.permisos-tabla td:first-child { width: 52%; }
.tres { display: inline-flex; background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.tres label { margin: 0 !important; font-weight: 550 !important; font-size: 12.5px !important; position: relative; }
.tres input { position: absolute; opacity: 0; }
.tres span { display: block; padding: .3rem .55rem; border-radius: 6px; cursor: pointer; color: var(--ink-2); transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.tres input:checked + span.si { background: var(--ok-soft); color: var(--ok-ink); }
.tres input:checked + span.aprobacion { background: var(--accent-soft); color: var(--accent-ink); }
.tres input:checked + span.no { background: var(--danger-soft); color: var(--danger-ink); }
.tres input:focus-visible + span { outline: 2px solid var(--brand); }
.perfiles { display: flex; gap: .35rem; flex-wrap: wrap; margin: .5rem 0 .2rem; }
.perfil-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--ai-soft); color: var(--ai-ink); }
.explorar { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.proyecto-explorar { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem; background: var(--surface); display: flex; flex-direction: column; gap: .4rem; }
.proyecto-explorar h3 { font-size: 16px; }
.proyecto-explorar p { color: var(--ink-2); font-size: 14px; flex: 1; }
.actividad-tabla td:nth-child(4) { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Documentos ---------- */
.doc { flex: 1; overflow-y: auto; padding: 1.4rem 1.6rem 3rem; }
.doc-cuerpo { max-width: 72ch; line-height: 1.65; font-size: 15.5px; }
.doc-cuerpo h2 { font-size: 22px; margin: 1.4rem 0 .5rem; } .doc-cuerpo h3 { font-size: 18px; margin: 1.2rem 0 .4rem; }
.doc-cuerpo h4, .doc-cuerpo h5 { font-size: 15.5px; color: var(--ink); margin: 1rem 0 .3rem; }
.doc-cuerpo p { margin: .5rem 0; }
.doc-cuerpo ul, .doc-cuerpo ol { padding-left: 1.3rem; }
.doc-cuerpo blockquote { background: var(--sunken); border-radius: var(--r-sm); margin: .6rem 0; padding: .5rem .8rem; color: var(--ink-2); }
.doc-editor { display: flex; flex-direction: column; height: 100%; max-width: 900px; }
.doc-editor textarea { flex: 1; min-height: 60vh; font: 14px/1.6 var(--mono); }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .tarjeta:hover, .reaccion:hover { transform: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .pista { display: none; }
  .solo-movil { display: inline-flex; }
  .buscador, .yo span { display: none; }
  .sidebar { position: fixed; top: 56px; bottom: 0; left: 0; z-index: var(--z-rail); transform: translateX(-100%); transition: transform var(--t) var(--ease); box-shadow: var(--shadow-3); }
  .menu-abierto .sidebar { transform: none; }
  body.sin-lateral .sidebar { display: flex; }
  .chat { flex-direction: column; }
  .canales { width: auto; border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; padding: .4rem; gap: .2rem; flex: none; }
  .canales-tit, .canales .vacio, .nav-proy-acc { display: none; }
  .nav-proy-cab { padding: .2rem .4rem; }
  .canal { flex: none; }
  .conv-cab { flex-wrap: wrap; padding: .7rem 16px; }
  .mensajes, .redactar { padding-left: 16px; padding-right: 16px; }
  .mensaje-acc { position: static; opacity: 1; transform: none; pointer-events: auto; box-shadow: none; background: none; margin-top: .2rem; }
  .tarjeta-cuerpo { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .pagina { padding: 1.3rem 16px 3rem; }
  .hilo { position: fixed; inset: 56px 0 0 0; width: auto; z-index: var(--z-rail); }
  .doc { padding: 1rem 16px 3rem; }
  .tabla { display: block; overflow-x: auto; }
  .modal { padding: 1.1rem 16px 1.4rem; }
  .portada-grande { margin: -1.1rem -16px 1rem; }
}
