/* 16/10/2026 (dueño): la barra de arriba de Giro (giro-nav.js), igual en cada página con sesión.
   Solo tokens de giro-theme.css: claro u oscuro según la persona. */
/* 12/11/2026 (dueño, «arreglar el diseño del navbar y los módulos»): una sola barra. Misma altura, logo y margen en Mesa,
   Chat y las demás páginas (antes 48/52/71 px, logo de 22/28/40 px, margen de 14/24 px): nada salta al cambiar de módulo.
   mesa.html lee estas variables en su propio <style>. */
/* 24/11/2026 (dueño, «Estilo 1 · Pastilla»): la empresa a la izquierda; los módulos en una cápsula gris, el abierto es una
   pastilla blanca con sombra; tres menús con tarjetas; Buscar, Firmas y la persona a la derecha. En el teléfono, una fila. */
:root {
  --giro-bar-h: 52px;
  --giro-bar-pad: 16px;
  --giro-bar-logo: 28px;
}
:root {
  --giro-nav-pop-shadow: 0 12px 32px -8px rgba(16, 24, 40, .24), 0 2px 6px rgba(16, 24, 40, .07);
  --giro-nav-pill-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
}
.giro-nav,
.giro-nav[data-giro-nav] {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 6px;
  font-size: 13px;
  line-height: 1.2;
  color: var(--ink-2);
}
.giro-nav[hidden] { display: none; }
.giro-nav-ic {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.giro-nav-chev { width: 13px; height: 13px; opacity: .6; transition: transform .15s ease; }
.giro-nav-spacer { flex: 1 1 auto; min-width: 0; }
.giro-nav-burger { display: none; }
/* Signed in, the theme lives in the person's menu; a public page without a session keeps this one. */
.giro-nav[data-giro-nav]:not(.giro-nav-guest) > .giro-theme-btn { display: none; }

/* ── The company: its square, its name and its system; a click opens the company's menu ─────────────────────────── */
.giro-nav-co-wrap { position: relative; flex: 0 1 auto; min-width: 0; }
.giro-nav-co {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 240px;
  min-width: 0;
  margin: 0;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.giro-nav-co:hover,
.giro-nav-co-wrap.open .giro-nav-co { background: var(--surface-2); }
.giro-nav-co-wrap.open .giro-nav-chev { transform: rotate(180deg); }
.giro-nav-mono {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.giro-nav-mono-sm { width: 22px; height: 22px; border-radius: 6px; font-size: 9.5px; }
.giro-nav-co-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.giro-nav-co-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.giro-nav-co-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 11px; }
.giro-nav-co-t span:empty { display: none; }

/* ── The capsule: Mesa, Chat and the three menus ──────────────────────────────────────────────────────────────── */
.giro-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.giro-nav[data-giro-nav] a.giro-nav-link:not(.giro-nav-tile),
.giro-nav-gbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.giro-nav[data-giro-nav] a.giro-nav-link:not(.giro-nav-tile):hover,
.giro-nav-gbtn:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.giro-nav[data-giro-nav] a.giro-nav-link:not(.giro-nav-tile)[aria-current="page"],
.giro-nav-group-cur > .giro-nav-gbtn,
.giro-nav-group.open > .giro-nav-gbtn {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--giro-nav-pill-shadow), 0 0 0 1px var(--rule);
}
.giro-nav[data-giro-nav] a.giro-nav-link:not(.giro-nav-tile)[aria-current="page"] .giro-nav-ic,
.giro-nav-group-cur > .giro-nav-gbtn .giro-nav-ic:not(.giro-nav-chev) { color: var(--accent); }
.giro-nav-group.open .giro-nav-chev { transform: rotate(180deg); }
.giro-nav-link[hidden],
.giro-nav-group[hidden] { display: none !important; }
.giro-nav-group { position: relative; }

/* ── Pop-ups: a module menu (cards), the company's menu, the person's menu ──────────────────────────────────────── */
.giro-nav-pop {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 80;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--giro-nav-pop-shadow);
  text-align: left;
  animation: giro-nav-in .14s ease-out;
}
.giro-nav-pop[hidden] { display: none; }
@keyframes giro-nav-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.giro-nav-mega { display: grid; gap: 2px; width: 320px; }
.giro-nav-mega-wide { grid-template-columns: 1fr 1fr; width: 540px; left: auto; right: 0; }
.giro-nav[data-giro-nav] a.giro-nav-tile {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  white-space: normal;
}
.giro-nav[data-giro-nav] a.giro-nav-tile:hover { background: var(--surface-2); text-decoration: none; }
.giro-nav[data-giro-nav] a.giro-nav-tile[aria-current="page"] { background: var(--accent-soft); }
.giro-nav-tile-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.giro-nav-tile-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.giro-nav-tile-t b { font-size: 13px; font-weight: 600; color: var(--ink); }
.giro-nav-tile-t span { font-size: 11.5px; line-height: 1.35; color: var(--ink-3); }

