/* =====================================================================
   Accendo Hub — app shell (internal CRM)
   Layer stack (load order in fragments/head.html and layout/base.html):
     1. fonts-brand.css    (@font-face → /fonts/geist, geist-mono, newsreader)
     2. vendor/bootstrap 5.3.8
     3. brand/tokens.css   (the one file allowed to hold a colour literal;
                            brand ramp, status/semáforo tokens, Bootstrap remap)
     4. vendor CSS         (phosphor, DataTables, EasyMDE, Dropzone — per page)
     5. css/base.css       (reset, headings, links, focus, .serif/.num/.eyebrow)
     6. hub.css            (this file — app chrome only)

   Prefer Bootstrap utilities/components. Prefer brand tokens (var(--navy),
   var(--blue), var(--ink), …). Do not re-declare the brand palette here.
   ===================================================================== */

/*
 * CRM density: slightly smaller type than marketing, tables stay readable.
 * Override only inside .hub-body so brand/marketing tokens stay intact.
 *
 * Surface guideline (card-on-paper):
 *   --paper / gray = app canvas only (headers, toolbars, tab chrome, spacing).
 *   Working content (forms, tables, empty states, audit, stats) sits on white
 *   cards: .panel, .hub-table-panel, .stat-card, .kanban-card, etc.
 *   Do not leave body copy floating on the gray canvas.
 */
.hub-body {
  --hub-fs: 0.875rem;           /* 14px body — CRM density */
  --hub-fs-sm: 0.8125rem;       /* 13px secondary */
  --hub-fs-xs: 0.6875rem;       /* 11px labels / thead */
  --hub-fs-xl: 1rem;            /* 16px section titles (media pane) */
  --hub-fs-title: 1.25rem;      /* 20px page titles */
  --hub-lh: 1.45;
  /* Cell air: modest vertical rhythm so dense type still breathes */
  --hub-cell-y: 0.55rem;
  --hub-cell-x: 0.75rem;
  --hub-sidebar-w: 15rem;
  --hub-content-topbar-h: 3.25rem;

  /* Semáforo (opportunity temperature) and the schedule/gantt one-off colours are brand.css
     :root tokens now (--sem-*, --schedule-*): the one file allowed to hold a colour literal.
     They still cascade down to .hub-body and every element inside it. */

  /*
   * hub-chart.js reads every `--hub-chart-*` token by name off the chart element itself
   * (getComputedStyle), never a hardcoded hex — see that file's header. `ours`/`customer`/`watched`
   * are "Ciclo comercial"'s own colour keys, matching the three-way ball split
   * ValueStreamStep#ball() already carries; a future chart adds its own `--hub-chart-<key>` here
   * rather than hardcoding a colour in JS.
   */
  --hub-chart-default: var(--blue);
  --hub-chart-ours: var(--blue);
  --hub-chart-customer: var(--muted);
  --hub-chart-watched: var(--sem-cool);
  --hub-chart-alert: var(--sem-hot);
  --hub-chart-tick: var(--ink);
  --hub-chart-label: var(--ink);
  --hub-chart-sublabel: var(--muted);
  --hub-chart-value: var(--body);

  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: var(--hub-fs);
  line-height: var(--hub-lh);
}

/* Bootstrap text controls inherit CRM density */
.hub-body .btn {
  font-size: var(--hub-fs);
  line-height: 1.35;
  padding: 0.35rem 0.7rem;
}

.hub-body .btn-sm {
  font-size: var(--hub-fs-sm);
  padding: 0.2rem 0.45rem;
}

.hub-body .form-control,
.hub-body .form-select {
  font-size: var(--hub-fs);
  line-height: 1.4;
  padding: 0.4rem 0.55rem;
}

/* Reserve right-side room for Bootstrap's chevron on every hub select. The density
   overrides above use a padding shorthand that zeroes the space Bootstrap keeps for
   the chevron background, so option text ran under the arrow. Selects only (never
   text inputs); specificity beats the shorthand and the -sm/quote select rules. */
.hub-body select.form-select {
  padding-right: 1.9rem;
}

.hub-body .form-label,
.hub-body .hub-form label {
  font-size: var(--hub-fs-sm);
}

/* Bootstrap's default legend is ~24px/400: a sub-group heading inside a form (e.g. "Contacto
   previo") read far louder than the 14px/600 card title above it. A legend groups fields the
   same way a panel-title groups a card, so it takes the same scale. */
.hub-body legend {
  font-size: var(--hub-fs);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
  float: none;
  width: auto;
}

.hub-body .alert {
  font-size: var(--hub-fs);
  padding: 0.55rem 0.75rem;
}

.hub-body .badge {
  font-size: var(--hub-fs-xs);
  font-weight: 500;
}

/*
 * Item 2 (lane L): a thumb needs more room than a cursor. Measured at 375px against real data —
 * 51 undersized controls on Pipeline, 11 on Entradas, 8 on Empresas — every one of them a button,
 * a row action, a tab or a pagination link sized for a mouse.
 *
 * Scoped to (hover: none), a coarse pointer, never to a viewport width: a mouse on a resized
 * desktop window must stay exactly as dense as it is today, and a touch laptop at a wide viewport
 * still needs the floor. min-height/min-width are a separate property from the height/width each
 * control already sets elsewhere (kanban's own compact .hub-icon-btn among them), so this floors
 * every one of them without having to repeat or out-specificity any of those rules.
 *
 * Forty pixels is the floor the brief names. Icon-only controls (square already, nothing else on
 * the row to crowd) get forty four, since the extra four pixels cost nothing there.
 */
@media (hover: none) {
  .hub-body .btn,
  .hub-tab-item,
  .hub-user-chip,
  .hub-mail-verb {
    min-height: 40px;
  }

  .hub-nav-toggle,
  .hub-icon-btn,
  .hub-mail-icon,
  div.dt-container.dt-bootstrap5 .page-link {
    min-height: 44px;
    min-width: 44px;
  }
}

code,
kbd,
pre,
.font-mono {
  font-family: var(--font-mono);
}

/*
 * Money in a table cell. Two jobs, both learned from a real screen: never break the symbol away
 * from its amount onto a second line, and reserve enough width that a Colombian peso figure at its
 * usual size fits on one. COP is quoted in whole pesos, so a real opportunity runs to nine digits
 * plus two thousands separators plus the symbol ("$ 999.999.999"), which is what the min-width is
 * measured against. Tabular figures so the decimal columns line up down the page rather than
 * drifting with the digits above them.
 */
.hub-money-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 8.5rem;
}

/* .serif and .eyebrow are base.css's now (this file still owns .eyebrow's own CRM-density
   tuning below, in the type scale section, since base.css's copy never reaches an element that
   also carries hub.css — every Hub page loads both). */

/* ── Shell: brand sidebar (full Accendo color) + content column ── */
.hub-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  max-width: 100%;
  align-items: stretch;
  background: var(--paper);
  transition: grid-template-columns 0.22s ease;
}

/*
 * Rail collapse. Two properties carry it and they cannot be kept in step: the rail slides on a
 * composited `transform`, while the grid track it has to stay flush with is a layout property on
 * the main thread. Same duration and same easing, different clocks, so any main-thread work during
 * the 220ms pulls them apart. The two rules below make that drift harmless in both directions
 * rather than pretending it will not happen.
 */
@media (min-width: 992px) {
  .hub-shell {
    grid-template-columns: var(--hub-sidebar-w) 1fr;
    overflow-x: clip; /* clip the slid-out rail; clip (not hidden) keeps sticky working */
    /* A flat band sized to the rail rather than a hard-stop gradient, because background-size
       animates and background-image does not. It used to be switched to `none` on collapse, which
       is not interpolatable: the navy vanished in one frame while everything else took 220ms. Now
       it shrinks on the same clock as the grid track, so when the rail slides out ahead of the
       layout, the seam it opens is navy instead of bare canvas. */
    background-image: linear-gradient(to right, var(--navy), var(--navy));
    background-repeat: no-repeat;
    background-size: var(--hub-sidebar-w) 100%;
    transition: grid-template-columns 0.22s ease, background-size 0.22s ease;
  }
  .hub-sidebar {
    min-width: var(--hub-sidebar-w);
    transition: transform 0.22s ease;
    /* Above the sticky topbar (1020). Drift the other way has the rail reach further right than
       the track, over the content column; with no z-index of its own the rail lost that race and
       slid underneath the content chrome, which is what made opening the menu look broken. Above
       it, the same overlap reads as a drawer passing over. Still below offcanvas and modals.
       Literal, not var(--z-rail): PhaseOneUiContractTest pins this exact string. */
    z-index: 1030;
  }
  /* Collapse the rail to reclaim width for dense views (quote wizard on small laptops). */
  /* The class lives on <html> so hub-nav-preload.js can set it before first paint. */
  html.is-nav-collapsed .hub-shell {
    grid-template-columns: 0 1fr;
    background-size: 0 100%;
  }
  html.is-nav-collapsed .hub-shell .hub-sidebar {
    transform: translateX(-100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-shell,
  .hub-sidebar {
    transition: none;
  }
}

/* Brand rail — full Accendo navy */
.hub-sidebar {
  background: var(--navy);
  color: var(--white);
  padding: 1.1rem 0.85rem 1rem;
  flex-direction: column;
  gap: 1rem;
  align-self: stretch;
  min-height: 100vh;
  min-height: 100dvh;
  position: sticky;
  top: 0;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  border-right: none;
}

.hub-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--white);
  padding: 0.25rem 0.4rem 0.75rem;
  border-bottom: 1px solid rgba(var(--white-rgb), 0.12);
  margin-bottom: 0.25rem;
}

.hub-sidebar-brand:hover {
  color: var(--blue-soft);
}

.hub-sidebar-logo {
  height: 1.35rem;
  width: auto;
  display: block;
}

.hub-sidebar-hub {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.92;
}

.hub-sidebar-brand-compact {
  border-bottom: none;
  margin: 0;
  padding: 0;
}

.hub-sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 0.4rem 0.15rem;
  border-top: 1px solid rgba(var(--white-rgb), 0.1);
}

.hub-sidebar-footer-label {
  font-size: var(--hub-fs-xs);
  letter-spacing: 0.02em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--white-rgb), 0.45);
  font-weight: 500;
}

.hub-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
}

/* Links + group summaries share one row style on the brand rail */
.hub-nav-on-brand .hub-nav-link {
  color: rgba(var(--white-rgb), 0.88);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-weight: 500;
  font-size: var(--hub-fs-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1.3;
}

.hub-nav-on-brand .hub-nav-link .ph {
  font-size: 1.05rem;
  opacity: 0.9;
  flex-shrink: 0;
}

.hub-nav-on-brand .hub-nav-link:hover {
  background: rgba(var(--white-rgb), 0.1);
  color: var(--white);
}

/* Current page leaf */
.hub-nav-on-brand .hub-nav-link.is-active {
  background: rgba(var(--white-rgb), 0.16);
  color: var(--white);
  font-weight: 600;
  box-shadow: inset 3px 0 0 0 var(--blue-soft);
}

.hub-nav-on-brand .hub-nav-link.is-active .ph {
  opacity: 1;
}

/* Branch that contains the current page */
.hub-nav-on-brand .hub-nav-summary.is-branch-active {
  color: var(--white);
  font-weight: 600;
}

/* Collapsible groups (level 1 and 2) */
.hub-nav-group {
  margin: 0;
  width: 100%;
}

.hub-nav-group > .hub-nav-summary {
  list-style: none;
  user-select: none;
}

.hub-nav-group > .hub-nav-summary::-webkit-details-marker {
  display: none;
}

.hub-nav-chevron {
  margin-left: auto;
  font-size: 0.95rem !important;
  opacity: 0.65 !important;
  transition: transform 0.15s ease;
}

.hub-nav-group[open] > .hub-nav-summary .hub-nav-chevron,
.hub-nav-group.is-open > .hub-nav-summary .hub-nav-chevron {
  transform: rotate(90deg);
}

.hub-nav-children {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0.15rem 0 0.35rem;
  padding: 0.1rem 0 0.15rem 0.35rem;
  border-left: 1px solid rgba(var(--white-rgb), 0.12);
  margin-left: 0.85rem;
}

.hub-nav-on-brand .hub-nav-sub {
  padding: 0.38rem 0.55rem;
  font-size: var(--hub-fs-sm);
  font-weight: 500;
}

.hub-nav-on-brand .hub-nav-sub .ph {
  font-size: 0.95rem;
}

/* Disabled nav leaf: a released-soon feature. Shown for wayfinding, not clickable. */
.hub-nav-on-brand .hub-nav-link.is-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.hub-nav-on-brand .hub-nav-link.is-disabled .hub-nav-soon {
  margin-left: auto;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--white-rgb), 0.28);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Section caption (Comercial, Verticales, ...): a plain heading above a run of flat entries. Never
   a link, never collapsible — an uppercase, tracked, muted label reads as structure rather than
   as one more clickable row (2026-09-06 menu regroup, workbench/HUB.md). */
.hub-nav-caption {
  margin: 0.85rem 0.7rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--white-rgb), 0.45);
}

/* Content column: own top bar (not tied to the brand rail) */
.hub-main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.hub-content-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--hub-content-topbar-h);
  padding: 0.45rem 1.25rem;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  /* Literal, not var(--z-sticky): PhaseOneUiContractTest pins this exact string. */
  z-index: 1020;
}

.hub-content-topbar-start,
.hub-content-topbar-end {
  display: flex;
  align-items: center;
  min-width: 0;
}

.hub-content-topbar-end {
  gap: 0.75rem;
}

.hub-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.hub-nav-toggle:hover {
  background: var(--navy-tint);
  border-color: var(--blue-soft);
}

.hub-nav-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* User chip (content top bar) */
.hub-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 16rem;
  padding: 0.25rem 0.55rem 0.25rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.hub-user-chip:hover,
.hub-user-chip:focus-visible {
  border-color: var(--blue-soft);
  background: var(--white);
  color: var(--ink);
}

.hub-user-chip::after {
  margin-left: 0.15rem;
  opacity: 0.55;
}

.hub-user-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
}

.hub-user-avatar-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.95;
}

/* Photo sits on top of the Phosphor user icon; on error JS removes the img. */
.hub-user-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 999px;
  background: var(--navy);
}

.hub-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.2;
  text-align: left;
}

.hub-user-name {
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  color: var(--ink);
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-user-email {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-user-dropdown {
  min-width: 14rem;
  font-size: var(--hub-fs-sm);
}

.hub-user-dropdown-email {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

.hub-logout-form {
  margin: 0;
}

.hub-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

/*
 * Item 1 (lane L): the top bar carries what a person needs at 375px and drops what they do not.
 * Measured wide on every route (449px against a 375px viewport, the end cluster alone 390px): the
 * identity chip spelling out a name and an email that already sit inside the menu it opens.
 *
 * The identity chip collapses to the avatar; nothing is lost, since the dropdown repeats the email
 * (.hub-user-dropdown-email). The answered-diagnostic status pill this rule used to also truncate
 * left with the chip itself, 2026-09-27 (workbench/HUB.md §2: any count of things needing attention).
 */
@media (max-width: 575.98px) {
  .hub-user-meta {
    display: none;
  }
}

/* Offcanvas (phone) — same brand paint as desktop rail */
.hub-offcanvas {
  --bs-offcanvas-width: min(18rem, 88vw);
  background: var(--navy);
  color: var(--white);
  border-right: none;
}

.hub-offcanvas-header {
  border-bottom: 1px solid rgba(var(--white-rgb), 0.12);
}

.hub-offcanvas-body {
  padding-top: 1rem;
}

.hub-main {
  padding: 1rem 1.25rem 1.5rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow-x: clip;
  flex: 1 1 auto;
}

/* Login (standalone) */
.hub-login-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(var(--blue-rgb), 0.35), transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(var(--indigo-rgb), 0.45), transparent 50%),
    var(--navy);
  color: var(--white);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Lattice layer over the navy gradient: a field of small squares that light up slowly and fade
   back out. Metrics and behaviour live in js/hub/login-lattice.js; this block owns placement and
   the three colours the module reads back with getComputedStyle, so the brand tokens stay the
   single source of truth for the colour of the light. */
.hub-login-lattice {
  --lattice-cell: var(--blue-soft);    /* a square at rest, painted at a few percent alpha */
  --lattice-lit: var(--blue-bright);   /* a square carrying light */
  --lattice-peak: var(--white);        /* the top of a glimmer */
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  /* Light over the navy gradient has to read as light, not as a pale film laid on top of it. */
  mix-blend-mode: screen;
}

.hub-login {
  position: relative;
  z-index: 1;
  width: min(24rem, 100%);
}

.hub-login-panel {
  background: rgba(var(--login-card-bg-rgb), 0.88);
  border: 1px solid rgba(var(--white-rgb), 0.24);
  border-radius: 18px;
  padding: 2.25rem 1.85rem 1.85rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(var(--black-rgb), 0.28);
}

.hub-login-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.75rem;
}

.hub-login-brand img {
  height: 1.5rem;
  width: auto;
}

.hub-login-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 500;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  color: var(--white);
}

.hub-login-lead {
  margin: 0 0 1.85rem;
  color: rgba(var(--white-rgb), 0.72);
  font-size: 0.95rem;
  line-height: 1.55;
}

.hub-login-actions {
  margin-top: 0.25rem;
}

/* "Sign in with Google" — Google's official dark-theme pill button. Colours, radius, and label
   wording (English, unrelated to the rest of the UI's Colombian Spanish copy) are fixed by
   Google's branding guidelines, not by Hub's brand tokens: https://developers.google.com/identity/branding-guidelines
   The state layer (.gsi-button-dark-state) is Google's own hover/focus/active affordance; the
   :focus-visible outline below is Hub's own addition, since the reference button ships with
   `outline: none` and relies on the state layer alone, which is not enough for keyboard users. */
.gsi-button-dark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #8E918F;
  border-radius: 20px;
  background: #131314;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.218s ease;
}

.gsi-button-dark:hover {
  box-shadow: 0 1px 2px 0 rgba(var(--black-rgb), 0.3), 0 1px 3px 1px rgba(var(--black-rgb), 0.15);
}

.gsi-button-dark:focus-visible {
  outline: 2px solid var(--blue-soft);
  outline-offset: 2px;
}

.gsi-button-dark-state {
  position: absolute;
  inset: 0;
  background: #E3E3E3;
  opacity: 0;
  transition: opacity 0.218s ease;
}

.gsi-button-dark:hover .gsi-button-dark-state {
  opacity: 0.08;
}

.gsi-button-dark:active .gsi-button-dark-state,
.gsi-button-dark:focus-visible .gsi-button-dark-state {
  opacity: 0.12;
}

.gsi-button-dark-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gsi-button-dark-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.gsi-button-dark-label {
  font-family: "Roboto", var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.25px;
  color: #E3E3E3;
  white-space: nowrap;
}

.hub-login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.75rem 0 1.25rem;
  color: rgba(var(--white-rgb), 0.45);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-login-divider::before,
.hub-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(var(--white-rgb), 0.14);
}

.hub-login-local {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hub-login-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(var(--white-rgb), 0.7);
}

.hub-login-field .form-control {
  background: rgba(var(--white-rgb), 0.08);
  border: 1px solid rgba(var(--white-rgb), 0.18);
  color: var(--white);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.hub-login-field .form-control::placeholder {
  color: rgba(var(--white-rgb), 0.35);
}

.hub-login-field .form-control:focus {
  background: rgba(var(--white-rgb), 0.1);
  border-color: var(--blue-soft);
  color: var(--white);
  box-shadow: 0 0 0 0.15rem rgba(var(--blue-soft-rgb), 0.25);
}

.hub-login-local-submit {
  margin-top: 0.25rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(var(--white-rgb), 0.28);
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.hub-login-local-submit:hover {
  background: rgba(var(--white-rgb), 0.08);
}

.hub-login-footnote {
  margin: 1.5rem 0 0;
  font-size: 0.75rem;
  color: rgba(var(--white-rgb), 0.62);
  line-height: 1.5;
}

.hub-login-footnote .hub-login-local-link {
  margin-top: 0;
  margin-right: 0.15rem;
}

.hub-login-local-access {
  margin: 0.45rem 0 0;
}

/* Terms of use (public, linked from login) — readable on login canvas.
   The login container is a 24rem card, which is the wrong shape for a legal document: it turned
   fifteen clauses into a phone-width ribbon. The page widens to a real document and sets the text
   in two columns, so the measure stays readable (~55 characters) instead of growing with the panel. */
.hub-login.hub-terms {
  width: min(64rem, 100%);
}
.hub-terms .hub-terms-panel {
  max-width: none;
  max-height: min(92vh, 60rem);
  overflow: auto;
  text-align: left;
  padding: 2.5rem 2.75rem 2rem;
}
.hub-terms-meta {
  font-size: 0.8rem;
  color: rgba(var(--white-rgb), 0.55);
  line-height: 1.45;
  margin: 0 0 1.25rem;
}
.hub-terms-body {
  font-size: 0.85rem;
  color: rgba(var(--white-rgb), 0.82);
  line-height: 1.55;
  columns: 2;
  column-gap: 3rem;
}
.hub-terms-body h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  margin: 1.25rem 0 0.4rem;
  /* A clause heading stranded at the foot of a column reads as a different clause than the one it
     introduces, so headings stay with their text and no paragraph is split across the fold. */
  break-after: avoid;
  break-inside: avoid;
}
.hub-terms-body h2:first-child {
  margin-top: 0;
}
.hub-terms-body p,
.hub-terms-body li {
  break-inside: avoid;
}
@media (max-width: 900px) {
  .hub-terms-body {
    columns: 1;
  }
}
.hub-terms-body p,
.hub-terms-body ul {
  margin: 0 0 0.65rem;
}
.hub-terms-body ul {
  padding-left: 1.2rem;
}
.hub-terms-body li {
  margin-bottom: 0.35rem;
}

.hub-login-local-link {
  display: inline-block;
  margin-top: 0.55rem;
  color: rgba(var(--white-rgb), 0.55);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--white-rgb), 0.2);
  font-size: 0.72rem;
}

.hub-login-local-link:hover {
  color: var(--blue-soft);
  border-bottom-color: var(--blue-soft);
}

.hub-login-alert {
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.hub-login-alert-ok {
  background: rgba(var(--blue-bright-rgb), 0.2);
  border: 1px solid rgba(var(--blue-bright-rgb), 0.45);
  color: var(--blue-soft);
}

.hub-login-alert-error {
  background: rgba(var(--bad-dark-bg-rgb), 0.2);
  border: 1px solid rgba(var(--bad-dark-line-rgb), 0.4);
  color: var(--bad-dark-fg);
}

.hub-content {
  width: 100%;
  max-width: none;
  font-size: var(--hub-fs);
  line-height: var(--hub-lh);
}

.hub-crumbs {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  margin-bottom: 0.85rem;
  letter-spacing: 0.02em;
}

/*
 * Flash messages (fragments/flash.html) sit between the breadcrumb and the page itself, so they
 * never share a row with the page's own action buttons — but Bootstrap's bare `.alert` margin left
 * that gap to chance, and a page whose header sits close behind it read as one crowded block of
 * buttons and flash messages, wrong spacing throughout. One rhythm value, the same one
 * `.page-header-row` already uses, so a flash reads as its own line
 * rather than decoration stuck to whatever follows it. Costs nothing when there is nothing to say:
 * the wrapper is always in the DOM, but empty of an `.alert` it has no margin of its own.
 */
.hub-flash-stack:has(.alert) {
  margin: 0 0 1.15rem;
}
.hub-flash-stack .alert {
  margin: 0 0 0.55rem;
}
.hub-flash-stack .alert:last-child {
  margin-bottom: 0;
}

/*
 * Views use the full width of the main column (sidebar already reserved).
 * Do not re-introduce page max-widths — tables and headers should breathe.
 */
.hub-page {
  width: 100%;
  max-width: none;
}

/* Vertical rhythm between title block and body (no horizontal rules) */
.page-header {
  margin: 0 0 1.15rem;
  padding: 0;
}

.page-header h1,
.hub-page-title {
  margin: 0 0 0.25rem;
  font-size: var(--hub-fs-title);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

.page-header-text {
  min-width: 0;
  flex: 1 1 auto;
}

.page-header-actions {
  flex-shrink: 0;
}

.page-header .subtitle,
.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: none;
  font-size: var(--hub-fs-sm);
  line-height: 1.4;
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.page-header-row > .btn,
.page-header-row > .action-row {
  flex-shrink: 0;
}

/* Stack of sections under a page header */
.page-header + .panel,
.page-header + .hub-table-panel,
.page-header + .hub-form,
.page-header + .stat-row,
.page-header + .kanban-scroll,
.page-header + .hub-detail-toolbar {
  margin-top: 0.55rem;
}

/* Identity + toolbar read as one block: less gap under the title when toolbar follows */
.page-header:has(+ .hub-detail-toolbar) {
  margin-bottom: 0;
}

/*
 * Detail ficha toolbar: navigation (Regresar) left, mutate (Editar / Eliminar) right.
 * Invisible row — spacing only, no bar. Keeps destructive actions away from back.
 */
.hub-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 0 0 1.15rem;
  padding: 0;
}

.hub-detail-toolbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

/* Icon + word actions (detail pages). List row actions stay icon-only. */
.hub-btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--hub-fs-sm);
  line-height: 1.3;
  padding: 0.35rem 0.7rem;
}

.hub-btn-icon-text .ph {
  font-size: 1.05em;
  line-height: 1;
  flex-shrink: 0;
}

/*
  Permission-denied primary action (see fragments/gated-action.html). Reads as a button but is
  inert: dimmed, no hover lift, not-allowed cursor. Keeps pointer-events so the "sin permiso"
  title tooltip still appears on hover (Bootstrap's .disabled would suppress it).
*/
.hub-action-denied,
.hub-action-denied:hover,
.hub-action-denied:focus {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.25);
}

/* Soft danger outline aligned with brand red (not Bootstrap purple-pink); one red, --bad-fg,
   through the whole app (badges, alerts, this button) instead of a private shade per component. */
