/* Panel VAG — approved mockup F1.b (light + dark). Tokens first; components read only tokens. */
:root {
  --bg: #f7f6f3; --side: #efede8; --surface: #ffffff; --surface2: #f1eee8; --line: #e2ddd4; --line2: #c9c3b8;
  --text: #1c1b19; --text2: #3b3935; --muted: #67635c; --accent: #1558b0; --accentHover: #0f4488; --accentSoft: #e8eff9; --accentText: #ffffff;
  --bot: #1d7550; --botSoft: #e4f2ea; --wait: #945600; --waitSoft: #fcf0da; --hot: #b42318; --hotSoft: #fde8e6;
  --money: #8a4519; --moneySoft: #f7ebe1; --shadow: 0 12px 32px rgba(0,0,0,.14);
  --font: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111316; --side: #16191d; --surface: #1b1f24; --surface2: #232830; --line: #2d333b; --line2: #46505b;
  --text: #e8eef2; --text2: #c9d2da; --muted: #9aa7b3; --accent: #6ea8ff; --accentHover: #9cc3ff; --accentSoft: #172538; --accentText: #0b1220;
  --bot: #3ddc97; --botSoft: #132b23; --wait: #e8a317; --waitSoft: #2e2410; --hot: #ff6b5e; --hotSoft: #361816;
  --money: #d99b6c; --moneySoft: #2f2219; --shadow: 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111316; --side: #16191d; --surface: #1b1f24; --surface2: #232830; --line: #2d333b; --line2: #46505b;
    --text: #e8eef2; --text2: #c9d2da; --muted: #9aa7b3; --accent: #6ea8ff; --accentHover: #9cc3ff; --accentSoft: #172538; --accentText: #0b1220;
    --bot: #3ddc97; --botSoft: #132b23; --wait: #e8a317; --waitSoft: #2e2410; --hot: #ff6b5e; --hotSoft: #361816;
    --money: #d99b6c; --moneySoft: #2f2219; --shadow: 0 12px 32px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); } a:hover { color: var(--accentHover); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { flex-shrink: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .t-hot { color: var(--hot); } .t-wait { color: var(--wait); } .t-bot { color: var(--bot); } .t-money { color: var(--money); }
.row { display: flex; align-items: center; gap: 8px; } .row.end { justify-content: flex-end; } .grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.serif { font-family: var(--serif); font-weight: 400; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--surface2); color: var(--text); }
a.btn { text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accentText); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { background: var(--hot); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; position: relative; }
.icon-btn.plain { border-color: transparent; background: transparent; }
.icon-btn:hover { background: var(--surface2); }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--hot); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pill { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--hot); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.chip { height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .3px; display: inline-flex; align-items: center; white-space: nowrap; }
.chip.bot { background: var(--botSoft); color: var(--bot); } .chip.tu { background: var(--accentSoft); color: var(--accent); }
.chip.espera { background: var(--hotSoft); color: var(--hot); } .chip.gris { background: var(--surface2); color: var(--muted); }
.chip.wait { background: var(--waitSoft); color: var(--wait); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot.verde { background: var(--bot); } .dot.amarillo { background: var(--wait); } .dot.rojo { background: var(--hot); } .dot.gris { background: var(--line2); }
.avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--surface2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--text2); }
.card { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 16px; }
.input { height: 40px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); outline: none; }
.input:focus { border-color: var(--accent); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
label.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text2); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.skel { background: linear-gradient(90deg, var(--surface2), var(--line), var(--surface2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.spin { width: 16px; height: 16px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ── shell ───────────────────────────────────────────────────────────── */
#app { height: 100%; display: flex; overflow: hidden; }
.side { width: 264px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; background: var(--side);
  border-right: 1px solid var(--line); overflow-y: auto; }
/* Colapsada = sólo en COMPUTADORA. En el teléfono la barra es un cajón que se abre completo siempre: la preferencia
   «colapsada» se guarda por navegador y, si venía de antes, dejaba el cajón con puros íconos y sin chats recientes (24-09). */
@media (min-width: 901px) {
  .side.collapsed { width: 64px; padding: 14px 10px; }
  .side.collapsed .lbl-txt, .side.collapsed .side-sec, .side.collapsed .reciente, .side.collapsed .side-foot .who, .side.collapsed .botstate span:not(.dot),
  .side.collapsed .brand-name, .side.collapsed .pill { display: none; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accentText); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 12px; letter-spacing: .5px; flex-shrink: 0; }
.brand-name { flex: 1; font-family: var(--serif); font-size: 21px; font-weight: 500; }
/* 20-10: the VAG isotipo sits on its own white tile so the blue G reads in dark mode too */
.brand-mark.brand-iso { background: #fff; padding: 2px; object-fit: contain; box-shadow: 0 0 0 1px var(--line); }
.nav-new { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; margin-bottom: 8px; text-decoration: none; color: var(--text); }
.nav-new:hover { background: var(--surface2); color: var(--text); }
.nav { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: none; border-radius: 10px; background: transparent;
  color: var(--text2); text-decoration: none; font-size: 14px; }
.nav:hover { background: var(--surface2); color: var(--text); }
.nav.on { background: var(--surface2); color: var(--text); font-weight: 700; }
.side-sec { margin: 18px 12px 6px; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; }
.reciente { height: 32px; padding: 0 12px; border-radius: 8px; color: var(--text2); font-size: 13.5px; text-decoration: none; display: flex; align-items: center; }
.reciente:hover, .reciente.on { background: var(--surface2); color: var(--text); }
.reciente span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.botstate { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--botSoft); color: var(--bot);
  font-size: 13px; font-weight: 600; margin-top: 12px; }
.botstate.off { background: var(--waitSoft); color: var(--wait); }
.botstate .dot { background: currentColor; }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 8px 6px 0; }
.side-foot .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-foot .who small { font-size: 12px; color: var(--muted); }
.erp-link { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.mas-menu { position: absolute; z-index: 30; width: 230px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.mas-menu a, .mas-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: none; border-radius: 8px;
  background: transparent; color: var(--text); text-decoration: none; text-align: left; }
.mas-menu a:hover, .mas-menu button:hover { background: var(--surface2); }

/* min-height:0 no es decorativo: en móvil #app pasa a columna y, sin él, este flex item toma
   min-height:auto (la altura de su contenido), #app{overflow:hidden} lo recorta y los .page/.ficha
   de adentro quedan tan altos como su contenido — no había nada que desplazar. */
.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.top { height: 56px; flex-shrink: 0; padding: 0 20px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tab { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; border: 1px solid transparent; background: transparent; color: var(--muted);
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { border-color: var(--line); background: var(--surface); color: var(--text); font-weight: 700; }
.top-search { display: flex; align-items: center; gap: 8px; width: 260px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); position: relative; }
.top-search input { border: none; outline: none; background: transparent; color: var(--text); width: 100%; font-size: 13.5px; }
.search-res { position: absolute; top: 42px; left: 0; right: 0; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; max-height: 360px; overflow: auto; }
.search-res a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-res a:hover, .search-res a.on { background: var(--surface2); }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.scroll { overflow-y: auto; }
.mobile-only { display: none !important; }

/* ── avisos ──────────────────────────────────────────────────────────── */
.avisos { position: absolute; top: 60px; right: 16px; width: 390px; max-height: calc(100% - 80px); display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); z-index: 50; }
.avisos-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.aviso { display: flex; gap: 10px; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--text); border: none; background: transparent; text-align: left; width: 100%; }
.aviso:hover { background: var(--surface2); }
.aviso.nuevo.urgente { background: var(--hotSoft); } .aviso.nuevo.atencion { background: var(--waitSoft); } .aviso.nuevo.info { background: var(--accentSoft); }
.aviso .dot { margin-top: 6px; }
.aviso b { font-weight: 700; } .aviso.leido b { font-weight: 400; }
.push-box { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ── inicio / chat ───────────────────────────────────────────────────── */
.home { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 64px 24px 32px; gap: 28px; }
.home h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 42px; letter-spacing: -.3px; text-align: center; }
.cards3 { width: min(760px, 100%); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.brief { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; }
.brief:hover { border-color: var(--line2); color: var(--text); }
.brief .et { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.brief .ti { font-size: 15px; font-weight: 600; } .brief .de { font-size: 13px; color: var(--muted); }
.tono-hot .et { color: var(--hot); } .tono-money .et { color: var(--money); } .tono-wait .et { color: var(--wait); } .tono-bot .et { color: var(--bot); }
.composer { width: min(760px, 100%); border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.05);
  display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 10px; }
.composer textarea { border: none; outline: none; resize: none; background: transparent; color: var(--text); font-size: 16px; line-height: 1.5; max-height: 40vh; min-height: 28px; }
.composer .tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer { position: relative; }
.seg-mode { margin-left: auto; }
#cmpSeg[data-modo="estricto"] { color: var(--bot); } #cmpSeg[data-modo="equilibrado"] { color: var(--accent); } #cmpSeg[data-modo="fluido"] { color: var(--wait); }
.seg-menu { position: absolute; bottom: calc(100% + 8px); right: 8px; z-index: 40; width: min(320px, calc(100vw - 32px)); padding: 6px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 8px 28px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 2px; }
.seg-menu[hidden] { display: none; }
.seg-menu button { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 8px 10px; border: none; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.seg-menu button:hover, .seg-menu button[aria-checked="true"] { background: var(--surface2); }
.seg-menu button b { display: block; font-size: 14px; } .seg-menu button small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.seg-menu .ic { margin-top: 1px; } .seg-menu .ic[data-modo="estricto"] { color: var(--bot); } .seg-menu .ic[data-modo="equilibrado"] { color: var(--accent); } .seg-menu .ic[data-modo="fluido"] { color: var(--wait); }
.seg-menu .nota { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; border-top: 1px solid var(--line); margin-top: 2px; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface2); }
.seg button { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: none; border-radius: 8px; font-size: 13px; background: transparent; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.hint { flex: 1; min-width: 140px; font-size: 12.5px; color: var(--muted); }
.send { width: 36px; height: 36px; border-radius: 10px; border: none; background: var(--accent); color: var(--accentText); display: flex; align-items: center; justify-content: center; }
/* 04-11: composer bar = [attach · Internet · Investigar · mode ▾] ……… [safety · mic · send]. Two groups, never wrapping into
   a second crowded line; on phones the toggle labels collapse to icons. */
.composer .tools { justify-content: space-between; flex-wrap: nowrap; gap: 8px; }
.cmp-izq, .cmp-der { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cmp-der { flex-shrink: 0; }
.cmp-der .seg-mode { margin-left: 0; }
.cmp-tog { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.cmp-tog:hover { color: var(--text); background: var(--surface2); }
.cmp-tog[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 700; }
.cmp-modo { border-color: transparent; padding: 0 8px; }
.cmp-modo[aria-expanded="true"] { background: var(--surface2); color: var(--text); }
.cmp-pop { position: relative; }
.seg-menu.izq { right: auto; left: 0; }
.send[disabled] { opacity: .4; }
.sugs { width: min(760px, 100%); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sug { height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: transparent; color: var(--text2); font-size: 13.5px; }
.sug:hover { background: var(--surface); }

.chatwrap { flex: 1; min-height: 0; display: flex; }
.chatcol { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msgs { flex: 1; overflow-y: auto; padding: 24px 24px 12px; }
.msgs-in { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.m-user { align-self: flex-end; max-width: 85%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--surface2); white-space: pre-wrap; word-wrap: break-word; }
.m-asis { align-self: stretch; line-height: 1.6; font-size: 15px; word-wrap: break-word; }
.m-asis p { margin: 0 0 .7em; } .m-asis p:last-child { margin-bottom: 0; }
.m-asis h2, .m-asis h3, .m-asis h4, .m-asis h5 { margin: 1em 0 .4em; font-size: 1.05em; }
.m-asis ul, .m-asis ol { margin: .3em 0 .7em; padding-left: 1.4em; }
.m-asis code { background: var(--surface2); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.m-asis pre { background: var(--surface2); padding: 12px; border-radius: 10px; overflow-x: auto; }
.m-asis pre code { background: none; padding: 0; }
.m-asis blockquote { margin: .5em 0; padding-left: 12px; border-left: 3px solid var(--line2); color: var(--text2); }
.tbl { overflow-x: auto; margin: .5em 0; } .tbl table { border-collapse: collapse; font-size: 13.5px; min-width: 60%; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 6px 10px; } .tbl th { font-weight: 700; background: var(--surface2); }
.m-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.toolchip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line); font-size: 12.5px; color: var(--text2); background: var(--surface); }
.toolchip.listo { color: var(--muted); } .toolchip.fallo { color: var(--hot); border-color: var(--hot); }
.toolrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.artcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; width: 100%; max-width: 420px; color: var(--text); }
.artcard:hover { border-color: var(--accent); }
.artcard .ai { width: 36px; height: 36px; border-radius: 8px; background: var(--accentSoft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.confcard { border: 1.5px solid var(--wait); background: var(--waitSoft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.confcard.confirmada { border-color: var(--bot); background: var(--botSoft); } .confcard.cancelada, .confcard.fallida { border-color: var(--line2); background: var(--surface2); }
.chat-foot { padding: 8px 24px 18px; }
.chat-foot .composer { margin: 0 auto; max-width: 780px; width: 100%; }
.cursor::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--muted); }
@keyframes blink { 50% { opacity: 0; } }
.artpanel { width: min(48%, 720px); flex-shrink: 0; border-left: 1px solid var(--line); display: flex; flex-direction: column; background: var(--surface); }
.artpanel header { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.artbody { flex: 1; overflow: auto; padding: 20px 24px; }
.artbody iframe { width: 100%; height: 100%; border: none; background: #fff; border-radius: 8px; }
.artbody.frame { padding: 0; }

/* ── conversaciones ──────────────────────────────────────────────────── */
.conv { flex: 1; min-height: 0; display: flex; }
.conv-list { width: var(--w-bandeja, 340px); flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.filtros { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filtro { height: 30px; padding: 0 10px; border-radius: 15px; font-size: 12.5px; border: 1px solid var(--line); background: transparent; color: var(--text2); display: inline-flex; align-items: center; gap: 6px; }
.filtro.on { border-color: var(--text); background: var(--text); color: var(--bg); font-weight: 700; }
.hilo { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px 12px 8px; border: none; border-bottom: 1px solid var(--line);
  text-align: left; background: transparent; color: var(--text); text-decoration: none; }
.hilo:hover { background: var(--surface2); color: var(--text); } .hilo.on { background: var(--surface2); }
.hilo .bar { width: 4px; align-self: stretch; border-radius: 2px; background: transparent; }
.hilo .bar.hot { background: var(--hot); } .hilo .bar.wait { background: var(--wait); }
.hilo .nm { font-weight: 400; } .hilo.unread .nm { font-weight: 700; }
.hilo .pv { font-size: 13px; color: var(--muted); }
.thread { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread-top { min-height: 60px; flex-shrink: 0; padding: 8px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.thread-msgs { flex: 1; overflow-y: auto; padding: 20px 28px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.bw { display: flex; flex-direction: column; gap: 4px; }
.bw.c { align-items: flex-start; } .bw.b, .bw.h { align-items: flex-end; } .bw.s { align-items: center; }
.bub { max-width: min(520px, 85%); padding: 10px 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.bw.c .bub { border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); }
.bw.b .bub { border-radius: 14px 14px 4px 14px; border: 1.5px dashed var(--bot); }
.bw.h .bub { border-radius: 14px 14px 4px 14px; background: var(--accent); color: var(--accentText); }
.bw.s .bub { font-size: 12.5px; color: var(--muted); background: var(--surface2); border-radius: 10px; }
.bw .meta { font-size: 11.5px; color: var(--muted); }
.bw .who { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--bot); }
.thread-foot { flex-shrink: 0; padding: 12px 20px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.sendbox { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.sendbox textarea { flex: 1; border: none; outline: none; resize: none; background: transparent; color: var(--text); font-size: 14px; padding: 6px 0; max-height: 160px; }
.ficha-mini { width: var(--w-ficha, 300px); flex-shrink: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--line); overflow-y: auto; }
.kv { display: flex; flex-direction: column; gap: 4px; } .kv small { font-size: 12px; color: var(--muted); }
.money2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.money2 > div, .money3 > div { padding: 10px; border-radius: 10px; background: var(--surface2); }
.money2 .debe, .money3 .debe { background: var(--moneySoft); color: var(--money); }
.money2 b, .money3 b { font-size: 16px; display: block; }
.sincli { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--waitSoft); border: 1px solid var(--line); }

/* ── clientes ────────────────────────────────────────────────────────── */
.cli { flex: 1; min-height: 0; display: flex; }
.cli-list { width: 310px; flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.cli-search { padding: 12px; border-bottom: 1px solid var(--line); }
.cli-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; text-decoration: none; }
.cli-row:hover { background: var(--surface2); color: var(--text); } .cli-row.on { background: var(--surface2); }
.ficha { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.ficha h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 30px; }
.resumen { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 16px; background: var(--accentSoft); border: 1px solid var(--line); }
.resumen .et { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent); }
.resumen p { margin: 0; font-size: 15px; line-height: 1.55; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sec { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.sec h3 { margin: 0; font-size: 15px; }
.sec .row h3 { flex: 1; }
.money3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lrow { display: flex; gap: 10px; font-size: 13.5px; padding-top: 6px; border-top: 1px solid var(--line); align-items: baseline; }
.lrow:first-of-type { border-top: none; }
.lrow .f { color: var(--muted); width: 72px; flex-shrink: 0; font-size: 12.5px; }
.kanban-top { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--surface2); min-height: 120px; }
.kcol.drop { outline: 2px dashed var(--accent); }
/* Una etapa sin tarjetas no merece una columna entera: se pliega a una tira angosta y sigue
   aceptando que le arrastres una tarjeta encima. */
.kcol.vacia { max-width: 132px; opacity: .72; }
.kcol.vacia:hover, .kcol.vacia.drop { opacity: 1; }
.kcard { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.kcard[draggable="true"] { cursor: grab; }
.kcard:hover { border-color: var(--line2); }

/* ── módulos (iframe) ───────────────────────────────────────────────── */
.modframe { flex: 1; border: none; width: 100%; background: var(--bg); }
.modbar { display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }

/* ── páginas (proyectos, artefactos, programados, ajustes) ───────────── */
.page { flex: 1; overflow-y: auto; padding: 28px; }
.page-in { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 30px; }
.gridc { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; text-align: left; }
.tile:hover { border-color: var(--line2); color: var(--text); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch { width: 40px; height: 24px; border-radius: 12px; background: var(--line2); border: none; position: relative; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch[aria-checked="true"] { background: var(--bot); } .switch[aria-checked="true"]::after { left: 19px; }
/* FASE Q: interruptor del bot nocturno (checkbox real: accesible con teclado y lector de pantalla) */
label.switch { display: inline-block; cursor: pointer; }
label.switch::after { display: none; }
label.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--line2); transition: background .15s; }
label.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
label.switch input:checked + span { background: var(--bot); }
label.switch input:checked + span::after { left: 19px; }
label.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.noct { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 14px; }
.noct.on { border-color: var(--bot); background: var(--botSoft); }

/* ── login ───────────────────────────────────────────────────────────── */
.login { min-height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-box { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login-box h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 34px; }
.login-err { color: var(--hot); font-size: 13.5px; min-height: 1.2em; }
.login-ok { color: var(--bot); font-size: 13.5px; }

/* dialogs & toasts */
dialog.dlg { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 20px; width: min(460px, calc(100% - 32px)); box-shadow: var(--shadow); }
dialog.dlg::backdrop { background: rgba(0,0,0,.35); }
dialog.dlg.wide { width: min(720px, calc(100% - 32px)); }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow); transition: opacity .4s; max-width: 90vw; }
.toast.error { background: var(--hot); color: #fff; } .toast.ok { background: var(--bot); color: #fff; }
.toast.out { opacity: 0; }

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .ficha-mini { display: none; }
  .artpanel { position: absolute; inset: 0; width: auto; z-index: 20; }
}
@media (max-width: 900px) {
  body { font-size: 15px; }
  .mobile-only { display: flex !important; }
  .desk-only { display: none !important; }
  /* 100dvh sigue a la barra del navegador del teléfono; 100% se queda con la altura grande y deja
     la última franja debajo del borde. overscroll-behavior evita el rebote que arrastra la página. */
  #app { flex-direction: column; height: 100dvh; overscroll-behavior: none; }
  .page, .home, .ficha, .msgs, .thread-msgs, .scroll { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 60; width: 86vw; max-width: 320px; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .top { padding: 0 8px 0 12px; gap: 6px; }
  .top h1 { font-size: 17px; flex: 1; }
  .top .icon-btn { width: 44px; height: 44px; border: none; background: transparent; }
  .tabs-m { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .bottom { height: 64px; flex-shrink: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--side); padding-bottom: env(safe-area-inset-bottom); }
  .bottom a, .bottom button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: none; background: transparent;
    font-size: 11.5px; color: var(--muted); text-decoration: none; position: relative; }
  .bottom .on { color: var(--accent); font-weight: 700; }
  .bottom .pill { position: absolute; top: 6px; left: calc(50% + 6px); }
  .home { padding: 24px 16px; gap: 16px; align-items: stretch; }
  .home h2 { font-size: 30px; text-align: left; }
  .composer textarea { font-size: 16px; }
  .composer .tools { flex-wrap: nowrap; gap: 6px; }
  .seg { flex: 1; min-width: 0; } .seg button { flex: 1; justify-content: center; height: 36px; padding: 0 4px; font-size: 12.5px; gap: 4px; }
  .composer .icon-btn.plain { width: 36px; min-height: 36px; }
  .cmp-tog { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .cmp-tog span { display: none; }
  .cmp-modo { width: auto; padding: 0 6px; gap: 2px; }
  .composer .tools { gap: 4px; } .cmp-izq, .cmp-der { gap: 2px; }
  .conv-list, .cli-list { width: 100%; border-right: none; }
  .conv.sel .conv-list, .cli.sel .cli-list { display: none; }
  .conv:not(.sel) .thread, .cli:not(.sel) .ficha { display: none; }
  .thread-msgs { padding: 16px; }
  .ficha { padding: 18px 16px; } .ficha h2 { font-size: 26px; }
  .grid2 { grid-template-columns: 1fr; }
  .avisos { position: fixed; inset: 56px 8px auto 8px; width: auto; max-height: calc(100% - 140px); }
  .msgs { padding: 16px 14px 8px; } .chat-foot { padding: 6px 10px 10px; }
  .page { padding: 18px 16px; }
  .kanban { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; } .kcol { scroll-snap-align: start; }
  .btn, .icon-btn { min-height: 40px; }
}
@media (min-width: 901px) { .bottom, .tabs-m, .scrim { display: none !important; } }

/* Tarjeta de MENSAJES a clientes (20-09-2026). El texto se enseña completo y con sus saltos de
   línea: es literal lo que va a leer el cliente, así que recortarlo sería esconder lo que se
   aprueba. Cada renglón es un <label> para que el toque en cualquier parte marque la casilla. */
.msgprev { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 2px; }
.msgrow { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border-radius: 9px;
  background: var(--bg-2, rgba(127, 127, 127, .07)); border: 1px solid var(--line); cursor: pointer; }
.msgrow:has(input:checked) { border-color: var(--accent); }
.msgrow.cerrada { opacity: .72; border-style: dashed; }
.msgrow input { margin-top: 3px; width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--accent); }
.msgrow input:disabled { cursor: default; }


/* Archivos del cliente: desplegable sobre el redactor (2026-09-21). En rejilla empujaban el hilo
   hacia abajo; aquí están a un clic y cada uno dice lo que VIO el cerebro de visión. */
.adjmenu { position: relative; }
.adjmenu .adjn { font-weight: 700; }
.adjpop {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 40;
  width: min(380px, 78vw); max-height: 46vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16); padding: 6px;
}
.adjit { display: flex; gap: 10px; align-items: center; padding: 7px; border-radius: 9px;
  text-decoration: none; color: var(--text); }
.adjit:hover { background: var(--surface2); }
.adjit img { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; flex-shrink: 0; }
.adjit .adjico { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: var(--surface2); border-radius: 7px; flex-shrink: 0; }
.adjtx { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; line-height: 1.3; }
.adjtx b { font-size: 12.5px; }
.adjtx .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Copiloto: se queda con el sitio que ocupaban el resumen y las acciones rápidas. */
.copiloto { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.copiloto { border-top: 1px solid var(--line); padding-top: 12px; }
.cop-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cop-top b { display: inline-flex; align-items: center; gap: 6px; }
.cop-nuevos { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--waitSoft); color: var(--wait); }
.cop-hilo { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 46vh; min-height: 60px; }
.cop-vacio { font-size: 12.5px; line-height: 1.5; }
.cop-yo { align-self: flex-end; max-width: 90%; padding: 6px 10px; border-radius: 10px; background: var(--accentSoft); font-size: 13px; }
.cop-ia { font-size: 13.5px; line-height: 1.5; }
.cop-ia .toolrow { display: flex; flex-wrap: wrap; gap: 4px; }
.cop-ia .toolrow:empty { display: none; }
.cop-ia .toolchip { height: 22px; font-size: 11.5px; padding: 0 8px; }
.cop-nota { font-size: 12px; color: var(--muted); border-left: 2px solid var(--line2); padding-left: 8px; }
.cop-sug { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--bot); background: var(--botSoft); }
.cop-sug.incierta { border-color: var(--hot); background: var(--hotSoft); }
.cop-sug small { font-size: 12px; font-weight: 700; color: var(--text2); }
.cop-porque { font-size: 12px; }
.cop-sug textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--surface); font-size: 13.5px; line-height: 1.45; }
.cop-intake { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accentSoft); }
.cop-intake small { font-size: 12px; font-weight: 700; color: var(--text2); }
.cop-intake dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 12.5px; }
.cop-intake dt { color: var(--muted); text-transform: capitalize; } .cop-intake dd { margin: 0; overflow-wrap: anywhere; }
.cop-pago { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--moneySoft); color: var(--money); font-size: 12.5px; font-weight: 600; }
.cop-acciones { display: flex; gap: 6px; }
.cop-acciones .btn { flex: 1; justify-content: center; }
.cop-preg { display: flex; gap: 6px; align-items: center; }
.cop-preg .input { height: 34px; flex: 1; min-width: 0; }
.cop-preg .send { width: 34px; height: 34px; flex-shrink: 0; }

/* Columnas ajustables (2026-09-21). El tirador es el borde: se arrastra y el ancho se recuerda
   en este navegador. Sin JS de librería, sin depender de que el layout sea grid. */
.tirador { width: 6px; flex-shrink: 0; cursor: col-resize; background: transparent;
  border-right: 1px solid var(--line); transition: background .12s; }
.tirador:hover, .tirador.arrastrando { background: var(--text); opacity: .18; }
.conv-list { border-right: none; }
.ficha-mini { border-left: none; }
@media (max-width: 900px) { .tirador { display: none; } .conv-list { width: 100%; } }
/* M1 — botones de artefacto (fuera del iframe: el sandbox sigue sin red) */
.artacc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface); }
/* M7 — tablas del tablero de uso */
.tabla-scroll { overflow-x: auto; max-width: 100%; }
.tmin { border-collapse: collapse; font-size: 12.5px; width: 100%; margin-top: 4px; }
.tmin th, .tmin td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tmin th { color: var(--muted); font-weight: 600; }
/* M5 — Mostrador (tableta de pie): objetivos táctiles de 56 px o más, texto grande, sin hover. */
.most { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-width: 1400px; margin: 0 auto; width: 100%; }
.most-top { display: flex; gap: 12px; flex-wrap: wrap; }
.most-buscar { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--surface); }
.most-buscar input { flex: 1; border: none; background: none; font-size: 18px; outline: none; min-width: 0; }
.most-grande { min-height: 60px; font-size: 17px; padding: 0 22px; border-radius: 14px; }
.most-res { display: flex; flex-direction: column; gap: 8px; }
.most-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.most-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.most-card h3 { margin: 0; font-size: 18px; }
.most-list { display: flex; flex-direction: column; gap: 8px; }
.most-item { display: flex; flex-direction: column; gap: 2px; min-height: 58px; justify-content: center; padding: 10px 14px; border-radius: 12px; background: var(--surface2); color: var(--text); text-decoration: none; border-left: 5px solid var(--line2); }
.most-item b { font-size: 16px; } .most-item span { font-size: 14px; color: var(--text2); }
.most-item.hot { border-left-color: var(--hot); } .most-item.wait { border-left-color: var(--wait); }
.most-item:active { transform: scale(.99); }
.most-vacio { color: var(--muted); font-size: 15px; padding: 10px 2px; }
.most-in { height: 52px; font-size: 18px; }
.most-pie { text-align: center; font-size: 13px; margin: 0; }
/* ── Pantallas NATIVAS (Inventario / Calculadora / Presupuestos, 2026-09-21) ─────────────────── */
.nat { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 0; height: 100%; max-width: 1500px; margin: 0 auto; width: 100%; }
.nat-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nat-h { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 26px; }
.nat-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nat-bar .input { flex: 1 1 260px; height: 38px; }
.nat-split { display: flex; gap: 14px; flex: 1; min-height: 0; }
.nat-tabla { flex: 1; min-width: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.nat-panel { width: 380px; flex-shrink: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.nat-sec { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.ntab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ntab th { position: sticky; top: 0; background: var(--surface2); text-align: left; font-weight: 600; color: var(--text2); padding: 8px 10px; border-bottom: 1px solid var(--line); z-index: 1; }
.ntab td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ntab td b { display: block; font-weight: 600; } .ntab td .muted { font-size: 12px; }
.ntab tbody tr { cursor: pointer; } .ntab tbody tr:hover, .ntab tbody tr.on { background: var(--accentSoft); }
.ntab .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.chip-s { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--surface2); color: var(--text2); border: 1px solid var(--line); cursor: default; }
button.chip-s { cursor: pointer; }
.chip-s.wait { background: var(--waitSoft); color: var(--wait); border-color: transparent; }
.chip-s.bot { background: var(--botSoft); color: var(--bot); border-color: transparent; }
.ubic { font-size: 13px; }
.nat-chat { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.nat-chat .input { flex: 1; border: none; height: 34px; background: transparent; }
.nat-ej { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tj { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accentSoft); font-size: 13.5px; }
.tj.confirmada { border-color: var(--bot); background: var(--botSoft); } .tj.fallida, .tj.incierta { border-color: var(--hot); background: var(--hotSoft); }
.tj.cancelada { border-color: var(--line); background: var(--surface2); }
.tj-est { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text2); }
.tj-cambio { display: flex; gap: 10px; align-items: baseline; font-size: 16px; font-variant-numeric: tabular-nums; }
.tj-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13px; }
.tj-dl dt { color: var(--muted); } .tj-dl dd { margin: 0; overflow-wrap: anywhere; }
.tj-lista { margin: 0; padding-left: 18px; } .tj-res { font-size: 13px; color: var(--text2); white-space: pre-wrap; }
@media (max-width: 1000px) { .nat-split { flex-direction: column; } .nat-panel { width: 100%; } .nat { padding: 12px; } }
/* 22-09 (Fernando: «en teléfono no puedo bajar» en Presupuestos y Calculadora). .nat medía el 100 % del alto y .view recorta
   (overflow:hidden): lo que pasaba del alto quedaba cortado sin forma de bajar (Calculadora 611 px visibles de 978). Ahora .nat
   desplaza siempre; y en pantallas angostas la tabla y el panel toman su alto natural y se baja con TODA la página, en vez de
   dos cajitas con scroll propio (la lista de Presupuestos quedaba en 252 px y el detalle, debajo, inalcanzable). */
.nat { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* Los hijos de .nat no se encogen (el tablero de Trabajos quedaba en 268 px y cortaba las columnas); sólo .nat-split se ajusta
   al alto en escritorio para que su tabla y su panel desplacen por dentro. */
.nat > :not(.nat-split) { flex-shrink: 0; }
@media (max-width: 1000px) {
  .nat-split { flex: none; }
  .nat-tabla { flex: none; overflow-y: visible; overflow-x: auto; }
  .nat-panel { flex: none; overflow: visible; }
  .ntab th { position: static; }
}
.nat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cpart { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.cfield { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.cfield .input { height: 34px; color: var(--text); }
.cfield.wide { grid-column: span 2; } .cfield.chk { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.nat-panel.ancho { width: 560px; }
.money3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.money3 > div { background: var(--surface2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.money3 small { font-size: 11.5px; color: var(--muted); } .money3 b { font-size: 16px; font-variant-numeric: tabular-nums; }
.money3 .debe { background: var(--moneySoft); color: var(--money); }
.ntab.edit td { padding: 4px 6px; } .ntab.edit .input { height: 32px; width: 100%; } .ntab.edit .input.n { width: 96px; text-align: right; }
.ntab.edit tbody tr { cursor: default; } .ntab.edit tr.nueva { background: var(--botSoft); }
@media (max-width: 1000px) { .nat-panel.ancho { width: 100%; } }
.nat-bar .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.nat-bar .seg button { flex-shrink: 0; }
.nat-panel .tmin td, .nat-panel .tmin th { white-space: normal; }
.nat-panel .tmin td.num, .nat-panel .tmin th.num { white-space: nowrap; text-align: right; }
.nat, .nat-split, .nat-tabla { min-width: 0; }

/* U1 (21-09): tarjetas del copiloto — las pendientes con tope de alto; las resueltas en «Acciones confirmadas». */
/* 21-09 (2ª): sin scroll propio — en la columna flexible del panel se encogía hasta no leerse. */
#copTarjetas { flex-shrink: 0; }
.copiloto > * { flex-shrink: 0; }
.copiloto > .cop-hilo { flex-shrink: 1; }
.cop-tj { border-color: var(--accent); background: var(--accentSoft); }
.cop-tj-t { font-size: 13.5px; line-height: 1.35; }
.cop-tj .tmin, .cop-tj .tj-lista, .cop-tj .tj-dl { font-size: 12.5px; }
.cop-tj .tmin { width: 100%; table-layout: fixed; }
.cop-tj .tmin th, .cop-tj .tmin td { white-space: normal; overflow-wrap: anywhere; padding: 4px 4px; }
.cop-tj .tmin th:nth-child(2), .cop-tj .tmin td:nth-child(2) { width: 46px; text-align: center; }
.cop-tj .tmin th:nth-child(3), .cop-tj .tmin td:nth-child(3) { width: 78px; text-align: right; }
.cop-tj .tj-res { font-size: 12.5px; }
#copTarjetas:empty { display: none; }
.cop-hechas .cop-hechas-pop { top: calc(100% + 6px); bottom: auto; }
.cop-hecha { align-items: flex-start; cursor: default; }
.cop-hecha.confirmada svg { color: var(--bot); } .cop-hecha.cancelada svg { color: var(--muted); }
.cop-hecha.fallida svg, .cop-hecha.incierta svg { color: var(--hot); }

/* U2 (21-09): Agenda nativa */
.ag-lista { padding: 4px 14px 14px; }
.ag-grupo h3 { font-size: 13px; text-transform: capitalize; color: var(--text2); margin: 14px 0 4px; }
.ag-grupo.venc h3 { color: var(--hot); }
.ag-fila { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.ag-grupo .ag-fila:first-of-type { border-top: none; }
.ag-fila.venc .ag-t { color: var(--hot); }
.ag-ico { width: 22px; text-align: center; flex-shrink: 0; }
.ag-cuerpo { font-size: 12.5px; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-acc { flex-shrink: 0; gap: 6px; }
@media (max-width: 640px) { .ag-fila { display: grid; grid-template-columns: 22px minmax(0, 1fr); } .ag-acc { grid-column: 2; justify-content: flex-end; } }

/* Acciones confirmadas del chat (21-09): bajo la caja de escribir, desplegable hacia arriba */
.ch-hechas { max-width: 780px; margin: 4px auto 0; width: 100%; }
.ch-hechas .adjpop { max-height: 50vh; }

/* U2: parámetros de la calculadora nativa */
.calc-par { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.calc-par summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.calc-par-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 8px 0 4px; }

/* U2 Trabajos nativo */
.avance { flex: 1; height: 6px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.avance i { display: block; height: 100%; background: var(--bot); }
/* Publicar desde el chat (21-09): la imagen tal como saldría en Facebook, dentro de la tarjeta. */
.pub-prev { display: block; max-width: min(100%, 360px); max-height: 360px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2, #0000); }
/* Su panel de cliente (eje extra, 21-09): réplica del portal del cliente (/opt/cliente-pwa) con SU paleta, para que se vea como él lo ve. */
.cpv-wrap { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cpv-wrap { grid-template-columns: 1fr; } }
.cpv { --pbg: #eef2f7; --psf: #fff; --pink: #0f172a; --psoft: #475569; --pline: #d3dce6; --pacc: #0f4c81; --pok: #15803d; --ptrack: #e2e8f0;
  background: var(--pbg); color: var(--pink); border: 8px solid #1f2937; border-radius: 26px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; max-height: 640px; overflow: auto; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cpv { --pbg: #0b1220; --psf: #16202f; --pink: #e8eef7; --psoft: #9fb0c6; --pline: #2b3a4f; --pacc: #4c9be8; --pok: #34d17d; --ptrack: #22303f; } }
:root[data-theme="dark"] .cpv { --pbg: #0b1220; --psf: #16202f; --pink: #e8eef7; --psoft: #9fb0c6; --pline: #2b3a4f; --pacc: #4c9be8; --pok: #34d17d; --ptrack: #22303f; }
.cpv-brand { display: flex; gap: 10px; align-items: center; }
.cpv-brand small, .cpv-sub { color: var(--psoft); font-size: 12.5px; display: block; }
.cpv-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--pacc); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.cpv-card { background: var(--psf); border: 1px solid var(--pline); border-radius: 14px; padding: 14px; overflow-wrap: anywhere; }
.cpv-card h4 { margin: 0 0 6px; font-size: 14.5px; line-height: 1.3; }
.cpv-pct { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.cpv-bar { height: 10px; background: var(--ptrack); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.cpv-bar > i { display: block; height: 100%; background: var(--pacc); border-radius: 999px; }
.cpv-steps { display: flex; gap: 5px; }
.cpv-steps > div { flex: 1; text-align: center; font-size: 10.5px; color: var(--psoft); min-width: 0; }
.cpv-steps > div > i { display: block; height: 6px; border-radius: 999px; background: var(--ptrack); margin-bottom: 4px; }
.cpv-steps > div.done { color: var(--pink); font-weight: 600; }
.cpv-steps > div.done > i { background: var(--pacc); }
.cpv-linea { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--pline); font-size: 13px; }
.cpv-imp { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cpv-ok { color: var(--pok); }
.cpv-total { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 2px solid var(--pline); }
.cpv-total b { font-size: 1.15rem; }
.cpv-map { display: inline-block; margin-top: 10px; color: var(--pacc); font-weight: 600; font-size: 13px; }
.cpv-btn { display: block; text-align: center; border: 1px solid var(--pline); border-radius: 10px; padding: 10px; color: var(--pacc); font-weight: 700; }
.cpv-edit { gap: 10px; min-width: 0; }
.cpv-proy { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.cpv-aviso { font-size: 13px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--accentSoft); }

/* FASE W (24-09): Cortes de vidrio (prefijo vd-, verificado libre) */
.vd-lista { max-height: 260px; overflow: auto; }
.vd-lista tr.sel td { background: var(--accentSoft); }
.vd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.vd-piezas td { padding: 2px 4px; }
.vd-piezas .input { height: 30px; min-width: 64px; width: 100%; }
.vd-piezas .vd-cant { min-width: 48px; }
.vd-kpi { display: flex; gap: 18px; flex-wrap: wrap; }
.vd-kpi div { display: flex; flex-direction: column; } .vd-kpi b { font-size: 20px; } .vd-kpi span { font-size: 12px; color: var(--muted); }
.vd-svg { width: 100%; height: auto; background: var(--surface2); border-radius: 8px; }
.vd-hoja { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
.vd-pz { fill: var(--accentSoft); stroke: var(--text); stroke-width: .7; }
.vd-sob { fill: var(--surface2); stroke: var(--line2); stroke-width: .5; stroke-dasharray: 3 2; }
.vd-cut { stroke: var(--hot); stroke-width: .9; stroke-dasharray: 5 3; }
.vd-t { fill: var(--text); text-anchor: middle; dominant-baseline: middle; font-weight: 700; }
.vd-pasos { margin: 6px 0 0; padding-left: 22px; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.chip-s.vd-ok { background: var(--moneySoft); color: var(--money); border-color: transparent; }
@media (max-width: 700px) { .vd-piezas th:nth-child(4), .vd-piezas td:nth-child(4) { display: none; } }
/* O4 (2026-09-27): design preview in the chat */
.diseno-prev { margin: 8px 0; max-width: min(100%, 420px); }
.diseno-prev img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.diseno-prev figcaption { display: flex; gap: 8px; margin-top: 8px; }
.m-medio { display: inline-block; vertical-align: top; margin: 6px 6px 6px 0; max-width: min(100%, 320px); }
.m-medio img, .m-medio video { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; border-radius: 10px; border: 1px solid var(--line); }
.m-medio figcaption { font-size: 12px; color: var(--muted, #888); margin-top: 4px; }
.artbody.visor { flex: 1; min-height: 0; padding: 0; display: flex; align-items: center; justify-content: center; overflow: auto; background: var(--surface2, #00000008); }
.artbody.visor img, .artbody.visor video { max-width: 100%; max-height: 100%; object-fit: contain; }
.artbody.visor iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.artbody.visor canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.artbody.visor svg { width: 100%; height: 100%; color: var(--text); padding: 12px; }
.visor-pie { font-size: 12px; padding: 6px 12px; border-top: 1px solid var(--line); min-height: 28px; }
.visor-pie:empty { display: none; }
.m-archivo { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 6px 4px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.m-archivo-ico { font-size: 18px; }
.visor-piezas { max-height: 34%; overflow: auto; border-top: 1px solid var(--line); }
.visor-piezas:empty { display: none; }
.vp-tit, .vp-fila { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; }
.vp-fila + .vp-fila, .vp-tit + .vp-fila { border-top: 1px solid var(--line); }
@media (max-width: 860px) { .dis-grid { grid-template-columns: minmax(0, 1fr) !important; } }

/* Z4 (2026-10-05): images attached in the chat composer */
.cmp-adj { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-adj[hidden] { display: none; }
.cmp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface2); color: var(--text2); font-size: 13px; max-width: 100%; }
.cmp-chip img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px;
  background: repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 10px 10px; }
.cmp-chip.err { border-color: var(--hot); color: var(--hot); }
.cmp-chip button.cmp-fondo { font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: inherit; }
.cmp-chip.revisar { flex-wrap: wrap; }
.cmp-chip.revisar img { width: 160px; height: 160px; background: repeating-conic-gradient(#d9d9d9 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.cmp-chip button { border: none; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
#cmpImgBtn { cursor: pointer; }
.m-user .m-img { display: inline-flex; flex-direction: column; gap: 2px; margin: 6px 6px 0 0; color: inherit; text-decoration: none; font-size: 12px; }
.m-user .m-img img { max-width: 160px; max-height: 160px; border-radius: 10px; object-fit: contain;
  background: repeating-conic-gradient(rgba(0,0,0,.08) 0 25%, transparent 0 50%) 0 0 / 12px 12px; }

/* 07-10 (conv 220) · pending cards: a bar above the composer + clearer card (type chip, title, label/value rows, warning) */
.tjv-bar { max-width: 780px; margin: 0 auto 8px; width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1.5px solid var(--wait); background: var(--waitSoft); color: var(--text); border-radius: 12px; font-size: 13.5px; }
.tjv-bar[hidden] { display: none; }
.tjv-bar > svg { color: var(--wait); flex: none; }
.tjv-head { font-size: 12px; font-weight: 700; gap: 6px; align-items: center; }
.tjv-tipo { white-space: nowrap; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line2); color: var(--text2); }
.tjv-num { font-size: 11px; font-weight: 600; }
.tjv-tit { font-size: 14.5px; line-height: 1.35; }
.tjv-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.tjv-dl dt { color: var(--muted); font-weight: 600; }
.tjv-dl dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.tjv-aviso { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; font-weight: 600; color: var(--hot);
  background: var(--hotSoft); border-radius: 8px; padding: 7px 9px; }
.tjv-aviso > svg { flex: none; margin-top: 2px; }
.confcard.tjv-flash { box-shadow: 0 0 0 3px var(--wait); transition: box-shadow .2s; }
@media (max-width: 520px) { .tjv-dl { grid-template-columns: 1fr; gap: 0 0; } .tjv-dl dd { margin-bottom: 6px; } }
.tjv-sinresp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; margin: -4px 0 4px auto; justify-content: flex-end; }
.tjv-sinresp svg { vertical-align: -2px; }
/* 07-10 Sitios module */
.sitios-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sitio { min-height: 170px; }

/* Generador 3D (Impresión 3D, 2026-10-09): shape/mounting pickers with pictures + the generation's review pictures */
.g3-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 6px; }
.g3-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12.5px; cursor: pointer; }
.g3-tile img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 6px; background: #eeeae2; }
.g3-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accentSoft); font-weight: 700; }
.g3-vistas { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.g3-vistas img { width: 100%; border-radius: 10px; background: #eeeae2; }

/* ── axis saas F6 (13-10): a client's panel — CRM record, calculator, 5-item bottom nav. VAG never renders these classes. */
@media (max-width: 900px) { .bottom.b5 { grid-template-columns: repeat(5, 1fr); } }
.crm-rec { display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; gap: 14px; padding: 16px 20px; height: 100%; min-height: 0; max-width: 1500px; margin: 0 auto; width: 100%; }
.crm-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px; }
.crm-tl { display: flex; flex-direction: column; gap: 2px; }
.crm-tl-i { display: flex; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); }
.crm-tl-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--accentSoft); color: var(--accent); }
.crm-mini { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 13px; min-width: 0; }
.crm-mini:hover { border-color: var(--line2); }
.crm-tarea { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cot-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; }
.cot-precio { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.1; }
@media (max-width: 1000px) {
  .crm-rec { grid-template-columns: 1fr; height: auto; overflow-y: auto; padding: 12px; }
  .crm-col { overflow: visible; }
  .cot-grid { grid-template-columns: 1fr; }
}

/* 20-10: copy button next to a bare link in chat messages */
.copiar-liga { margin-left: 4px; padding: 0 5px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: inherit;
  font-size: 12px; line-height: 18px; cursor: pointer; vertical-align: baseline; }
.copiar-liga:hover { background: var(--line); }

/* 20-10: a card that failed / half-ran after the turn — visible, with «Revísalo» */
.nota-falla { display: flex; gap: 8px; align-items: center; margin: 6px auto; max-width: 640px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, #d97706 45%, transparent); background: color-mix(in srgb, #d97706 10%, transparent); font-size: 13px; }
.nota-falla .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* 20-10 UX: on a phone the quote and inventory tables lost their money columns off-screen. Drop the least useful column. */
@media (max-width: 640px) {
  .pres-tab th:nth-child(3), .pres-tab td:nth-child(3) { display: none; }
  .inv-tab th:nth-child(2), .inv-tab td:nth-child(2) { display: none; }
  .pres-tab, .inv-tab { font-size: 13px; }
}

/* 20-10 UX: kanban card actions read as loose text and stacked one per line (very tall cards). Compact outlined chips. */
.kcard .btn.sm.ghost { border-color: var(--line); height: 26px; padding: 0 8px; font-size: 12px; color: var(--text); }
.kcard .btn.sm.ghost:hover { background: var(--surface2); }
/* 20-10 UX: with no conversation open, the copilot column was an empty third pane. Show it only with a thread open. */
.conv:has(#thread > .empty:only-child) .ficha-mini, .conv:has(#thread > .empty:only-child) #tir2 { display: none; }
/* 20-10: a quote with an advance = real money owed */
.chip-s.money { background: var(--moneySoft); color: var(--money); border-color: transparent; }

/* 20-10: Inicio «Pendientes de hoy» — one row per client with each reason and its action */
.pend { width: min(760px, 100%); display: flex; flex-direction: column; gap: 8px; }
.pend h3 { margin: 0; font-size: 16px; }
.pend-fila { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pend-av { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--text2); font-size: 12px; font-weight: 700; text-decoration: none; }
.pend-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pend-nombre { font-weight: 700; color: var(--text); text-decoration: none; }
.pend-mot { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pend-mot .grow { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .pend-mot { flex-wrap: wrap; } .pend-mot .btn { margin-left: 18px; } }

/* 20-10: WhatsApp performance strip above the inbox */
.conv-desemp { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 14px; font-size: 12px; color: var(--text2); border-bottom: 1px solid var(--line); }
.conv-desemp:empty { display: none; }

/* 26-10 Publicar AI-first: one card per image — image | chips (stacks on a phone) */
.confcard:has(.pubrev) { max-width: 880px; }
.pubrev { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; align-items: start; }
.pubrev-img { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pubrev-img img { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); }
.pubrev-dup { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1.5px dashed var(--line); border-radius: 8px; }
.pubrev-dup img { max-height: 200px; }
.pubrev-campos { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pubrev-f { display: flex; flex-direction: column; gap: 4px; }
.pubrev-f small { font-weight: 700; font-size: 12px; }
.pubrev-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pubrev-chips .pr-sug:not(.primary) { outline: 1.5px dashed var(--wait); }
.pubrev textarea { width: 100%; font: inherit; font-size: 13.5px; border-radius: 8px; border: 1px solid var(--line); padding: 8px; background: var(--bg, #fff0); color: inherit; resize: vertical; }
@media (max-width: 640px) { .pubrev { grid-template-columns: 1fr; } }

/* ── 04-11 Inicio chat-first («hablarle al panel» en vez de a Gemini) ─────────────────────────────────────────────
   Desktop ≥1100: [greeting + composer + chips, centred] | [Lo que necesita de ti, own scroll].
   Below: one scrolling column; the composer is docked at the bottom (sticky) for the thumb. */
.inicio { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 440px); }
.ini-main { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: max(56px, 11vh) 28px 32px; }
.ini-hola { width: min(760px, 100%); text-align: center; }
.ini-hola h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 42px; letter-spacing: -.3px; }
.ini-hola p { margin: 6px 0 0; font-size: 14.5px; }
.ini-cmp { width: min(760px, 100%); }
.ini-chips { width: min(760px, 100%); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ini-chip { display: inline-flex; flex-direction: column; gap: 2px; min-width: 150px; max-width: 240px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; }
.ini-chip:hover { border-color: var(--line2); color: var(--text); }
.ini-chip.skel { height: 48px; border: none; }
.ini-chip .et { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; }
.ini-chip .ti { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ini-lado { min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); background: var(--side); padding: 20px 16px 28px;
  display: flex; flex-direction: column; gap: 22px; }
.ini-sec { display: flex; flex-direction: column; gap: 10px; }
.ini-sec h3 { margin: 0; font-size: 15px; font-weight: 700; }
.ini-sec .cnt { font-weight: 400; }
.ini-vacio { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 12px; background: var(--botSoft); color: var(--bot); font-weight: 600; }
.ini-ver { align-self: flex-start; }
.ini-nota { margin: 4px 0 6px; font-size: 12.5px; }

/* one conversation that needs him */
.at { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  transition: opacity .2s, transform .2s; }
.at.fresco { border-left: 3px solid var(--hot); }
.at.saliendo { opacity: 0; transform: translateX(12px); }
.at.skel { border: none; }
.at-cab { display: flex; align-items: center; gap: 10px; }
.at-quien { display: flex; flex-direction: column; min-width: 0; }
.at-nombre { font-weight: 700; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-nombre:hover { text-decoration: underline; color: var(--text); }
.at-meta { font-size: 12.5px; color: var(--muted); }
.at-mas { width: 32px; height: 32px; }
.at-menu { top: calc(100% + 4px); bottom: auto; right: 0; width: 270px; }
.at-menu a { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.at-menu a:hover { background: var(--surface2); }
.at-menu a b { font-size: 14px; }
.at-msg { margin: 0; font-size: 13.5px; color: var(--text2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.at-cop { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--accent); }
.at-cop .ico { margin-top: 2px; }
.at-sug { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--accentSoft); }
.at-sug-et { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--accent); letter-spacing: .2px; }
.at-sug-txt { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
textarea.at-sug-ed { width: 100%; resize: vertical; border: 1px solid var(--accent); border-radius: 8px; padding: 8px; background: var(--surface); line-height: 1.45; }
.at-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.at-conf { font-size: 13px; flex: 1 1 100%; }
.at-hecho { display: flex; align-items: center; gap: 6px; color: var(--bot); font-weight: 700; font-size: 13px; }
.at .pend-mot { padding-top: 6px; border-top: 1px dashed var(--line); }

/* archived by the copilot (collapsed, never dropped) */
.ini-arch { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ini-arch summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 600; color: var(--text2); }
.ini-arch summary::-webkit-details-marker { display: none; }
.ini-arch[open] summary { border-bottom: 1px solid var(--line); }
.ini-arch > p, .ini-arch > .arch-fila { margin-left: 12px; margin-right: 12px; }
.arch-fila { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.arch-fila:last-child { border-bottom: none; }
.arch-txt { overflow-wrap: anywhere; margin-top: 2px; }
.arch-por { margin-top: 4px; color: var(--text2); }

@media (max-width: 1099px) {
  /* single column: greeting, chips, lists, suggestions, composer docked at the bottom */
  .inicio { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .ini-main, .ini-lado { display: contents; }
  .ini-main > *, .ini-lado > * { flex-shrink: 0; }   /* a flex column with overflow would squash the chip row to nothing */
  .ini-hola { order: 1; width: auto; text-align: left; padding: 20px 16px 0; }
  .ini-hola h2 { font-size: 28px; }
  .ini-chips { order: 2; width: auto; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 14px 16px 4px; scrollbar-width: none;
    scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
  .ini-chips::-webkit-scrollbar { display: none; }
  .ini-chip { flex: 0 0 auto; min-width: 136px; scroll-snap-align: start; }
  .ini-sec { order: 3; padding: 14px 16px 0; }
  .ini-sugs { order: 4; width: auto; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 16px 16px 4px; scrollbar-width: none; }
  .ini-sugs::-webkit-scrollbar { display: none; }
  .ini-sugs .sug { flex: 0 0 auto; }
  .ini-cmp { order: 5; position: sticky; bottom: 0; z-index: 5; width: auto; margin-top: auto; padding: 10px 10px 10px;
    background: linear-gradient(to bottom, transparent, var(--bg) 22%); }
  .ini-cmp .composer { box-shadow: 0 4px 18px rgba(0,0,0,.10); }
  #secAr { padding-bottom: 8px; }
}
@media (max-width: 640px) {
  .at-acc .btn { flex: 1 1 auto; }
  .at-menu { width: min(270px, calc(100vw - 48px)); }
}

/* 04-11 round 2: suggestion age, «N más» chip */
.at-sug-hace { font-weight: 400; color: var(--muted); }
.at-sug-vieja { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--wait); }
.ini-chip-mas { flex-direction: row; align-items: center; justify-content: center; gap: 6px; min-width: 0; cursor: pointer; color: var(--text2); font: inherit; }

/* 04-11 «Trabajó 42 s · 6 pasos» — privado-style process timeline under the tool chips (added, nothing replaced) */
.trabajo { margin: 2px 0 10px; max-width: 760px; }
.trabajo > summary { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 10px; border-radius: 10px; cursor: pointer;
  list-style: none; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.trabajo > summary::-webkit-details-marker { display: none; }
.trabajo > summary:hover { color: var(--text); background: var(--surface2); }
.trabajo > summary .ico:last-child { transition: transform .15s; }
.trabajo[open] > summary .ico:last-child { transform: rotate(180deg); }
.trb-ahora { color: var(--text); font-weight: 600; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trb-res { white-space: nowrap; }
.trb-pasos { list-style: none; margin: 8px 0 0; padding: 0 0 0 6px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.trb-paso { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0 3px 8px; position: relative; font-size: 13px; }
.trb-punto { width: 20px; height: 20px; margin-left: -19px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg); color: var(--bot); }
.trb-paso.fallo .trb-punto { color: var(--hot); } .trb-paso.vivo .trb-punto, .trb-razon .trb-punto { color: var(--accent); }
.trb-paso > details { flex: 1; min-width: 0; }
.trb-paso summary { cursor: pointer; list-style: none; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trb-paso summary::-webkit-details-marker { display: none; }
.trb-paso summary b { font-weight: 600; color: var(--text); }
.trb-obj { color: var(--muted); } .trb-ms { color: var(--muted); font-size: 12px; }
.trb-paso.fallo summary b { color: var(--hot); }
.trb-cuerpo { margin: 6px 0 6px; display: flex; flex-direction: column; gap: 4px; }
.trb-lbl { font-size: 11px; font-weight: 700; letter-spacing: .3px; color: var(--muted); text-transform: uppercase; }
.trb-cuerpo pre { margin: 0; max-height: 260px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--surface2); font-size: 12px;
  line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.trb-pensar { color: var(--text2); font-style: italic; }
@media (max-width: 640px) { .trb-ahora { max-width: 22ch; } .trabajo > summary { flex-wrap: nowrap; max-width: 100%; } .trb-res { overflow: hidden; text-overflow: ellipsis; } }
/* 04-11 Bandeja: conversations the copilot archived (no answer needed / client's turn) */
.chip.arch { background: var(--surface2); color: var(--muted); border: 1px dashed var(--line2); }
.arch-mot { font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 4px; }
.at-pidiendo { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--accent); padding: 6px 8px; border-radius: 8px; background: var(--accentSoft); }

/* 04-11 microphone: a bigger round button; while listening it becomes a pill with sound bars + timer.
   The bars idle softly and jump when the browser hears a voice (.oyendo). */
.composer .cmp-mic { width: 40px; height: 40px; border-radius: 50%; color: var(--text2); transition: width .2s, background .2s, color .2s; }
.composer .cmp-mic:hover { background: var(--surface2); color: var(--text); }
.composer .cmp-mic.escuchando { width: auto; min-width: 40px; padding: 0 12px 0 10px; gap: 8px; border-radius: 999px; background: var(--hot); color: #fff;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--hot) 45%, transparent); animation: mic-pulso 1.6s ease-out infinite; }
.mic-ondas { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.mic-ondas i { display: block; width: 3px; height: 6px; border-radius: 2px; background: currentColor; animation: mic-onda 1.1s ease-in-out infinite; }
.mic-ondas i:nth-child(2) { animation-delay: .15s; } .mic-ondas i:nth-child(3) { animation-delay: .3s; }
.mic-ondas i:nth-child(4) { animation-delay: .45s; } .mic-ondas i:nth-child(5) { animation-delay: .6s; }
.cmp-mic.oyendo .mic-ondas i { animation-duration: .5s; }
.cmp-mic.oyendo .mic-ondas i:nth-child(odd) { animation-name: mic-onda-alta; }
.mic-txt { font-size: 12.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
@keyframes mic-onda { 0%, 100% { height: 5px; } 50% { height: 11px; } }
@keyframes mic-onda-alta { 0%, 100% { height: 6px; } 50% { height: 18px; } }
@keyframes mic-pulso { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hot) 45%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (max-width: 900px) {
  .composer .cmp-mic { width: 44px; height: 44px; min-height: 44px; }
  .composer .cmp-mic.escuchando { width: auto; }
  .composer .cmp-mic.escuchando .mic-txt { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .mic-ondas i, .composer .cmp-mic.escuchando { animation: none; }
  .mic-ondas i { height: 10px; }
}
/* 04-11 Personalizar: the panel's own skills / sub-agents */
.prop-fila summary::-webkit-details-marker { display: none; }
.prop-pre { margin: 0 0 8px; max-height: 280px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--surface2); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 640px) { .composer:has(.cmp-mic.escuchando) .cmp-tog[data-h] { display: none; } }   /* room for the listening pill */

/* 04-11 DeepSeek audit F-8 / F-9: visible focus where outline:none won (composer, inputs); 44 px touch targets on phones */
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accentSoft); }
.input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 900px) { .sug { height: 44px; padding: 0 16px; border-radius: 22px; } .ini-chip { min-height: 44px; } }
/* 04-11: «toca el micrófono» when the assistant gesture could not start listening by itself */
.composer .cmp-mic.mic-llamar { background: var(--accent); color: var(--accentText); animation: mic-pulso 1.2s ease-out infinite; }
.and-pasos { margin: 4px 0 0; padding-left: 20px; font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }

/* ── compartir: personas, enlaces y ramas (04-11) ────────────────────── */
.share-dlg[open] { display: flex; flex-direction: column; gap: 12px; width: min(680px, calc(100% - 24px)); max-height: min(88vh, 820px); }
.share-head { display: flex; align-items: center; gap: 10px; }
.share-head h3 { margin: 0; font-size: 18px; min-width: 0; }
.share-body { display: flex; flex-direction: column; gap: 14px; overflow: auto; min-height: 0; padding-right: 4px; }
.share-cargando { display: flex; align-items: center; gap: 10px; padding: 24px 8px; color: var(--muted); font-size: 13.5px; }
.share-sec { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
.share-sec h4 { margin: 0; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.share-nota { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.share-personas { display: flex; flex-direction: column; gap: 6px; max-height: 232px; overflow: auto; }
.share-persona { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer; color: var(--text); }
.share-persona:hover { border-color: var(--line2); }
.share-persona:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accentSoft); }
.share-persona input, .share-opt input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); }
.share-persona .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--accentSoft); color: var(--accent); font-size: 12px; font-weight: 700; }
.share-persona b { font-size: 13.5px; }
.share-persona small { font-size: 12px; color: var(--muted); }
.share-permisos { display: flex; gap: 6px; flex-wrap: wrap; }
.share-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer; flex: 1 1 200px; }
.share-opt:has(input:checked) { border-color: var(--accent); background: var(--accentSoft); }
.share-opt b { font-size: 13px; }
.share-opt small { font-size: 12px; color: var(--muted); }
.share-acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-acciones .btn { min-height: 44px; }
.share-link { display: flex; gap: 6px; align-items: center; }
.share-link .input { height: 40px; font-size: 12.5px; }
.share-enlaces { display: flex; flex-direction: column; gap: 2px; }
.share-enlace { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.share-enlace code { font-size: 12px; min-width: 0; }
.share-tree, .share-tree ul { list-style: none; margin: 0; padding: 0; }
.share-tree ul { margin-left: 18px; padding-left: 10px; border-left: 1px solid var(--line); }
.share-nodo { display: flex; align-items: center; gap: 8px; min-height: 44px; flex-wrap: wrap; }
.share-nodo .rama-autor { font-size: 13px; }
.share-nodo .muted { font-size: 12px; }
.share-error { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text2); }
.share-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; flex-wrap: wrap; }
.share-pie { font-size: 12.5px; min-height: 1em; }
.share-dlg .btn, .share-dlg .icon-btn { min-height: 40px; }
@media (max-width: 900px) { .share-dlg .btn, .share-dlg .icon-btn { min-height: 44px; } }
.badge-rama { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11px; font-weight: 700;
  background: var(--accentSoft); color: var(--accent); border: 1px solid var(--line); white-space: nowrap; }

/* visor standalone de artefacto: /artefactos/{id} */
.share-art { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.share-art-top { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.share-art-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface); flex-wrap: wrap; }
.share-art-bar h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.share-art-body { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px; }
.share-art-body.frame { padding: 0; }
.share-art-body iframe { width: 100%; height: 100%; border: none; background: #fff; }
.share-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
@media (max-width: 900px) {
  .share-art-top { padding: 6px 10px; }
  .share-art-bar { padding: 10px 12px; gap: 8px; }
  .share-art-bar h2 { font-size: 18px; }
  .share-art-body { padding: 14px; }
  .share-art-body.frame { padding: 0; }
}

/* ── 04-11 UX pass (all screens, measured with real data at 390 and 1366 px) ───────────────────────────── */
/* Tabs that do not fit: fade on the side that still has tabs (set by app.js ajustarTabs). */
.tabs.ux4-mas-der, .tabs-m.ux4-mas-der { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.tabs.ux4-mas-izq, .tabs-m.ux4-mas-izq { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
.tabs.ux4-mas-izq.ux4-mas-der, .tabs-m.ux4-mas-izq.ux4-mas-der { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.tabs .tab, .tabs-m .tab { flex: 0 0 auto; white-space: nowrap; }
/* Segmented filters (Inventario, Presupuestos…) scroll instead of being cut off. */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) {
  /* Header rows (title + several buttons): the title keeps its line, the buttons wrap below. */
  .ux4-cab { flex-wrap: wrap; }
  .ux4-cab > .grow { flex: 1 1 100%; }
  .nat-card > .row.ux4-cab > .grow { flex-basis: 100%; }
  /* List rows (Programados, Proyectos…): text keeps ≥220 px, actions wrap to a second line. */
  .list-row { flex-wrap: wrap; row-gap: 8px; }
  .list-row > .grow { flex: 1 1 220px; }
  /* Filter bars: the segmented filter takes its own full line. */
  .nat-bar .seg { flex: 1 1 100%; }
  /* «Pídeselo al chat» examples: one swipeable line instead of a wall of chips. */
  .nat-ej { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .nat-ej::-webkit-scrollbar { display: none; }
  .nat-ej .chip-s { flex: 0 0 auto; white-space: nowrap; }
  /* Kanban boards: columns snap one by one when swiping. */
  .kanban { scroll-snap-type: x mandatory; grid-auto-columns: minmax(260px, 86%); }
  .kanban > .kcol { scroll-snap-align: start; }
}
/* Touch screens: small buttons and tabs at least 36 px tall (they were 30-32 px). */
@media (pointer: coarse) {
  .btn.sm { height: 36px; }
  .tab { height: 36px; }
  .seg button { height: 34px; }
  .chip-s { padding: 4px 10px; }
}
/* Cortes de vidrio: offcuts, stock and merma tables scroll sideways inside their card on a phone (they were cut). */
#vRLista, #vInv, #vMerma, #vRes { max-width: 100%; overflow-x: auto; }
/* Artefactos list: compact icon square (was a full-width empty .artcard bar). */
.ux4-ai { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 8px; background: var(--accentSoft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
/* Shared chats (04-11): banner under the chat header, author above someone else's message, mark in «Chats recientes». */
.ux4-comp { display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-size: 13px; color: var(--text2); background: var(--accentSoft); border-bottom: 1px solid var(--line); }
.ux4-comp .ic, .ux4-comp svg { color: var(--accent); flex: 0 0 auto; }
.ux4-autor { align-self: flex-end; font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 6px 4px -2px 0; }
.ux4-rcomp { margin-left: auto; padding-left: 6px; color: var(--muted); display: inline-flex; flex: 0 0 auto; }
.reciente:has(.ux4-rcomp) { display: flex; align-items: center; }
.reciente:has(.ux4-rcomp) > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Chat header on a phone (04-11): secondary actions move into «⋯» (#chMas) so the chat title fits. */
@media (max-width: 900px) { .ux4-sec { display: none !important; } }
.ux4-menu { position: absolute; top: calc(100% + 4px); right: 12px; z-index: 40; min-width: 220px; padding: 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.ux4-menu[hidden] { display: none; }
.ux4-menu button { text-align: left; padding: 11px 12px; border: none; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14.5px; }
.ux4-menu button:hover, .ux4-menu button:focus-visible { background: var(--surface2); }
/* Phone: no bottom bar while the keyboard is open (class set by app.js on text focus). */
@media (max-width: 900px) { body.ux4-teclado .bottom { display: none !important; } }
/* Text size per device (04-11): body zoom from core.js aplicarLetra (--ux4-z); heights compensated so the shell still
   fits the screen exactly (the bottom bar stays at the bottom). */
html.ux4-zoom body { zoom: var(--ux4-z, 1); }
html.ux4-zoom #app { height: calc(var(--ux4-vh, 100vh) / var(--ux4-z, 1)) !important; }   /* real window height, see core.js */
/* Compact arrangement when big text leaves < 330 px of effective width (core.js → html.ux4-estrecho). */
.cmp-tog, .cmp-der > * { flex-shrink: 0; }   /* round buttons never squash into ovals */
html.ux4-estrecho .cmp-izq { overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; }
html.ux4-estrecho .cmp-izq::-webkit-scrollbar { display: none; }
html.ux4-estrecho .ini-hola h2 { font-size: 23px; }
html.ux4-estrecho .ini-hola p { font-size: 13.5px; }
html.ux4-estrecho .page h2, html.ux4-estrecho .page-in > h2 { font-size: 24px; }
html.ux4-estrecho .bottom a, html.ux4-estrecho .bottom button { font-size: 10.5px; }
html.ux4-estrecho .bottom a span, html.ux4-estrecho .bottom button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Compact: 7 composer buttons do not fit in ~277 px. Internet / Investigar toggles step aside (asking «búscalo en
   internet» in words still works); attach, mode, safety, mic and send stay. */
html.ux4-estrecho .cmp-tog[data-h] { display: none; }

/* 04-11: phone-action card («Ponerla en el teléfono») + the teammate overlay opened from a push (telefono.js) */
.telc { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; margin-top: 8px;
  display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.telc-cab { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.telc-cab .ico { flex: none; margin-top: 2px; color: var(--accent); }
.telc-txt { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.telc-pie { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.telc-pie .btn { text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.telc[data-estado="hecha"] { border-color: var(--line2); }
.telc-ok { color: var(--money); display: inline-flex; gap: 4px; align-items: center; }
.telc-esp { font-size: 12.5px; }
.telc-capa { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9999; display: grid; place-items: center; padding: 16px; }
.telc-dlg { background: var(--bg); border-radius: 14px; padding: 14px; width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; }
.telc-dlg .telc { margin-top: 0; max-width: none; }
.telc-dlg > .btn { align-self: flex-end; }

/* ── 05-11 phone cleanup (prefix ux5-). Fernando: «limpia de cosas la UI/UX del panel en la vista de teléfono». ── */
/* Inicio: one tap back into the chat he was working in today (he kept opening new chats for the same job). */
.ux5-seguir { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin: 0 auto 8px; padding: 8px 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  font-size: 13.5px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.ux5-seguir[hidden] { display: none; }
.ux5-seguir svg { color: var(--accent); flex: none; }
.ux5-seguir .ellipsis { min-width: 0; }
.ux5-seguir-h { flex: none; font-size: 12px; }
/* chat shared with N people: a count on the share icon instead of a full-width banner (phone) */
.ux5-sharen { min-width: 17px; height: 17px; padding: 0 4px; margin-left: 2px; border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.ux5-sharen[hidden] { display: none; }
.conv-desemp .ux5-corto { display: none; }
@media (max-width: 900px) {
  #btnTema { display: none !important; }                 /* theme lives in Más → Personalizar */
  /* inside a chat: the chat's own header (← title ⋯) is the only bar; composer at the very bottom */
  body.ux5-enchat .top, body.ux5-enchat .tabs-m, body.ux5-enchat .bottom { display: none !important; }
  .ux5-chhead { padding: 4px 4px 4px 0 !important; min-height: 54px; gap: 2px !important; }
  .ux5-chhead #chTit { font-size: 16.5px !important; }
  .ux5-chhead .btn.sm { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .ux5-atras { width: 44px; height: 44px; display: grid !important; place-items: center; color: var(--text); flex: none; }
  .ux4-comp.ux5-propio { display: none !important; }
  .ch-hechas > #chHechasBtn { display: none !important; }   /* «Acciones confirmadas» → item of the ⋯ menu */
  .ch-hechas { margin: 0; }
  .ch-hechas .adjpop { left: 0; right: 0; width: auto; }
  /* native screens: the tab already names the screen; the example chips repeat the input's own placeholder */
  .nat-h { display: none; }
  .nat-ej { display: none !important; }
  .conv-desemp .ux5-largo { display: none; }
  .conv-desemp .ux5-corto { display: inline; }
}
@media (min-width: 901px) { .ux5-sharen { display: none !important; } }   /* desktop keeps its «Compartido con…» banner */

/* ── 05-11 sidebar (every screen). Fernando: his parents «no tienen modo de saber en dónde están» and read the chat list
   as one paragraph. Where you are = accent colour + bar; sections have headers; every chat is its own row. ── */
.side { gap: 2px; }
.nav { height: 42px; font-size: 14.5px; color: var(--text); position: relative; }
.nav svg { color: var(--text2); flex: none; }
.nav.on, .reciente.ux5-rec.on { background: var(--accentSoft); color: var(--accent); font-weight: 700; }
.nav.on svg, .reciente.ux5-rec.on svg { color: var(--accent); }
.nav.on::before, .reciente.ux5-rec.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--accent); }
.side-sec { margin: 16px 4px 4px; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 11.5px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase; color: var(--text2); flex-wrap: wrap; gap: 2px 8px; }
.ux5-secn { width: 100%; font-size: 11.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.ux5-rgrupo { margin: 8px 12px 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.reciente.ux5-rec { position: relative; height: auto; min-height: 40px; gap: 9px; padding: 6px 10px; margin: 1px 0; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13.5px; }
.reciente.ux5-rec:hover { background: var(--surface2); }
.reciente.ux5-rec.on { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.reciente.ux5-rec svg { flex: none; color: var(--muted); }
.ux5-rtit { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ux5-rhace { flex: none; font-size: 11.5px; color: var(--muted); font-weight: 400; }
@media (min-width: 901px) { .side.collapsed .ux5-rgrupo, .side.collapsed .ux5-secn { display: none; } }
/* the drawer is sized in vw/px BEFORE the body zoom: with big text (zoom 1.5) it ran past the right edge */
@media (max-width: 900px) {
  html.ux4-zoom .side { width: calc(86vw / var(--ux4-z, 1)); max-width: calc(320px / var(--ux4-z, 1)); }
}
/* 05-11 Cotizaciones (Cotizar → Cotizaciones): one card per quote, fits a phone */
.ux5-cots { display: flex; flex-direction: column; gap: 8px; }
.ux5-cot { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ux5-cot-a { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ux5-cot-a .ellipsis { min-width: 0; }
.ux5-cot-b { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ux5-cot-c { display: flex; flex-wrap: wrap; gap: 6px; }
.ux5-cot-c .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }

/* ── 05-11 Caja del panel (cj-): ONE window — floating, side by side or full; on the phone a bottom sheet / bubble ── */
:root { --cj-w: clamp(360px, 31vw, 460px); --cj-hoja: 56dvh; }
.cj-boton { width: auto; min-width: 36px; padding: 0 10px; gap: 6px; font-weight: 600; }
.cj-boton.on { background: var(--accentSoft); color: var(--accent); border-color: transparent; }
.cj { position: fixed; z-index: 50; background: var(--surface); color: var(--text); display: flex; flex-direction: column;
  border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.cj[data-modo="lado"] { top: 0; right: 0; bottom: 0; width: var(--cj-w); border-width: 0 0 0 1px; box-shadow: none; }
body.cj-lado #app { margin-right: var(--cj-w); }
.cj[data-modo="flotante"] { border-radius: 14px; resize: both; min-width: 340px; min-height: 380px; }
.cj[data-modo="flotante"]:not(.cj-tel) .cj-head { cursor: move; user-select: none; }
.cj[data-modo="completa"] { inset: 0; z-index: 70; border: 0; box-shadow: none; }
.cj[data-modo="completa"] .cj-panel { max-width: 760px; width: 100%; margin: 0 auto; }
.cj-head { display: flex; align-items: center; gap: 6px; padding: 8px 6px 8px 14px; border-bottom: 1px solid var(--line); min-height: 52px; flex-shrink: 0; flex-wrap: wrap; }
.cj-tit { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.cj-est { flex-shrink: 0; }
.cj-vistas { display: flex; background: var(--surface2); border-radius: 9px; padding: 2px; flex-shrink: 0; }
.cj-vistas button { border: 0; background: transparent; height: 28px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cj-vistas button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.cj-modo { position: relative; }
.cj-modos { position: absolute; right: 0; top: 42px; z-index: 6; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 8px; width: 250px; display: flex; flex-direction: column; gap: 4px; }
.cj-modos button { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; background: transparent; padding: 8px; border-radius: 9px; text-align: left; font-weight: 600; color: var(--text); }
.cj-modos button:hover { background: var(--surface2); }
.cj-modos button.on { border-color: var(--accent); background: var(--accentSoft); color: var(--accent); }
.cj-modos-t { font-size: 12px; color: var(--muted); padding: 2px 6px; font-weight: 700; }
.cj-modos-n { font-size: 11.5px; color: var(--muted); padding: 4px 6px 2px; }
.cj-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.cj-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.cj-panel.cj-cargando { opacity: .6; pointer-events: none; }
.cj-odoo { flex: 1; width: 100%; border: 0; background: #fff; }
.cj-espejo { padding: 6px 14px; font-size: 12.5px; background: var(--botSoft); color: var(--bot); display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cj-tira { display: none; }
.cj-burbuja { position: fixed; right: 12px; top: calc(64px + env(safe-area-inset-top)); z-index: 52; display: flex; align-items: center; gap: 6px;
  height: 50px; padding: 0 18px; border-radius: 25px; border: 0; background: var(--accent); color: var(--accentText); box-shadow: var(--shadow); font-size: 15px; }
.cj-ventas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; flex-shrink: 0; }
.cj-venta { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 5px 10px; font-size: 12px; line-height: 1.25; }
.cj-venta b { font-size: 13px; font-variant-numeric: tabular-nums; }
.cj-venta.on { border-color: var(--accent); background: var(--accentSoft); }
.cj-nueva { flex-direction: row; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; border-style: dashed; }
.cj-busca { position: relative; flex-shrink: 0; }
.cj-q { display: flex; align-items: center; gap: 8px; height: 46px; border: 1px solid var(--line2); border-radius: 12px; padding: 0 12px; background: var(--surface); color: var(--muted); }
.cj-q:focus-within { border-color: var(--accent); }
.cj-q input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 16px; color: var(--text); }
.cj-res { position: absolute; left: 0; right: 0; top: 50px; z-index: 4; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 50vh; overflow: auto; }
.cj-res button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); padding: 10px 12px; }
.cj-res button:hover { background: var(--surface2); }
.cj-res small { display: block; }
.cj-r0 { padding: 10px 12px; }
.cj-cliq .cj-res { position: static; box-shadow: none; margin-top: 6px; max-height: 240px; }
.cj-lineas { display: flex; flex-direction: column; }
.cj-linea { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cj-ln { font-weight: 600; line-height: 1.3; }
.cj-nota { font-size: 12px; color: var(--text2); white-space: pre-line; }
.cj-lp { font-size: 12px; }
.cj-paso { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex-shrink: 0; }
.cj-paso button { width: 34px; height: 34px; border: 0; background: var(--surface2); color: var(--text); font-size: 17px; font-weight: 700; }
.cj-paso span, .cj-qty { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.cj-sub { min-width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.cj-x { width: 30px; height: 30px; }
.cj-comp { font-size: 11.5px; color: var(--muted); padding: 0 0 6px 10px; margin-top: -4px; border-bottom: 1px solid var(--line); }
.cj-pie { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: auto; }
.cj-cli { font-size: 13.5px; }
.cj-tot { font-size: 15px; }
.cj-tot b { font-size: 26px; font-variant-numeric: tabular-nums; }
.cj-ancho { width: 100%; height: 46px; font-size: 15px; border-radius: 12px; }
.cj-cobrar { height: 54px; font-size: 17px; }
.cj-dia { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cj-fuera { background: var(--waitSoft); color: var(--wait); padding: 8px 10px; border-radius: 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cj-vacio { padding: 18px 8px; text-align: center; }
.cj-cerrada, .cj-hecho, .cj-cobro { display: flex; flex-direction: column; gap: 10px; }
.cj-cerrada p { margin: 0; }
.cj-big { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.cj-hecho { align-items: center; text-align: center; padding-top: 20px; }
.cj-total { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cj-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text2); font-weight: 600; flex: 1; min-width: 0; }
.cj-fila { display: flex; gap: 8px; align-items: flex-end; }
.cj-merma { flex: 0 0 96px; }
.cj-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; padding-bottom: 10px; }
.cj-medida { border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--accentSoft); flex-shrink: 0; }
.cj-medida .input { background: var(--surface); }
.cj-prev { font-size: 13px; }
.cj-prev b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cj-pago { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.cj-metodos { display: flex; flex-wrap: wrap; gap: 6px; }
.cj-metodos button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 9px; height: 38px; padding: 0 12px; font-weight: 600; }
.cj-metodos button.on { border-color: var(--accent); background: var(--accentSoft); color: var(--accent); }
.cj-cuenta { font-size: 18px; text-align: center; }
.cj-dif { font-size: 15px; min-height: 20px; }
@media (max-width: 900px) {
  .cj-boton { padding: 0 8px; }
  .cj[data-modo="lado"] { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: var(--cj-hoja); border-width: 1px 0 0; border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px rgba(0,0,0,.16); padding-bottom: env(safe-area-inset-bottom); }
  body.cj-lado #app { margin-right: 0; height: calc(100dvh - var(--cj-hoja)); }
  body.cj-lado .bottom { display: none; }
  .cj[data-modo="lado"] .cj-tira { display: flex; justify-content: center; padding: 7px 0 1px; touch-action: none; cursor: ns-resize; flex-shrink: 0; }
  .cj-tira span { width: 42px; height: 5px; border-radius: 3px; background: var(--line2); }
  .cj[data-modo="flotante"] { inset: 9dvh 8px 12px 8px; resize: none; border-radius: 16px; min-width: 0; min-height: 0; }
  .cj.cj-oculta { display: none; }
  .cj-head { padding: 2px 2px 4px 12px; gap: 2px; min-height: 46px; flex-wrap: nowrap; }
  .cj-head .icon-btn { width: 40px; height: 40px; }
  .cj-tit { font-size: 14px; }
  .cj-vistas button { padding: 0 7px; font-size: 12px; }
  .cj-panel { padding: 10px 12px 14px; }
  .cj-sub { min-width: 66px; }
}

/* ── 06-11 Conversaciones con aire (prefix ux6-). Fernando: «mejora la UI/UX del módulo de conversaciones, está demasiado
   apretado». Client card + copilot = toggle («Cliente»): column on wide screens, drawer under 1180 px, full sheet on the
   phone (it had NO card there). Phone thread = whole screen (no app bar / bottom bar), mode as one compact select. ── */
.ux6-fichatop { display: none; align-items: center; gap: 8px; }
.ux6-fichatop b { flex: 1; font-size: 15px; }
.conv.ux6-sinficha .ficha-mini, .conv.ux6-sinficha #tir2 { display: none; }
.ux6-vercli { gap: 6px; flex-shrink: 0; }
.ux6-vercli[aria-pressed="true"] { background: var(--accentSoft); color: var(--accent); }
.ux6-tit { flex: 1 1 auto; }
.ux6-vent { white-space: nowrap; }
.conv-desemp { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.conv-desemp .ux5-largo { display: none; }
.conv-desemp .ux5-corto { display: inline; overflow: hidden; text-overflow: ellipsis; }
.conv-list { width: var(--w-bandeja, 320px); }
.thread-top { padding: 8px 16px; gap: 10px; }
.thread-msgs { padding: 20px clamp(14px, 3vw, 40px); }
.thread-foot { padding: 10px 16px 14px; gap: 6px; }
.bub { max-width: min(560px, 80%); }
@media (max-width: 1180px) {
  .conv { position: relative; }
  .conv.ux6-ficha .ficha-mini { display: flex; position: absolute; top: 0; right: 0; bottom: 0; z-index: 30;
    width: min(380px, 100%); background: var(--bg); box-shadow: var(--shadow); border-left: 1px solid var(--line); }
  .conv.ux6-ficha .ux6-fichatop { display: flex; }
}
@media (max-width: 900px) {
  body.ux6-enhilo .top, body.ux6-enhilo .tabs-m, body.ux6-enhilo .bottom { display: none !important; }
  .filtros { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 10px 12px; }
  .filtros::-webkit-scrollbar { display: none; }
  .filtro { flex-shrink: 0; height: 34px; }
  .thread-top { padding: 4px 6px 4px 0; gap: 4px; min-height: 56px; }
  .thread-top #volver { width: 44px; height: 44px; flex: none; }
  .ux6-modo { height: 36px; max-width: 128px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
    color: var(--text); font: inherit; font-size: 13.5px; flex: none; }
  .ux6-vercli { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .thread-msgs { padding: 12px 10px; gap: 10px; }
  .bub { max-width: 86%; padding: 9px 12px; }
  .thread-foot { padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
  .ux6-hint { font-size: 12px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sendbox { padding: 4px 4px 4px 12px; gap: 2px; }
  .sendbox textarea { font-size: 16px; }
  .sendbox .btn.sm.ghost { width: 36px; padding: 0; justify-content: center; }
  .conv.ux6-ficha .ficha-mini { position: fixed; inset: 0; width: auto; z-index: 70; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
}

/* 06-11 guided quote (PREVIEW) */
.gq-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.gq-box .btn.sm { min-height: 38px; }
.gq-prev { align-self: flex-start; font-size: 11.5px; font-weight: 700; color: var(--wait); background: color-mix(in srgb, var(--wait) 14%, transparent);
  border-radius: 8px; padding: 2px 8px; }

/* 06-11: files in the chat — PDF card with its first page, PDF pages in the viewer, floating viewer outside the chat,
   and the quick-reply buttons under a question (Fernando: «no quiero estar diciéndole SÍ a todo»). */
.m-auto { display: inline-block; vertical-align: top; max-width: 100%; }
.m-pdf { display: inline-flex; gap: 10px; align-items: flex-start; margin: 6px 6px 6px 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: min(100%, 460px); }
.m-pdf-hoja { padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: zoom-in; flex-shrink: 0; width: 110px; overflow: hidden; }
.m-pdf-hoja img { display: block; width: 100%; height: auto; }
.m-pdf-pie { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m-pdf-pie b { overflow-wrap: anywhere; }
.visor.visor-pdf { overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; background: var(--bg, #222); touch-action: pan-x pan-y pinch-zoom; }
.visor.visor-pdf img { width: 100%; max-width: 1000px; height: auto; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.visor-flotante { position: fixed !important; inset: 0; width: auto !important; z-index: 1000; }
@media (min-width: 900px) { .visor-flotante { left: auto; width: min(720px, 60vw) !important; box-shadow: -8px 0 30px rgba(0,0,0,.25); } }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick button { border: 1px solid var(--accent); color: var(--accent); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 14px; line-height: 1.2; cursor: pointer; text-align: left; }
.quick button.si { background: var(--accent); color: var(--accentText); }
.quick button:disabled { opacity: .45; cursor: default; }