.giro-nav-co-menu { width: 300px; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; }
.giro-nav-ph {
  margin: 0;
  padding: 8px 10px 4px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.giro-nav-co-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 4px 6px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--ink-3);
}
.giro-nav-co-search[hidden] { display: none; }
.giro-nav-co-search input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.giro-nav-co-list { display: flex; flex-direction: column; gap: 1px; }
.giro-nav-co-empty { margin: 0; padding: 8px 10px; color: var(--ink-3); font-size: 12.5px; }
.giro-nav-co-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.giro-nav-co-item:hover { background: var(--surface-2); }
.giro-nav-co-item.on { background: var(--accent-soft); font-weight: 600; }
.giro-nav-co-item-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.giro-nav-co-item small { color: var(--ink-3); font-size: 11.5px; font-weight: 400; }
.giro-nav-co-check { color: var(--accent); }

/* ── Right side: Buscar, Firmas, the person ─────────────────────────────────────────────────────────────────────── */
.giro-nav-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-width: 180px;
  height: 34px;
  margin: 0;
  padding: 0 8px 0 11px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.giro-nav-search:hover { border-color: var(--rule-2); color: var(--ink-2); }
.giro-nav-search kbd,
.giro-nav-cmdk kbd {
  margin-left: auto;
  padding: 3px 5px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
}
.giro-nav[data-giro-nav] a.giro-nav-bell {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--ink-2);
  text-decoration: none;
}
.giro-nav[data-giro-nav] a.giro-nav-bell:hover { background: var(--surface-2); color: var(--ink); }
.giro-nav[data-giro-nav] a.giro-nav-bell[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.giro-nav[data-giro-nav] a.giro-nav-bell[hidden] { display: none; }
.giro-nav-bell .giro-nav-ic { width: 18px; height: 18px; }
.giro-nav-count {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--bad);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.giro-nav-link:focus-visible,
.giro-nav-gbtn:focus-visible,
.giro-nav-co:focus-visible,
.giro-nav-search:focus-visible,
.giro-nav-bell:focus-visible,
.giro-nav-burger:focus-visible,
.giro-nav-item:focus-visible,
.giro-nav-avatar:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.giro-nav .giro-plan-switch { display: inline-flex; flex-direction: row; margin: 0; font-size: 12px; }
.giro-nav-plan { display: inline-flex; align-items: center; }
.giro-nav .giro-theme-btn { margin: 0; align-self: center; }

.giro-nav-account { position: relative; flex-shrink: 0; }
.giro-nav-avatar {
  width: 32px;
  height: 32px;
  margin: 0 0 0 2px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, hsl(38 90% 55%), hsl(14 72% 50%));
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  font: inherit;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px hsl(32 70% 64%);
}
.giro-nav-avatar:hover,
.giro-nav-account.open .giro-nav-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }
.giro-nav-initial { font-size: 13px; font-weight: 700; line-height: 1; }