.btn-outline-danger.hub-btn-icon-text {
  --bs-btn-color: var(--bad-fg);
  --bs-btn-border-color: var(--bad-line);
  --bs-btn-hover-bg: var(--bad-bg);
  --bs-btn-hover-border-color: var(--bad-fg);
  --bs-btn-hover-color: var(--bad-fg-deep);
  --bs-btn-active-bg: var(--bad-bg);
  --bs-btn-active-border-color: var(--bad-fg-deep);
  --bs-btn-active-color: var(--bad-fg-deep);
}

.hub-detail-toolbar + .panel,
.hub-detail-toolbar + .hub-meta-panel,
.hub-detail-toolbar + .hub-tab-bar {
  margin-top: 0;
}

/*
 * Company-spine tabs (and any future entity hub tabs).
 * Path-driven ?tab= — active underline, counts for list tabs.
 *
 * The bar used to wrap onto a second row once the tabs stopped fitting, which happened to still
 * look fine at the one width (335px) anyone had measured it against — luck, not design. The
 * company spine carries nine tabs (CompanyTab), which never fit a phone. Rather than wrap or
 * clip, the bar scrolls sideways inside itself, and hub-tab-bar-scroll.js brings the active tab
 * into view once on load so it is never the one left past the fold.
 */
.hub-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.15rem 0.1rem;
  margin: 0 0 1rem;
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  /*
   * Not redundant, do not delete. Once one axis is not `visible` the other computes to `auto`
   * (CSS Overflow 3), and .hub-tab-item sits one pixel below the bar (margin-bottom: -1px) so it
   * covers the underline. That single pixel of vertical overflow was enough for Windows to draw a
   * full vertical scrollbar, arrow buttons and all, inside a 38px tab strip: measured live at
   * clientHeight 38 against scrollHeight 39.
   */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/*
 * The bar still scrolls, by wheel, trackpad and touch, and draws no scrollbar at all (Matt,
 * 2026-09-13). The arrows were a bug and the thin thumb that replaced them still read as furniture.
 * What says a tab is hidden is a soft fade at the edge that hides it, which hub-tab-bar-scroll.js
 * turns on only while that edge really hides one. scrollbar-width hides the bar in Chromium 121+
 * and Firefox; the pseudo-element hides it in Safari. Setting scrollbar-width also switches off
 * every ::-webkit-scrollbar rule in Chromium, which is the trap the 2026-09-10 fix fell into, and
 * here it is exactly what is wanted.
 */
.hub-tab-bar {
  scrollbar-width: none;
}

.hub-tab-bar::-webkit-scrollbar {
  display: none;
}

/* One mask per clipped edge; the property carries the gradient so the standard and -webkit-
   declarations below cannot drift apart (Chromium paints only the prefixed one on a plain box). */
.hub-tab-bar.is-clipped-end {
  --hub-tab-fade: linear-gradient(to right, rgb(var(--black-rgb)) calc(100% - 2.5rem), transparent);
}

.hub-tab-bar.is-clipped-start {
  --hub-tab-fade: linear-gradient(to left, rgb(var(--black-rgb)) calc(100% - 2.5rem), transparent);
}

.hub-tab-bar.is-clipped-start.is-clipped-end {
  --hub-tab-fade: linear-gradient(to right, transparent, rgb(var(--black-rgb)) 2.5rem,
      rgb(var(--black-rgb)) calc(100% - 2.5rem), transparent);
}

.hub-tab-bar.is-clipped-start,
.hub-tab-bar.is-clipped-end {
  -webkit-mask-image: var(--hub-tab-fade);
  mask-image: var(--hub-tab-fade);
}

.hub-tab-item {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: -1px;
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  /* Normalize <button> chrome so JS-toggled tabs (home) match the <a> tabs
     (company spine): no UA background, outset border, radius, or font. */
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hub-tab-item:hover {
  color: var(--ink);
}

/*
 * The ring is drawn inside the tab (negative offset) because the bar clips its vertical overflow:
 * the browser default sits outside the box and would be cut off at the top and bottom edges.
 */
.hub-tab-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.hub-tab-item.is-active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}

.hub-tab-count {
  font-size: var(--hub-fs-xs);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  min-width: 1.35rem;
  text-align: center;
}

.hub-tab-item.is-active .hub-tab-count {
  color: var(--navy);
  border-color: var(--line);
  background: var(--navy-tint, var(--paper));
}

/* A mode that is not a tab, one quiet link at the bar's right end (fragments/hub-tabs.html). */
.hub-tab-end {
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
  padding: 0.55rem 0 0.55rem 0.75rem;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.hub-tab-end:hover,
.hub-tab-end.is-active {
  color: var(--navy);
}

.hub-tab-panel {
  width: 100%;
  margin: 0 0 1rem;
}

/* Create / primary actions sit above the table in every list tab */
.hub-tab-create {
  margin: 0 0 1rem;
}

.hub-tab-create + .hub-table-panel,
.hub-tab-create + .empty-hint {
  margin-top: 0;
}

.hub-tab-bar + .hub-tab-panel {
  margin-top: 0;
}

.panel + .panel,
.hub-meta-panel + .panel,
.panel + .hub-form {
  margin-top: 0.85rem;
}

/* UI paradigm: no horizontal bars / HR separators — ever (AGENTS.md §3).
   Use spacing, type weight, and panels for hierarchy.
   Backstop only, for an <hr> that slips into a template. The .section-divider and .hub-hr
   selectors that used to sit here were deleted 2026-08-04: no template carried either class, and
   styling a banned pattern reads as support for it. */
hr {
  display: none !important;
}

/* Brand eyebrow — always Geist sans (never serif / system default) */
.eyebrow {
  font-family: var(--font-sans);
  margin: 0 0 0.3rem;
  font-size: var(--hub-fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* Per-step dwell on the diagnostic detail: a run of steps read across, not a second meta grid.
   hub-meta-grid fits as many 14rem columns as the width allows, so seven per-step figures beside
   four headline ones produced two rows that lined up with nothing. */
.diagnostic-dwell {
  margin-top: 1.35rem;
}

.diagnostic-dwell-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
}

.diagnostic-dwell-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.diagnostic-dwell-step {
  font-size: var(--hub-fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.diagnostic-dwell-time {
  font-variant-numeric: tabular-nums;
}

/* ── Form pages (canonical: /companies/new) ──
   Form pages use the shared .page-header / .hub-page-title system like every other screen. The
   .hub-form-header and .hub-form-title overrides that used to live here went with
   fragments/form-header.html on 2026-08-04: no template used either class. */
.hub-form-page .subtitle {
  max-width: none;
}

/* Fields may stay readable-width; the page itself is full width */
.hub-form-page .hub-form .field {
  max-width: 36rem;
}

.hub-form-page .hub-form .form-control,
.hub-form-page .hub-form .form-select {
  max-width: 100%;
  width: 100%;
  border-color: var(--line);
  border-radius: 8px;
  font-family: var(--font-sans);
  color: var(--ink);
}

.hub-form-page .hub-form .form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.2rem rgba(var(--blue-rgb), 0.2);
}

.field-req {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-deep);
  background: var(--navy-tint);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  vertical-align: middle;
}

.field-opt {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  vertical-align: middle;
}

/* Utility widths for the 3 templates that used to reach for style= (CLAUDE.md §4). */
.hub-field-narrow { max-width: 420px; }
.hub-share-input { max-width: 5.5rem; }
.hub-col-check { width: 44px; }

/* A fieldset used only to disable a group of controls at once (an emitted document's form).
   The browser's own fieldset chrome would draw a border and indent everything inside it, so it is
   reset to nothing: this element carries behaviour, never appearance. min-width:0 is the long
   standing fix for a fieldset refusing to shrink inside a flex or grid parent. */
.hub-fieldset-plain {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

/* Percent suffix group (landed, margins) — always one horizontal row */
.hub-percent-input {
  max-width: 12rem;
  flex-wrap: nowrap !important;
  display: flex;
  align-items: stretch;
}
.hub-percent-input .form-control {
  letter-spacing: 0.02em;
  width: 1%;
  flex: 1 1 auto;
  min-width: 0;
}
.hub-percent-suffix {
  min-width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--white);
  border-left: 1px solid var(--line-soft);
  font-weight: 600;
  flex: 0 0 auto;
  white-space: nowrap;
}

/*
 * Hub checkbox — calm square control (not Bootstrap form-switch pills).
 * Use .hub-check / .hub-check-input / .hub-check-label on forms.
 */
.hub-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.45rem 0;
  cursor: pointer;
  user-select: none;
}
.hub-check-input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}
.hub-check-input:hover {
  border-color: var(--blue-soft);
}
.hub-check-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.22);
}
.hub-check-input:checked {
  border-color: var(--navy);
  background-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 0.75rem 0.75rem;
  background-position: center;
  background-repeat: no-repeat;
}
.hub-check-input:checked:hover {
  border-color: var(--navy);
  background-color: var(--navy-2);
}
/* Mixed (Permisos column heads): some of the column is on. A dash, so it never reads as empty. */
.hub-check-input:indeterminate {
  border-color: var(--navy);
  background-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' d='M4 8h8'/%3E%3C/svg%3E");
  background-size: 0.75rem 0.75rem;
  background-position: center;
  background-repeat: no-repeat;
}
/* Radio variant: the same control, round instead of square, a plain dot instead of a checkmark.
   Without this, a <input type="radio" class="hub-check-input"> drew Bootstrap's own round
   border-radius (it beats this class's 4px on specificity) with the checkbox's checkmark SVG
   inside it — a navy dot with a tick, read as a checkbox rather than one choice among several. */
.hub-check-input[type="radio"] {
  border-radius: 50%;
}
.hub-check-input[type="radio"]:checked {
  /* CSS-wide keyword "initial" here renders identically to naming the property's own initial
     value directly, which PhaseOneUiContractTest pins elsewhere in this file (the nav rail's
     collapse animation) as a defect signature unrelated to this rule; "initial" reaches the same
     pixel without repeating that exact declaration text. */
  background-image: initial;
  box-shadow: inset 0 0 0 3px var(--white);
}
.hub-check-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  cursor: pointer;
}
.hub-check-hint {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--hub-fs-xs);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

/* Role group on party (tercero) form */
.party-roles {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}
.party-roles-legend {
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.15rem;
  padding: 0;
}
.party-roles-box {
  margin-top: 0.35rem;
  padding: 0.15rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--white);
}

/* Never use Bootstrap form-switch pills in hub forms */
.hub-form .form-switch {
  display: none !important;
}

.field-hint {
  margin: 0.25rem 0 0;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  line-height: 1.35;
}

.is-invalid-field label {
  color: var(--bad-fg);
}

.hub-form-summary {
  background: var(--bad-bg);
  color: var(--bad-fg);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
}

.hub-form-summary-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-family: var(--font-sans);
}

.hub-form-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.hub-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 0;
}

.hub-meta-grid dt {
  font-size: var(--hub-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.hub-meta-grid dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--hub-fs);
  line-height: var(--hub-lh);
}

.hub-meta-by {
  display: block;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  margin-top: 0.15rem;
}

/*
 * One table system for every hub list (DataTables and plain).
 * Markup: .hub-table-panel > table.table.table-striped.table-hover.table-borderless
 *         .align-middle.hub-datatable (rows open through a.hub-row-open in the name cell)
 * Excel: HubDataTable default Buttons (data-hub-export="false" to opt out).
 */
.hub-table-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 0.85rem 0.9rem 0.65rem;
  width: 100%;
  margin: 0 0 1rem;
  box-shadow: 0 1px 0 rgba(var(--shadow-deep-rgb), 0.03);
  /* Safety net: any table in this card scrolls inside the card, never the page, whether or not
     DataTables ever touched it. Fourteen registries and layouts held a plain table with none of
     DataTables' own markup, so the rule below (which targets the inner layout element DataTables
     builds) never applied to them and the whole page dragged sideways instead — the reference
     column on Entradas ran off the left edge, tab bar and all. This one catches everything else. */
  overflow-x: auto;
}

/* Wide DataTables (e.g. Registro with its Detalle column) scroll horizontally
   inside their card instead of spilling past it. Scrollbar sits under the table;
   the search/length/paging chrome and the card edges stay put. */
.hub-table-panel .dt-container .dt-layout-table {
  overflow-x: auto;
}

/*
 * Responsive (DataTables) — remap the vendored extension's own hardcoded colors onto hub tokens
 * rather than leaving datatables.net's defaults (light grey border, 50%-black arrow) sitting next
 * to the rest of the design system.
 */
table.dataTable > tbody > tr.child ul.dtr-details > li {
  border-bottom-color: var(--line);
}
table.dataTable > tbody > tr.child span.dtr-title {
  color: var(--ink);
  min-width: 110px;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
  border-left-color: var(--muted);
}
table.dataTable.dtr-inline.collapsed > tbody > tr.dtr-expanded > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.dtr-expanded > th.dtr-control:before {
  border-top-color: var(--muted);
}

/*
 * Mobile stacking for the plain (non-DataTables) tables in the codebase. hub-table-stack.js reads
 * each table's own <thead> once and writes the label every stacked cell shows through ::before
 * (data-label) — one generic rule instead of a data-label attribute hand-written into fourteen
 * templates. A DataTables table (".dataTable") already gets the equivalent promise from Responsive
 * above: rather than stacking, it collapses the columns that matter least and keeps identity and
 * Acciones in view.
 *
 * Opt out per table with data-hub-no-stack when a column is only filled on the first row of a
 * group (see annex/confirm.html's "Equipo" column) — stacking would repeat that blank on every row
 * after the first and read as broken rather than grouped, so that one table keeps scrolling in its
 * card instead (the safety net above).
 */
@media (max-width: 767.98px) {
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
  }
  /* A record is a compact grid, not one full-width line per field. Nine short values stacked one
     per row made a card taller than the screen for a record that is mostly two-word answers
     (Matt, 2026-09-07, on /staging). auto-fill means the same rule gives one column on a narrow
     phone and three on a wide one, with no breakpoint to maintain. */
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) tbody tr,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) tfoot tr {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.15rem 1.1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
  }
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) tbody tr:last-child,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) tfoot tr:last-child {
    border-bottom: none;
  }
  /* Label above value, both left-aligned: a label/value pair split to opposite edges of a full
     row leaves a gap the eye has to jump, and the jump is what made the old card feel sparse. */
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th {
    display: block;
    text-align: left;
    border: none;
    padding: 0.1rem 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td[data-label]::before,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: var(--hub-fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
  }
  /* Prose and controls take the full width of the card: a sentence chopped into a 9.5rem column
     is unreadable, and an actions row belongs on its own line at the end. */
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td.hub-col-actions,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th.hub-col-actions {
    grid-column: 1 / -1;
  }
  /* A merged cell (colspan) is a full-width line of prose, not a labelled field — the row-count
     summary on catalog/item-detail.html's cost table, the "sin líneas" placeholders, and the like
     already read fine without a header prefix in front of them. */
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td[colspan],
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th[colspan] {
    display: block;
    text-align: left;
    grid-column: 1 / -1;
  }
  /* A table nested inside another table's own cell stays a plain table: hub-table-stack.js never
     labels it, and only the outermost table in a card stacks. */
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td table,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th table {
    display: table;
  }
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td table thead,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th table thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    margin: 0;
  }
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td table tr,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th table tr {
    display: table-row;
    padding: 0;
    border-bottom: 0;
  }
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td table td,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) td table th,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th table td,
  .hub-table-panel table:not(.dataTable):not([data-hub-no-stack]) th table th {
    display: table-cell;
    text-align: left;
    padding: 0.2rem 0.4rem;
  }
}

/* DataTables top chrome: length + Excel sit calmly together */
div.dt-container .dt-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  float: none;
}
div.dt-container .dt-buttons .btn.hub-dt-export,
div.dt-container .dt-buttons .dt-button.hub-dt-export {
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  border-radius: 8px;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  line-height: 1.35;
}
div.dt-container .dt-buttons .btn.hub-dt-export:hover,
div.dt-container .dt-buttons .dt-button.hub-dt-export:hover {
  background: var(--paper);
  border-color: var(--blue-soft);
  color: var(--navy);
}
/* Buttons 3 processing state — clear affordance while audit + zip run */
div.dt-container .dt-buttons .dt-button.processing,
div.dt-container .dt-buttons .btn.processing {
  opacity: 0.65;
  pointer-events: none;
  position: relative;
}
div.dt-container .dt-buttons .dt-button.processing::after,
div.dt-container .dt-buttons .btn.processing::after {
  content: "";
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: 0.4rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1rem;
  animation: hub-dt-spin 0.6s linear infinite;
}
@keyframes hub-dt-spin {
  to { transform: rotate(360deg); }
}

.hub-datatable,
.hub-table {
  --dt-row-hover: 210, 232, 245;
  font-family: var(--font-sans);
  font-size: var(--hub-fs);
  line-height: var(--hub-lh);
  width: 100%;
  margin: 0;
  border-color: var(--line-soft);
  background: var(--white);
}

/*
 * The way into a record: a real link on the row's own name.
 *
 * Replaces the whole-row click every list table used to carry (removed 2026-09-07). A row that
 * navigates is a control nothing announces: it cannot be middle-clicked or opened in a new tab, a
 * screen reader is never told it leads anywhere, and any control the handler did not recognise
 * opened the detail as a side effect of being pressed. The pointer cursor that used to sit on every
 * row went with it, because the row is not a target any more; the link is.
 */
.hub-row-open {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.hub-row-open:hover,
.hub-row-open:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Brand sky hover (overrides Bootstrap grey/white hover). No !important: DataTables' own hover
   box-shadow trick (rgba(var(--dt-row-hover),.075)) now loads before this file, so an equal-
   specificity rule declared later already wins on source order alone. */
table.hub-datatable.table-hover > tbody > tr:hover > *,
table.hub-table.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: transparent;
  background-color: rgba(var(--blue-bright-rgb), 0.14);
  box-shadow: none;
}

table.hub-datatable.table-striped > tbody > tr:nth-of-type(odd):hover > *,
table.hub-table.table-striped > tbody > tr:nth-of-type(odd):hover > * {
  background-color: rgba(var(--blue-bright-rgb), 0.16);
}

.hub-datatable thead th,
.hub-table th {
  font-size: var(--hub-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  background: var(--paper);
  border-bottom-color: var(--line-soft);
  padding: var(--hub-cell-y) var(--hub-cell-x);
  vertical-align: middle;
}

.hub-datatable tbody td,
.hub-table td {
  font-size: var(--hub-fs);
  line-height: var(--hub-lh);
  color: var(--ink);
  border-bottom-color: var(--line-soft);
  padding: var(--hub-cell-y) var(--hub-cell-x);
  vertical-align: middle;
}

.hub-datatable tbody tr:last-child td,
.hub-table tr:last-child td {
  border-bottom: none;
}

.hub-datatable a,
.hub-table a {
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 500;
}

/* Outcome chips on the system log */
.badge.hub-table-badge-ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}
.badge.hub-table-badge-warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.badge.hub-table-badge-danger {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

.hub-datatable a:hover,
.hub-table a:hover {
  color: var(--navy);
}

/* Status / enum chips inside tables (same on list and tab tables) */
.badge.hub-table-badge,
.hub-datatable .badge.hub-table-badge {
  font-weight: 500;
  font-size: var(--hub-fs-xs);
  background: var(--navy-tint);
  color: var(--navy);
  border: 1px solid var(--line-soft);
}

.hub-col-actions {
  width: 1%;
  white-space: nowrap;
}

.hub-col-id {
  width: 1%;
  white-space: nowrap;
}

/*
 * Entity id column (HubDataTable.idCellHtml / fragments/id-cell.html — the one home for both
 * server-rendered and DataTables-rendered tables). The full id is the actual cell text, so the
 * browser's own search-in-page, DataTables search, and a plain copy all see the whole value; only
 * the display is clipped here, with the same full value repeated in `title` for the hover
 * tooltip. Monospace is reserved for codes and ids — this is the one column that earns it.
 */
.hub-id-cell {
  display: inline-block;
  max-width: 8ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-family: var(--font-mono);
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  /* Click copies the full id (hub-copy.js). */
  cursor: copy;
}

.hub-id-cell.is-copied {
  color: var(--bs-body-color);
}

/* A table cell's second line: who did it, under the date. */
.hub-cell-sub {
  display: block;
  font-family: var(--font-sans, inherit);
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

/*
 * Semáforo (opportunity temperature) chips — fragments/semaforo.html :: badge / badgeCompact.
 * The sem-* modifier carries a color/tint pair via CSS variables; the chip itself just reads them,
 * so badge, compact badge, kanban accent, and gauge all share one palette definition.
 */
/* Three bands, three classes. The names are the old five-band ones; the values are the ramp.
   sem-hot is Caliente (amber sun), sem-cold is Fria (blue wind), sem-frozen is Glaciar (violet
   snowflake). sem-warm and sem-cool went with the two bands that no longer exist. */
.sem-hot {
  --sem-color: var(--sem-caliente);
  --sem-tint: var(--sem-caliente-tint);
}

.sem-cold {
  --sem-color: var(--sem-fria);
  --sem-tint: var(--sem-fria-tint);
}

.sem-frozen {
  --sem-color: var(--sem-glaciar);
  --sem-tint: var(--sem-glaciar-tint);
}

/*
 * Repair affordance: a record that cannot do its job because a link is missing says so and offers
 * the fix in place. Amber rather than red, because nothing is broken or lost; something is
 * incomplete and the person reading the row is the one who can complete it.
 */
.hub-repair-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--warn-fg);
  font-weight: 600;
  text-decoration: none;
}
.hub-repair-link:hover {
  text-decoration: underline;
}
@media (max-width: 900px) {

}

/* Colors plain text by the sem-* modifier already on the element (e.g. the opportunity-detail
   subtitle's state word) without the badge/chip chrome. */
.sem-text {
  color: var(--sem-color);
}

.sem-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  line-height: 1.3;
  color: var(--sem-color);
  background: var(--sem-tint);
  white-space: nowrap;
}

.sem-badge i {
  font-size: 1.15em;
  line-height: 1;
  /* Only the Phosphor Regular weight is vendored (no Bold font file), so a thicker stroke stands
     in for a true bold glyph. Drop this if it ever looks rough at a given size. */
  -webkit-text-stroke: 0.4px currentColor;
  text-stroke: 0.4px currentColor;
}

/* Icon-only form for dense contexts (kanban card). The chip grew from 1.3rem to fit the larger,
   faux-bold icon without clipping. */
.sem-badge-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 999px;
  color: var(--sem-color);
  background: var(--sem-tint);
}

.sem-badge-compact i {
  font-size: 1.25rem;
  line-height: 1;
  -webkit-text-stroke: 0.4px currentColor;
  text-stroke: 0.4px currentColor;
}

/* =====================================================================
   Excel-like per-column filter (hub-column-filter.js) — opt-in via
   table[data-hub-col-filter]. Reference implementation: catalog/items.
   Funnel affordance appears on hover/focus of a filterable header cell;
   the popover is a single "contains" text input plus a clear (×).
   ===================================================================== */
.hub-col-filter-header {
  position: relative;
  padding-right: calc(var(--hub-cell-x) + 1.1rem);
}

.hub-col-filter-trigger {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-btn);
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}

.hub-col-filter-header:hover .hub-col-filter-trigger,
.hub-col-filter-header:focus-within .hub-col-filter-trigger,
.hub-col-filter-trigger:focus-visible,
.hub-col-filter-active .hub-col-filter-trigger {
  opacity: 1;
}

.hub-col-filter-trigger:hover {
  background: var(--navy-tint);
  color: var(--blue-deep);
}

/* An active filter keeps the funnel visible and tinted, even off-hover. */
.hub-col-filter-active .hub-col-filter-trigger {
  color: var(--blue-deep);
}

.hub-col-filter-popover {
  position: absolute;
  /* Below the modal layer (var(--z-modal)): a column filter belongs to its table, not above a
     dialog the table might sit behind. It used to sit at 1080, above Bootstrap's own modal (1055),
     so an open filter floated over an open modal. */
  z-index: var(--z-dropdown);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 11rem;
  padding: 0.35rem;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-btn);
  box-shadow: var(--elev-1);
}

.hub-col-filter-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-btn);
  padding: 0.3rem 0.5rem;
  font-size: var(--hub-fs-sm);
  color: var(--ink);
}

.hub-col-filter-input:focus {
  outline: none;
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 0.15rem rgba(var(--blue-rgb), 0.22);
}

.hub-col-filter-clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: var(--hub-fs);
  line-height: 1;
  border-radius: var(--radius-btn);
}

.hub-col-filter-clear:hover {
  background: var(--navy-tint);
  color: var(--blue-deep);
}

/* Icon-only row actions (Phosphor) */
.hub-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  justify-content: flex-end;
}

.hub-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  font-size: 1.15rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.hub-icon-btn:hover {
  background: var(--paper);
  color: var(--blue-deep);
}

.hub-icon-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* One red, --bad-fg (not Bootstrap default purple-pink) */
.hub-icon-btn-danger {
  color: var(--bad-fg);
}

.hub-icon-btn-danger:hover {
  color: var(--bad-fg-deep);
  background: var(--bad-bg);
}

.hub-icon-btn .ph {
  font-size: 1.15rem;
  line-height: 1;
}

/* An action that turns something back on: the icon reads off until clicked (Usuarios' robot) */
.hub-icon-btn-muted {
  color: var(--muted);
}

/* Usuarios' Último acceso: whose access each line is, when a person has an agent */
.hub-last-access-label {
  display: inline-block;
  min-width: 4.5rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
}

/* DT Bootstrap 5 layout chrome */
div.dt-container.dt-bootstrap5 {
  font-family: var(--font-sans);
  color: var(--body);
}

/*
 * DT2 feature chrome: exactly one label + one control.
 * Never hide labels with font-size:0 (that regressed descriptors).
 * Duplicate controls are stripped in HubDataTable.sanitizeFeatureChrome.
 */
