/* ═══════════════════════════════════════════════════════════════════════════
   ARIA · LA FASE 4 A PANTALLA COMPLETA (Luis, 2026-10-22). Las piezas las arma aria-hoja.js.
   Toda la carpeta (pestañas y sus cuatro apartados) sobre la consola, encabezado incluido; arriba
   las pestañas como una pastilla y, en el Documento, la «hoja» de CEIBA (comisiones-hoja.css): la
   barra de formato debajo de las pestañas, el papel de ancho fijo con su zoom, Parámetros abajo a
   la izquierda y las acciones abajo a la derecha. Los colores son los del tema de la consola (las
   variables de aria-interiores.css); el papel no lo toca ningún tema. Sin barras de desplazamiento.
   ═══════════════════════════════════════════════════════════════════════════ */

/* la entrada, al final de las pestañas (fuera de la pantalla completa) */
.ah-entrar{ align-self:center; flex:none; display:inline-grid; place-items:center; width:32px; height:32px; margin-left:8px; padding:0;
  border:1px solid var(--filete2, rgba(26,38,51,.18)); border-radius:99px; background:transparent; color:var(--tinta2, inherit); cursor:pointer;
  transition:border-color 120ms linear, color 120ms linear; }
.ah-entrar:hover{ border-color:var(--tinta3, currentColor); color:var(--tinta-f, inherit); }
.ah-entrar:focus-visible{ outline:2px solid var(--marca); outline-offset:2px; }
.ah-entrar svg{ width:15px; height:15px; }
html:not(#_):not(#_) #docTabs .doc-bk + .ah-entrar{ margin-left:12px; }

/* ── 1 · La carpeta entera sobre la consola ── */
html:not(#_):not(#_):not(#_) .pz-marco.ah-completa{ position:fixed !important; inset:0 !important; z-index:9000 !important; max-width:none !important;
  margin:0 !important; padding:0 !important; background:var(--suelo) !important; overflow:hidden !important; }
html.ah-abierta body{ overflow:hidden; }
.ah[hidden]{ display:none; }
html:not(#_):not(#_):not(#_) .ah-completa .ah-entrar{ display:none !important; }

/* las pestañas: una pastilla arriba al centro, la de la vista en relleno */
html:not(#_):not(#_):not(#_) .ah-completa #docTabs{ position:fixed; top:14px; left:50%; transform:translateX(-50%); z-index:7; width:max-content;
  max-width:calc(100vw - 2 * (2.6rem + 28px)); margin:0 !important; padding:4px !important; gap:2px !important; align-items:center !important;
  border:1px solid var(--filete2) !important; border-radius:99px !important; background:var(--hoja) !important; box-shadow:var(--sombra);
  overflow-x:auto; scrollbar-width:none; }
.ah-completa #docTabs::-webkit-scrollbar{ display:none; }
html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-tab{ display:inline-flex !important; align-items:center; height:2.25rem; padding:0 1rem !important;
  border:0 !important; border-radius:99px !important; transition:background-color 120ms linear; }
html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-tab::before{ display:none !important; }
html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-tab b{ font-size:15px; }
html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-tab:hover{ background:var(--suave); }
html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-tab.doc-tab--on{ background:var(--acento); }
html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-tab.doc-tab--on b{ color:var(--acento-t); }
html:not(#_):not(#_):not(#_) .ah-completa #docTabs .pz-carpeta-estado{ display:none !important; }
html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-bk{ align-self:center !important; margin-left:6px; padding:0 12px 0 4px !important; }

/* los otros tres apartados: debajo de las pestañas, con su ancho de siempre, y se desplazan solos */
html:not(#_):not(#_):not(#_) .ah-completa > .doc-seccion:not(#docDocumento){ position:absolute; inset:var(--ah-arriba, 72px) 0 0 0; overflow:auto;
  padding:10px max(24px, calc((100vw - 1176px) / 2)) 96px; scrollbar-width:none; }
.ah-completa > .doc-seccion::-webkit-scrollbar, .ah-completa .doc-hoja::-webkit-scrollbar{ display:none; }

/* ── 2 · El documento: la hoja de CEIBA ── */
html:not(#_):not(#_):not(#_) .ah-completa #docDocumento:not(.hidden){ position:absolute; inset:0; display:block !important; }
html:not(#_):not(#_):not(#_) .ah-completa #docDocumento > .doc-hoja{ position:absolute; inset:0; overflow:auto; scrollbar-width:none;
  padding:calc(var(--ah-barra, 120px) + 20px) 1.5rem 6rem !important; touch-action:pan-x pan-y; }
/* el ancho del papel y su zoom, sólo con papel: el aviso de «falta un dato» se lee a su tamaño */
html:not(#_):not(#_):not(#_) .ah-completa #docVista2:not(:has(> .doc-papel)){ max-width:640px; margin:0 auto; }
html:not(#_):not(#_):not(#_) .ah-completa #docVista2:has(> .doc-papel){ width:850px !important; min-width:850px; max-width:none; margin:0 auto; overflow:visible !important;
  zoom:var(--ah-zoom, .88); }
html:not(#_):not(#_):not(#_) .ah-completa #docVista2 > .doc-papel{ max-width:none; border-radius:0; }

/* la barra de formato: una pieza debajo de las pestañas, toda a la vista; si no cabe, baja en renglones
   (el ancho lo ajusta aria-hoja.js) */
html:not(#_):not(#_):not(#_) .ah-completa #docBarra{ position:fixed !important; top:var(--ah-arriba, 72px) !important; left:50%; transform:translateX(-50%); z-index:6 !important;
  width:max-content; max-width:calc(100vw - 32px); margin:0 !important; flex-wrap:wrap !important; justify-content:center !important; overflow:visible !important;
  gap:4px 3px !important; padding:5px 8px !important; border-radius:22px !important; border:1px solid var(--filete2) !important;
  background:var(--hoja) !important; box-shadow:var(--sombra) !important; }
html:not(#_):not(#_):not(#_) .ah-completa #docBarra :is(.bf-esp, .bf-estado, .bf-restaurar){ display:none !important; }
html:not(#_):not(#_):not(#_) .ah-completa #docBarra .bf-sep.ah-sep-corte{ visibility:hidden; width:0 !important; margin:0 !important; }

/* los parámetros: el panel de opciones en un globo encima de la hoja */
html:not(#_):not(#_):not(#_) .ah-completa #docPanel{ position:fixed !important; left:16px !important; right:auto !important; top:auto !important; bottom:68px !important;
  z-index:8 !important; width:360px !important; max-width:calc(100vw - 32px) !important; max-height:calc(100vh - var(--ah-arriba, 72px) - 96px) !important;
  overflow-y:auto !important; scrollbar-width:none; border-radius:20px !important; box-shadow:var(--sombra) !important; animation:ah-globo 180ms cubic-bezier(.2,.7,.2,1); }
html:not(#_):not(#_):not(#_) .ah-completa:not(.ah-param) #docPanel{ display:none !important; }
/* el globo ya es el panel abierto (Luis: «es un clic más, debería aparecer abierto»): con la Fase 4 angosta
   (el chat al lado) las opciones se pliegan en su pastilla; acá no hay pastilla y van siempre a la vista */
html:not(#_):not(#_):not(#_) .ah-completa #docPanel{ padding:4px 18px 12px !important; }
html:not(#_):not(#_):not(#_) .ah-completa #docPanel .doc-plegar{ display:none !important; }
html:not(#_):not(#_):not(#_) .ah-completa #docPanel .doc-panel__cuerpo{ display:block !important; padding:0 !important; }
.ah-completa #docPanel::-webkit-scrollbar{ display:none; }
@keyframes ah-globo{ from{ opacity:0; transform:translateY(8px); } }

/* ── 3 · Las piezas que flotan ── */
.ah__param, .ah__acciones{ position:fixed; z-index:7; display:flex; align-items:center; gap:.35rem; padding:4px; width:var(--ah-pastilla, auto); box-sizing:border-box;
  border-radius:99px; background:var(--hoja); border:1px solid var(--filete2); box-shadow:var(--sombra); color:var(--tinta); }
.ah__param{ bottom:16px; left:16px; }
.ah__acciones{ bottom:16px; right:16px; justify-content:center; }
/* fuera del documento sólo queda cerrar */
.ah-completa:has(> #docDocumento.hidden) :is(.ah__param, .ah__acciones){ display:none; }
.ah__cerrar{ position:fixed; z-index:7; top:14px; left:14px; width:2.6rem; height:2.6rem; padding:0; display:inline-grid; place-items:center;
  border-radius:99px; border:1px solid var(--filete2); background:var(--hoja); color:var(--tinta); cursor:pointer; box-shadow:var(--sombra);
  transition:border-color 120ms linear; }
.ah__cerrar:hover{ border-color:var(--tinta3); }
:is(.ah__boton, .ah__abrir){ display:inline-flex; align-items:center; justify-content:center; gap:.45rem; height:2.25rem; min-width:2.25rem; padding:0;
  border:0; border-radius:99px; background:transparent; color:var(--tinta); cursor:pointer; font:400 .9rem/1 var(--sans); letter-spacing:.02em; white-space:nowrap;
  transition:background-color 120ms linear, color 120ms linear; }
:is(.ah__boton, .ah__abrir):hover{ background:var(--suave); }
:is(.ah__cerrar, .ah__boton, .ah__abrir) svg{ width:18px; height:18px; flex:none; }
:is(.ah__cerrar, .ah__boton, .ah__abrir):focus-visible{ outline:2px solid var(--marca); outline-offset:2px; }
.ah__abrir{ flex:1; min-width:0; padding:0 1rem 0 .75rem; }
.ah__resumen{ min-width:0; overflow:hidden; text-overflow:ellipsis; color:var(--tinta2); font-size:.84rem; }
.ah__resumen:not(:empty)::before{ content:"·"; margin-right:.45rem; }
.ah__abrir[aria-pressed="true"]{ background:var(--acento); color:var(--acento-t); }
.ah__abrir[aria-pressed="true"] .ah__resumen{ color:inherit; opacity:.8; }
/* el correo, la acción principal, en relleno */
.ah__boton--principal{ padding:0 1rem 0 .8rem; background:var(--acento); color:var(--acento-t); }
.ah__boton--principal:hover{ background:var(--acento-h); }

/* ── 4 · Celular: las pestañas y la barra de lado a lado; cerrar baja junto a los parámetros ── */
@media (width < 768px){
  html:not(#_):not(#_):not(#_) .ah-completa #docTabs{ top:8px; left:6px; right:6px; transform:none; width:auto; max-width:none; }
  html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-tab{ padding:0 .7rem !important; }
  html:not(#_):not(#_):not(#_) .ah-completa #docTabs .doc-tab b{ font-size:13.5px; }
  html:not(#_):not(#_):not(#_) .ah-completa #docBarra{ max-width:calc(100vw - 12px); gap:3px 1px !important; padding:4px 5px !important; }
  html:not(#_):not(#_):not(#_) .ah-completa #docBarra .bf-sep{ display:none !important; }
  html:not(#_):not(#_):not(#_) .ah-completa #docDocumento > .doc-hoja{ padding:calc(var(--ah-barra, 120px) + 12px) .5rem 5.2rem !important; }
  html:not(#_):not(#_):not(#_) .ah-completa > .doc-seccion:not(#docDocumento){ padding:8px 12px 84px; }
  .ah__cerrar{ top:auto; bottom:12px; left:10px; width:2.5rem; height:2.5rem; }
  .ah__param, .ah__acciones{ width:auto; }
  .ah__param{ bottom:12px; left:calc(2.5rem + 16px); }
  .ah__acciones{ bottom:12px; right:10px; gap:0; }
  .ah__boton{ height:2.1rem; min-width:2.1rem; }
  .ah__resumen{ display:none; }
  .ah__boton--principal{ padding:0; width:2.1rem; }
  .ah__boton--principal .ah__rot{ display:none; }
  html:not(#_):not(#_):not(#_) .ah-completa #docPanel{ left:10px !important; right:10px !important; width:auto !important; bottom:62px !important; max-height:70vh !important; }
}
/* pantallas muy angostas: «Parámetros» queda en su ícono para que las tres piezas de abajo no se monten */
@media (width < 401px){
  .ah__abrir{ flex:none; width:2.1rem; height:2.1rem; padding:0; }
  .ah__abrir .ah__rot{ display:none; }
}
@media (prefers-reduced-motion:reduce){ :is(.ah__cerrar, .ah__boton, .ah__abrir, .ah-entrar), .ah-completa #docPanel{ transition:none !important; animation:none !important; } }