.giro-nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 80;
  min-width: 260px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--giro-nav-pop-shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  animation: giro-nav-in .14s ease-out;
}
.giro-nav-menu[hidden] { display: none; }
.giro-nav-who {
  margin: 0;
  padding: 8px 10px 6px;
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.giro-nav-who[hidden] { display: none; }
.giro-nav-who strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.giro-nav-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.giro-nav[data-giro-nav] .giro-nav-pop a.giro-nav-item,
.giro-nav[data-giro-nav] .giro-nav-menu a.giro-nav-item { color: var(--ink); text-decoration: none; }
.giro-nav-item:hover { background: var(--surface-2); }
.giro-nav-item[hidden] { display: none; }
.giro-nav-item:disabled { opacity: .55; cursor: default; }
.giro-nav[data-giro-nav] .giro-nav-pop a.giro-nav-item[aria-current="page"],
.giro-nav[data-giro-nav] .giro-nav-menu a.giro-nav-item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.giro-nav-sep { border: 0; border-top: 1px solid var(--rule); margin: 4px 2px; height: 0; }
.giro-nav-sep[hidden] { display: none; }
.giro-nav-plan-row,
.giro-nav-theme-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: default; }
.giro-nav-plan-row:hover,
.giro-nav-theme-row:hover { background: transparent; }
.giro-nav-plan-row .giro-plan-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font-size: 13px; color: var(--ink); }
.giro-nav-plan-row[hidden],
.giro-nav-theme-row[hidden] { display: none; }
.giro-nav-theme-row .giro-theme-btn { width: 32px; height: 32px; }