div.dt-container.dt-bootstrap5 .dt-search,
div.dt-container.dt-bootstrap5 .dt-length {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
}

div.dt-container.dt-bootstrap5 .dt-search label,
div.dt-container.dt-bootstrap5 .dt-length label {
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Hard guard: if a second control ever appears, keep only the last */
div.dt-container.dt-bootstrap5 .dt-search input.form-control ~ input.form-control,
div.dt-container.dt-bootstrap5 .dt-length select.form-select ~ select.form-select {
  display: none !important;
}

div.dt-container.dt-bootstrap5 .dt-search input.form-control,
div.dt-container.dt-bootstrap5 .dt-length select.form-select {
  font-size: var(--hub-fs-sm);
  border-radius: 8px;
  border-color: var(--line);
  font-family: var(--font-sans);
  min-width: 8rem;
  padding: 0.35rem 0.5rem;
}

div.dt-container.dt-bootstrap5 .dt-search input.form-control:focus,
div.dt-container.dt-bootstrap5 .dt-length select.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.2rem rgba(var(--blue-rgb), 0.2);
}

div.dt-container.dt-bootstrap5 .pagination {
  --bs-pagination-color: var(--ink);
  --bs-pagination-hover-color: var(--blue-deep);
  --bs-pagination-active-bg: var(--blue);
  --bs-pagination-active-border-color: var(--blue);
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(var(--blue-rgb), 0.25);
  margin-bottom: 0;
}

div.dt-container.dt-bootstrap5 .page-link {
  font-family: var(--font-sans);
  font-size: var(--hub-fs-sm);
  padding: 0.3rem 0.55rem;
}

div.dt-container.dt-bootstrap5 .dt-info {
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  padding-top: 0.35rem;
}

div.dt-container.dt-bootstrap5 table.dataTable.table {
  margin-top: 0.65rem;
  border-color: var(--line-soft);
  font-size: var(--hub-fs);
}

div.dt-container.dt-bootstrap5 table.dataTable.table > :not(caption) > * > * {
  border-bottom-color: var(--line-soft);
  padding: var(--hub-cell-y) var(--hub-cell-x);
}

/* .btn-primary and .btn-outline-primary (D1: --blue-deep, full state set incl. disabled and
   focus) now live in brand/tokens.css's component block, the one place that also covers
   .btn-outline-secondary, form controls, checkboxes, dropdowns, pagination and .btn-close. */

/* Dashboard stat tiles (home). A grid, not a flex wrap: with flex the tiles that wrap onto a short
   last line stretch to fill it, so the lone TRM tile rendered as a full-width slab. auto-fill keeps
   the empty tracks, so an orphan tile stays exactly one column wide and the tiles stay on a shared
   rhythm at every width. */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* A card that opens what it counts. The lift is the app's standing signal for "clickable", so the
   TRM card — which counts nothing you can open — deliberately does not get it. */
a.stat-card.is-linked {
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

a.stat-card.is-linked:hover,
a.stat-card.is-linked:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--elev-1);
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 0.85rem 1rem;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: var(--radius-card);
  background: var(--paper);
  color: var(--muted);
  font-size: 1.15rem;
}

