/* El marco: barra superior, tira de secciones, vista, columna del chat y su botón. */

.app { height: 100dvh; display: flex; flex-direction: column; position: relative; }

/* —— Barra superior —————————————————————————————————————— */
.top { flex: none; height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 20px 0 24px; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; text-decoration: none; color: var(--ink); flex: none; }
.marca:hover { color: var(--ink); }
.buscador { flex: 1; max-width: 560px; margin: 0 auto; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; border-radius: var(--r-pill); background: var(--row-hover); color: var(--ink3); }
.buscador input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: 0; color: var(--ink); }
.buscador input::placeholder { color: var(--muted); }
.buscador:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.top-fin { display: flex; align-items: center; gap: 8px; flex: none; }
.demo { font-size: var(--t-min); color: var(--muted); margin-right: 4px; white-space: nowrap; }
.empresa { height: 36px; padding: 0 10px 0 12px; border-radius: var(--r-pill); display: flex; align-items: center; gap: 8px; background: var(--surface); font-size: var(--t-ui); font-weight: 500; white-space: nowrap; }
.empresa:hover { background: var(--soft); }
.avatar { width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--row-hover); color: var(--ink2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--t-ui); }
.avatar:hover { background: var(--line-btn); }

/* —— Cuerpo ———————————————————————————————————————————— */
.cuerpo { flex: 1; min-height: 0; display: flex; }
#vista { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; outline: 0; }

/* —— Tira de secciones: icono y nombre, para no tener que adivinar ———————————— */
.tira { flex: none; width: var(--tira-w); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 16px; overflow-y: auto; }
.tira-fin { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.t-item { position: relative; flex: none; width: 64px; padding: 8px 0 6px; border-radius: var(--r-field); display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink3); text-decoration: none; font-size: var(--t-min); }
.t-item:hover { background: var(--row-hover); color: var(--ink); }
.t-item.on { color: var(--ink); font-weight: 600; }
.t-item.on .ic { background: var(--primary); color: var(--on-primary); }
.t-item .ic { width: 36px; height: 30px; padding: 6px 9px; border-radius: var(--r-pill); }
.t-txt { line-height: 1.2; }
.t-num { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: var(--t-min); font-weight: 600; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }
.t-sep { width: 28px; height: 1px; background: var(--line); margin: 8px 0; flex: none; }

/* —— Chat: columna a la derecha, no modal ———————————————————————————— */
.chat-col { flex: none; width: var(--chat-w); min-height: 0; margin: 0 16px 16px 0; border-radius: var(--r-card); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.chat-cab { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px 16px; }
.chat-cab .anillo { width: 30px; height: 30px; }
.chat-cab h2 { flex: 1; font-size: var(--t-body); font-weight: 600; }
.chat-hilo { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; display: flex; flex-direction: column; gap: 8px; }
.msg-tu { align-self: flex-end; background: var(--soft); border-radius: var(--r-block); padding: 10px 14px; }
.msg-cuentas { align-self: flex-start; color: var(--ink2); }
.msg ul { display: flex; flex-direction: column; gap: 6px; padding-left: 16px; list-style: disc; }
.msg strong { color: var(--ink); }
.chat-enl { font-size: var(--t-ui); }
.chat-pie { padding: 8px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-sug { display: flex; flex-wrap: wrap; gap: 6px; }
.sug { padding: 6px 12px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line-btn); font-size: var(--t-ui); color: var(--ink2); }
.sug:hover { background: var(--soft); color: var(--ink); }
.chat-form { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 4px 0 14px; border-radius: var(--r-pill); background: var(--soft); }
.chat-form:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.chat-form input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: 0; }
.chat-form input::placeholder { color: var(--muted); }
.chat-enviar { background: var(--primary); color: var(--on-primary); }
.chat-enviar:hover { background: var(--primary); color: var(--on-primary); opacity: .88; }
.chat-nota { font-size: var(--t-min); color: var(--muted); }

.fab { position: absolute; right: 32px; bottom: 32px; z-index: 20; width: 64px; height: 64px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--pop); display: flex; align-items: center; justify-content: center; }
.fab:hover .anillo { transform: rotate(30deg); }
.fab .anillo { transition: transform .4s ease-out; }

/* —— Sin marco: el modo foco se queda solo ——————————————————————————— */
.sin-marco .top, .sin-marco .tira, .sin-marco .fab, .sin-marco .chat-col { display: none; }

@media (max-width: 1180px) {
  .demo { display: none; }
  .chat-col { position: absolute; z-index: 25; right: 0; top: var(--top-h); bottom: 0; box-shadow: var(--pop); max-width: calc(100vw - 32px); }
}
@media (max-width: 900px) {
  .app { height: auto; min-height: 100dvh; }
  .top { height: auto; flex-wrap: wrap; padding: 8px 16px; gap: 8px 12px; }
  .buscador { order: 3; flex: 1 1 100%; max-width: none; }
  .top-fin { margin-left: auto; }
  .empresa span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
  .cuerpo { flex-direction: column; }
  .tira { width: 100%; flex-direction: row; gap: 4px; padding: 4px 12px 8px; overflow-x: auto; overflow-y: visible; scrollbar-width: none; }
  .tira-fin { margin-top: 0; margin-left: auto; flex-direction: row; }
  .t-sep { display: none; }
  #vista { flex-direction: column; min-height: 60dvh; }
  .chat-col { position: fixed; inset: 8px; top: 8px; width: auto; max-width: none; margin: 0; }
  .fab { position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; }
  .fab .anillo { width: 40px; height: 40px; }
}