/* ── Buscar (Ctrl K) ──────────────────────────────────────────────────────────────────────────────────────────── */
.giro-nav-cmdk {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 12px 12px;
  background: rgba(10, 15, 22, .38);
}
.giro-nav-cmdk[hidden] { display: none; }
.giro-nav-cmdk-box {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--giro-nav-pop-shadow);
  animation: giro-nav-in .14s ease-out;
}
.giro-nav-cmdk-q {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-3);
}
.giro-nav-cmdk-q input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.giro-nav-cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.giro-nav-cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.giro-nav-cmdk-item .giro-nav-ic { color: var(--ink-3); }
.giro-nav-cmdk-item small { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.giro-nav-cmdk-item:hover,
.giro-nav-cmdk-item.on { background: var(--accent-soft); }

/* ── The phone's ☰ panel ──────────────────────────────────────────────────────────────────────────────────────── */
.giro-nav-drawer { position: fixed; inset: 0; z-index: 150; background: rgba(10, 15, 22, .38); }
.giro-nav-drawer[hidden] { display: none; }
.giro-nav-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 340px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding: max(10px, env(safe-area-inset-top)) 10px 24px max(10px, env(safe-area-inset-left));
  border-right: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  animation: giro-nav-slide .18s ease-out;
  scrollbar-width: none;
}
@keyframes giro-nav-slide { from { transform: translateX(-14px); opacity: .5; } to { transform: none; opacity: 1; } }
.giro-nav-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px 8px; }
.giro-nav-drawer-title { font-size: 15px; font-weight: 700; }
.giro-nav-drawer-close,
.giro-nav-burger {
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.giro-nav-drawer-close { display: grid; border-color: transparent; }
.giro-nav-drawer-close .giro-nav-ic,
.giro-nav-burger .giro-nav-ic { width: 20px; height: 20px; }
.giro-nav-drawer-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  margin: 2px 0 6px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-3);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.giro-nav-drawer-co {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 4px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.giro-nav-drawer-co .giro-nav-co-t { flex: 1 1 auto; }
.giro-nav-drawer-co .giro-nav-co-t b { font-size: 14px; }
.giro-nav-drawer-co .giro-nav-co-t span { font-size: 12px; }
.giro-nav-drawer-cos { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px; }
.giro-nav-drawer-cos[hidden] { display: none; }
.giro-nav-drawer-cos .giro-nav-co-item { min-height: 44px; font-size: 15px; }
.giro-nav-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 8px 6px; }
.giro-nav-chip {
  margin: 0;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.giro-nav-chip.on { background: var(--accent); color: var(--surface); font-weight: 600; }
.giro-nav-drawer a.giro-nav-drow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.giro-nav-drawer a.giro-nav-drow .giro-nav-ic { width: 18px; height: 18px; color: var(--ink-3); }
.giro-nav-drawer a.giro-nav-drow:hover { background: var(--surface-2); }
.giro-nav-drawer a.giro-nav-drow[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.giro-nav-drawer a.giro-nav-drow[aria-current="page"] .giro-nav-ic { color: var(--accent); }
.giro-nav-drawer a.giro-nav-drow-sm { min-height: 40px; padding-left: 12px; font-size: 14px; }
html.giro-nav-drawer-open { overflow: hidden; }

/* The company being set up (onboarding): no desk yet, so no modules, company menu, search nor Modo plan. */
.giro-nav[data-variant="setup"] .giro-nav-links,
.giro-nav[data-variant="setup"] .giro-nav-plan,
.giro-nav[data-variant="setup"] .giro-nav-burger,
.giro-nav[data-variant="setup"] .giro-nav-workspace { display: none !important; }
/* A public page (/ayuda) without a session: the theme only. */
.giro-nav.giro-nav-guest > :not(.giro-theme-btn) { display: none !important; }

/* Chat: the same side margin as every page (its height and logo were already the bar's). */
body.chat-page .header { padding: 0 var(--giro-bar-pad); }

/* 13/11/2026 (dueño): no sideways jump between pages. A page that scrolls always shows its scrollbar, even when its
   content is short; Mesa and Chat, whose panes scroll instead of the page, leave the same width free at the right
   of the bar (--giro-sbw, measured by giro-nav.js: 15 px on Windows, 0 where scrollbars float). */
html:has(body.app-page) { overflow-y: scroll; }
/* Above the phone layout only: under 800 px each header keeps its own phone padding. */
@media (min-width: 801px) {
  body.chat-page .header,
  body.mesa-page .app > header { padding-right: calc(var(--giro-bar-pad) + var(--giro-sbw, 0px)); }
}
@media (min-width: 801px) {
  /* 24/11/2026: the page's module is on the capsule, so its own title steps aside and the logo leads the bar. */
  header:has(> .giro-nav[data-giro-nav-in-bar="1"]:not(.giro-nav-guest)) .brand-copy,
  .header:has(> .giro-nav[data-giro-nav-in-bar="1"]:not(.giro-nav-guest)) .brand-copy { display: none; }
  .header:has(> .giro-nav[data-giro-nav-in-bar="1"]:not(.giro-nav-guest)) .brand-product,
  .header:has(> .giro-nav[data-giro-nav-in-bar="1"]:not(.giro-nav-guest)) .brand-company { display: none; }
}
body.chat-page .brand { gap: 10px; }

/* Secondary pages (Empresas, Historial, Reglas, Plan, Uso, Costos, Reportes, Bancos, Solicitudes, Alta, Ayuda): the same bar
   as Mesa and Chat; one line, the title shrinks. html[data-theme]: above giro-theme.css's own header padding and title size. */
body.app-page .header.giro-nav-host,
html[data-theme] body.app-page .header.giro-nav-host {
  flex-wrap: nowrap;
  box-sizing: border-box;
  min-height: var(--giro-bar-h);
  padding: 0 var(--giro-bar-pad);
  gap: 12px;
}
body.app-page .header.giro-nav-host .brand { flex: 0 1 auto; min-width: 0; }
body.app-page .header.giro-nav-host .brand { gap: 10px; }
body.app-page .header.giro-nav-host .logo-img.giro-mark {
  width: var(--giro-bar-logo);
  height: var(--giro-bar-logo);
  max-width: var(--giro-bar-logo);
  border-radius: 8px;
}
body.app-page .header.giro-nav-host .brand-copy { min-width: 0; }
body.app-page .header.giro-nav-host .brand-copy h1,
body.app-page .header.giro-nav-host .brand-copy .sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.app-page .header.giro-nav-host .brand-copy h1,
html[data-theme] body.app-page .header.giro-nav-host .brand-copy h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
}
body.app-page .header.giro-nav-host .brand-copy .sub { margin: 1px 0 0; font-size: 12px; line-height: 1.25; }
body.app-page .header.giro-nav-host .giro-nav-page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Módulos (12/11/2026, dueño): el mismo marco en cada página ──────────────────────────────────────────────────────────
   Two widths instead of four: reading and forms 900 px (Reglas, Empresas, Plan, Uso); tables and reports 1240 px (Historial,
   Costos, Reportes, Tableros, Bancos). Solicitudes keeps its 560 px form column. The content starts 20 px under the bar,
   two panels never touch, and the page's title is one size (before: 16 to 24 px). body.app-page: above each page's own sheet. */
:root {
  --giro-page: 900px;
  --giro-page-wide: 1240px;
  --giro-page-top: 20px;
}
body.app-page .billing-page { max-width: var(--giro-page); margin-top: var(--giro-page-top); }
body.app-page .billing-page.hist-page,
body.app-page .billing-page.cost-page { max-width: var(--giro-page-wide); }
body.app-page .billing-page > .panel + .panel { margin-top: 16px; }
body.app-page .sl-page { padding-top: var(--giro-page-top); }
body.app-page .billing-page:not(.usage-page) .panel > h2,
body.app-page .rp .cabeza h1,
body.app-page .tb-head h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.01em;
}