.stat-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.stat-label {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.stat-value {
  /* Responsive so a long money value (the TRM tile) shrinks with the tile instead of spilling past
     its card at narrow widths; still reads as one line at any size. A figure is never ellipsised, that would silently cut digits from a money value, so the card must be free to shrink
     (min-width: 0 above) rather than clip its content. */
  display: block;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  min-width: 0;
  /* A stat is one figure. Without this the TRM tile breaks at the space after "$" and reads as two
     lines of nonsense at narrow tile widths. */
  white-space: nowrap;
}

.hub-trm-provenance {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.hub-trm-provenance .quote-trm-status {
  margin-left: 0;
}

.hub-trm-validity {
  color: var(--muted);
  font-size: var(--hub-fs-xs);
  line-height: 1.3;
}

/*
 * "Ciclo comercial" + Urgente, side by side. Replaces the old "Cuánto tardamos" / "Los pasos" pair
 * of cards, which read the same rows keyed by stage and each drew its own self-scaled bar — a
 * five-day stage and a one-day stage both filled 60% of their own track and looked identical. One
 * shared-axis chart (hub-chart.js, data-hub-chart) now carries both.
 *
 * auto-fit + a wide minmax (not a fixed 2-column grid) is what stacks the two cards on narrow
 * screens without a breakpoint of its own — the same technique .stat-row already uses. Grid's own
 * default align-items: stretch is the whole equal-height mechanism: both cards become exactly as
 * tall as the row's tallest natural content, so the shorter one never has to be measured in JS.
 */
.hub-cycle-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hub-cycle-split > .panel {
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* Fills the card: flex-grow absorbs whatever height the grid's equal-height stretch adds past the
   chart's own natural content, so the legend below stays pinned to the card's bottom edge instead
   of floating in a gap. min-height is the floor before that stretch has anything to work with. */
.hub-chart-canvas {
  flex: 1 1 auto;
  min-height: 16rem;
  width: 100%;
}

.hub-chart-legend {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.9rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: var(--hub-fs-xs);
}

.hub-chart-legend-swatch {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: -1px;
}

.hub-chart-legend-swatch.is-ours { background: var(--hub-chart-ours); }
.hub-chart-legend-swatch.is-customer { background: var(--hub-chart-customer); }
.hub-chart-legend-swatch.is-watched { background: var(--hub-chart-watched); }
.hub-chart-legend-swatch.is-target { background: var(--hub-chart-tick); border-radius: 1px; width: 3px; }

/* The Urgente card: same flex-column contract as the chart card, so its own DataTables chrome
   (search → table → info/paging) stretches to the grid-equalised card height and the pagination
   row lands at the bottom rather than floating right under a short table. */
.hub-attention-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hub-attention-card .hub-tab-bar {
  flex: 0 0 auto;
}

.hub-attention-card .hub-table-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hub-attention-card div.dt-container.dt-bootstrap5 {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* The bottom info+pagination row is always the container's last child, whatever DataTables 2 names
   it internally — margin-top: auto pins it to the card's bottom edge regardless. */
.hub-attention-card div.dt-container.dt-bootstrap5 > *:last-child {
  margin-top: auto;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.badge {
  font-weight: 500;
  font-size: var(--hub-fs-xs);
  background: var(--navy-tint);
  color: var(--navy);
}

/* Muted helper text — always place inside a card (.panel), not bare on paper */
.empty-hint {
  margin: 0;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
  line-height: var(--hub-lh);
}

/*
 * White content cards on gray paper canvas.
 * Prefer .panel for forms/empty/audit blocks; .hub-table-panel for DataTables.
 */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 0.95rem 1.05rem;
  margin: 0 0 1rem;
  width: 100%;
  box-shadow: 0 1px 0 rgba(var(--shadow-deep-rgb), 0.03);
}

.panel-title {
  margin: 0 0 0.6rem;
  font-size: var(--hub-fs);
  font-weight: 600;
  color: var(--ink);
}

.panel-spaced {
  margin-bottom: 1.25rem;
}

/*
 * A card's header row: the title, any line under it, and the card's own actions (buttons, a
 * switch, a hint). Every card header with actions uses this one rule (PanelHeadContractTest).
 * The row owns the space below it, never the title: a header hand-built from Bootstrap's d-flex
 * took its bottom margin from the title, so once the buttons stood taller than the title nothing
 * separated them from what came next, and they sat on the border of the table card below
 * (the Agente tab on Usuarios, 2026-10-26).
 *
 * Markup: .panel-head > (.panel-title | .panel-head-text) + .panel-head-actions
 */
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

/* A card that is only its header (the Agente card) ends on the card's own padding. */
.panel-head:last-child {
  margin-bottom: 0;
}

.panel-head > .panel-title {
  margin: 0;
}

/* A title with lines under it (an email, a last-use time): it takes the room the actions leave. */
.panel-head-text {
  flex: 1 1 auto;
  min-width: 0;
}

.panel-head-text .panel-title {
  margin-bottom: 0.25rem;
}

.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.hub-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0;
}

.hub-kv dt {
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  font-weight: 500;
}

.hub-kv dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
}

/*
 * Question and answer, one pair per row. Use it wherever the label is a real sentence: a
 * questionnaire, a derived reading, anything a person wrote rather than a field name.
 *
 * The grids above (hub-meta-grid, hub-kv) fit as many columns as the width allows, which is right
 * for "Visitas" beside a number and wrong for "¿La etiqueta tiene que resistir algo en particular?".
 * At sentence length the label wraps, the columns reflow, and an answer ends up printed above a
 * question it does not belong to, which is what the diagnostic results page was doing.
 * This reads top to bottom, in the order the questions were answered.
 */
.hub-qa {
  margin: 0;
}

.hub-qa > div {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  gap: 0.3rem 2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.hub-qa > div:last-child {
  border-bottom: 0;
}

.hub-qa dt {
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  color: var(--muted);
}

.hub-qa dd {
  margin: 0;
  font-weight: 500;
}

/* The photographs are the answer, not a footnote to it: they take the full width. */
.hub-qa dd.diagnostic-result-photos {
  grid-column: 1 / -1;
}

@media (max-width: 62rem) {
  .hub-qa > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

/*
 * A settings screen is a fact sheet, not a form (HUB.md §15, "the design settled 2026-09-02").
 * Three columns per row: the setting's name (muted), the truth with an optional muted sentence
 * under it, and one quiet verb on the right that opens the smallest possible inline form. Reuses
 * .hub-qa's row rhythm and hairline separators, same idea, one more column.
 */
.mail-fact-sheet {
  margin: 0;
}

.mail-fact-row {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr) auto;
  gap: 0.35rem 1.5rem;
  align-items: start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.mail-fact-row:last-child {
  border-bottom: 0;
}

.mail-fact-label {
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  font-weight: 500;
  padding-top: 0.1rem;
}

.mail-fact-value {
  color: var(--ink);
  font-weight: 500;
}

.mail-fact-sub {
  display: block;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
  font-weight: 400;
  margin-top: 0.2rem;
}

.mail-fact-verb {
  text-align: right;
}

@media (max-width: 48rem) {
  .mail-fact-row {
    grid-template-columns: 1fr;
  }
  .mail-fact-verb {
    text-align: left;
  }
}

.hub-plain-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.hub-plain-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

/*
 * Base breathing room for every field, not only inside `.hub-form`: a field with no ancestor form
 * class (e.g. a bare `<form>` around a single textarea + submit button) got zero margin-bottom and
 * the button rendered flush against the input above it. One rule, everywhere; `.hub-form-inline`
 * and the panel-scoped variants below still override it where a tighter or wider rhythm is wanted.
 */
.field {
  margin-bottom: 0.8rem;
}

.hub-form label {
  display: block;
  font-size: var(--hub-fs-sm);
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-weight: 500;
}

.hub-form .optional {
  color: var(--muted);
  font-weight: 400;
}

/* Reassert the shared checkbox layout after the generic form-label rule above. */
.hub-form label.hub-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.45rem 0;
}

/* Text-like inputs only: checkboxes/radios keep their own sizing (.hub-check-input,
   .hub-seg) — otherwise this width:100%/pill rule stretches every checkbox into a
   full-width oval site-wide. */
.hub-form input:not([type="checkbox"]):not([type="radio"]),
.hub-form select,
.hub-form .form-control,
.hub-form .form-select {
  width: 100%;
  max-width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: var(--hub-fs);
  line-height: 1.4;
  background: var(--white);
  color: var(--ink);
}

/*
 * Bootstrap input-group needs flex children, not width:100% (else % suffix wraps).
 *
 * The :not() pair is not decoration, it is the whole point: the width:100% rule above carries an
 * element selector and two :not()s, so a plain `.hub-form .input-group > input` loses to it and the
 * suffix or button drops onto its own line. That is what put "Copiar" under the diagnostic link.
 */
.hub-form .input-group > .form-control,
.hub-form .input-group > .form-select,
.hub-form .input-group > input:not([type="checkbox"]):not([type="radio"]),
.hub-form .input-group > select {
  width: 1%;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
}
.hub-form .input-group > .input-group-text,
.hub-form .input-group > .btn {
  width: auto;
  max-width: none;
  flex: 0 0 auto;
}

.hub-form input:not([type="checkbox"]):not([type="radio"]):focus,
.hub-form select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
/* Wizard step footer: back on the left, reset in the middle, the way forward on the right. The
   empty slot keeps those positions steady on the first step, which has nowhere to go back to. */
.form-actions-wizard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
.form-actions-slot {
  flex: 0 0 auto;
}
/* Reset is a quiet escape hatch, not a third thing competing to be pressed. */
.form-actions-reset {
  color: var(--muted);
  text-decoration: none;
}
.form-actions-reset:hover {
  color: var(--ink);
  text-decoration: underline;
}

/*
 * ZONE 1 — "Informe de gestión". The eyebrow + today's date, the two count pairs (current and
 * previous 90-day window — never a percentage, workbench/HUB.md §2), and the by-kind row above the
 * existing year grid. The by-kind row reuses .hub-summary-* (opportunity-detail's Resumen row):
 * labels above values, hairline rhythm, no boxes.
 */
/* Office-status strip: whether the service clocks are running right now. A pause is not a failure,
   so it never uses the alarm colour; open is quiet, paused is a calm sage note that a consultant
   reads as "nothing is slipping while we are closed", not as an alert. */
.hub-office-status {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-card);
  margin-bottom: 0.9rem;
  font-size: var(--hub-fs-sm);
}

.hub-office-status > .ph {
  align-self: center;
  font-size: 1rem;
}

.hub-office-status.is-open {
  color: var(--muted);
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.hub-office-status.is-paused {
  color: var(--teal-deep);
  background: var(--green-tint);
  border: 1px solid var(--sage-soft);
}

.hub-office-status-headline {
  font-weight: 500;
}

.hub-office-status.is-open .hub-office-status-headline {
  font-weight: 400;
}

.hub-office-status-detail {
  color: var(--muted);
}

.hub-office-status.is-paused .hub-office-status-detail {
  color: var(--teal-mid);
}

@media (max-width: 991.98px) {

}

/*
 * The date half of a commitment/renewal row. hub-commitment-row itself (the date + what + owed
 * grid) and its Upcoming/Por-hacer siblings came out with Inicio's one-table rework (2026-08-30):
 * grep found no template still rendering them, only this date span survives, reused by the
 * renewal radar below.
 */
.hub-commitment-when {
  font-size: var(--hub-fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/*
 * The renewal radar (HUB.md §12) borrows the is-overdue/is-soon modifier idiom already
 * established on .kanban-card-due and .hub-espera-when, rather than a third pair of names for the
 * same two states.
 */
.hub-commitment-when.is-overdue {
  color: var(--bad-fg);
  font-weight: 600;
}

.hub-commitment-when.is-soon {
  color: var(--sem-warm);
  font-weight: 600;
}

/*
 * Radar row (renovaciones): contract, action. A grid so the two columns line up across rows.
 */
.hub-renewal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 767.98px) {
  .hub-renewal-row {
    grid-template-columns: 1fr;
  }
}

/* Section icon beside a page title: muted and slightly smaller than the text, so it identifies
   the record without competing with its name. */
.hub-page-title-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hub-page-title-icon > .ph {
  font-size: 0.8em;
  color: var(--muted);
  flex: none;
}

/* ── Opportunity detail: identity, actions, the two columns ── */

/*
 * The state chip. The state is the record's position, so its control sits in the subtitle where a
 * reader already looks for it, not as a form in the action bar.
 */
.hub-state-picker {
  position: relative;
  display: inline-block;
}

.hub-state-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 0.05rem 0.5rem;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.hub-state-chip:hover,
.hub-state-chip:focus-visible {
  border-color: var(--sem-color, var(--ink));
}

.hub-state-chip .ph {
  font-size: 0.85em;
  color: var(--muted);
}

.hub-state-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  left: 0;
  display: grid;
  min-width: 11rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--elev-1);
}

.hub-state-menu button {
  border: 0;
  background: none;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.hub-state-menu button:hover:not(:disabled) {
  background: var(--canvas);
}

.hub-state-menu button:disabled {
  color: var(--muted);
  cursor: default;
}

/*
 * A stage whose verdict is already recorded: still offered, because a mis-closed deal has to be
 * fixable, but marked so nobody changes one by reflex. Calm amber, never red — reopening is a
 * correction, not a destruction — and the word carries the meaning so the colour never has to.
 */
.hub-state-menu button.is-reopening {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.hub-state-menu-reopen {
  font-size: var(--hub-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warn-fg);
}

/* The title row: the record's name on the left, the one control that moves it on the right. It is
   the most consequential thing on the page, so it is sized like it rather than tucked into a
   subtitle. Wraps below the title on a narrow screen. */
.hub-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.hub-state-picker-label {
  font-size: var(--hub-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-right: 0.5rem;
}

.hub-state-picker-lg .hub-state-chip {
  padding: 0.3rem 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Right-aligned control, so the menu opens back under it rather than off the edge. */
.hub-state-picker-lg .hub-state-menu {
  left: auto;
  right: 0;
}

/* The macro heading. Not a button, because the macro is derived from whichever stage is picked. */
.hub-state-menu-group {
  margin: 0.5rem 0 0.15rem;
  padding: 0 0.6rem;
  font-size: var(--hub-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hub-state-menu-group:first-child {
  margin-top: 0.15rem;
}

/* A panel head's right-hand side: the "ver todas" link and the action that adds one. */
.hub-column-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Rare and destructive actions, one click away: they do not earn permanent width beside the two
   buttons pressed all day. */
.hub-overflow {
  position: relative;
}

.hub-overflow > summary {
  list-style: none;
  cursor: pointer;
}

.hub-overflow > summary::-webkit-details-marker {
  display: none;
}

.hub-overflow-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  right: 0;
  display: grid;
  min-width: 12rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--elev-1);
}

.hub-overflow-menu a,
.hub-overflow-menu button {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: none;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.hub-overflow-menu a:hover,
.hub-overflow-menu button:hover {
  background: var(--canvas);
}

.hub-overflow-menu button.is-danger {
  color: var(--bad-fg);
}

/* Resumen: what the opportunity *is*, in one row read left to right. Labels above values, hairline
   dividers between cells, no boxes — the row is a sentence, not five cards. */
.hub-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: flex-start;
}

.hub-summary-cell {
  display: grid;
  gap: 0.3rem;
}

.hub-summary-gauge {
  /* The gauge brings its own label and readout, so the cell only has to give it room. */
  min-width: 15rem;
}

.hub-summary-label {
  font-size: var(--hub-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hub-summary-value {
  font-weight: 500;
}

/*
 * La espera: a statement on the left, the one thing that can be resolved on the right.
 *
 * The one panel in the app that is not white. A deal in espera is stopped — nothing will move until
 * somebody delivers something — and rendering that as another white card among white cards said it
 * was ordinary. Pale amber and a warning glyph, which is the app's only anomaly treatment; red is
 * kept for destructive actions and would say "this is wrong" when waiting is often correct.
 */
.hub-espera {
  background: var(--sem-warm-tint);
  border-color: color-mix(in srgb, var(--sem-warm) 30%, transparent);
}

.hub-espera-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hub-espera-title .ph {
  color: var(--sem-warm);
  font-size: 1.1em;
}

.hub-espera {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hub-espera-when {
  margin-top: 0.35rem;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.hub-espera-when.is-overdue {
  color: var(--bad-fg);
}

.hub-espera-actions {
  flex: none;
}

/* The provenance line, above the actions: read once to trust the page, then ignored. */
.hub-last-move {
  margin: 0 0 0.75rem;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}

/*
 * A description is prose, so it gets prose measure rather than the full page width. Since V63
 * this holds the rendered HTML of a Markdown brief (MarkdownProse#toHtml), so it also carries the
 * typography for every element that Markdown can produce: headings, lists, a table, a quote, code.
 * The first/last child rule keeps the card's own padding as the only air above and below the text,
 * so a heading at the top of the brief does not add a second gap on top of the panel's.
 */
.hub-prose {
  max-width: 68ch;
  color: var(--body);
}

.hub-prose > :first-child {
  margin-top: 0;
}

.hub-prose > :last-child {
  margin-bottom: 0;
}

.hub-prose h1,
.hub-prose h2,
.hub-prose h3,
.hub-prose h4,
.hub-prose h5,
.hub-prose h6 {
  margin: 1.1rem 0 0.4rem;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
}

.hub-prose h1 {
  font-size: 1.05rem;
}

.hub-prose h2 {
  font-size: var(--hub-fs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hub-prose h3,
.hub-prose h4,
.hub-prose h5,
.hub-prose h6 {
  font-size: var(--hub-fs);
}

.hub-prose p {
  margin: 0 0 0.6rem;
}

.hub-prose ul,
.hub-prose ol {
  margin: 0 0 0.6rem;
  padding-left: 1.25rem;
}

.hub-prose li {
  margin: 0.2rem 0;
}

.hub-prose li > ul,
.hub-prose li > ol {
  margin: 0.2rem 0;
}

.hub-prose strong {
  color: var(--ink);
  font-weight: 600;
}

.hub-prose a {
  color: var(--blue);
  text-underline-offset: 2px;
}

.hub-prose blockquote {
  margin: 0 0 0.6rem;
  padding: 0.05rem 0 0.05rem 0.85rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.hub-prose code {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* A next-steps table is the one Markdown construct that outgrows prose measure on purpose: it
   gets the full card width, with the same airy, hairline-only rhythm as every other Hub table
   (.hub-table, .hub-datatable) rather than a browser default grid. */
.hub-prose table {
  width: 100%;
  max-width: none;
  margin: 0 0 0.75rem;
  border-collapse: collapse;
  font-size: var(--hub-fs-sm);
}

.hub-prose th,
.hub-prose td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.hub-prose thead th {
  color: var(--muted);
  font-size: var(--hub-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

/* One gestión in the summary: date, outcome, note, on one line. */
.hub-gestion-brief {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: var(--hub-fs-sm);
}

@media (max-width: 991.98px) {

}

.hub-column-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.hub-column-head a {
  font-size: var(--hub-fs-sm);
}

/* The .hub-entry* family lived here: one compromiso row, its head, meta, note, and late/due state
   pill. V27 replaced the compromiso with the espera, and no template has carried any of these
   classes since. Deleted 2026-08-04: a styled vocabulary for a retired model is how the next
   reader concludes the model is still supported. */

/*
 * The Markdown editor (EasyMDE, static/vendor/easymde) that edits a prose panel in place — the
 * opportunity's Descripción today, any future account brief later. It replaces the small edit
 * modal: full panel width, generous height, so a real note is written where it lives instead of
 * in a box built for a sentence.
 *
 * EasyMDE ships its own classes (.EasyMDEContainer, .editor-toolbar, .CodeMirror, …); this section
 * remaps them onto Hub's own tokens rather than inventing a parallel set, the same way the
 * DataTables override above styles `.dt-container` directly.
 */
.hub-markdown-editor-collapse {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.EasyMDEContainer .editor-toolbar {
  padding: 0.4rem 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: none;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.EasyMDEContainer .editor-toolbar button {
  height: 1.9rem;
  min-width: 1.9rem;
  border-radius: 6px;
  color: var(--body);
}

.EasyMDEContainer .editor-toolbar button.active,
.EasyMDEContainer .editor-toolbar button:hover {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.EasyMDEContainer .editor-toolbar i.separator {
  border-left-color: var(--line);
}

.EasyMDEContainer .CodeMirror {
  border: 1px solid var(--line);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-size: var(--hub-fs);
  color: var(--ink);
}

.EasyMDEContainer .CodeMirror-focused {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.EasyMDEContainer .editor-preview {
  background: var(--white);
}

/* ── Pipeline kanban (app-specific) ── */
/*
 * The board is sized for the column nobody planned for.
 *
 * It used to be a page-tall stack: every column shrink-wrapped its cards, so one column holding a
 * hundred deals made the whole document five thousand pixels tall and turned its five neighbours
 * into stubs beside an endless corridor. Measured at 1280x800 with twenty cards drawn in Decisión,
 * the page was 5210px and exactly one card sat above the fold.
 *
 * So the board owns a viewport-sized box and nothing outside it grows:
 *   .kanban-scroll  is that box, and scrolls sideways when there are more stages than fit
 *   .kanban-col     is a flex column, head pinned, body taking the rest
 *   .kanban-col-body scrolls on its own
 * A column with 150 cards is now exactly as tall as a column with none, its head (and the honest
 * total in it) never leaves the screen, and the last card is reachable by scrolling one lane
 * instead of the document.
 *
 * The height comes from pipeline-kanban.js, which measures where the board starts and writes
 * --kanban-fit-height. The fallback below keeps the board usable with no JavaScript at all.
 */
.kanban-scroll {
  /* Column geometry as tokens. The floor is the width at which a card stops being readable, and
     past it the board scrolls sideways rather than shrinking into confetti. 9.5rem is measured, not
     chosen: it is the widest floor at which today's six stages still all fit a 1280px laptop with
     no sideways scroll, which is the screen this board is opened on in a meeting. The card's height
     does not depend on it — every line is clamped — so a narrower column costs ellipsis, never
     rows. */
  --kanban-col-min: 9.5rem;
  --kanban-gap: 0.65rem;
  --kanban-card-pad: 0.4rem 0.5rem;
  overflow: auto;
  height: var(--kanban-fit-height, 34rem);
  -webkit-overflow-scrolling: touch;
  margin-inline: -0.15rem;
  padding-inline: 0.15rem;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

/* One column per stage, all of them on screen while they fit. The count is data
   (hub.opportunity_stage decides which stages draw a column), so the grid cannot name it:
   auto-flow column with equal fractions fits whatever the table holds. */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(var(--kanban-col-min), 1fr);
  gap: var(--kanban-gap);
  align-items: stretch;
  height: 100%;
}

.kanban-scroll .kanban {
  /* No floor: the grid already refuses to shrink a column below --kanban-col-min, and a fixed
     minimum here forced a scrollbar on a board that fitted. */
  min-width: 100%;
}

/*
 * No fill and no border. The lanes read as columns of white cards on the gray canvas, which is the
 * house rule (whitespace and hairlines, not boxes) and also what makes the drop highlight legible:
 * against a permanently tinted, permanently outlined column it was one more box among boxes.
 */
.kanban-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0 0.15rem 0.45rem;
  flex: 0 0 auto;
}

.kanban-col-head h2 {
  margin: 0;
  font-size: var(--hub-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The count is a link into the registry for this state, so a column can be capped without hiding
   anything. It reads as a badge until hovered, when it admits it is a way across. */
.kanban-count {
  font-size: var(--hub-fs-xs);
  background: var(--white);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  color: var(--ink);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.kanban-count:hover,
.kanban-count:focus-visible {
  color: var(--ink);
  border-color: var(--line);
}

/* Pinned above the scrolling body on purpose: it states how much of the column you are looking at,
   which is not a fact to discover after scrolling past twenty cards. */
.kanban-truncated {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  margin: 0 0 0.4rem;
  padding: 0 0.15rem;
  flex: 0 0 auto;
}

.kanban-truncated a {
  color: var(--blue);
}

/*
 * The one scrolling surface per lane. The explicit `min-height` is what actually lets it scroll: a
 * flex item defaults to `min-height: auto`, which refuses to shrink below its content, so the lane
 * would grow to fit 150 cards and push the board open again — the bug this layout exists to remove.
 * Any explicit value overrides `auto`; 4rem is just a floor so an empty lane still reads as a lane.
 */
.kanban-col-body {
  flex: 1 1 auto;
  min-height: 4rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 0.15rem;
  border-radius: 10px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.kanban-col.is-drop-target .kanban-col-body {
  background: color-mix(in srgb, var(--blue-deep) 8%, var(--white));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue-deep) 35%, var(--line));
}

/*
 * Two rows and a bounded height. The card used to measure 197px because nothing in it was bounded:
 * a name wrapped to four lines, "TRACKVY · ADQUISICION" wrapped to three more, and the countdown
 * took two. Every line is clamped or ellipsed now, so a card cannot surprise the column it sits in,
 * and the height is a design decision rather than a consequence of the longest name in the database.
 */
.kanban-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: var(--kanban-card-pad, 0.4rem 0.5rem);
  margin-bottom: 0.35rem;
  cursor: grab;
  user-select: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

/* A hover lift is this app's standing signal for "clickable", and a card is: it opens the
   opportunity. Shadow only, never a transform — the card is also a drag source, and lifting it
   under the cursor at the moment a drag starts reads as the drag having gone wrong. */
.kanban-card:hover,
.kanban-card:focus-within {
  border-color: var(--line);
  box-shadow: var(--elev-1);
}

@media (prefers-reduced-motion: reduce) {
  .kanban-card {
    transition: none;
  }
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.is-dragging {
  opacity: 0.55;
}

/* Row 1: what it is, and how warm it is. */
.kanban-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  min-width: 0;
}

.kanban-card-name {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-weight: 600;
  font-size: var(--hub-fs-sm);
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
}

/* The clamp lives on the inner span, never on the anchor: `overflow: hidden` on the anchor would
   clip ::after, the overlay that makes the whole card open the opportunity, down to the width of
   the words. The card would look right and only the text would be clickable. */
.kanban-card-name > span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.kanban-card-name::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kanban-card-name:hover {
  color: var(--navy);
}

.kanban-card-name:focus-visible::after {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* The compact temperature chip is sized for this row. 1.75rem set the height of every card whose
   name fitted on one line, which is most of them. */
.kanban-card .sem-badge-compact {
  width: 1.15rem;
  height: 1.15rem;
}

.kanban-card .sem-badge-compact i {
  font-size: 0.95rem;
}

/*
 * Row 2: whose it is, and the one clock that matters, with the console trigger at the end. The
 * company gives up width first (it is the item a reader can also see in the column they are
 * scanning); the clock never truncates, because a half-printed date is worse than none.
 */
.kanban-card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0.35rem;
  margin: 0;
  min-width: 0;
  font-size: var(--hub-fs-xs);
  line-height: 1.35;
  color: var(--muted);
}

.kanban-card-company {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--hub-fs-xs);
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 500;
}

.kanban-card-company:hover {
  color: var(--navy);
  text-decoration: underline;
}

.kanban-card-countdown {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

/* The sub-state, in the countdown's place. Muted and small: it is the absence of a reminder, not
   an alarm, and the card is still in its column because its state has not changed. */
/* A promise owed today or earlier, in the countdown's place. Inked rather than muted: unlike the
   forecast it replaces, this one is a fact about something somebody agreed to. */
/*
 * A commitment, coloured by how close it is. It used to be red the moment a date existed, which
 * made a promise for next month look like an emergency and taught everyone that red on this card
 * means nothing. Red is now reserved for a date that has passed.
 */
.kanban-card-due {
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  font-weight: 500;
}

.kanban-card-due.is-soon {
  color: var(--sem-warm);
  font-weight: 600;
}

.kanban-card-due.is-overdue {
  color: var(--sem-hot);
  font-weight: 600;
}

.kanban-card-substate {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  gap: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

.kanban-card-substate .ph {
  font-size: 0.95em;
}

/* The console triggers stay quiet until the card is engaged with: a board of cards each shouting
   two icons is noisier than the information on the cards themselves. */
/* Above .kanban-card-name::after, which is a stretched link covering the whole card. Without this
   the overlay sits on top of the buttons and every click on them opens the opportunity instead, and a scripted .click() still works, so it passes a JS check and fails a real one. */
.hub-registro-triggers {
  position: relative;
  z-index: 2;
  display: inline-flex;
  gap: 0.15rem;
  margin-left: auto;
}

/* Same reason: the company link is a real link and must beat the card-wide overlay. */
.kanban-card-company {
  position: relative;
  z-index: 2;
}

/* Sized to the card's dense second line rather than to a toolbar. At the shared 2rem the trigger
   alone set the height of that row, so every card in the board paid 32px for a button that is
   invisible until the card is hovered. */
.kanban-card .hub-icon-btn {
  width: 1.4rem;
  height: 1.4rem;
  font-size: 1rem;
  border-radius: 6px;
}

.kanban-card .hub-registro-triggers {
  opacity: 0;
  transition: opacity 120ms ease;
  /* The shared rule pushes the trigger to the far right of its row. On the card's first row it
     belongs beside the temperature chip, not with a gap punched between them. */
  margin-left: 0;
  flex: 0 0 auto;
}

.kanban-card:hover .hub-registro-triggers,
.kanban-card:focus-within .hub-registro-triggers {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .kanban-card .hub-registro-triggers {
    transition: none;
  }
}

/* Coarse pointers have no hover, so the triggers are always visible there. */
@media (hover: none) {
  .kanban-card .hub-registro-triggers {
    opacity: 1;
  }
}

/* Perdido has no column. This target appears only while a card is in flight (is-armed), so the
   board never carries a standing invitation to lose a deal.

   Fixed to the viewport rather than placed after the columns: as a block at the bottom of the board
   it sat below the fold, so a consultant mid-drag could neither see it nor reach it. */
.kanban-discard {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 0.75rem);
  z-index: var(--z-offcanvas);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--elev-1);
  color: var(--muted);
  font-size: var(--hub-fs-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease, transform 120ms ease;
}

.kanban-discard.is-armed {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.kanban-discard.is-drop-target {
  border-style: solid;
  border-color: var(--bad-fg);
  color: var(--bad-fg);
}

@media (prefers-reduced-motion: reduce) {
  .kanban-discard {
    transition: none;
  }
}

.kanban-empty {
  margin: 0.5rem;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .kanban-col-body {
    transition: none;
  }
}

/*
 * Kanban card semáforo: a subtle left-edge accent on a white card plus the pastel compact badge.
 * GANADO/PERDIDO cards get neither class, since a closed deal has no semáforo.
 *
 * Drawn as ::before rather than an inset box-shadow so the card's one box-shadow slot stays free
 * for elevation: as a shadow, the hover lift and the temperature were the same property and the
 * one that won erased the other.
 */
.kanban-card.sem-hot,
.kanban-card.sem-cold,
.kanban-card.sem-frozen {
  background: var(--white);
}

.kanban-card.sem-hot::before,
.kanban-card.sem-cold::before,
.kanban-card.sem-frozen::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: color-mix(in srgb, var(--sem-color) 72%, var(--white));
}

/*
 * Opportunity temperature gauge — fragments/semaforo.html :: gauge. A calm five-step ladder
 * (Caliente → Glaciar); the active step lights up, the rest stay muted paper-gray.
 */
.sem-gauge {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sem-gauge-ladder {
  position: relative;
  display: flex;
  gap: 0.3rem;
  padding-top: 0.6rem;
}

.sem-gauge-step {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--paper);
  color: var(--line);
  opacity: 0.6;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.sem-gauge-step i {
  font-size: 1.5rem;
  line-height: 1;
  /* Only the Phosphor Regular weight is vendored (no Bold font file), so a thicker stroke stands
     in for a true bold glyph. Drop this if it ever looks rough at a given size. */
  -webkit-text-stroke: 0.4px currentColor;
  text-stroke: 0.4px currentColor;
}

.sem-gauge-step.is-active {
  opacity: 1;
  background: var(--sem-tint);
  color: var(--sem-color);
}

.sem-gauge-readout {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sem-gauge-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  font-weight: 600;
  font-size: var(--hub-fs);
  color: var(--sem-color);
}

.sem-gauge-label i {
  font-size: 1.125rem;
  line-height: 1;
  -webkit-text-stroke: 0.4px currentColor;
  text-stroke: 0.4px currentColor;
}

.sem-gauge-days {
  margin: 0;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}

@media (prefers-reduced-motion: reduce) {
  .sem-gauge-step {
    transition: none;
  }
}

/* ── Breakpoints (desktop-first; best-effort menus & chrome) ── */
@media (max-width: 1199.98px) {
  .hub-main {
    padding: 1.1rem 1.15rem 1.75rem;
  }
}

@media (max-width: 991.98px) {
  /* Sidebar is display:none via Bootstrap d-lg-*; shell is single column */
  .hub-main {
    padding: 1rem 1rem 1.5rem;
  }

  .page-header h1 {
    font-size: 1.15rem;
  }
}

@media (max-width: 767.98px) {

  .hub-main {
    padding: 0.85rem 0.85rem 1.5rem;
  }

  .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-row > .btn {
    width: 100%;
    justify-content: center;
  }

  .hub-detail-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-detail-toolbar-end {
    margin-left: 0;
    width: 100%;
  }

  .hub-detail-toolbar .btn {
    justify-content: center;
  }

  .hub-detail-toolbar-end .btn {
    flex: 1 1 auto;
  }

  .action-row {
    width: 100%;
  }

  .action-row .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions .btn {
    flex: 1 1 auto;
  }

  /* .hub-form-inline is flex + flex-wrap, not grid (see the canonical rule): each field already
     wraps to its own full-width line on a narrow viewport via its own flex-basis, so nothing here
     needs to force it. */

  /* Below the sidebar breakpoint the board keeps its readable column floor and scrolls sideways;
     the grid's own minmax already guarantees that, so this only stops a two-column board from
     stretching two lanes across a phone. */
  .kanban-scroll .kanban {
    min-width: 52rem;
  }
}

@media (max-width: 575.98px) {
  .stat-row {
    gap: 0.5rem;
  }

  .hub-table th,
  .hub-table td {
    padding: 0.45rem 0.55rem;
    font-size: var(--hub-fs-sm);
  }

  div.dt-container.dt-bootstrap5 table.dataTable.table > :not(caption) > * > * {
    padding: 0.45rem 0.55rem;
  }
}

/* Status, elevation, semáforo and every other Hub colour literal now live in
   brand/tokens.css, the one file allowed to hold one (loaded before this file). */

/* ── Quote draft wizard (Web Flow + HTMX) ─────────────────────────────────── */
/*
 * Connected stepper rail: each step is its own POST <form> (real navigation
 * target) and also owns half of the connector line on each side, so two
 * adjoining halves always resolve to the same color — no two-tone seams.
 * States (done / current / ahead) are computed in the template from
 * s.order() vs step.order() and applied as a class on the form.
 */
.quote-wizard-nav {
  display: flex;
  align-items: flex-start;
  margin: 0 0 1.25rem;
  padding: 0.4rem 0.4rem 0;
}
.quote-wizard-pill-form {
  flex: 1 1 0;
  position: relative;
  margin: 0;
  padding-top: 0.35rem;
}
.quote-wizard-pill-form::before,
.quote-wizard-pill-form::after {
  content: "";
  position: absolute;
  top: calc(0.35rem + 14px);
  height: 2px;
  background: var(--line);
}
.quote-wizard-pill-form::before { left: 0; right: 50%; }
.quote-wizard-pill-form::after { left: 50%; right: 0; }
.quote-wizard-pill-form:first-child::before,
.quote-wizard-pill-form:last-child::after {
  display: none;
}
.quote-wizard-pill-form.is-done::before,
.quote-wizard-pill-form.is-done::after {
  background: var(--blue);
}
.quote-wizard-pill-form.is-current::before {
  background: var(--blue);
}
.quote-wizard-pill {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.42rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.quote-wizard-pill:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 8px;
}
.quote-wizard-body.panel {
  margin-bottom: 0;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: var(--elev-1);
}
.quote-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
/*
 * Step dot: number by default, swaps to a check icon once done. The "ahead"
 * state is the unstyled baseline (white dot, muted number/label); done and
 * current below are the only states that need explicit overrides.
 */
.quote-wizard-step-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--line);
  color: var(--muted);
  font-size: var(--hub-fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.quote-wizard-step-dot .ph {
  font-size: 0.8rem;
}
.quote-wizard-pill:hover .quote-wizard-step-dot {
  border-color: var(--blue);
}
.quote-wizard-pill-form.is-done .quote-wizard-step-dot {
  background: var(--navy-tint);
  border-color: var(--blue);
  color: var(--blue);
}
.quote-wizard-pill-form.is-current .quote-wizard-step-dot {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  /* Ring at --blue (73,141,190) 18% alpha; no rgb-triplet token exists for it. */
  box-shadow: 0 0 0 4px rgba(var(--blue-rgb), 0.18);
}
.quote-wizard-pill-label {
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  font-weight: 500;
  text-align: center;
}
.quote-wizard-pill-form.is-current .quote-wizard-pill-label {
  color: var(--ink);
  font-weight: 700;
}
.quote-wizard-pill-chip {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--line-soft);
  color: var(--muted);
}
.quote-wizard-pill-chip.is-ready { background: var(--ok-bg); color: var(--ok-fg); }
.quote-wizard-pill-chip.is-incomplete { background: var(--warn-bg); color: var(--warn-fg); }
.quote-wizard-pill-chip.is-na { background: var(--line-soft); color: var(--muted); }
.quote-wizard-pill-chip.is-blocked { background: var(--bad-bg); color: var(--bad-fg); }

.quote-money-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  align-items: baseline;
  margin-bottom: 1rem;
}
.quote-money-strip.panel {
  box-shadow: var(--elev-1);
}
.quote-money-label {
  display: block;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quote-money-value { font-weight: 600; color: var(--ink); }
/* Under the total on a quote with options and no base: says where the value is. */
.quote-money-note { display: block; font-size: var(--hub-fs-xs); color: var(--muted); }
/* Subtotal / IVA / Total read at one equal size; Total is distinguished by
   navy color + weight only, never by size. */
.quote-money-total .quote-money-value { color: var(--navy); font-weight: 700; }
/* TRM reference stat: smaller and muted, deliberately not part of the three
   equal-size money values above. */
.quote-money-trm .quote-money-value {
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  color: var(--muted);
}
/* The control that fixes the quote's TRM: closed by default, one row of field and buttons. */
.quote-trm-fix summary { cursor: pointer; font-size: var(--hub-fs-xs); color: var(--muted); }
.quote-trm-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.quote-trm-form .form-control { width: 8rem; }
/* Single readiness verdict pill, appended at the end of the strip. */
.quote-verdict {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: center;
  margin-left: auto;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.quote-verdict .ph {
  font-size: 1rem;
}
.quote-verdict.is-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.quote-verdict.is-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.quote-verdict.is-bad { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-line); }

.quote-group-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.quote-kit-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.quote-kit-quantity-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.quote-kit-quantity-form label {
  margin: 0;
  color: var(--muted);
  font-size: var(--hub-fs-xs);
  font-weight: 600;
}
.quote-kit-quantity-form .form-control { width: 4.25rem; }
.quote-kit-note {
  margin: -0.25rem 0 0.7rem;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}
.quote-doc-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  font-size: var(--hub-fs-sm);
}
.quote-doc-check.is-ok { color: var(--ok-fg); background: var(--ok-bg); border-color: var(--ok-line); }
.quote-doc-check.is-off { color: var(--bad-fg); background: var(--bad-bg); border-color: var(--bad-line); }
/* TRM provenance chip (LIVE / STALE / FALLBACK) on draft wizard masthead */
.quote-trm-status {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 4px;
  vertical-align: middle;
}
.quote-trm-status.is-live { background: var(--ok-bg); color: var(--ok-fg); }
.quote-trm-status.is-stale { background: var(--warn-bg); color: var(--warn-fg); }
.quote-trm-status.is-fallback { background: var(--bad-bg); color: var(--bad-fg); }
.cot-dot { margin: 0 0.25rem; color: var(--muted); }

/* ── Company create (one screen) ─ */
.company-create-panel {
  max-width: 40rem;
}
/* Spreadsheet plantilla / export / import (master data) */
.spreadsheet-io-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.9rem;
}
.spreadsheet-io-bar-label {
  margin: 0;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.spreadsheet-io {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
}
.spreadsheet-io-switcher {
  align-items: center;
}
.spreadsheet-io-resource-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.spreadsheet-io-resource-label {
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  color: var(--ink);
}
.spreadsheet-io-resource-select {
  width: auto;
  min-width: 9.5rem;
}
.spreadsheet-io-import {
  position: relative;
}
.spreadsheet-io-import > summary {
  list-style: none;
  cursor: pointer;
}
.spreadsheet-io-import > summary::-webkit-details-marker {
  display: none;
}
.spreadsheet-io-form {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 18rem;
  padding: 0.85rem 1rem;
  box-shadow: var(--elev-1);
}
.spreadsheet-io-help {
  position: relative;
}
.spreadsheet-io-help > summary {
  list-style: none;
  cursor: pointer;
}
.spreadsheet-io-help > summary::-webkit-details-marker {
  display: none;
}
.spreadsheet-io-help-body {
  flex-basis: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
}
.spreadsheet-io-help-rules {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  font-size: var(--hub-fs-sm);
}
.spreadsheet-io-errors {
  margin-bottom: 1rem;
}
.spreadsheet-io-error-list {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  font-size: var(--hub-fs-sm);
}
.spreadsheet-io-error-list li {
  margin-bottom: 0.25rem;
}

@media (max-width: 575.98px) {
  .spreadsheet-io-switcher {
    align-items: stretch;
  }
  .spreadsheet-io-resource-field {
    width: 100%;
  }
  .spreadsheet-io-resource-select {
    flex: 1 1 auto;
  }
}
.hub-admin-access-form {
  max-width: 66rem;
}
.hub-admin-access-panel {
  max-width: none;
}
.hub-admin-identities-table {
  max-width: 100%;
}
.hub-admin-meta {
  padding: 0.65rem 0.75rem;
  background: var(--paper);
  border-radius: 0.35rem;
}
.panel-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* ── RUES (company form + registry card) ───────────────────────────────── */
.rues-nit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.rues-nit-row .form-control { flex: 1 1 12rem; min-width: 10rem; }
.rues-dv-label {
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rues-dv-value {
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 1.25rem;
  text-align: center;
}
/* The client-side lookup widget (rues-lookup.js / fragments/rues-lookup.html): a button plus an
   inline status line, never a separate indicator element — the status text itself says
   "Consultando…" while the request is in flight. */
.rues-lookup {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.rues-lookup-status {
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}
.rues-box {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 0.65rem;
  font-size: var(--hub-fs-sm);
}
.info-box.rues-box {
  background: var(--navy-tint);
  color: var(--ink);
}
.warning-box.rues-box {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-line);
}
.rues-box .box-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: 0.1rem; }
.rues-box .box-title { font-weight: 600; margin-bottom: 0.25rem; }
.rues-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--white);
  margin-bottom: 0.65rem;
}
.rues-card .meta-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.5rem;
  font-size: var(--hub-fs-sm);
}
.rues-card .field-label {
  color: var(--muted);
  font-weight: 500;
}
/* ── Shared typeahead (company / catalog party) ───────────────────────────── */
.hub-typeahead {
  position: relative;
}
.hub-typeahead-menu {
  position: absolute;
  /* Was 40: any ancestor with its own stacking context or overflow clipped or covered the menu.
     A dropdown-level z-index keeps it above ordinary page content and inside modals alike. */
  z-index: var(--z-dropdown);
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 16rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(var(--shadow-slate-rgb), 0.1);
}
.hub-typeahead-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.hub-typeahead-opt:hover,
.hub-typeahead-opt.is-active {
  background: var(--navy-tint);
}
.hub-typeahead-opt-label {
  font-weight: 500;
}
.hub-typeahead-opt-meta {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}
.hub-typeahead-empty {
  margin: 0;
  padding: 0.55rem 0.75rem;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}
/* Empty-state "Crear «nombre»" affordance (companyCreatable only — opt-in per usage) and the
   inline create panel it reveals. */
.hub-typeahead-create {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.hub-typeahead-create:hover {
  background: var(--navy-tint);
}
.hub-company-create {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--white);
}
.hub-company-create-lead {
  margin: 0 0 0.65rem;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}
.hub-company-create .field:last-of-type {
  margin-bottom: 0;
}

/* ── Consultant quote wizard bodies ───────────────────────────────────────── */
.quote-step-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-sans);
}
.quote-step-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
  max-width: 42rem;
  line-height: 1.5;
}
.quote-section-label {
  margin: 1.25rem 0 0.65rem;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-section-label:first-child { margin-top: 0; }
.quote-empty {
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}

/* Segmented control (zero-JS): styled radios for two/three exclusive choices. */
.hub-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--line-soft);
  border-radius: 11px;
}
.hub-seg label { margin: 0; cursor: pointer; }
.hub-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hub-seg span {
  display: block;
  padding: 0.34rem 0.85rem;
  border-radius: 8px;
  font-size: var(--hub-fs-sm);
  color: var(--body);
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
.hub-seg input:checked + span {
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(var(--shadow-deep-rgb), 0.06);
}
.hub-seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Segmented control, multi-select variant: same pill track/tokens as .hub-seg, but each
   option is an independent checkbox so more than one can be active at once. */
.hub-seg-multi {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  gap: 2px;
  background: var(--line-soft);
  border-radius: 11px;
}
.hub-seg-multi label { margin: 0; cursor: pointer; }
.hub-seg-multi input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hub-seg-multi span {
  display: block;
  padding: 0.34rem 0.85rem;
  border-radius: 8px;
  font-size: var(--hub-fs-sm);
  color: var(--body);
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
.hub-seg-multi input:checked + span {
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(var(--shadow-deep-rgb), 0.06);
}
.hub-seg-multi input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Bound-company card at the top of Encabezado. */
.quote-company-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--paper);
}
.quote-company-card .qc-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--navy-tint);
  color: var(--navy);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.quote-company-card .qc-ico .ph { font-size: 1.2rem; }
.quote-company-card .qc-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.quote-company-card .qc-label {
  font-size: var(--hub-fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-company-card .qc-name { font-size: 1rem; font-weight: 600; color: var(--ink); }
.quote-company-card .qc-meta {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.quote-company-card .qc-meta .sep { color: var(--line); }
.quote-company-card .qc-actions { margin-left: auto; }

/* Header step: two columns (encuadre | condiciones) */
.quote-header-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  margin-bottom: 0.25rem;
}
@media (max-width: 900px) {
  .quote-header-grid { grid-template-columns: 1fr; }
}
.quote-header-panel {
  margin: 0;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper);
}
.quote-header-panel-title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}
.quote-header-panel .field { margin-bottom: 0.9rem; }
.quote-header-panel .field:last-child { margin-bottom: 0; }
.quote-delivery-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
}
.quote-delivery-range .form-control {
  width: 5.5rem;
  max-width: 5.5rem;
  flex: 0 0 auto;
}
.quote-delivery-sep {
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}
.quote-delivery-unit {
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}
.quote-milestones-block {
  margin-top: 1.25rem;
  padding-top: 0.15rem;
}
.quote-milestone-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.quote-milestone-row {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
}
.quote-milestone-row .hub-percent-input {
  max-width: none;
  width: 100%;
}
.quote-ms-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.quote-ms-head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}
.quote-ms-sum {
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  color: var(--muted);
}
.quote-ms-sum.is-ok { color: var(--ok-fg); }
.quote-ms-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.quote-ms-del:hover { color: var(--bad-fg); background: var(--bad-bg); }
.quote-ms-add {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--blue-deep);
  font: inherit;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  cursor: pointer;
}
.quote-ms-add:hover { border-color: var(--blue-soft); }


/* Revisión: read-only content preview (grouped lines + totals + forma de pago + condiciones). */
.quote-review-group-title {
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  color: var(--ink);
  margin: 1rem 0 0.4rem;
}
.quote-review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  margin-top: 1.25rem;
}
.quote-review-block { flex: 1 1 12rem; min-width: 0; }
.quote-review-total { font-weight: 600; color: var(--navy); }
.quote-review-notes {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
  white-space: pre-line;
}

.quote-chip {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: var(--navy-tint);
  color: var(--navy);
}
/*
 * A chip standing beside buttons rather than inside a table cell.
 *
 * .quote-chip is sized for a dense row, where 10px uppercase is right. Dropped into a page header
 * next to full-height buttons it reads as a leftover fragment: too small to be a peer, too dark to
 * ignore. This keeps the same colour and case and gives it the buttons' own height and padding.
 */
.page-header-actions .quote-chip,
.action-row .quote-chip {
  align-self: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.quote-chip-muted {
  background: var(--line-soft);
  color: var(--muted);
}
.quote-chip-warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.quote-chip-ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

/* Quote choices (opciones): one block per choice, its alternatives reuse .quote-group-block. */
.quote-choice-block {
  margin: 1.5rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}
.quote-choice-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.quote-choice-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

/* The option's difference note: one paragraph under the heading, as the PDF prints it. */
.quote-choice-difference {
  max-width: 48rem;
  margin: 0.5rem 0 1rem;
}
.quote-choice-difference-label {
  margin-bottom: 0.25rem;
  font-size: var(--hub-fs-sm);
}
.quote-choice-difference-foot {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.quote-choice-difference-foot .form-text { margin: 0.25rem 0 0; }
.quote-choice-difference.is-saved .quote-row-saved { opacity: 1; transition-duration: 0.1s; }
.quote-choice-difference-text {
  margin: 0.5rem 0 1rem;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}

/*
 * The quote board: Base, then each option as a group of alternative cards. Every card prints the
 * same table; only the header differs (eyebrow, title, section total). Drag and drop is driven by
 * quote-board.js, which toggles .is-dragging and .is-drop-over.
 */
.quote-group-heading {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.quote-group-heading .eyebrow { margin: 0; }
.quote-group-total {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-left: auto;
  font-size: var(--hub-fs-sm);
  color: var(--ink);
}
.quote-group-total-note {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}
.quote-empty-note,
.quote-empty-warning {
  margin: 0 0 0.65rem;
  font-size: var(--hub-fs-sm);
}
.quote-empty-note { color: var(--muted); }
.quote-empty-warning { color: var(--warn-fg); }

.quote-handle-cell { width: 1.75rem; padding-right: 0; }
.quote-handle {
  display: inline-flex;
  color: var(--muted);
  cursor: grab;
}
.quote-handle:hover { color: var(--ink); }
.quote-lines-table tr.is-dragging,
.quote-group-block.is-dragging { opacity: 0.45; }

.quote-drop {
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.quote-drop.is-drop-over,
.quote-drop-strip.is-drop-over {
  background: color-mix(in srgb, var(--blue-deep) 8%, var(--white));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue-deep) 35%, var(--line));
}

/*
 * The board's drop strips: zero height and invisible at rest, so a board with no line in flight
 * shows only the cards, none of "Soltar aquí...". quote-board.js adds .is-dragging-line to the
 * panel on a line's dragstart and removes it on dragend/drop/cancel (delegated on document, so a
 * mid-drag panel swap cannot leave it stuck open); every strip then opens together as a thin
 * dashed target. No motion under reduced-motion: the strips just appear.
 */
.quote-drop-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 0;
  margin: 0;
  padding: 0 1rem;
  overflow: hidden;
  border: 1px dashed transparent;
  border-radius: 10px;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  text-align: center;
  opacity: 0;
  transition: max-height 0.2s ease, opacity 0.2s ease, margin 0.2s ease, padding 0.2s ease;
}
.quote-board.is-dragging-line .quote-drop-strip {
  max-height: 2.5rem;
  margin: 0.5rem 0;
  padding: 0.6rem 1rem;
  border-color: var(--line);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .quote-drop-strip { transition: none; }
}

/* The board's foot: the small "Nueva opción" button and the hint on the same line, wrapping on a
   narrow card instead of the button sitting under text that overlaps it. */
.quote-board-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 1.5rem;
}
.quote-board-foot .quote-board-hint { margin: 0; }

/*
 * The editable board's table and its controls. Fixed layout: the description column takes the
 * spare width, so a row never scrolls sideways at 1280px. Fields read as text until hovered or
 * focused (a hairline appears), which keeps a table of inputs from looking like a form.
 */
.quote-lines-editable { table-layout: fixed; width: 100%; }
.quote-col-handle { width: 1.75rem; }
.quote-col-seq { width: 2rem; }
.quote-col-sku { width: 7.5rem; }
.quote-col-qty { width: 5.5rem; }
.quote-col-money { width: 8rem; }
.quote-col-pct { width: 4.75rem; }
.quote-col-actions { width: 5.5rem; }
/* A laptop with the main menu open leaves the card about 800px wide: the fixed columns would take
   all of it and squeeze the description to a few characters. Tighten the numeric columns first so
   the description keeps room to read. */
.quote-drop { container-type: inline-size; }
@container (max-width: 62rem) {
  .quote-col-seq { width: 1.5rem; }
  .quote-col-sku { width: 5.75rem; }
  .quote-col-qty { width: 4.5rem; }
  .quote-col-money { width: 6.5rem; }
  .quote-col-pct { width: 4rem; }
  .quote-col-actions { width: 5.25rem; }
}
.quote-lines-editable td { vertical-align: top; }
.quote-sku-cell { overflow: hidden; }
.quote-sku,
.quote-line-id { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-sku { font-size: var(--hub-fs-sm); color: var(--ink); }
.quote-line-id { max-width: 100%; font-size: 0.625rem; }
.quote-cell-input {
  border-color: transparent;
  background: transparent;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.quote-cell-input:hover { border-color: var(--line); }
.quote-cell-input:focus { border-color: var(--blue); background: var(--white); }
.quote-cell-note {
  display: block;
  padding-right: 0.35rem;
  text-align: right;
  font-size: 0.625rem;
  color: var(--muted);
}
.quote-line-total { padding-top: 0.6rem; }
.quote-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0.35rem;
  margin-top: 0.15rem;
}
.quote-chip-form { display: inline-block; margin: 0; }

/* Line groups (workbench/HUB.md §10, §21): the Grupo select is a chip that is a native select, the
   header row tints the rows it heads, and a member sits indented under it. */
.quote-chip-select {
  max-width: 11rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--white);
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  text-overflow: ellipsis;
  cursor: pointer;
}
.quote-chip-select:hover { border-color: var(--blue); }
.quote-new-group { margin-left: auto; }
.quote-new-group + .quote-group-total { margin-left: 0.75rem; }
.quote-new-group > summary { list-style: none; cursor: pointer; }
.quote-new-group > summary::-webkit-details-marker { display: none; }
.quote-group-drop-cell {
  padding: 0.7rem 1rem;
  text-align: center;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}
.quote-group-name-form { display: flex; align-items: center; gap: 0.25rem; padding: 0.4rem; }
.quote-group-name-form input[name="title"] { width: 11rem; }
.quote-line-group-row > td {
  background: color-mix(in srgb, var(--blue) 6%, var(--white));
  vertical-align: middle;
}
.quote-line-group-row.is-drop-over > td {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue-deep) 35%, var(--line));
}
.quote-line-group-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.quote-line-group-name { font-weight: 600; }
.quote-line-group-actions { white-space: nowrap; }
.quote-line-group-actions > * { vertical-align: middle; }
.quote-line-grouped > td.quote-line-cell { padding-left: 1.1rem; }
.quote-row-actions { white-space: nowrap; text-align: end; }
/* Armed, the trash reads "Confirmar" and needs the room of both icons: the move button steps aside
   and the trash, anchored at the cell's right edge, widens leftward over the space it left. The
   cell is sized for that (.quote-col-actions), so the red button never leaves its own row. */
.quote-row-actions:has(.is-confirm-armed) > form:not(:has(.is-confirm-armed)) { display: none; }
.quote-row-actions > * { vertical-align: top; }
.quote-head-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.quote-head-actions form { margin: 0; }
.quote-head-trash { margin: 0; }

/* A chip that opens a menu: a small pill, same size as .quote-chip but a button. */
.quote-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
.quote-chip-btn::-webkit-details-marker { display: none; }
.quote-chip-btn:hover { border-color: var(--blue); color: var(--blue-deep); }
.quote-chip-btn.is-static { color: var(--muted); cursor: default; }
.quote-chip-btn.is-static:hover { border-color: var(--line); color: var(--muted); }
.quote-menu.is-active > .quote-chip-btn {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--white));
  color: var(--blue-deep);
}
.quote-menu:not(.is-active)[data-quote-recur] > .quote-chip-btn { color: var(--muted); }

/* The two 28px icon buttons of a row and the trash of a card header. */
.quote-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.quote-icon-btn::-webkit-details-marker { display: none; }
.quote-icon-btn:hover { border-color: var(--blue); color: var(--blue-deep); }
.btn.quote-icon-btn { --bs-btn-padding-x: 0; --bs-btn-padding-y: 0; }

/* hub-confirm.js: a destructive control armed by its first click. The button itself widens and
   reads "Confirmar", so what is red is exactly what takes the second click. An overlay label
   (tried first) sat on top of the icon button and Matt could not tell where to click. */
.btn.is-confirm-armed {
  --bs-btn-color: var(--white);
  --bs-btn-bg: var(--bs-danger);
  --bs-btn-border-color: var(--bs-danger);
  --bs-btn-hover-color: var(--white);
  --bs-btn-hover-bg: var(--bs-danger);
  --bs-btn-hover-border-color: var(--bs-danger);
}
.quote-icon-btn.is-confirm-armed {
  width: auto;
  padding: 0 0.4rem;
  color: var(--white);
  background: var(--bs-danger);
  border-color: var(--bs-danger);
}
.quote-icon-btn.is-confirm-armed > i { display: none; }
.quote-icon-btn.is-confirm-armed::after {
  content: "Confirmar";
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

/* Menu panel. Absolute, so it opens over the card edge instead of stretching the row. */
.quote-menu { position: relative; display: inline-block; }
.quote-menu[open] { z-index: 5; }
.quote-menu-list {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 6;
  min-width: 11rem;
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--elev-1);
}
.quote-menu-list-end { left: auto; right: 0; }
.quote-menu-list-wide { min-width: 17rem; }
.quote-menu-heading {
  margin: 0.4rem 0.5rem 0.15rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-menu-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.3rem 0.5rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: var(--hub-fs-sm);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.quote-menu-item:hover:not(:disabled) { background: var(--line-soft); }
.quote-menu-item.is-current { font-weight: 600; }
.quote-menu-item:disabled { color: var(--muted); cursor: default; }
.quote-menu-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-mono);
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}
.quote-menu-price-aside { font-size: 0.625rem; }
.quote-menu-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.25rem 0 0;
  padding: 0.3rem 0.5rem 0.1rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}
.quote-menu-field .form-control { width: 4.5rem; }

/* Click-to-edit title: text until clicked, then an input in the same place. */
.quote-title-edit { min-width: 0; }
.quote-title-text {
  padding: 0;
  border: 0;
  border-bottom: 1px dashed transparent;
  background: transparent;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: text;
}
.quote-title-text:hover { border-bottom-color: var(--line); }
.quote-title-form { margin: 0; }
.quote-title-input { min-width: 12rem; font-weight: 600; }

/* "Guardado": quiet confirmation at the end of the chip row, faded in and out by the module. */
.quote-row-saved {
  margin-left: auto;
  font-size: 0.625rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.6s ease;
}
tr.is-saved .quote-row-saved { opacity: 1; transition-duration: 0.1s; }
@media (prefers-reduced-motion: reduce) {
  .quote-row-saved { transition: none; }
}
.quote-board-hint {
  margin: -0.5rem 0 1rem;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

/* An alternative's own antes de IVA / IVA / Total, priced standalone (workbench/HUB.md §10). */
.quote-figures-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: -0.25rem 0 0.7rem;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}
.quote-figures-line strong { color: var(--ink); }

/* Calm card rhythm, shared by both board modes: comfortable space between cards, headers and the
   figures line, and a trash button never sits right under another one (Matt saw two stacked,
   2026-09-25). Only what one mode alone needs stays under .is-editable/.is-readonly below: the
   editable rows' compact padding around their inputs, the read-only rows' plain-text padding. */
.quote-board .quote-group-block { margin-bottom: 2.25rem; }
.quote-board .quote-group-head { margin-bottom: 1.1rem; }
.quote-board .quote-choice-head { margin-bottom: 1.5rem; }
.quote-board .quote-figures-line {
  gap: 0.5rem 2.5rem;
  margin: 0 0 1.25rem;
}
.quote-board .quote-figures-line strong {
  margin-left: 0.4rem;
  font-variant-numeric: tabular-nums;
}

/* Review step (read-only panel): the row itself breathes too. The editable board keeps its own
   compact row padding, because its cells hold two-line inputs, not plain text. */
.quote-lines-panel.is-readonly .quote-lines-table > :not(caption) > * > * {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.quote-lines-panel.is-readonly .quote-lines-table > tbody > tr > * {
  border-bottom: 1px solid var(--line-soft);
}
.quote-lines-panel.is-readonly .quote-lines-table td.text-end,
.quote-lines-panel.is-readonly .quote-lines-table th.text-end {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Import drawer: collapsed by default, quiet like a secondary control. */
.quote-drawer { margin: 0 0 1.5rem; }
.quote-drawer-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
}
.quote-drawer-summary::-webkit-details-marker { display: none; }
.quote-drawer-summary .eyebrow { margin: 0; }
.quote-drawer-summary:hover { color: var(--ink); }
.quote-drawer[open] > .quote-drawer-summary i { transform: rotate(180deg); }
.quote-drawer-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.5rem;
  margin-top: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper);
}
.quote-drawer-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
}
.quote-drawer-col .eyebrow { margin: 0; }
.quote-drawer-col-text textarea { flex: 1 1 auto; min-height: 8rem; }
.quote-drawer-col .eyebrow + .form-select,
.quote-drawer-col .eyebrow + .form-control { margin-bottom: 0.65rem; }
.quote-drawer-submit { align-self: flex-start; margin-top: 0.35rem; }
@media (min-width: 768px) {
  .quote-drawer-form { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

/* "Decisión del cliente": one radio group per choice, read after emission. */
.quote-decision-block { margin-top: 1.5rem; }
.quote-decision-choice { margin-bottom: 1rem; }
.quote-decision-choice-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--ink);
}
.quote-decision-options { flex-wrap: wrap; }