/* Narrower windows: Buscar keeps its icon (≤ 1180 px); then the capsule drops its icons and the company its system. */
@media (max-width: 1180px) {
  .giro-nav-search { min-width: 0; width: 34px; padding: 0; justify-content: center; }
  .giro-nav-search-t,
  .giro-nav-search kbd { display: none; }
}
@media (max-width: 1000px) {
  .giro-nav,
  .giro-nav[data-giro-nav] { gap: 6px; }
  .giro-nav-links .giro-nav-ic:not(.giro-nav-chev) { display: none; }
  .giro-nav-co { max-width: 170px; }
  .giro-nav-co-erp { display: none; }
  body.app-page .header.giro-nav-host .brand-copy .sub { display: none; }
}

/* A phone (as Mesa's tab bar, ≤ 800 px). 24/11/2026 (dueño): one row — ☰, the page's name over its company, Firmas and the
   person. The ☰ opens everything: Buscar, the company, Mesa's views and the modules by menu (before: a second row of
   modules that scrolled sideways and a second ☰ in Mesa). The bar's pieces become the header's own (display: contents). */
@media (max-width: 800px) {
  .giro-nav,
  .giro-nav[data-giro-nav] { display: contents; }
  .giro-nav-co-wrap,
  .giro-nav-links,
  .giro-nav-spacer,
  .giro-nav-search { display: none !important; }
  .giro-nav-burger { display: grid; order: -1; flex: none; }
  .giro-nav[data-giro-nav] a.giro-nav-bell { width: 40px; height: 40px; margin-left: auto; }
  .giro-nav-avatar { width: 36px; height: 36px; }
  /* Mesa's views are in the ☰ panel now: its own ☰ steps aside. */
  body.mesa-page .app > header #btnMenu { display: none !important; }
  .giro-nav .giro-theme-btn,
  .app > header .mobile-only,
  body.chat-page .header .mobile-only { width: 40px; height: 40px; }
  .giro-nav .giro-theme-btn { border-radius: 9px; }
  .giro-nav-item { min-height: 44px; padding: 12px 10px; font-size: 15px; }
  .giro-nav-plan-row .giro-plan-switch { font-size: 15px; }
  .giro-nav-menu { width: min(320px, calc(100vw - 24px)); max-width: calc(100vw - 24px); }

  /* One row: ☰, the page's name over its company, Firmas and the person. */
  body.chat-page .header,
  body.app-page .header.giro-nav-host,
  html[data-theme] body.app-page .header.giro-nav-host {
    flex-wrap: nowrap;
    height: auto;
    min-height: 56px;
    padding: 6px 12px;
    gap: 8px;
  }
  body.mesa-page .app > header { flex-wrap: nowrap; min-height: 56px; padding-bottom: 6px; gap: 8px; }
  body.app-page .header.giro-nav-host .brand-copy h1,
  html[data-theme] body.app-page .header.giro-nav-host .brand-copy h1 { font-size: 15px; }
  /* 13/11/2026 (dueño): on a phone the company fits under the title, like in Mesa and Chat. */
  body.app-page .header.giro-nav-host .brand-copy .sub { display: block; }
  /* A long company name is cut with «…»: the title block takes what is left of the row. */
  body.app-page .header.giro-nav-host .brand { flex: 1 1 0; }
  body.app-page .header.giro-nav-host .logo-img.giro-mark { display: none; }
  body.mesa-page .app > header .brand img,
  body.chat-page .header .logo-img.giro-mark { display: none; }
  body.chat-page .header .brand-product { font-size: 15px; }
}
/* ── Controls on the module pages (13/11/2026, dueño: «sigue trabajando en mejorar el diseño») ───────────────────────
   Measured that day on the pages with the shared header: the main button was 37 px tall and the secondary one 39;
   a button marked `hidden` still showed (Historial's «Cargar más» with nothing to load); and a checkbox sat on top of
   its own label (Empresas → Tus preferencias, Plan → Recarga automática), because styles.css stacks every <label>. */