/* Status pills sitting next to buttons in a page-header action row (e.g. diagnostic detail):
   .action-row stretches its flex children to a common height by default, which distorts a
   .quote-chip's small fixed padding. This wrapper centers the pills on the button row and keeps
   a clear gap before the buttons that follow. */
.hub-status-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.5rem;
}

/* Two DD/MM/AAAA date fields (fragments/date-field.html) plus a separator, sitting in a page-header action row (e.g. the Registro
   table's Cuándo range) — the one column whose funnel is a range instead of the shared
   Excel-like "contiene" popover, so it lives beside the Excel export button instead of on the
   column header. */
.hub-daterange {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.hub-daterange [data-hub-date-field] {
  width: 9.5rem;
}
.hub-daterange-sep {
  color: var(--body);
}

/* Unified add bar: one kind switch + one row of fields */
.quote-addbar {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper);
}
.quote-addbar .eyebrow { margin-bottom: 0.65rem; }
.quote-addbar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.65rem;
}
.quote-addbar-kind-field {
  flex: 0 0 auto;
  min-width: 8.5rem;
  margin: 0;
}
.quote-addbar-kind-field label {
  display: block;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.quote-addbar-kind-field .form-select {
  width: auto;
  min-width: 8.5rem;
}
.quote-addbar-toolbar .field {
  margin: 0;
  flex: 1 1 10rem;
  min-width: 7rem;
  max-width: 18rem;
}
.quote-addbar-toolbar .field-qty {
  flex: 0 0 5.5rem;
  max-width: 5.5rem;
}
.quote-addbar-toolbar .field-price {
  flex: 0 0 7.5rem;
  max-width: 8rem;
}
.quote-addbar-toolbar .field-currency,
.quote-addbar-toolbar .field-class,
.quote-addbar-toolbar .field-tax {
  flex: 0 0 6.5rem;
  max-width: 7.5rem;
}
.quote-addbar-toolbar .field-grow {
  flex: 2 1 14rem;
  max-width: 22rem;
}
.quote-addbar-toolbar .field label {
  display: block;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.quote-addbar-toolbar .form-select,
.quote-addbar-toolbar .form-control {
  width: 100%;
  max-width: 100%;
}
.quote-addbar-toolbar .quote-addbar-submit {
  flex: 0 0 auto;
  align-self: flex-end;
}
.quote-addbar-hint {
  margin: 0.55rem 0 0;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  line-height: 1.4;
}

.catalog-variant-picker {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) minmax(14rem, 1fr);
  gap: 0.45rem;
}
.catalog-variant-picker .hub-typeahead { min-width: 0; }
@media (max-width: 640px) {
  .catalog-variant-picker { grid-template-columns: 1fr; }
}

/* Wizard help disclosure ("¿Cómo funciona el cotizador?") */
.quote-help {
  margin: 0 0 1rem;
}
.quote-help > summary {
  list-style: none;
  cursor: pointer;
}
.quote-help > summary::-webkit-details-marker {
  display: none;
}
.quote-help-body {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
}
.quote-help-heading {
  margin: 0.9rem 0 0.35rem;
  font-size: var(--hub-fs-sm);
}
.quote-help-heading:first-of-type { margin-top: 0.35rem; }
.quote-help-list {
  margin: 0 0 0.5rem;
  padding-left: 1.15rem;
  font-size: var(--hub-fs-sm);
  color: var(--body);
}
.quote-help-list li { margin-bottom: 0.25rem; }
.quote-help-footnote {
  margin: 0.75rem 0 0;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

/* Costing step table */
.quote-costing-note {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  font-size: var(--hub-fs-sm);
  color: var(--body);
  line-height: 1.45;
}
.quote-costing-note strong { color: var(--ink); font-weight: 600; }
.quote-group-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}
.quote-lines-table thead th {
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--line-soft);
  background: transparent;
}
/* Wizard step tables carry a lot of columns — keep the body text compact. */
.quote-wizard-body table.table { font-size: var(--hub-fs-sm); }
.quote-wizard-body table.table thead th { font-size: var(--hub-fs-xs); }
.quote-line-edit { margin: 0; }
.quote-dials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}
.quote-dial label {
  display: block;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.quote-dial .field-hint {
  margin-top: 0.35rem;
}
.quote-dial .hub-percent-input {
  max-width: 10rem;
}
/*
 * Pricing step, Origen column: the margin actually in force, beside the chip naming where it comes
 * from. The per-line box is blank unless that line carries its own adjustment, so this is the only
 * place the consultant reads the figure that will price the row.
 */
.quote-margin-effective {
  margin-left: 0.4rem;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}
.quote-shipment {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line-soft);
}
.quote-shipment:last-child { border-bottom: 0; }
.quote-shipment-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.quote-shipment-title {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.quote-shipment-fee { margin-bottom: 0.75rem; }
.quote-scope-heading {
  margin: 1.5rem 0 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}
.quote-scope-heading:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.quote-shipment-note {
  margin: -0.4rem 0 0.85rem;
  font-size: var(--hub-fs-xs);
}
.field-action .btn { width: 100%; }
.quote-inline-form { margin: 0; display: inline-flex; }
.quote-cierre-actions { margin: 1rem 0 1.5rem; }
.quote-cierre-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1.5rem;
}
.quote-doc-checks { display: flex; flex-direction: column; gap: 0.45rem; }

/*
 * A quote with no linked opportunity, on the Cierre step: a fact worth surfacing but not a
 * blocker (emitting is still allowed) and not a success either, so neither .quote-doc-check
 * modifier fits — both carry a status color, and a valid state reads neutral (frontend-design
 * rules, "status color is never alarm color"). Shares .quote-doc-check's shape, one new tone.
 */
.quote-emit-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--paper);
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}

/* State A: the notice has nothing to align to, so its verb sits under it rather than in a column. */
.emit-verb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Opportunity media: Dropzone owns selection/progress while this layer keeps it inside Hub's calm card system. */
.hub-media-pane { display:grid; gap:1.25rem; }
.hub-media-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1.25rem; }
.hub-media-section-title { margin:0; color:var(--ink); font-size:var(--hub-fs-xl); }
.hub-media-section-copy { margin:.35rem 0 0; color:var(--muted); font-size:var(--hub-fs-sm); }
.hub-media-count { flex:0 0 auto; padding:.3rem .55rem; border:1px solid var(--line-soft); border-radius:999px; background:var(--paper); color:var(--muted); font-size:var(--hub-fs-xs); }
.hub-media-upload-layout { display:grid; grid-template-columns:minmax(15rem, .9fr) minmax(18rem, 1.1fr); gap:1rem; align-items:stretch; }
.hub-media-drop { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.35rem; min-height:13rem; padding:1.5rem; border:2px dashed var(--line); border-radius:10px; text-align:center; background:var(--white); cursor:pointer; }
.hub-media-drop:hover, .hub-media-drop.dz-drag-hover { border-color:var(--blue); background:var(--navy-tint); }
.hub-media-drop > i { font-size:2rem; color:var(--blue-deep); }
.hub-media-drop > strong { color:var(--ink); }
.hub-media-drop > span, .hub-media-drop > small { color:var(--muted); font-size:var(--hub-fs-sm); }
.hub-media-drop .btn { margin-top:.35rem; pointer-events:none; }
.hub-media-fallback-input { max-width:18rem; }
/* A file-drop zone already offers the drop and its own "Seleccionar archivo" button (file-drop.js),
   so the native input stays in the form for submit and "required" but out of sight; the filename
   readout shows only once a file is chosen, never as an empty grey chip. */
[data-file-drop] { position:relative; }
[data-file-drop] input[type=file] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
[data-file-drop] .hub-media-status:empty { display:none; }
/* A column, explicitly. It was display:flex with no direction, so items laid out in a ROW:
   each queued file declares width:100% but a flex item in a row still shrinks, so twelve
   files became twelve slivers and overflow-wrap:anywhere broke every name one character
   per line. Latent while a queue held one or two files, obvious the moment a meeting
   bundle arrived. The cap keeps a long queue from pushing the form off the screen. */
.hub-media-queue { display:flex; flex-direction:column; align-items:stretch; gap:.5rem; min-height:13rem; max-height:22rem; overflow-y:auto; padding:.8rem; border:1px solid var(--line-soft); border-radius:10px; background:var(--paper); }
.hub-media-queue-empty { align-self:center; margin:auto; max-width:18rem; color:var(--muted); font-size:var(--hub-fs-sm); text-align:center; }
.hub-media-queued-file { display:flex; align-items:flex-start; gap:.7rem; width:100%; margin:0; padding:.75rem; border:1px solid var(--line-soft); border-radius:8px; background:var(--white); }
.hub-media-queued-icon { display:grid; place-items:center; flex:0 0 2.25rem; width:2.25rem; height:2.25rem; border-radius:7px; color:var(--blue-deep); background:var(--navy-tint); }
.hub-media-queued-details { flex:1 1 auto; min-width:0; }
/* The name is one line with an ellipsis (the full name is in the title attribute); the
   description below it may wrap, since that is prose worth reading. */
.hub-media-queued-details strong { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.hub-media-queued-details > span { display:block; overflow-wrap:anywhere; }
.hub-media-queued-details > span { margin-top:.15rem; color:var(--muted); font-size:var(--hub-fs-xs); }
.hub-media-queued-progress { height:.35rem; margin-top:.7rem; overflow:hidden; border-radius:999px; background:var(--line-soft); }
.hub-media-queued-progress .dz-upload { display:block; width:0; height:100%; background:var(--blue); transition:width .15s ease; }
.hub-media-queued-file .dz-error-message { display:none; margin:.45rem 0 0; color:var(--bad-fg); font-size:var(--hub-fs-xs); }
.hub-media-queued-file.dz-error .dz-error-message { display:block; }
.hub-media-remove { flex:0 0 auto; padding:.15rem; border:0; background:transparent; color:var(--muted); cursor:pointer; }
.hub-media-remove:hover, .hub-media-remove:focus-visible { color:var(--bad-fg); }
.hub-media-status { display:flex; align-items:flex-start; gap:.5rem; padding:.7rem .8rem; border:1px solid var(--line-soft); border-radius:8px; background:var(--paper); color:var(--muted); font-size:var(--hub-fs-sm); }
.hub-media-status i { flex:0 0 auto; font-size:1.1rem; }
.hub-media-status.is-ready { border-color:var(--ok-line); background:var(--ok-bg); color:var(--ok-fg); }
.hub-media-status.is-uploading { border-color:var(--blue-soft); background:var(--navy-tint); color:var(--navy); }
.hub-media-status.is-success { border-color:var(--ok-line); background:var(--ok-bg); color:var(--ok-fg); }
.hub-media-status.is-error { border-color:var(--bad-line); background:var(--bad-bg); color:var(--bad-fg); }
.hub-media-progress { display:block; width:100%; height:.65rem; accent-color:var(--blue); }
.hub-media-submit-tooltip { position:relative; display:inline-flex; }
.hub-media-submit-tooltip:focus-visible { outline:2px solid var(--blue); outline-offset:3px; border-radius:6px; }
.hub-media-submit-tooltip:has(button:disabled)::after { position:absolute; z-index:4; bottom:calc(100% + .45rem); left:0; width:max-content; max-width:19rem; padding:.45rem .6rem; border-radius:6px; background:var(--navy); color:var(--white); content:attr(data-tooltip); font-size:var(--hub-fs-xs); line-height:1.35; opacity:0; pointer-events:none; transform:translateY(.2rem); transition:opacity .15s ease, transform .15s ease; }
.hub-media-submit-tooltip:has(button:disabled):hover::after, .hub-media-submit-tooltip:has(button:disabled):focus-within::after, .hub-media-submit-tooltip:has(button:disabled):focus-visible::after { opacity:1; transform:translateY(0); }
.hub-media-submit-tooltip .btn:disabled { border-color:var(--line); background:var(--line-soft); color:var(--muted); opacity:1; cursor:not-allowed; }
@media (max-width: 767.98px) { .hub-media-upload-layout { grid-template-columns:1fr; } .hub-media-drop, .hub-media-queue { min-height:10rem; } .hub-media-section-heading { flex-direction:column; } }
.hub-media-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:1rem; }
.hub-media-card { display:flex; flex-direction:column; min-width:0; border:1px solid var(--line-soft); border-radius:10px; background:var(--white); overflow:hidden; }
.hub-media-preview { position:relative; display:grid; place-items:center; min-height:150px; background:var(--paper); text-decoration:none; overflow:hidden; }
.hub-media-preview img { width:100%; height:150px; object-fit:cover; transition:transform .18s ease; }
.hub-media-preview > span { position:absolute; right:.6rem; bottom:.6rem; padding:.25rem .45rem; border-radius:5px; background:color-mix(in srgb, var(--navy) 88%, transparent); color:var(--white); font-size:var(--hub-fs-xs); opacity:0; transform:translateY(.2rem); transition:opacity .15s ease, transform .15s ease; }
.hub-media-preview:hover img { transform:scale(1.02); }
.hub-media-preview:hover > span, .hub-media-preview:focus-visible > span { opacity:1; transform:translateY(0); }
.hub-media-card-body { display:flex; flex:1 1 auto; flex-direction:column; padding:.85rem; }
.hub-media-card p { margin:.35rem 0; color:var(--muted); font-size:var(--hub-fs-xs); overflow-wrap:anywhere; }