/* A label that wraps a checkbox or a radio is one row: the box, then its text. */
body.app-page label:has(> input[type="checkbox"]),
body.app-page label:has(> input[type="radio"]) { flex-direction: row; }
/* The two buttons are the same box; the main one is the bolder of the two. */
body.app-page .btn-primary,
body.app-page .btn-secondary { box-sizing: border-box; border: 1px solid transparent; }
body.app-page .btn-primary { font-weight: 600; }
body.app-page .btn-secondary { font-weight: 500; }
/* `hidden` means hidden, whatever the button's own display says. */
body.app-page .btn[hidden],
body.app-page .btn-primary[hidden],
body.app-page .btn-secondary[hidden] { display: none; }
/* Reglas: the number of each rule in the ink of the page, not a bright blue that nothing else uses; its two
   buttons side by side. */
body.app-page .rule-num { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
body.app-page .rule-actions { flex-direction: row; align-items: flex-start; }
/* Form fields on the module pages: one height (text 39 px, lists 40 px and dates 42 px, side by side in Historial). */
body.app-page .billing-page input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
body.app-page .billing-page select { box-sizing: border-box; height: 40px; }
/* … and the buttons beside them, on the same line: a field's label has a margin under it, a button has none. */
body.app-page .billing-page .btn-primary:not(.btn-sm),
body.app-page .billing-page .btn-secondary:not(.btn-sm) { min-height: 40px; }
body.app-page .hist-filters label,
body.app-page #autoRecharge label { margin-bottom: 0; }
/* The composers of Chat and Mesa: the clip, the microphone and «Enviar» are the same 44 px (Chat's «Enviar» was
   37 px beside 44; Mesa's clip 34 and «Enviar» 33 beside a 44 px microphone). */
body.chat-page .chat-input .btn-primary { box-sizing: border-box; min-height: 44px; border-radius: 10px; font-weight: 600; }
body.mesa-page .composer .btn,
body.mesa-page .composer .btn-attach { box-sizing: border-box; min-height: 44px; }
body.mesa-page .composer .btn-attach { min-width: 44px; }
/* 14/11/2026 (seen in DEV with a session): a text box speaks in the page's font. The browser gives <textarea> a
   typewriter face of its own, so Chat's «Pregúntale a Giro…» and Reglas' «Agregar una regla» read like code. */
body.app-page textarea,
body.chat-page textarea { font-family: inherit; }
/* 14/11/2026 (seen in prod with a session): the same for a button, a field and a list. The browser gives each its own
   face, so «Enviar» in Chat and «Agregar regla» in Reglas came out in Arial beside a page in Segoe UI. Zero
   specificity (:where): any rule that names a font for one of them still wins (the Google button, a code field). */
:where(body.app-page, body.chat-page) :where(button, input, select) { font-family: inherit; }
/* Segoe UI sets a taller line than Arial: with it the 40 px buttons of Reglas and Historial came out at 43 px, below
   their fields again. The button's line is fixed, so its height does not depend on the face. */
body.app-page .btn-primary,
body.app-page .btn-secondary { line-height: 1.2; }
/* 17/11/2026 (toda la app medida a 1366, 1024 y 375 px): the last controls under 32 px and text under 12 px. */
/* Chat: the company under «Chat», like the other modules. */
body.chat-page .brand-company { font-size: 12px; }
/* Chat: «+ Nueva» and «Seleccionar» were 29 px; on the phone they are touched with a thumb. */
body.chat-page .sidebar-head-actions .btn-sm,
body.chat-page .sidebar-head-actions .btn-secondary,
body.chat-page .sidebar-head-actions button { box-sizing: border-box; min-height: 32px; }
/* A small button of the module pages (Empresas «Usar», Plan): 32 px, 36 on the phone. */
body.app-page .btn-sm { box-sizing: border-box; min-height: 32px; }
/* «Activa», «Tú»: 11 px badges read as 12. */
body.app-page .tenant-badge { font-size: 12px; }
@media (max-width: 800px) {
  body.chat-page .sidebar-head-actions .btn-sm,
  body.chat-page .sidebar-head-actions .btn-secondary,
  body.chat-page .sidebar-head-actions button { min-height: 40px; }
  body.app-page .btn-sm { min-height: 36px; }
}
/* Chat's text box on the panel's white, like Mesa's: on the paper colour it looked switched off. */
html[data-theme] body.chat-page .chat-input textarea { background: var(--surface); }

/* ── One notice for «nothing yet», «not active» and «could not load» (13/11/2026, dueño) ─────────────────────────
   Each module said it its own way: Solicitudes a loose red line, Tableros a dashed box with a «← Tableros» button
   that led to the same page, Bancos a 290 px card that broke its text into six lines. The look is Reportes'
   (reportes.css «.rp .estado»): icon, title, one line of text and, when there is something to do, one button. */
.giro-aviso {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 32px 16px 36px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
}
.giro-aviso svg { width: 34px; height: 34px; color: var(--ink-3); }
.giro-aviso[data-tono="error"] svg { color: var(--bad); }
.giro-aviso h2 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.3; }
.giro-aviso p { max-width: 460px; margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.giro-aviso-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.giro-aviso-btn:hover { border-color: var(--rule-2); }
.giro-aviso-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Inside a panel that already has its own frame (a table's empty state): no second frame. */
.giro-aviso.giro-aviso-plano { padding: 28px 16px; background: none; border: 0; border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  .giro-nav * { transition: none !important; }
}

/* 16/11/2026: quien solo usa Solicitudes (giro-nav.js setMe) no ve los demás módulos ni el menú. */
[data-giro-solo] { display: none !important; }

/* ── 24/11/2026 (dueño: «revisa bien la transición de una pantalla a otra») ─────────────────────────────────────────────
   1. The bar draws the tab's last company, person and modules before the first paint (giro-nav.js applySnap). On a tab's
      first page, before /api/me answers, the company and the person are quiet grey blocks instead of «Empresa» and «·».
   2. Between Giro's pages the page cross-fades (same-origin view transitions; older browsers just navigate). Nothing moves for a person who asks the system for less motion. */
.giro-nav[data-giro-nav]:not([data-giro-nav-me]):not(.giro-nav-guest) .giro-nav-mono,
.giro-nav[data-giro-nav]:not([data-giro-nav-me]):not(.giro-nav-guest) .giro-nav-co-name {
  color: transparent;
  background: var(--surface-2);
  border-radius: 6px;
}
.giro-nav[data-giro-nav]:not([data-giro-nav-me]):not(.giro-nav-guest) .giro-nav-initial { color: transparent; }

@view-transition { navigation: auto; }
/* The bar has no name of its own in the view transition: a named element is its own stacking context, and Chat's messages then covered the
   bar's menus (seen 24/11/2026). The bar is already the same on both pages (applySnap), so the page's fade is enough. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ── 24/11/2026 (dueño: «la parte de los planes y los créditos quisiera que se vea mejor»): «Plan» is a card ──────────── */
.giro-nav[data-giro-nav] .giro-nav-menu a.giro-nav-item.giro-nav-plancard {
  display: grid;
  gap: 7px;
  margin: 2px 0 4px;
  padding: 11px 12px 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--ink);
  cursor: pointer;
}
.giro-nav[data-giro-nav] .giro-nav-menu a.giro-nav-item.giro-nav-plancard:hover { border-color: var(--rule-2); background: var(--surface-2); }
.giro-nav[data-giro-nav] .giro-nav-menu a.giro-nav-item.giro-nav-plancard[aria-current="page"] { border-color: var(--accent); }
.giro-nav-pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.giro-nav-pc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.giro-nav-pc-badge .giro-nav-ic { width: 13px; height: 13px; stroke-width: 1.6; }
.giro-nav-pc-badge[data-paid="0"] { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule); }
.giro-nav-pc-more { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.giro-nav-pc-more .giro-nav-pc-arrow { width: 12px; height: 12px; transform: rotate(-90deg); }
a.giro-nav-plancard:hover .giro-nav-pc-more { color: var(--accent); }
.giro-nav-pc-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; color: var(--ink-2); font-size: 12px; line-height: 1.3; }
.giro-nav-pc-num b { color: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.giro-nav-pc-bar { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: var(--rule); }
.giro-nav-pc-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.giro-nav-pc-bar[data-tone="wait"] i { background: var(--wait); }
.giro-nav-pc-bar[data-tone="bad"] i { background: var(--bad); }
.giro-nav-pc-foot { color: var(--ink-3); font-size: 11.5px; }