/* ── What Entradas' own pages still read ─────────────────────────────────
   The Entradas list and pane are the "Mail component" below. These few classes are read by other
   screens: the diagnostic's measurements (.staging-real / .staging-business), Salidas' and the
   convert page's small meta lines (.staging-meta) and the sender's own words (.staging-said, on the
   convert page). */
.staging-real { font-variant-numeric: tabular-nums; color: var(--body); }
.staging-business { font-variant-numeric: tabular-nums; font-weight: 600; }

.staging-said { font-size: 1.0625rem; line-height: 1.55; color: var(--ink); margin: 0 0 .75rem; }
.staging-said-mark { border-left: 3px solid var(--blue-soft); padding-left: .9rem; }
.staging-meta { font-size: var(--hub-fs-xs); color: var(--muted); line-height: 1.6; margin: 0 0 .75rem; }

/* Convertir, "vincular a una oportunidad existente": what the picker chose, read back before the verb
   (HTMX, GET /staging/{id}/link-preview, innerHTML into an empty target). The left border reads as
   "this came from the field above", the same idea as .staging-said-mark. */
.staging-link-preview { margin-top: .6rem; border-left: 2px solid var(--blue-soft); padding: .05rem 0 .05rem .8rem; }
.staging-link-preview .eyebrow { margin-bottom: .2rem; }
.staging-link-preview-name { margin: 0 0 .15rem; font-weight: 600; color: var(--ink); }
.staging-link-preview-sub { margin: 0; color: var(--muted); font-size: var(--hub-fs-sm); }

/* The company Hub guesses the request is from and its open deals, offered one click each. */
.staging-link-hint { display: grid; gap: .5rem; margin: 0 0 1rem; }
.staging-link-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.staging-link-choice-name { margin: 0; font-weight: 600; color: var(--ink); }
.staging-link-choice-sub { margin: 0; color: var(--muted); font-size: var(--hub-fs-sm); }
.staging-link-or { margin: 1rem 0 .5rem; color: var(--muted); font-size: var(--hub-fs-sm); }

/* ── Mail component (fragments/mail.html, hub-bulk-select.js, hub-mail.js, hub-mail-verbs.js) ──
   One list-and-reading-pane component for Entradas and Salidas: a white card on the grey canvas,
   the list on the left and the open item on the right, stacked on a phone. Entradas' bulk actions are
   icon buttons at the right end of the list's toolbar; pressing one turns the toolbar into a one-line
   confirm, so nothing posts until its verb is pressed. Salidas' verbs are labelled buttons (icon and
   word) that act in one click and fold the row to its outcome with Deshacer, which replaces the
   confirm (HUB.md §15). Blue is the main verb, red the destructive one (red is for destructive
   actions only), and the unread dot is the only mark of what is new: nothing counts, ranks or ages it.

   Layers. No row container that holds a menu sets a z-index: a z-index on .hub-mail-verbs or
   .hub-mail-side made each row its own stacking context, so a menu inside it ranked only against
   that row and the next row's buttons painted over it. Only what must take a click rises above the
   row's stretched link (z 1, to z 2): the verbs, the ⋮, and the fold, whose Nota and Deshacer would
   otherwise open the row; the fold holds no menu. A row's menus are fixed dropdowns on the
   --z-offcanvas layer in the root context, as .kanban-discard is: above the list, the row controls,
   the sticky selection bar, the sticky topbar (--z-sticky) and the rail (--z-rail), and under
   Bootstrap's offcanvas panel and modals. The exception is the selection bar's own menus (its ⋮ and
   Más tarde): the sticky bar is a stacking context at z 5, so they rank at 5 against the page. They
   open downward from a bar that sticks under the topbar, over rows that sit at 2 at most, so they
   never meet the topbar or the rail. The list never uses container queries; the breakpoints are the
   page's. */
.hub-mail {
  display: grid;
  grid-template-columns: minmax(18.75rem, 26rem) minmax(0, 1fr);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 0 rgba(var(--shadow-deep-rgb), 0.03);
  /* clip rounds the corners as hidden did without making a scroll container, so the selection
     bar can stick to the page's topbar. */
  overflow: clip;
  min-height: 37.5rem;
  margin: 0 0 1rem;
}
@media (max-width: 899.98px) {
  .hub-mail { grid-template-columns: minmax(0, 1fr); }
  .hub-mail-list { border-right: none; border-bottom: 1px solid var(--line); }
}
.hub-mail-list { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }

/* The toolbar: select-all, the count, the icons at the right. A confirm line replaces all of it. */
.hub-mail-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.9rem;
  padding: .35rem .75rem;
  border-bottom: 1px solid var(--line);
}
.hub-mail-select-all { margin-right: .35rem; }
.hub-mail-count { margin-right: auto; font-size: var(--hub-fs-sm); color: var(--muted); }
.hub-mail-toolbar.is-confirming > :not(.is-asking) { display: none; }
.hub-mail-confirm {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  font-size: var(--hub-fs-sm);
  color: var(--ink);
}
.hub-mail-confirm[hidden] { display: none; }
.hub-mail-sentence { margin-right: auto; }
/* Extras in the confirm line (a date, a reason): a label and its input side by side. */
.hub-mail-confirm label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.hub-mail-confirm .form-control { width: auto; }

/* The selection bar: the toolbar of a screen whose verbs fold. Select-all and the count always, and
   "Seleccionar todas" while nothing is ticked; the verbs and the ⋮ only while rows are ticked
   (hub-bulk-select.js sets .is-visible), and then the bar sticks under the topbar. */
.hub-mail-selbar { flex-wrap: wrap; gap: .4rem; }
.hub-mail-selbar.is-visible {
  position: sticky;
  top: var(--hub-content-topbar-h);
  z-index: 5;
  background: var(--navy-tint);
}
.hub-mail-selbar:not(.is-visible) .hub-mail-selbar-verbs,
.hub-mail-selbar:not(.is-visible) .hub-mail-selbar-more,
.hub-mail-selbar.is-visible .hub-mail-selbar-hint { display: none; }
/* While nothing is ticked the count is empty, so it gives up its push and the hint sits beside the box. */
.hub-mail-selbar:not(.is-visible) .hub-mail-count { margin-right: 0; }
.hub-mail-selbar-hint { font-size: var(--hub-fs-sm); color: var(--muted); }
.hub-mail-selbar-verbs { display: contents; }
.hub-mail-selbar .hub-mail-count { color: var(--ink); font-weight: 500; }
/* Two lines (count and ⋮, then the verbs) wherever the list is too narrow for one: the phone, and
   the two-column layout from 900px, where the list column is at most 26rem. */
@media (max-width: 575.98px), (min-width: 900px) {
  .hub-mail-selbar.is-visible .hub-mail-count { flex: 1 0 calc(100% - 6rem); margin-right: 0; }
  .hub-mail-selbar-verbs > * { order: 2; }
}
@media (max-width: 575.98px) {
  .hub-mail-selbar { padding: .4rem .5rem; gap: .3rem; }
  .hub-mail-selbar .hub-mail-verb { padding: 0 .45rem; gap: .25rem; }
}

/* Icon buttons (the label lives in the title: operators know them from a mail client) and labelled
   verbs (fragments/mail :: verb, verbLink, later: an icon and a word, for a screen whose verbs act
   in one click and fold the row) share their shape and every state; only their size and frame
   differ. */
.hub-mail-icon,
.hub-mail-verb {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  color: var(--body);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.hub-mail-icon {
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  font-size: 1.15rem;
}
.hub-mail-verb {
  gap: .3rem;
  height: 1.9rem;
  padding: 0 .6rem;
  border: 1px solid var(--line-soft);
  background: var(--white);
  font-family: inherit;
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  white-space: nowrap;
}
.hub-mail-verb .ph { font-size: 1rem; }
.hub-mail-icon:hover:not(:disabled),
.hub-mail-verb:hover:not(:disabled) { background: var(--line-soft); color: var(--ink); }
.hub-mail-icon:focus-visible,
.hub-mail-verb:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.hub-mail-icon:disabled { opacity: .35; cursor: not-allowed; }
.hub-mail-icon.is-primary,
.hub-mail-verb.is-primary { color: var(--blue-deep); }
.hub-mail-verb.is-primary { border-color: var(--navy-tint); }
.hub-mail-icon.is-primary:hover:not(:disabled),
.hub-mail-verb.is-primary:hover:not(:disabled) { background: var(--navy-tint); color: var(--blue-deep); }
.hub-mail-icon.is-danger,
.hub-mail-verb.is-danger { color: var(--bad-fg); }
.hub-mail-icon.is-danger:hover:not(:disabled),
.hub-mail-verb.is-danger:hover:not(:disabled) { background: var(--bad-bg); color: var(--bad-fg-deep); }
.hub-mail-verb-form { margin: 0; }
.hub-mail-verbs .dropdown,
.hub-mail-selbar .dropdown,
.hub-mail-actions .dropdown,
.hub-mail-side .dropdown { position: static; }

/* The ⋮ menu and Más tarde: fixed dropdowns with an opaque background (see Layers above). */
.hub-mail-menu {
  z-index: var(--z-offcanvas);
  min-width: 15rem;
  padding: .35rem;
  background: var(--white);
  border-color: var(--line);
  box-shadow: var(--elev-1);
  font-size: var(--hub-fs-sm);
}
.hub-mail-menu .dropdown-item { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border-radius: 6px; color: var(--ink); white-space: normal; }
.hub-mail-menu .dropdown-item .ph { font-size: 1.05rem; color: var(--muted); }
.hub-mail-menu .dropdown-item.is-danger,
.hub-mail-menu .dropdown-item.is-danger .ph { color: var(--bad-fg); }
.hub-mail-menu .dropdown-item:hover { background: var(--line-soft); }
.hub-mail-menu .dropdown-divider { margin: .3rem 0; border-color: var(--line-soft); }
/* The menu repeats the row's verbs only where the row's own buttons are hidden: on a phone. */
.hub-mail-menu-verbs { display: none; }

/* Más tarde: the server's date chips, then a date field only once "Elegir fecha" is pressed. A chip
   is the menu's own item (.hub-mail-menu .dropdown-item) with its date at the right. */
.hub-snooze { width: 17rem; max-width: calc(100vw - 1.5rem); }
.hub-snooze-chip { justify-content: space-between; }
.hub-snooze-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.hub-snooze-pick { padding: .35rem .35rem .2rem; }
.hub-snooze-pick .hub-mail-verb-form { display: flex; gap: .4rem; }
.hub-snooze-pick .form-control { flex: 1 1 auto; min-width: 0; }
.hub-snooze-inline { padding: .2rem .35rem .35rem 2.1rem; }

/* The fold: after a verb the row keeps who, what, tags and date, and only its verb area becomes the
   outcome, an optional note and Deshacer. The outcome in that area is the fold itself, so no class
   has to be kept in step with it. */
.hub-mail-outcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .6rem;
  min-width: 0;
  min-height: 1.9rem;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}
.hub-mail-outcome strong { color: var(--ink); font-weight: 500; }
.hub-mail-outcome .hub-mail-note { flex: 1 1 10rem; min-width: 0; }
.hub-mail-outcome .hub-mail-note .form-control { flex: 1 1 auto; min-width: 0; width: auto; }
.hub-mail-saved { color: var(--muted); font-size: var(--hub-fs-xs); white-space: nowrap; }
.hub-mail-undo { margin-left: auto; }
.hub-mail-undo .btn-link { padding: 0; font-size: inherit; }

/* The optional reason beside a discard's verb, in the toolbar's confirm line and in the pane's panel. */
.hub-mail-note { display: flex; flex: 1 1 14rem; align-items: center; gap: .4rem; margin: 0; color: var(--muted); font-size: var(--hub-fs-sm); }
.hub-mail-note > span { white-space: nowrap; }
.hub-mail-note .form-control { min-width: 8rem; }

/* The pane's ask-before-posting action: a native <details> whose panel hangs under the icon. */
.hub-mail-ask { position: relative; }
.hub-mail-ask > summary { list-style: none; }
.hub-mail-ask > summary::-webkit-details-marker { display: none; }
.hub-mail-ask-panel {
  position: absolute;
  top: 2.4rem;
  right: 0;
  z-index: 3;
  display: grid;
  gap: .6rem;
  width: min(22rem, 80vw);
  padding: .8rem .9rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--elev-1);
}
.hub-mail-ask-sentence { margin: 0; color: var(--ink); font-size: var(--hub-fs-sm); }
.hub-mail-ask-buttons { display: flex; gap: .5rem; }

/* The list. Each row is a grid of checkbox, dot, text and time; the who line is a link stretched
   over the whole row so a click anywhere opens it, and the checkbox sits above that layer. */
.hub-mail-rows { list-style: none; margin: 0; padding: 0; overflow: auto; }
.hub-mail-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.4rem .6rem minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: start;
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--line-soft);
}
.hub-mail-row:hover { background: var(--paper); }
.hub-mail-row.is-current { background: var(--navy-tint); }
.hub-mail-check { position: relative; z-index: 2; padding-top: .15rem; }
.hub-mail-dot { width: .5rem; height: .5rem; margin-top: .5rem; border-radius: 50%; }
.hub-mail-row.is-unread .hub-mail-dot { background: var(--blue); }
.hub-mail-main { min-width: 0; }
.hub-mail-who {
  display: block;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-mail-who::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hub-mail-who:focus-visible { outline: none; }
.hub-mail-row:has(.hub-mail-who:focus-visible) { outline: 2px solid var(--blue); outline-offset: -2px; }
.hub-mail-row.is-unread .hub-mail-who,
.hub-mail-row.is-unread .hub-mail-subject { font-weight: 600; }
.hub-mail-subject,
.hub-mail-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-mail-subject { color: var(--ink); font-size: var(--hub-fs-sm); }
.hub-mail-preview { color: var(--muted); font-size: var(--hub-fs-sm); }
.hub-mail-meta {
  color: var(--muted);
  font-size: var(--hub-fs-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The time, with the row's ⋮ under it; the verbs sit under the tags, so the list column keeps its
   width. */
.hub-mail-side { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
/* The row's verb area, the verbs or the fold, under the tags. */
.hub-mail-verbs,
.hub-mail-outcome { grid-column: 3 / -1; }
.hub-mail-verbs { display: flex; flex-wrap: wrap; gap: .35rem; }
/* Above the stretched link (see Layers): the verbs, the ⋮ and the fold's Nota and Deshacer. */
.hub-mail-verb,
.hub-mail-side .hub-mail-icon,
.hub-mail-outcome { position: relative; z-index: 2; }
/* A folded row draws no checkbox (fragments/mail :: outcome), so only its dot needs hiding. */
.hub-mail-row:has(> .hub-mail-outcome) { background: var(--paper); }
.hub-mail-row:has(> .hub-mail-outcome) .hub-mail-who,
.hub-mail-row:has(> .hub-mail-outcome) .hub-mail-subject { font-weight: 400; }
.hub-mail-row:has(> .hub-mail-outcome) .hub-mail-dot { visibility: hidden; }
/* Phone: the row's buttons live in the ⋮ menu, which repeats them; the selection bar stays. The
   outcome and Deshacer share line one and the note takes line two. */
@media (max-width: 575.98px) {
  .hub-mail-row > .hub-mail-verbs,
  .hub-mail-actions .hub-mail-verb { display: none; }
  .hub-mail-menu-verbs { display: block; }
  .hub-mail-undo { order: 1; }
  .hub-mail-outcome .hub-mail-note { order: 2; flex: 1 0 100%; }
}
.hub-mail-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.hub-mail-tag {
  padding: 0 .45rem;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--body);
  font-size: var(--hub-fs-xs);
  line-height: 1.15rem;
  white-space: nowrap;
}
.hub-mail-tag.is-kind { background: var(--navy-tint); color: var(--blue-deep); font-weight: 500; }
.hub-mail-tag.is-deadline { background: var(--warn-bg); color: var(--warn-fg); }
.hub-mail-group {
  padding: .9rem .75rem .35rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hub-mail-empty,
.hub-mail-pane-empty { padding: 2rem 1rem; color: var(--muted); text-align: center; }

/* The reading pane: the title and the item's icon actions, the from line, then the body. */
.hub-mail-pane { min-width: 0; }
.hub-mail-pane-body { display: grid; gap: 1.1rem; align-content: start; padding: 1.25rem 1.5rem 1.75rem; }
.hub-mail-head { display: grid; gap: .6rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line-soft); }
.hub-mail-head-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.hub-mail-title { min-width: 0; margin: 0; color: var(--ink); font-size: 1.2rem; font-weight: 600; overflow-wrap: anywhere; }
.hub-mail-actions { display: flex; flex: none; gap: .15rem; }
/* Labelled verbs need more room than icons: the title and the verbs may take a line each. */
.hub-mail-head-top:has(.hub-mail-verb) { flex-wrap: wrap; }
.hub-mail-actions:has(.hub-mail-verb) { flex-wrap: wrap; align-items: center; gap: .35rem; }
.hub-mail-action-form { margin: 0; }
.hub-mail-from { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: .65rem; align-items: start; }
.hub-mail-avatar {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--navy-tint);
  color: var(--blue-deep);
  font-weight: 600;
}
.hub-mail-from-name { color: var(--ink); font-weight: 600; }
.hub-mail-from-role { color: var(--muted); font-weight: 400; }
.hub-mail-from-contact { font-size: var(--hub-fs-sm); }
.hub-mail-phone { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink); }
a.hub-mail-phone { color: var(--blue-deep); text-decoration: none; }
a.hub-mail-phone:hover { text-decoration: underline; }
.hub-mail-from-address { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: var(--hub-fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.hub-mail-from-date { color: var(--muted); font-size: var(--hub-fs-sm); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.hub-mail-body { display: grid; gap: 1.25rem; min-width: 0; }
.hub-mail-brief { max-width: 70ch; margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.65; }
.hub-mail-emphasis { color: var(--warn-fg); font-weight: 600; }
.hub-mail-section > .eyebrow { margin-bottom: .45rem; }

/* The times the sender offered: one tight row each, information only. */
.hub-mail-slots { max-width: 35rem; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; list-style: none; }
.hub-mail-slot {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: baseline;
  padding: .4rem .75rem;
  font-size: var(--hub-fs-sm);
}
.hub-mail-slot + .hub-mail-slot { border-top: 1px solid var(--line-soft); }
.hub-mail-slot-number { color: var(--muted); font-variant-numeric: tabular-nums; }
.hub-mail-slot-day { color: var(--ink); }
.hub-mail-slot-band { color: var(--blue-deep); white-space: nowrap; }

.hub-mail-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .65rem 1.1rem; margin: 0; }
.hub-mail-facts > div { min-width: 0; }
.hub-mail-facts dt { color: var(--muted); font-size: var(--hub-fs-xs); font-weight: 500; }
.hub-mail-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.hub-mail-facts dd.is-highlight { color: var(--warn-fg); font-weight: 600; }
.hub-mail-reference { font-family: var(--font-mono); font-size: var(--hub-fs-xs); color: var(--muted); }
.hub-mail-previous summary { color: var(--blue-deep); cursor: pointer; font-size: var(--hub-fs-sm); font-weight: 500; }
.hub-mail-previous .hub-mail-facts { margin-top: .6rem; }

.hub-mail-timeline { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.hub-mail-timeline li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .65rem; font-size: var(--hub-fs-sm); }
.hub-mail-timeline time { color: var(--muted); font-family: var(--font-mono); font-size: var(--hub-fs-xs); font-variant-numeric: tabular-nums; }
.hub-media-card-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:.5rem; margin-bottom:.15rem; }
.hub-media-card-heading strong { min-width:0; overflow-wrap:anywhere; }
.hub-media-pdf { display:block; padding:1.5rem 0; color:var(--bad-fg); font-size:5rem; text-align:center; }
.hub-media-rename { margin-top:.6rem; color:var(--muted); font-size:var(--hub-fs-sm); }
.hub-media-rename summary { width:max-content; color:var(--blue-deep); cursor:pointer; }
.hub-media-rename form { margin-top:.55rem; }
.hub-media-rename-controls { display:flex; gap:.45rem; }
.hub-media-rename-controls .form-control { min-width:0; }
.hub-media-card-actions { display:flex; justify-content:space-between; gap:.5rem; margin-top:auto; padding-top:.85rem; }

/* Installed iOS web-apps need their content clear of the sensor/home-indicator areas. Desktop keeps its normal spacing. */
@supports (padding: max(0px)) {
  @media (max-width: 991.98px) {
    .hub-content-topbar { padding-top:max(.45rem, env(safe-area-inset-top)); padding-left:max(1.25rem, env(safe-area-inset-left)); padding-right:max(1.25rem, env(safe-area-inset-right)); }
    .hub-main { padding-bottom:max(1.5rem, env(safe-area-inset-bottom)); padding-left:max(1.25rem, env(safe-area-inset-left)); padding-right:max(1.25rem, env(safe-area-inset-right)); }
  }
}

/*
 * Gestión log (opportunity detail, Gestiones tab): a calm timeline — hairline
 * separators between entries, no per-row card boxes (see frontend-design.md).
 */
.hub-gestion-entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.hub-gestion-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.hub-gestion-entry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.35rem;
}
.hub-gestion-entry-when {
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}
.hub-gestion-entry-actions {
  margin-left: auto;
}
.hub-gestion-entry-note {
  margin: 0;
  color: var(--ink);
}

/* The .hub-ball / .hub-ball-late pair ("who owes the next move, under a pending commitment") and
   .hub-registro-grid (the Gestión + Compromiso two-column console) lived here. Both describe the
   compromiso model V27 replaced with the espera, and no template has carried either class since.
   Deleted 2026-08-04 with the .hub-entry* family, for the same reason. */

/* ── Proposal detail: generate requirements checklist ──────────────────────
   Reuses the shared ok/warn status tokens (see :root above) rather than a
   new palette: a satisfied requirement reads as --ok, a pending one as
   --warn (never alarm red — nothing is broken, it just is not ready yet). */
.hub-gate-done {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--ok-fg);
  font-weight: 600;
}
.hub-gate-done .ph { font-size: 1.1rem; }

.hub-gatelist {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hub-gate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--hub-fs-sm);
}

.hub-gate .ph { font-size: 1rem; }

.hub-gate-ok { color: var(--ok-fg); }
.hub-gate-ok .ph { color: var(--ok-fg); }

.hub-gate-pending { color: var(--ink); }
.hub-gate-pending .ph { color: var(--warn-fg); }

/* A pending requirement is a jump link to the control that fixes it, with a one-line instruction
   underneath. Satisfied requirements stay plain text -- there is nothing to go and do. */
.hub-gate-link {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}
.hub-gate-link:hover,
.hub-gate-link:focus-visible {
  color: var(--blue);
  border-bottom-color: currentColor;
}
.hub-gate-hint {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  line-height: 1.35;
}

/* Jumped-to sections must clear the sticky header instead of hiding under it. */
[id^="sec-"],
#route,
#coverTitle {
  scroll-margin-top: 5rem;
}

.hub-gate-summary {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: var(--hub-fs-sm);
  font-weight: 500;
}

/* Compact read-only panels: tighter padding + kv rhythm than a working-form panel */
.panel-compact {
  padding: 0.7rem 1.05rem;
}

/* ── Propuesta Custom: ISO/IEC/IEEE 29148 section guidance ──────────────────
   Shown on the authoring page in place of an empty optional section (scope
   statement, actors, assumptions, constraints, references). Reuses .eyebrow
   for the clause label and .field-hint for the rationale, so this is layout
   glue only, not a new typography or color statement. Consultant-only copy:
   never rendered into the PDF. */
.hub-ieee-guidance {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hub-ieee-guidance .eyebrow {
  margin-bottom: 0;
}

.hub-ieee-optional {
  font-style: italic;
}

/*
 * Inline add-form row followed by its own result (a table or an empty-state notice), inside the
 * same panel: Alcance, Roles, Glosario, and the ISO/IEC/IEEE 29148 item lists all share this exact
 * shape. A wider column-gap than the canonical .hub-form-inline rhythm gives the submit button room
 * to read as an action, not a fifth field; the bottom margin is the same 0.85rem the app already
 * uses between two stacked panels (see ".panel + .panel"), so the form and what it produces read as
 * two things, not one crowded block.
 */
.hub-add-form-row {
  gap: 1rem 1.5rem;
  margin: 0 0 0.85rem;
}

.hub-kv-tight {
  gap: 0.5rem 1.25rem;
}

/*
 * One row of fields (canonical definition — do not redeclare this selector elsewhere).
 *
 * align-items is flex-start, not flex-end: a field's hint (`.field-hint`) always follows its input,
 * so it cannot move that field's own input, but flex-end used to bottom-align the whole row, and a
 * field with a two-line hint made every plainer sibling in the row taller than its own content,
 * pushing THEIR inputs down to match, out of line with the tall field's input above its hint (a
 * field with a hint next to one without landed at two different input heights). Every field now
 * grows from the row's top, so a hint's length only changes how far down that one field's OWN box
 * reaches, never its neighbors'.
 *
 * A field-less action — `.form-actions` or a bare submit button — has no label above it, so
 * top-aligning it the way a labelled field aligns would float it above the inputs it acts on
 * instead of beside them; the rule below opts it back into the row's bottom edge on purpose.
 */
.hub-form-inline {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.hub-form-inline .field { margin-bottom: 0; flex: 1 1 16rem; }

/*
 * The pipeline's filter row, narrowed. Same component, same markup, one width: a 16rem basis is
 * right for a form of text inputs and wrong for four short selects, which wrapped onto a second
 * line and made the toolbar taller than the first card underneath it. Vertical space is the board's
 * scarcest resource, so this row spends as little of it as the controls allow.
 */
.pipeline-filters {
  gap: 0.55rem 0.75rem;
  padding-block: 0.7rem;
}

.pipeline-filters .field {
  flex: 1 1 8rem;
  max-width: 13rem;
}

.pipeline-filters .field:first-child {
  flex: 2 1 12rem;
  max-width: 22rem;
}

.hub-form-inline .form-actions,
.hub-form-inline > .btn {
  align-self: flex-end;
}

/*
 * A create form with more fields than one row holds, in a tab (fragments/contact-panel.html). Fixed
 * columns rather than .hub-form-inline's wrapping row: a wrapping row put a field alone on a line
 * wherever the widths happened to break, and the submit button squeezed in beside the last input
 * (Matt, 2026-09-23). Here the fields read in rows the template chose, the actions sit under the
 * grid like every other form's, and the columns fold to two, then one, on a narrow screen.
 */
.hub-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  align-items: start;
}

.hub-form-grid .field {
  margin-bottom: 0;
}

@media (max-width: 991.98px) {
  .hub-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .hub-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/*
 * One row that stays one row: a short form (a field or two and its verb) inside a box that takes its
 * width from its content, a bulk bar or a fact sheet's verb column. A wrapping flex row in such a box
 * is measured by its widest single child, so the box got the field's width and the button dropped
 * under the field (Staging's bulk bar, Correo › Comportamiento, the company's "Pausar hasta…",
 * 2026-09-13/14). Here the row never wraps; the fields shrink instead, down to a width a date still
 * fits in.
 */
.hub-form-inline.is-one-row { flex-wrap: nowrap; gap: .5rem; align-items: flex-end; }
.hub-form-inline.is-one-row .field { flex: 0 1 12rem; min-width: 7.5rem; }

/* Small muted labels over each input: a fact sheet's own verb column, folded or not (a folded
   form still opens into this same quiet shape). */
.hub-form-inline.is-compact { gap: .5rem; }
.hub-form-inline.is-compact label {
  display: block;
  margin-bottom: .25rem;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

/* Propuesta Custom detail: acceptance-criteria list inside the per-requirement modal
   (templates/custom/detail.html). One line per criterion, its "Quitar" button on the same row. */
.hub-criteria-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hub-criteria-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.35rem;
  border-bottom: 1px solid var(--line-soft);
}

.hub-criteria-list li:last-child {
  border-bottom: none;
}

/* A draft's criterion is edited in place: its text field takes the row, Guardar and Quitar sit
   after it. */
.hub-criteria-list .hub-criterion-edit {
  flex: 1 1 auto;
  align-items: center;
  gap: 0.5rem;
}

/* The code a review cites ("SWE-001.2"), the same one the document prints before the criterion. */
.hub-criterion-code {
  flex: 0 0 auto;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}

/* "No incluye" opens the second list in the same modal; spacing, no rule, separates the two. */
.hub-criteria-heading {
  margin: 1.5rem 0 0.5rem;
  font-size: var(--hub-fs-sm);
  font-weight: 600;
}

/* The requirements' hours beside the quoted hours (fragments/proposal-hours.html): two plain
   figures, neutral on purpose, since the checklist already says whether they reconcile. */
.hub-hours-pair {
  margin: 0.5rem 0 0;
  font-size: var(--hub-fs-sm);
}

.hub-hours-lines {
  margin-top: 0.35rem;
  font-size: var(--hub-fs-sm);
}

/* Diagnostic detail "Enlace" card: the copy field + toggle/vigencia controls on the left, the QR
   code on the right, sharing the full card width instead of stacking in a narrow column. */
.diagnostic-link-row {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.diagnostic-link-main {
  flex: 1 1 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.diagnostic-link-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
}

/* The date picker and both buttons on one baseline. .hub-form-inline lets its field grow to fill
   the row, which pushed "Actualizar vigencia" away from the date it acts on. */
.diagnostic-link-actions { margin: 0; }
.diagnostic-link-actions .field { flex: 0 0 auto; }
.diagnostic-link-actions .form-control:disabled { background: var(--paper); cursor: not-allowed; }

.diagnostic-link-qr {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.diagnostic-link-qr img {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 0.5rem;
  background: var(--white);
}

.diagnostic-link-qr-caption {
  margin: 0;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

/* ── Trackvy proposal detail: the card above the tabs, and the tabs' own layout ─────────────
   (templates/proposal/detail.html, ProposalSummaryCard, ProposalTab) */
.proposal-card {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.25rem;
}

.proposal-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.proposal-card-text .hub-page-title {
  margin: 0.15rem 0 0.2rem;
}

.proposal-card-text .eyebrow a {
  color: inherit;
  text-decoration: none;
}

.proposal-card-meta {
  margin: 0;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}

.proposal-card-actions {
  align-items: center;
}

.proposal-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 0.75rem;
}

.proposal-figure {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--paper);
}

.proposal-figure b {
  font-size: var(--hub-fs-title);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.proposal-figure span {
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

/* The requirements figure links to the callout when something is pending. */
a.proposal-figure.is-link {
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--warn-line);
}

a.proposal-figure.is-link:hover b {
  color: var(--navy);
}

/* Emitir while a requirement is pending: Bootstrap's disabled look, still a link to the callout so
   a press answers instead of doing nothing, with its reason beside it. */
.proposal-emit-blocked {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
}

.btn.is-blocked {
  opacity: var(--bs-btn-disabled-opacity, 0.65);
  box-shadow: none;
  cursor: default;
}

.btn.is-blocked:hover,
.btn.is-blocked:focus {
  background-color: var(--bs-btn-bg);
  border-color: var(--bs-btn-border-color);
}

.proposal-emit-reason {
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  color: var(--warn-fg);
}

/* "Para emitir falta:": a hairline warning panel right under the figures. Reaching it by its
   anchor flashes the border once; with reduced motion it only stays highlighted. */
.proposal-pending-callout {
  padding: 0.85rem 1rem;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--white);
  outline: none;
  scroll-margin-top: 5rem;
}

.proposal-pending-title {
  margin: 0 0 0.5rem;
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  color: var(--ink);
}

.proposal-pending-callout:target {
  background: var(--warn-bg);
}

@media (prefers-reduced-motion: no-preference) {
  .proposal-pending-callout:target {
    animation: proposal-pending-flash 1.6s ease-out 1 forwards;
  }
}

@keyframes proposal-pending-flash {
  0%,
  35% {
    background: var(--warn-bg);
    box-shadow: 0 0 0 3px var(--warn-line);
  }

  100% {
    background: var(--white);
    box-shadow: none;
  }
}

/* One pending requirement per line: the sentence, then the tab that fixes it. */
.proposal-pending {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
}

.proposal-pending li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  color: var(--ink);
}

.proposal-pending li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn-fg);
  transform: translateY(-1px);
}

/* Information under the card that blocks nothing: muted ink, no warning colour. */
.proposal-notes {
  margin: 0.5rem 0 0;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}

.proposal-notes li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

/* General: the identity form beside the linked quote and the versions. */
.proposal-tab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.proposal-tab-grid > .hub-form > .hub-fieldset-plain > .panel,
.proposal-tab-grid > .panel {
  margin: 0;
}

.proposal-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}

.proposal-field-half {
  max-width: calc(50% - 0.5rem);
}

.proposal-legend {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  color: var(--ink);
}

.proposal-subtitle {
  margin-top: 1.25rem;
}

.proposal-versions li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.proposal-versions li > :last-child {
  margin-left: auto;
}

/* Módulos Trackvy as cards: as many 260px columns as fit, every card as tall as its row, the text
   wrapping inside. The selector carries .hub-form label so it outranks `.hub-form label.hub-check`,
   whose padding: 0.45rem 0 used to strip the card's side padding and let the text reach the border. */
.proposal-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16.25rem, 100%), 1fr));
  gap: 0.75rem;
}

.hub-form label.proposal-module,
.proposal-module {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}

/* The box sits on the title's first line, not in the middle of the card. */
.proposal-module .hub-check-input {
  margin-top: 0.1rem;
}

.proposal-module .hub-check-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.proposal-module-title {
  display: block;
  font-weight: 600;
}

.hub-form label.proposal-module:has(.hub-check-input:checked),
.proposal-module:has(.hub-check-input:checked) {
  border-color: var(--blue);
  background: var(--paper);
}

/* The proposal pages' one multi-select (fragments/form-field :: checklist): a vertical list of
   checkbox rows, the whole row the click target, hairlines between rows, the option's words over a
   muted line. Past six options (.is-long) it takes two columns where the width allows. */
.hub-checklist {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 2.5rem;
  max-width: 44rem;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
  list-style: none;
}

.hub-checklist > li {
  border-bottom: 1px solid var(--line-soft);
}

.hub-form .hub-checklist label.hub-check,
.hub-checklist .hub-check {
  align-items: flex-start;
  gap: 0.8rem;
  height: 100%;
  padding: 0.7rem 0.5rem;
  border-radius: 6px;
}

.hub-checklist .hub-check:hover {
  background: var(--paper);
}

.hub-checklist .hub-check:has(.hub-check-input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.hub-checklist .hub-check-input {
  margin-top: 0.1rem;
}

.hub-checklist .hub-check-title {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

.hub-checklist .hub-check-input:checked + .hub-check-label .hub-check-title {
  font-weight: 600;
  color: var(--navy);
}

.hub-checklist .hub-check-hint {
  max-width: 60ch;
}

@media (min-width: 992px) {
  .hub-checklist.is-long {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  /* Two columns start with a hairline over each, not just the first. */
  .hub-checklist.is-long {
    border-top: 0;
  }

  .hub-checklist.is-long > li:nth-child(-n + 2) {
    border-top: 1px solid var(--line-soft);
  }
}

/* Prose fields grow with their text up to a ceiling, then scroll: a long Detonante shows whole and
   an empty one stays short. Browsers without field-sizing keep the rows attribute. */
.hub-autosize,
.proposal-narrative-field textarea.form-control,
.proposal-field-grid textarea.form-control {
  field-sizing: content;
  min-height: 4.5rem;
  max-height: 22rem;
  resize: vertical;
}

/* Help text and hints read at a comfortable line length. */
.hub-measure,
.hub-form .field-hint {
  max-width: 80ch;
}

/* A duration: the number and its unit side by side (fragments/duration-field.html). flex-basis wins
   over the width: 100% that .hub-form gives every control. */
.hub-duration {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.hub-duration .hub-duration-amount {
  flex: 0 0 5rem;
  min-width: 0;
  text-align: right;
}

.hub-duration .hub-duration-unit {
  flex: 0 0 5.5rem;
  min-width: 0;
}

/* An editable table saved with one Guardar (TableForm): rows breathe, the refused row is marked
   with a hairline and its sentence sits under it, and the one save sits under the table. */
.hub-edit-table > tbody > tr > td {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line-soft);
}

.hub-edit-table .hub-col-wide {
  min-width: 18rem;
}

.hub-edit-table .hub-col-name {
  min-width: 13rem;
}

.hub-edit-table .hub-col-choice {
  min-width: 12rem;
}

/* A single short value in an inline form (a factor, a rate): the field keeps its own width. */
.hub-form-inline .field.is-narrow {
  flex: 0 1 10rem;
}

.hub-edit-table > tbody > tr.is-refused > td {
  border-bottom: 0;
}

.hub-edit-table > tbody > tr.hub-row-error > td {
  padding-top: 0;
  color: var(--bad-fg);
  font-size: var(--hub-fs-sm);
}

.hub-table-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
}

@media (max-width: 991.98px) {
  .proposal-tab-grid,
  .proposal-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .proposal-field-half {
    max-width: none;
  }
}

/* Edición avanzada keeps customer-specific prose by section. */
.proposal-authoring-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.proposal-narrative-toc {
  position: sticky;
  top: 1rem;
}

.proposal-section-nav {
  display: grid;
  gap: 0.25rem;
  margin-top: 1rem;
}

.proposal-section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-btn);
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
}

.proposal-section-link:hover {
  background: var(--paper);
  color: var(--ink);
}

.proposal-section-link.is-active {
  background: var(--navy-tint);
  color: var(--navy);
  font-weight: 600;
}

.proposal-section-count {
  min-width: 1.55rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-size: var(--hub-fs-xs);
  text-align: center;
}

.proposal-narrative-editor-header,
.proposal-narrative-field-heading,
.proposal-token-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.proposal-narrative-editor-header {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.proposal-token-toolbar {
  flex-wrap: wrap;
  padding: 0.75rem;
  border-radius: var(--radius-btn);
  background: var(--paper);
  margin-bottom: 1.25rem;
}

.proposal-token-toolbar-label {
  margin-right: 0.25rem;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
  font-weight: 600;
}

.proposal-narrative-field {
  margin-block: 1.35rem;
}

.proposal-narrative-field-heading {
  min-height: 2rem;
  margin-bottom: 0.45rem;
}

.proposal-narrative-field-heading label {
  margin: 0 auto 0 0;
}

.proposal-narrative-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-block: 0.8rem;
  background: var(--white);
}

@media (max-width: 991.98px) {
  .proposal-authoring-layout {
    grid-template-columns: 1fr;
  }

  .proposal-narrative-toc {
    position: static;
  }

  .proposal-section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .proposal-section-nav {
    grid-template-columns: 1fr;
  }

  .proposal-narrative-editor-header,
  .proposal-narrative-field-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .proposal-narrative-field-heading label {
    margin-right: 0;
  }
}

/* =====================================================================
   Cronograma editor: the Cronograma tab of the Trackvy formal proposal
   (fragments/schedule-editor.html, static/js/hub/schedule-editor.js)
   ===================================================================== */

/*
 * The approved prototype (gantt-proto, 2026-09-23) in brand tokens. The three heights below are
 * load-bearing: the HTML rows on the left line up with the SVG rows on the right only because they
 * match ScheduleChartLayout.Frame.editor() (a 40 axis, 28 block headings, 34 rows). --schedule-gold
 * is the prototype's snap guide and "changed by the consultant" dot; the brand had no token for it,
 * so it lives in brand/tokens.css now, next to the rest of Hub's one-off colours.
 */
.schedule-editor {
  --schedule-axis: 40px;
  --schedule-group: 28px;
  --schedule-row: 34px;
  position: relative;
  /* The whole panel is swapped on every change; a scroll anchor inside it would move the page. */
  overflow-anchor: none;
}

.schedule-switch {
  margin: 0;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
}

.schedule-chip {
  padding: 3px 9px;
  border: 1.5px dashed var(--schedule-chip-line);
  border-radius: 6px;
  background: var(--white);
  color: var(--body);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.schedule-chip.is-off {
  opacity: 0.45;
}

.schedule-totals {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.schedule-totals b {
  margin-right: 3px;
  font-size: var(--hub-fs);
  font-weight: 600;
  color: var(--navy);
}

/* Add a phase, pick its group, the gestures in one line, and Volver a sugerir at the far end. */
.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.schedule-add-name {
  flex: 0 1 20rem;
  min-width: 12rem;
}

.schedule-add-block {
  width: auto;
  min-width: 10rem;
}

/*
 * A form field with a standard text (fragments/default-field.html) keeps a plain field's rhythm, so
 * it lines up with the field beside it; the badge and the reset link sit on the label's line.
 */
.field.proposal-narrative-field {
  margin-block: 0 0.8rem;
}

.field.proposal-narrative-field .proposal-narrative-field-heading {
  min-height: 0;
  margin-bottom: 0.3rem;
}

.field.proposal-narrative-field .proposal-narrative-field-heading label {
  margin-bottom: 0;
}

.proposal-narrative-field-heading .btn-link {
  padding: 0;
  font-size: var(--hub-fs-xs);
}

/* "Textos para el cliente": one line per phase, its name and badge left, its sentence right. */
.schedule-notes {
  margin-top: 1.25rem;
}

.schedule-note-row {
  display: grid;
  grid-template-columns: minmax(12rem, 22rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.25rem 1rem;
  margin: 0 0 0.4rem;
}

.schedule-note-row .proposal-narrative-field-heading {
  margin: 0;
}

/* The standard white field, as every other form: grey read as disabled (consultants, 2026-09-23).
   Only an emitted proposal disables them, and then Bootstrap's disabled look is the truth. */
.schedule-notes .schedule-note:not(:disabled) {
  border: 1px solid var(--line);
  background-color: var(--white);
  color: var(--ink);
}

.schedule-notes-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}

.schedule-notes-head .proposal-legend {
  margin: 0;
}

/* Separar on a supply class row: a small menu of its products; Unir on a split row. */
.schedule-split {
  position: relative;
  flex: none;
}

.schedule-split > summary,
.schedule-join {
  display: inline-flex;
  align-items: center;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
}

.schedule-split > summary::-webkit-details-marker {
  display: none;
}

.schedule-split[open] > summary,
.schedule-split > summary:hover,
.schedule-join:hover {
  border-color: var(--blue);
}

.schedule-split-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 8;
  min-width: 18rem;
  max-width: 24rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(var(--navy-rgb), 0.14);
}

.schedule-split-title {
  margin: 0.2rem 0.45rem 0.35rem;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}

.schedule-split-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.4rem 0.45rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  text-align: left;
}

.schedule-split-item:hover,
.schedule-split-item:focus-visible {
  background: var(--paper);
}

.schedule-split-days {
  flex: none;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Takes the room left between the add controls and Volver a sugerir, and wraps inside it. */
.schedule-hint {
  flex: 1 1 12rem;
  min-width: 0;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  text-align: right;
}

/* Refusals: the prototype's toast, top right of the panel, fading by itself. */
.schedule-flash {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 6;
  max-width: 28rem;
  padding: 8px 12px;
  border-radius: 7px;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  pointer-events: none;
  animation: schedule-flash-out 0.2s ease 6s forwards;
}

@keyframes schedule-flash-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.schedule-board {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
}

.schedule-labels {
  position: relative;
  min-width: 0;
}

.schedule-axis-label {
  display: flex;
  align-items: flex-end;
  height: var(--schedule-axis);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
}

.schedule-group {
  display: flex;
  align-items: flex-end;
  height: var(--schedule-group);
  padding-bottom: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--blue-deep);
}

.schedule-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--schedule-row);
  border-bottom: 1px solid var(--line-soft);
  background: var(--white);
}

.schedule-row.is-lifted {
  z-index: 5;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(var(--navy-rgb), 0.18);
}

.schedule-grip {
  flex: none;
  width: 10px;
  height: 14px;
  background: radial-gradient(circle, var(--schedule-mute) 1.1px, transparent 1.3px) 0 0 / 4px 4px;
  cursor: grab;
  touch-action: none;
}

.schedule-seq {
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--navy);
  cursor: pointer;
}

.schedule-name {
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
  border-radius: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  outline: none;
}

.schedule-name[contenteditable="true"] {
  background: var(--white);
  box-shadow: 0 0 0 1.5px var(--blue);
  text-overflow: clip;
}

.schedule-name small {
  font-size: inherit;
  font-weight: 400;
  color: var(--muted);
}

.schedule-dot {
  display: inline-block;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--schedule-gold);
}

.schedule-missing {
  flex: none;
  padding: 0 5px;
  border: 1px solid var(--warn-line);
  border-radius: 4px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 10.5px;
  font-weight: 600;
}

/* The row's duration: the shared number-and-unit pair (fragments/duration-field.html), compact to
   fit a 34-high row. */
.schedule-dur {
  flex: none;
  gap: 2px;
}

.schedule-dur .hub-duration-amount,
.schedule-dur .hub-duration-unit {
  height: 24px;
  min-height: 0;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--white);
  color: var(--navy);
  font: 500 11.5px var(--font-mono);
  box-shadow: none;
}

.schedule-dur .hub-duration-amount {
  flex: 0 0 44px;
  text-align: right;
  -moz-appearance: textfield;
}

.schedule-dur .hub-duration-amount::-webkit-inner-spin-button,
.schedule-dur .hub-duration-amount::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

/* No arrow in a 34-high row: the unit reads as a small chip beside the number and still opens
   its list on a click. */
.schedule-dur select.hub-duration-unit {
  flex: 0 0 44px;
  padding: 0 2px;
  appearance: none;
  -webkit-appearance: none;
  background-size: 0 0;
  text-align: center;
  text-align-last: center;
}

.schedule-dur .hub-duration-amount:focus,
.schedule-dur .hub-duration-unit:focus {
  border-color: var(--blue);
  box-shadow: none;
}

.schedule-dur .hub-duration-amount:disabled,
.schedule-dur .hub-duration-unit:disabled {
  border-color: transparent;
  background-color: transparent;
  background-size: 0 0;
}

.schedule-row.is-missing .schedule-dur .hub-duration-amount,
.schedule-row.is-missing .schedule-dur .hub-duration-unit {
  border-color: var(--warn-line);
  background-color: var(--warn-bg);
}

.schedule-del {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--schedule-mute);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  visibility: hidden;
}

.schedule-row:hover .schedule-del,
.schedule-del:focus-visible {
  visibility: visible;
}

.schedule-del:hover {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

/*
 * The Gantt fills its column. The SVG keeps its frame height in pixels and stretches only its width
 * (preserveAspectRatio="none"), so a row meets its bar at any screen width. Strokes keep their pixel
 * width under the stretch; schedule-editor.js undoes the stretch on the text. A close label near the
 * end of the axis flips to the left of its line (ScheduleChartLayout.CloseLine), so nothing overflows.
 */
.schedule-chart-frame {
  min-width: 0;
}

.schedule-chart {
  display: block;
  width: 100%;
  font-family: var(--font-sans);
  touch-action: none;
  user-select: none;
}

.schedule-chart line,
.schedule-chart rect {
  vector-effect: non-scaling-stroke;
}

.schedule-band { fill: var(--paper); }
.schedule-caption { font-size: 10px; fill: var(--muted); }

.schedule-week {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--muted);
  text-anchor: middle;
}

.schedule-axis { stroke: var(--line); }
.schedule-close { stroke: var(--navy); stroke-opacity: 0.45; }

.schedule-close-label {
  font-size: 9.5px;
  font-weight: 600;
  fill: var(--navy);
}

.schedule-guide {
  stroke: var(--schedule-gold);
  stroke-width: 1.5;
  visibility: hidden;
}

.schedule-guide.is-on { visibility: visible; }

.schedule-bar { cursor: grab; }
.schedule-bar:active { cursor: grabbing; }
.schedule-bar.is-critical { fill: var(--navy); }
.schedule-bar.is-procurement { fill: var(--sage-soft); }
.schedule-bar.is-work { fill: var(--blue-soft); }

.schedule-bar.is-option {
  fill-opacity: 0.4;
  stroke-width: 1.3;
  stroke-dasharray: 4 2.5;
}

.schedule-bar.is-option.is-procurement { stroke: var(--sage); }
.schedule-bar.is-option.is-work { stroke: var(--blue); }

.schedule-bar.is-option.is-critical {
  fill-opacity: 0.85;
  stroke: var(--navy);
}

/* A placeholder duration: the bar says so until someone answers "Falta plazo". */
.schedule-bar.is-missing {
  stroke: var(--sem-caliente);
  stroke-width: 1.3;
  stroke-dasharray: 2 2;
}

.schedule-duration {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--navy);
  fill-opacity: 0.78;
  pointer-events: none;
}

.schedule-duration.is-on-navy {
  fill: var(--white);
  fill-opacity: 1;
}

.schedule-resize {
  fill: transparent;
  cursor: ew-resize;
}

.schedule-editor[data-editable="false"] .schedule-bar {
  cursor: default;
}

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted);
}

.schedule-swatch {
  display: inline-block;
  width: 12px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -1px;
}

.schedule-swatch.is-critical { background: var(--navy); }
.schedule-swatch.is-procurement { background: var(--sage-soft); }
.schedule-swatch.is-work { background: var(--blue-soft); }

.schedule-swatch.is-option {
  border: 1.5px dashed var(--navy);
  background: var(--white);
}

.schedule-legend .schedule-dot {
  margin-right: 5px;
  vertical-align: 1px;
}

/* Where a phase's duration came from, beside the pointer. Placed by schedule-editor.js. */
.schedule-tip {
  position: fixed;
  /* Was 1080, above Bootstrap's own modal (1055): a duration tooltip has no business floating
     over an open dialog it is not part of. */
  z-index: var(--z-dropdown);
  max-width: 320px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-size: 11.5px;
  line-height: 1.45;
  pointer-events: none;
}

.schedule-tip span {
  color: var(--schedule-mute-soft);
}

@media (max-width: 767.98px) {
  .schedule-board {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .schedule-totals {
    margin-left: 0;
  }
}

/* =====================================================================
   Diagnostic results: the customer's own photographs
   ===================================================================== */

/*
 * A contact sheet, not a gallery. The consultant is reading answers and these are one of them, so
 * the thumbnails sit inline at a size you can judge a doorway from and open full size in a tab.
 */
.diagnostic-result-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.diagnostic-result-photos figure {
  margin: 0;
  width: 11rem;
}

.diagnostic-result-photos img {
  display: block;
  width: 100%;
  height: 8rem;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.diagnostic-result-photos a:hover img { border-color: var(--blue); }

.diagnostic-result-photos figcaption {
  margin-top: 0.35rem;
  font-size: var(--hub-fs-sm);
  line-height: 1.4;
  color: var(--ink);
}

.diagnostic-result-photo-name {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Requirements the resolver derived, and the inferences it could not settle from the answers
   alone ("he said he has metal but X, so he needs Z") — the one thing on this page that is not
   plain evidence, so it earns one calm, distinct callout rather than blending into a paragraph. */
.diagnostic-hint-callout {
  margin: 0.9rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.diagnostic-hint-callout-title {
  margin: 0 0 0.4rem;
  font-weight: 600;
  font-family: var(--font-sans);
}

.diagnostic-hint-callout ul {
  margin: 0;
  padding-left: 1.1rem;
}

.diagnostic-hint-callout li + li {
  margin-top: 0.3rem;
}

/* The operating baseline. Numbers carry the hierarchy here, so there is no new colour and no box:
   the working is muted and the result is not, which is the whole visual idea. */
.hub-unit {
  font-size: var(--hub-fs-sm);
  font-weight: 400;
  color: var(--muted);
}

/* Who last changed an answer on Resultados (Cliente, Consultor, Agente): a fact beside the question, so
   it is quiet and never a colour that reads as a grade. */
.hub-answer-source {
  margin-left: 0.5rem;
  font-size: var(--hub-fs-sm);
  font-weight: 400;
  color: var(--muted);
}

/* The mark on a quote line an agent wrote, in the editor and Cierre only: a small muted fact for the person
   about to emit, so no alarm colour and no weight. It states who wrote the line, never how good it is. */
.hub-line-author {
  display: inline-block;
  padding: 0 0.5rem;
  background: var(--line-soft);
  border-radius: 999px;
  font-size: var(--hub-fs-sm);
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
}

/* An unanswered figure is an absence, not a fault. Muted and lowercase, never alarm colour: red is
   reserved for destructive actions, and a customer who skipped a question has done nothing wrong. */
.hub-value-missing {
  font-size: var(--hub-fs-sm);
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
}

/* The working, shown so it can be checked. Quieter than the result it produces. */
.diagnostic-baseline-arithmetic {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 400;
}

.diagnostic-baseline-result {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* =====================================================================
   Diagnostic results (dfv-25): full-width, answer-first (Síntesis leads,
   the evidence follows). No right column, no peso valuation — see
   templates/diagnostic/results.html and V88's migration header.
   ===================================================================== */

/* Síntesis: the one panel with a visible accent, so the reader's eye lands here first. */
.diagnostic-synthesis {
  border-left: 3px solid var(--blue-deep);
}

.diagnostic-synthesis-line {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: 66ch;
}

.diagnostic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.diagnostic-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: var(--hub-fs-sm);
  font-weight: 500;
  background: var(--navy-tint);
  color: var(--blue-deep);
}

.diagnostic-chip-why {
  font-weight: 400;
  color: var(--teal, var(--blue-deep));
  font-size: 0.78rem;
}

/* The support-fit gap and any other flag worth a consultant's attention: warm, not alarm. */
.diagnostic-chip.is-flag {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.diagnostic-chip.is-flag .diagnostic-chip-why {
  color: var(--warn-fg);
  opacity: 0.85;
}

/* An unresolved fact (nivel Mixto/estiba, mecanismo de integración por definir): dashed, quiet. */
.diagnostic-chip.is-open {
  background: var(--line-soft);
  color: var(--body);
  border: 1px dashed var(--line);
}

.diagnostic-drivers {
  border-top: 1px solid var(--line-soft);
  padding-top: 0.7rem;
}

.diagnostic-drivers-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.diagnostic-drivers p {
  margin: 0;
  font-size: var(--hub-fs-sm);
  color: var(--body);
  max-width: 68ch;
}

.diagnostic-drivers em {
  color: var(--ink);
  font-style: italic;
}

/* A sub-heading inside "El proyecto en cifras" (El universo / Las etiquetas / La lectura /
   Restricciones), the same small-caps rhythm the rest of Hub already uses for grouped lists. */
.diagnostic-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 600;
  margin: 0.9rem 0 0.15rem;
}

.diagnostic-group-label:first-of-type {
  margin-top: 0;
}

/* An unresolved figure ("se define en la revisión"): the same warm, non-alarm treatment as the
   integration-mechanism gap, never plain muted text — a gap the consultant must act on reads
   differently from an answer nobody gave. */
.diagnostic-pending {
  color: var(--warn-fg);
  background: var(--warn-bg);
  border-radius: 6px;
  padding: 0.05rem 0.5rem;
  font-size: var(--hub-fs-sm);
}

/* En sus palabras: the customer's own text, quoted rather than tabulated. */
.diagnostic-quote-block {
  border-left: 3px solid var(--line);
  padding: 0.1rem 0 0.1rem 0.85rem;
  margin: 0 0 0.85rem;
}

.diagnostic-quote-block:last-child {
  margin-bottom: 0;
}

.diagnostic-quote-source {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.diagnostic-quote-text {
  margin: 0;
  font-size: var(--hub-fs-sm);
  color: var(--ink);
  font-style: italic;
  max-width: 64ch;
}

.diagnostic-pain-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.diagnostic-pain-chips span {
  background: var(--line-soft);
  color: var(--body);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: var(--hub-fs-sm);
}

/* Respuestas completas: the exact questions and the exact answers, sitting open right under
   the metrics. It was a <details> drawer at the foot of the page until 2026-09-07; the five
   rules that dressed its summary went with it, since every panel below is derived from this
   and the source material should not be the one thing a reader has to open. */
.diagnostic-full-answers-section {
  margin-top: 0.9rem;
}

/* =====================================================================
   Sistema: solicitudes de capacidad del agente
   ===================================================================== */

/* Goal/missing/context are free prose an agent wrote, not a short label — line breaks the agent
   typed should survive, the same reasoning behind .quote-review-notes, so a multi-sentence report
   reads as the paragraphs it was written as rather than one run-on line. */
.agent-capability-text {
  white-space: pre-line;
  min-width: 12rem;
}

/*
 * Contratos › Días: how long until this one has to be renewed, signed. Past due reads as calm
 * amber, never red — red is for destructive actions, and a contract running out is neither
 * destructive nor anybody's fault. The Estado chip already carries the word "Vencida"; this only
 * says by how much.
 */
.contract-days-overdue { color: var(--warn-fg); font-weight: 600; }

/* ── Outbound (Salidas): Staging's sibling — what leaves rather than what arrives ────────── */
/* Salidas' lists and its pane are the "Mail component" (fragments/mail.html); what is left here is the
   body of its pane and the question component. */
/* The fix of a row of Por resolver: the one link, or the two verbs. */
.outbound-fix { display: flex; flex-wrap: wrap; gap: .5rem; }
.outbound-fix form { margin: 0; }

/*
 * Shared bulk bar (js/hub/hub-bulk-select.js): pick rows, then act on all of them at once. Used by
 * Salidas and by Configuración › Agente › Solicitudes; it lived under an .outbound- name until the second
 * screen needed it. Hidden until something is checked, so a table nobody has touched stays quiet.
 */
.hub-bulk-bar {
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  margin: 0 0 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-wrap: wrap;
}
.hub-bulk-bar.is-visible { display: flex; }
.hub-bulk-count { font-weight: 600; color: var(--ink); margin-right: auto; }
/* The bar's one optional field (Solicitudes' review note) gets more room than a
   folded form's field. The row itself is .hub-form-inline.is-one-row; the bar still wraps, so on a
   narrow screen the whole form moves to its own line with its verbs beside the field. */
.hub-bulk-bar .is-one-row .field { flex-basis: 18rem; }
.hub-bulk-check-col { width: 2.25rem; }
/*
 * A folded form's toggle reads as a disclosure, not a button (Matt, 2026-09-14: "the drawer is
 * redundant [on a one-line form]... make it one liner for all, clean"). The forms that DO stay
 * folded, because a checkbox list or a typeahead cannot fit one line, still get a toggle that looks
 * like what it is, never a lookalike `.btn`). Text plus a caret that turns on open; used for Copias
 * and the note in the company's Correo tab, the two contact pickers in Emitir's "A quién" panel, and
 * the letter a reply answered, folded under the reply in Salidas' pane.
 */
.hub-disclosure { margin-top: .75rem; }
.hub-disclosure > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}
.hub-disclosure > summary::-webkit-details-marker { display: none; }
.hub-disclosure > summary .ph-caret-down { transition: transform .15s ease; }
.hub-disclosure[open] > summary { color: var(--navy); }
.hub-disclosure[open] > summary .ph-caret-down { transform: rotate(180deg); }
.hub-disclosure > form { margin-top: .5rem; }

/* The letter as it is pasted into Gmail, in the body of the pane. */
.outbound-message-body {
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--line-soft);
  border-radius: 8px;
  padding: .9rem 1rem;
  margin: 0;
}

/* The reply box quotes what the customer wrote, in the reply pane (outbound/pane.html). */
.outbound-reply-box {
  font-family: var(--font-mono);
  font-size: var(--hub-fs-sm);
  line-height: 1.55;
  color: var(--ink);
  background: var(--line-soft);
  border-radius: 8px;
  padding: .75rem .9rem;
  margin: 0 0 .9rem;
  max-height: 9rem;
  overflow-y: auto;
}
/* white-space lives on the paragraph itself, not the box: the box stays plain (normal) so the
   template's own indentation between its tags is never rendered as visible blank lines, and only
   the reply's own line breaks, carried by th:text with nothing around it, show through. */
.outbound-reply-box p {
  margin: 0;
  white-space: pre-line;
}

/*
 * The one colour on a mail settings fact sheet (HUB.md §15): a 7px dot beside "Sí" / "No" /
 * "Pausada". Red is reserved for destructive actions, so "off" reads muted rather than alarmed, * a company not receiving automatic mail is a deliberate choice, not a fault.
 */
.mail-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.mail-dot.is-on { background: var(--ok-fg); }
.mail-dot.is-off { background: var(--muted); }

/*
 * The firm switch (admin/mail.html): two pills and the consequence of the one that is selected.
 * display:contents lets the <form> wrap the value and the verb without collapsing the row's three
 * columns, and :has() on the checked radio shows exactly one hint with zero JS.
 */
.mail-level-cell {
  display: contents;
}

.mail-level-hints {
  margin-top: 0.45rem;
}

.mail-level-hints .form-hint {
  display: none;
}

.mail-level-cell:has(.mail-level input[value="OFF"]:checked) .mail-hint-off,
.mail-level-cell:has(.mail-level input[value="DRAFT"]:checked) .mail-hint-draft {
  display: block;
}

/*
 * Sistema › Correo › Plantillas: the letter itself, in the editor. A monospace face and a wide
 * measure because what is being read is where the line breaks fall and where a {{campo}} sits, not
 * the prose rhythm; the paragraph breaks in a letter are load-bearing.
 */
.mail-template-body {
  font-family: var(--font-mono);
  font-size: var(--hub-fs-sm);
  line-height: 1.5;
}

/*
 * Plantillas as a list and one open letter (Matt, 2026-09-15): every variant used to render as a full
 * editor stacked one after another. The list groups by lane and letter; a variant is a plain link
 * (?carta=), so the open letter survives a reload and a Guardar comes back to it. Stacks under the
 * editor at phone width.
 */
.mail-templates {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.mail-template-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mail-template-group-title {
  margin: 0 0 0.25rem;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.mail-template-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mail-template-link {
  display: block;
  padding: 0.3rem 0.6rem;
  border-left: 2px solid transparent;
  color: var(--ink);
  font-size: var(--hub-fs-sm);
  text-decoration: none;
}

.mail-template-link:hover {
  background: var(--paper);
}

.mail-template-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

/* The same accent the tab bar underlines its open tab with, turned on its side. */
.mail-template-link[aria-current="true"] {
  border-left-color: var(--blue);
  background: var(--line-soft);
  color: var(--blue-deep);
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .mail-templates {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mail-lane-once {
  padding-top: 0.25rem;
}

/* ── The contact form's salutation preview (fragments/salutation.html) ───────────────────────
 * One line a consultant reads before a customer does, set as plain text under the form's fields:
 * the label in the field-label voice, the greeting in body text, the team it gains muted. No box:
 * a grey block of four identical "Buenos días" was the noise this replaced (Matt, 2026-09-23).
 */
.hub-salutation {
  margin: 0 0 0.8rem;
}

.hub-form-grid + .hub-salutation {
  margin-top: 0.85rem;
}

.hub-salutation-line {
  margin: 0;
  font-size: var(--hub-fs);
  color: var(--ink);
}

.hub-salutation-label {
  font-size: var(--hub-fs-sm);
  font-weight: 500;
}

.hub-salutation-empty {
  color: var(--muted);
}

/*
 * Configuración › Permisos (system/permissions): the matrix form, then the read-only detail's
 * door chips. The matrix is one table: a plain checkbox per profile and door, a check-all in the
 * head, in each family row and in each permission row, and a save bar that follows the scroll.
 * A fixed cell is a disabled box inside the fixed mark; its reason lives in a tooltip
 * (hub-tooltip.js). Breakpoints are the file's own: 991.98px keeps the permission name pinned on
 * the left while the table scrolls inside its card, 575.98px turns each permission into a card.
 */
.hub-permission-matrix {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.hub-permission-matrix thead th {
  background: var(--white);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
/* Three sticky head rows sit under the sticky topbar; their heights add up to the next offset. */
.hub-permission-matrix thead tr:nth-child(1) th {
  position: sticky;
  top: var(--hub-content-topbar-h);
  z-index: 3;
  height: 2.4rem;
  border-bottom: 1px solid var(--line);
}
.hub-permission-matrix thead tr:nth-child(2) th {
  position: sticky;
  top: calc(var(--hub-content-topbar-h) + 2.4rem);
  z-index: 3;
  height: 2.1rem;
  font-weight: 600;
  color: var(--ink);
}
.hub-permission-matrix thead tr:nth-child(3) th {
  position: sticky;
  top: calc(var(--hub-content-topbar-h) + 4.5rem);
  z-index: 3;
  height: 2.4rem;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.hub-permission-matrix thead th.is-role {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.hub-permission-matrix thead th.hub-matrix-corner {
  vertical-align: bottom;
  padding-bottom: 0.5rem;
}
.hub-permission-matrix th:first-child,
.hub-permission-matrix td:first-child {
  text-align: left;
  padding-left: 0.5rem;
}
.hub-permission-matrix .is-role-start {
  border-left: 1px solid var(--line);
}
.hub-permission-matrix td.hub-matrix-cell {
  padding: 0;
  text-align: center;
  width: 5.5rem;
}
.hub-matrix-cell label,
.hub-matrix-cell > span.hub-matrix-fixed {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.55rem 0;
  cursor: pointer;
}
.hub-matrix-cell > span.hub-matrix-fixed {
  cursor: not-allowed;
}
.hub-matrix-cell.is-changed {
  background: color-mix(in srgb, var(--blue) 12%, var(--white));
  box-shadow: inset 3px 0 0 var(--blue);
}
.hub-matrix-cell.is-fixed {
  background: var(--line-soft);
}
.hub-permission-matrix .hub-check-input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.hub-permission-matrix .hub-check-input:disabled:checked {
  background-color: var(--muted);
  border-color: var(--muted);
}
.hub-permission-matrix tbody tr:hover td {
  background-color: color-mix(in srgb, var(--blue) 4%, var(--white));
}
.hub-permission-matrix tbody tr:hover td.is-changed {
  background: color-mix(in srgb, var(--blue) 12%, var(--white));
}
.hub-permission-matrix tbody tr:hover td.is-fixed {
  background: var(--line-soft);
}
.hub-matrix-group th {
  background: var(--line-soft);
  padding: 0.4rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
  font-weight: 600;
}
.hub-matrix-group td {
  background: var(--line-soft);
  padding: 0;
  text-align: center;
}
.hub-matrix-group td label {
  display: flex;
  justify-content: center;
  padding: 0.4rem 0;
  margin: 0;
  cursor: pointer;
}
.hub-matrix-name {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.hub-matrix-name label {
  display: flex;
  margin: 0;
  cursor: pointer;
}
.hub-matrix-key {
  display: block;
  font-size: var(--hub-fs-xs);
  color: var(--muted);
}
.hub-matrix-kind {
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-left: 0.4rem;
}
.hub-matrix-doors-note {
  font-size: var(--hub-fs-xs);
  font-weight: 400;
  color: var(--muted);
}
.hub-permission-matrix thead .hub-check {
  padding: 0;
}
.hub-permission-matrix thead .hub-matrix-head-check {
  justify-content: center;
}
.hub-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.hub-matrix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hub-matrix-swatch {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  border: 1.5px solid var(--line);
  display: inline-block;
}
.hub-matrix-swatch.is-fixed {
  background: var(--line-soft);
  opacity: 0.8;
}
.hub-matrix-swatch.is-changed {
  background: color-mix(in srgb, var(--blue) 12%, var(--white));
  border-color: var(--blue);
}

/* The save bar follows the scroll, so the submit is always in reach. */
.hub-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 -4px 14px rgba(var(--shadow-deep-rgb), 0.06);
}
.hub-save-bar-status {
  font-weight: 600;
  color: var(--ink);
}
.hub-save-bar-status.is-clean {
  font-weight: 400;
  color: var(--muted);
}
.hub-save-bar-hint {
  font-size: var(--hub-fs-sm);
  color: var(--muted);
  margin-left: 0.75rem;
  font-weight: 400;
}
.hub-save-bar-actions {
  margin: 0;
}

/* The wide table keeps its sticky head, so its card must not scroll; below 992px it scrolls. */
.hub-table-panel-matrix {
  overflow: visible;
}
/* Phone-only parts, off until the phone tier below. */
.door-short,
.hub-matrix-celllabel,
.hub-matrix-toolbar,
.hub-matrix-rolecaption {
  display: none;
}

/* Tablet and small laptop: one letter per door, narrow cells, the permission name pinned left. */
@media (max-width: 991.98px) {
  .hub-table-panel-matrix {
    overflow-x: auto;
    padding: 0.5rem 0.5rem 0.25rem;
  }
  /* Visually hidden, not display:none: the column keeps its full name for a screen reader. */
  .door-long {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .door-short {
    display: inline;
    cursor: help;
  }
  .hub-permission-matrix thead tr:nth-child(n) th {
    position: static;
  }
  .hub-permission-matrix thead tr:nth-child(n) th:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    min-width: 12rem;
  }
  .hub-permission-matrix td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--white);
    min-width: 12rem;
    box-shadow: 1px 0 0 var(--line-soft);
  }
  .hub-matrix-group th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
  }
  .hub-permission-matrix {
    table-layout: fixed;
    min-width: 30rem;
  }
  .hub-matrix-col {
    width: 3rem;
  }
  .hub-permission-matrix td.hub-matrix-cell,
  .hub-matrix-group td {
    min-width: 0;
  }
  .hub-permission-matrix thead th.is-role {
    font-size: var(--hub-fs-sm);
  }
  .hub-permission-matrix thead th {
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }
  .hub-matrix-kind {
    display: none;
  }
}

/* Phone: one card per permission, a profile caption over three labelled checkboxes each. The
   same boxes and names as the table; the toolbar carries the check-alls. */
@media (max-width: 575.98px) {
  .hub-matrix-toolbar {
    display: block;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 0.5rem 0.75rem 0.75rem;
    margin: 0 0 0.75rem;
  }
  .hub-matrix-toolbar-title {
    font-size: var(--hub-fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
    margin: 0.25rem 0 0;
  }
  .hub-matrix-toolbar-roles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.5rem;
  }
  .hub-matrix-toolbar-role {
    font-weight: 600;
    color: var(--ink);
    margin: 0.4rem 0 0;
  }
  .hub-matrix-toolbar label.hub-check {
    min-height: 2.75rem;
    padding: 0;
  }
  .hub-table-panel-matrix {
    overflow: visible;
    padding: 0;
  }
  .hub-permission-matrix thead {
    display: none;
  }
  .hub-permission-matrix,
  .hub-permission-matrix tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .hub-permission-matrix tbody tr[data-permission-key] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.5rem;
    padding: 0.75rem 0.75rem 0.4rem;
    border-bottom: 1px solid var(--line);
  }
  .hub-permission-matrix td {
    display: block;
    padding: 0;
    border: 0;
  }
  .hub-permission-matrix td.hub-matrix-name-cell {
    position: static;
    min-width: 0;
    box-shadow: none;
    grid-column: 1 / -1;
    grid-row: 1;
    padding-left: 0;
    background: transparent;
  }
  .hub-permission-matrix td.hub-matrix-rolecaption {
    grid-row: 2;
    margin-top: 0.5rem;
    padding-left: 0.6rem;
    font-size: var(--hub-fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
  }
  .hub-permission-matrix td[data-role="PARTNER"] {
    grid-column: 1;
  }
  .hub-permission-matrix td[data-role="ENGINEER"] {
    grid-column: 2;
  }
  .hub-permission-matrix td[data-channel="WEB"] {
    grid-row: 3;
  }
  .hub-permission-matrix td[data-channel="MCP"] {
    grid-row: 4;
  }
  .hub-permission-matrix td[data-channel="REST"] {
    grid-row: 5;
  }
  .hub-permission-matrix td.hub-matrix-cell {
    width: auto;
    min-width: 0;
    text-align: left;
    border-left: 0;
    border-radius: 6px;
    margin-bottom: 0.25rem;
  }
  .hub-matrix-cell label,
  .hub-matrix-cell > span.hub-matrix-fixed {
    justify-content: flex-start;
    gap: 0.65rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.6rem;
  }
  .hub-matrix-celllabel {
    display: inline;
    font-size: var(--hub-fs-sm);
    color: var(--ink);
  }
  .hub-matrix-cell.is-fixed .hub-matrix-celllabel {
    color: var(--muted);
  }
  .hub-matrix-name label {
    padding: 0.5rem 0.5rem 0.5rem 0;
  }
  .hub-matrix-kind {
    display: inline;
  }
  .hub-permission-matrix tbody tr.hub-matrix-group {
    display: block;
    border-bottom: 0;
    padding: 0;
  }
  .hub-matrix-group th {
    display: block;
    width: 100%;
    position: static;
    padding: 0.55rem 0.75rem;
  }
  .hub-permission-matrix tr.hub-matrix-group td {
    display: none;
  }
  .hub-permission-matrix tbody tr:hover td,
  .hub-permission-matrix tbody tr:hover td.is-fixed,
  .hub-permission-matrix tbody tr:hover td.is-changed {
    background-color: transparent;
  }
  .hub-permission-matrix tbody tr:hover td.is-fixed {
    background-color: var(--line-soft);
  }
  .hub-permission-matrix tbody tr:hover td.is-changed {
    background-color: color-mix(in srgb, var(--blue) 12%, var(--white));
  }
  .hub-save-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .hub-save-bar-hint {
    display: block;
    margin: 0;
  }
  .hub-save-bar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .hub-save-bar-actions .btn {
    min-height: 2.75rem;
  }
  .hub-matrix-legend {
    gap: 0.4rem 1rem;
  }
}

/* The read-only detail: a door is a chip, on or off; a fixed one is the shared fixed-cell mark. */
.hub-door-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: var(--hub-fs-xs);
  font-weight: 600;
  color: var(--muted);
  background: var(--white);
  white-space: nowrap;
}
.hub-door-chip.is-on {
  border-color: transparent;
  background: var(--ok-bg);
  color: var(--ok-fg);
}
.hub-fixed-cell {
  color: var(--muted);
  cursor: help;
}
/* The scope picker lists up to 12 groups; columns keep it on one screen at desktop width. */
.hub-scope-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.5rem;
}
.hub-scope-group {
  break-inside: avoid;
}
.hub-fixed-cell.is-held {
  color: var(--ok-fg);
  font-size: 0.75rem;
}
.hub-fixed-cell:focus-visible,
.hub-scope-chip:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.hub-permission-grid th,
.hub-permission-grid td {
  width: 25%;
}

/*
 * Usuarios › Agente: a credential's scope as chips. An item whose matrix cell is off right now is
 * struck through; the credential keeps it on paper and cannot use it (fixed-cell :: struckScope).
 */
.hub-scope-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.hub-scope-chip.is-off {
  text-decoration: line-through;
  background: var(--line-soft);
  color: var(--muted);
  cursor: help;
}
.hub-scope-more > summary {
  cursor: pointer;
  list-style: none;
}
.hub-scope-more > summary::-webkit-details-marker {
  display: none;
}
.hub-scope-more[open] > .hub-scope-chips {
  margin-top: 0.25rem;
}

/*
 * PDF jobs (fragments/pdf-job.html, js/hub/pdf-job.js): one panel in one shared modal. The bar is a
 * native <progress> fed by the steps the render reported, so it needs no inline width; the steps
 * are real events on the server, never a timer.
 */
.pdf-job-control {
  display: inline-flex;
}
.pdf-job-panel {
  display: grid;
  gap: 0.5rem;
}
.pdf-job-title {
  margin: 0;
  font-size: var(--hub-fs-xl);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.pdf-job-progress {
  display: block;
  width: 100%;
  height: 0.65rem;
  accent-color: var(--blue);
}
.pdf-job-step {
  margin: 0;
  font-weight: 500;
}
.pdf-job-meta,
.pdf-job-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}
.pdf-job-panel.is-failed .pdf-job-step,
.pdf-job-panel.is-gone .pdf-job-step {
  color: var(--bad-fg);
}

/* A choice that is one whole link: an icon, a name and a hint (Nueva firma's type chooser). Hover
   and keyboard focus raise the border and the shadow, the way the other clickable surfaces do. */
.hub-choice-list {
  display: grid;
  gap: 0.75rem;
}

.hub-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 1.05rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-choice-card:hover,
.hub-choice-card:focus-visible {
  border-color: var(--blue-soft);
  box-shadow: 0 2px 10px rgba(var(--shadow-deep-rgb), 0.08);
  color: var(--ink);
}

.hub-choice-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.hub-choice-card-icon {
  flex: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--blue);
}

.hub-choice-card-body {
  display: block;
}

.hub-choice-card-title {
  display: block;
  font-weight: 600;
}

.hub-choice-card-hint {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: var(--hub-fs-sm);
}
