/* ═══════════════════════════════════════════════════════════════════════════
   K2 · KIT BASE DE LAS PÁGINAS JINJA
   El mismo sistema del gestor, para las páginas que sirve FastAPI con Jinja y
   que ya pasaron a K2 (la primera: /j/{hash}, resultados_juris.html). Es el kit
   de la landing K2 (design/landing-k2/k2-base.css, rama claude/landing-k2), con
   la letra servida desde /static/fuentes/.

   · Los tokens de color viven al lado, en k2_tokens.css (copia exacta de
     frontend/src/gestor.css, atada por tests/test_k2_base_jinja.py), que se
     carga antes que esta hoja.
   · Aquí no hay un solo color literal: todo sale de var(--…). Tampoco hay
     `opacity` para apagar texto (va --text-2/--text-3) ni `color: #fff`
     sobre la tinta (va --accent-fg).
   · El tema: lo pone js/k2_tema.js en <html data-theme> antes de pintar. Si no
     hay atributo (sin guion), manda prefers-color-scheme con los mismos
     valores (el bloque @media de k2_tokens.css).
   · La letra va alojada en /static/fuentes/ (nada de Google ni CDN): copias
     byte a byte de frontend/src/tipografia/, con su licencia al lado.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Letra (alojada) ─────────────────────────────────────────────────────────
   Mismas caras que frontend/src/tipografia/tipografia.css: Inter variable
   (tamaño óptico 14–32, peso 400–600), JetBrains Mono 400/500 y DM Sans 600. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/static/fuentes/inter-variable-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fuentes/jetbrains-mono-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fuentes/jetbrains-mono-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fuentes/dm-sans-600-latin.woff2') format('woff2');
}

/* ── Geometría y letra (sin color) ───────────────────────────────────────────
   Radios y familias: copia de :root de gestor.css. El resto (márgenes, aire de
   sección, ancho) es el de la landing K2 y no toca la paleta. */
:root {
  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, Menlo, monospace;
  --marca: 'DM Sans', var(--sans);

  --e-out:      cubic-bezier(.22, .61, .36, 1);
  --e-out-expo: cubic-bezier(.16, 1, .3, 1);

  /* Landing: el ancho del contenido, el margen lateral y el aire de sección. */
  --k2-ancho: 1200px;
  --k2-margen: 16px;                               /* teléfono: 16 px, regla de la casa */
  --k2-seccion: clamp(56px, 4.4vw + 39px, 112px);  /* 56 a 390 px · 102 a 1440 px */
  --k2-alto-barra: 56px;
}
@media (min-width: 761px)  { :root { --k2-margen: 24px; } }
@media (min-width: 1200px) { :root { --k2-margen: 32px; } }

/* ── Reset mínimo ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  /* Un ancla o el foco con Tab no quedan debajo de la barra fija. */
  scroll-padding-top: calc(var(--k2-alto-barra) + 16px);
}
/* Cada elemento que declara un tema pinta su propio fondo y su tinta (así una
   sección puede forzar un tema dentro de otro). Especificidad cero: cualquier
   clase lo pisa. */
:where(:root, [data-theme="light"], [data-theme="dark"]) { background-color: var(--bg); color: var(--text); }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; font-weight: 400; line-height: 1.6;
  /* Inter con su tamaño óptico 32 (el trazo del gestor) y la «a» de un piso
     sin tocar: cv11 apagado. Igual que html, body en gestor.css. */
  font-variation-settings: 'opsz' 32;
  font-feature-settings: 'cv11' 0;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }
img, video, iframe { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; font-variation-settings: inherit; }
a { color: inherit; text-decoration: none; }
/* Un enlace suelto dentro de un texto que se lee: en tinta y subrayado. */
:where(p, li, dd) > a:not([class]) {
  text-decoration: underline; text-decoration-color: var(--deco);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
:where(p, li, dd) > a:not([class]):hover { text-decoration-color: var(--text-3); }
::selection { background: var(--accent-bg); }
/* El foco es el hilo cobalto, separado 2 px de lo enfocado: el hueco deja ver
   el fondo real, así el anillo nunca queda pegado a la tinta (pegado daría
   2,25:1 en claro y 1,90 en oscuro, DISENO §3). */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.k2-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.k2-num { font-variant-numeric: tabular-nums; }

/* ── Escala tipográfica ─────────────────────────────────────────────────────────
   Inter 400/500 para todo; la jerarquía la dan tamaño y tinta, no la negrita
   (600 queda para la marca y el énfasis dentro de un texto que se lee). Los
   titulares fluyen entre 390 y 1440 px y se apoyan en la escala del gestor:
   la entradilla toma los 19 px de .cs-lede, el h3 los 19 px de .page-head h1,
   la pequeña los 13 px del cuerpo del gestor y el rótulo sus 12 px. */
.k2-display {
  font-size: clamp(36px, 2.29vw + 27px, 60px);   /* 36 a 390 px · 60 a 1440 px */
  font-weight: 500; line-height: 1.04; letter-spacing: -0.026em;
  color: var(--text); text-wrap: balance;
}
.k2-h2 {
  font-size: clamp(26px, 1.15vw + 21.5px, 38px); /* 26 a 390 px · 38 a 1440 px */
  font-weight: 500; line-height: 1.12; letter-spacing: -0.02em;
  color: var(--text); text-wrap: balance;
}
.k2-h3 {
  font-size: 19px; font-weight: 500; line-height: 1.3; letter-spacing: -0.012em;
  color: var(--text);
}
.k2-entradilla {
  font-size: clamp(16px, 0.29vw + 14.9px, 19px); /* 16 a 390 px · 19 a 1440 px */
  font-weight: 400; line-height: 1.5; letter-spacing: -0.006em;
  color: var(--text-2); text-wrap: pretty;
}
.k2-cuerpo { font-size: 15px; font-weight: 400; line-height: 1.6; color: var(--text-2); text-wrap: pretty; }
.k2-pequena { font-size: 13px; font-weight: 400; line-height: 1.5; color: var(--text-2); }
/* Rótulo en mayúsculas: Inter 12 px, como .nav-group-lab del gestor. */
.k2-rotulo {
  font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-3);
}
/* Una cifra: Inter 500 con cifras tabulares (no baila al cambiar). Nunca mono. */
.k2-cifra {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: clamp(32px, 1.14vw + 27.5px, 44px); /* 32 a 390 px · 44 a 1440 px */
  font-weight: 500; line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.k2-cifra small { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--text-2); }
/* El énfasis dentro de un texto que se lee. */
:where(.k2-cuerpo, .k2-entradilla, .k2-pequena) strong { font-weight: 600; color: var(--text); }
/* Tonos para apagar: NUNCA opacity (compone contra el fondo y baja el contraste). */
.k2-tono-1 { color: var(--text); }
.k2-tono-2 { color: var(--text-2); }
.k2-tono-3 { color: var(--text-3); }
/* Ancho de lectura cómodo para párrafos. */
.k2-medida { max-width: 62ch; }

/* ── Disposición ─────────────────────────────────────────────────────────── */
.k2-contenedor {
  width: 100%; max-width: calc(var(--k2-ancho) + 2 * var(--k2-margen));
  margin-inline: auto; padding-inline: var(--k2-margen);
}
.k2-seccion { padding-block: var(--k2-seccion); }
.k2-pila { display: flex; flex-direction: column; gap: var(--k2-pila, 16px); min-width: 0; }
.k2-rejilla {
  display: grid; gap: var(--k2-rejilla-gap, 16px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--k2-rejilla-min, 260px)), 1fr));
}
/* Un solo corte de teléfono, el del gestor (TELEFONO = 760 px, DISENO §3 bis). */
@media (max-width: 760px) { .k2-solo-escritorio { display: none !important; } }
@media (min-width: 761px) { .k2-solo-telefono { display: none !important; } }

/* ── Marca: la hoja + «Folium» con su punto ──────────────────────────────────
   La hoja real (hoja-folium.svg, trazo currentColor) en --logo-ink: marino
   #1e3a5e en claro, crema #f0ebe2 en oscuro. El nombre en DM Sans 600, la
   única letra que no es Inter. Todo se mide en em desde font-size: 14 px es la
   firma del menú del gestor (hoja 22, punto 4, hueco 7). */
.k2-marca {
  display: inline-flex; align-items: center; gap: 0.5em; flex: none;
  font-size: 14px; color: var(--logo-ink); text-decoration: none; white-space: nowrap;
  border-radius: var(--radius-sm);
}
.k2-marca--grande { font-size: 17px; }
.k2-marca-hoja { display: block; flex: none; width: 1.5715em; height: 1.5715em; color: var(--logo-ink); }
.k2-marca-hoja svg { display: block; width: 100%; height: 100%; }
.k2-marca-nombre {
  font-family: var(--marca); font-weight: 600; font-size: 1em; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--logo-ink); font-variation-settings: normal; font-feature-settings: 'ss01';
}
.k2-marca-punto {
  display: inline-block; width: 0.2857em; height: 0.2857em; border-radius: 50%;
  background: var(--logo-punto); vertical-align: middle; margin: 0 0 0.07em 0.2143em;
}
/* Solo en pantallas 1x y a 22 px: el trazo (1,8 de 48) mide 0,83 px de
   dispositivo y se pinta gris, no marino. Se lleva a 1 px justo y las
   nervaduras suben lo justo para no borrarse (gestor.css, .sidebar-brand). Es
   el dibujo del logo, no texto: aquí la opacidad es del trazo. */
@media (max-resolution: 1.49dppx) {
  .k2-marca:not(.k2-marca--grande) .k2-marca-hoja path { stroke-width: 2.18px; }
  .k2-marca:not(.k2-marca--grande) .k2-marca-hoja line { stroke-width: 1.58px; opacity: 0.6; }
  .k2-marca:not(.k2-marca--grande) .k2-marca-hoja line.nerv { stroke-width: 1.33px; opacity: 0.46; }
}

/* ── Barra superior ──────────────────────────────────────────────────────────
   Translúcida sobre la página, con filete abajo. Lleva la marca, la
   navegación, el interruptor de tema y, como mucho, UNA acción en tinta. */
.k2-barra {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 0.8px solid var(--border);
}
.k2-barra-dentro { display: flex; align-items: center; gap: 16px; min-height: var(--k2-alto-barra); }
.k2-barra-acciones { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ── Navegación: lo actual va en píldora ─────────────────────────────────── */
.k2-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.k2-nav a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 10px;
  border-radius: var(--radius); border: 0.8px solid transparent;
  font-size: 13px; font-weight: 400; line-height: 1; color: var(--text-2); white-space: nowrap;
  transition: background 150ms, color 150ms, box-shadow 150ms, border-color 150ms;
}
.k2-nav a:hover { background: var(--bg-hover); color: var(--text); }
.k2-nav a[aria-current]:not([aria-current='false']) {
  background: var(--pildora); border-color: var(--border); box-shadow: var(--sombra-reposo); color: var(--text);
}

/* ── Doble marco: bandeja rayada + tarjeta ───────────────────────────────────
   La bandeja es un pozo gris con rayado diagonal y filete de 0,8 px; dentro va
   la tarjeta, que es la que lleva el contenido. El título y el pie viven en la
   bandeja, fuera de la tarjeta (DISENO §3 bis). */
.k2-bandeja {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: 4px; border-radius: var(--radius-lg);
  background-color: var(--bandeja); background-image: var(--rayado);
  box-shadow: inset 0 0 0 0.8px var(--border);
}
.k2-bandeja-tit {
  display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px;
  font-size: 14px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; color: var(--text-2);
}
.k2-bandeja-tit > :where(h2, h3, h4, p) { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }
.k2-bandeja-tit svg { width: 16px; height: 16px; flex: none; }
.k2-bandeja-tit .k2-der {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--text-2);
}
.k2-bandeja-pie {
  display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px 0;
  font-size: 12px; line-height: 1.3; color: var(--text-2);
}
.k2-bandeja-pie .k2-der { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
/* El canto de la tarjeta es un BORDE de 0,8 px, no una sombra interior: así se
   ve firme sobre la bandeja, y la sombra queda para la luz de borde del oscuro
   (sistema.css, .k-tarjeta). */
.k2-tarjeta {
  position: relative; flex: 1 1 auto; min-width: 0; padding: 12px;
  background: var(--bg-1); border: 0.8px solid var(--border-in); border-radius: var(--radius-lg);
  box-shadow: var(--luz-borde);
}
.k2-tarjeta--amplia { padding: clamp(16px, 0.76vw + 13px, 24px); }
/* Para una imagen, un recorte o la vitrina: sin relleno y recortada al radio. */
.k2-tarjeta--ras { padding: 0; overflow: hidden; }
/* La tarjeta de una cifra (como las cuatro de Inicio): radio 10, filete --border. */
.k2-tarjeta--cifra { border-color: var(--border); border-radius: var(--radius-md); }
/* Una tarjeta que es enlace: se eleva un píxel al pasar el cursor. */
a.k2-tarjeta, .k2-tarjeta--viva { transition: transform 300ms var(--e-out-expo), box-shadow 300ms var(--e-out-expo); }
a.k2-tarjeta:hover, .k2-tarjeta--viva:hover { transform: translateY(-1px); box-shadow: var(--sombra-hover); }

/* La hoja: el plano del contenido del gestor (--hoja, radio 12) con su filete
   pintado ENCIMA, para que una imagen o un iframe no lo tapen. */
.k2-hoja { position: relative; background: var(--hoja); border-radius: var(--radius-lg); }
.k2-hoja::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 0.8px var(--border);
}

/* ── Acciones ────────────────────────────────────────────────────────────────
   UNA sola cosa pintada por pantalla: .k2-boton-tinta. Todo lo demás es
   .k2-boton (superficie de botón, sin tinta) o .k2-enlace. */
.k2-boton, .k2-boton-tinta {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius);
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1; letter-spacing: -0.005em;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: border-color 160ms, background 160ms, box-shadow 160ms, color 160ms, transform 160ms;
}
.k2-boton svg, .k2-boton-tinta svg { width: 16px; height: 16px; flex: none; }
.k2-boton {
  border: 0.8px solid var(--border); background: var(--sup-btn); box-shadow: var(--luz-borde); color: var(--text-2);
}
.k2-boton:hover { border-color: var(--border-hover); background: var(--sup-btn-hover); box-shadow: var(--sombra-hover); color: var(--text); }
/* La tinta: degradado del acento con su texto que se INVIERTE con el tema
   (--accent-fg), y en relieve (--sombra-tinta). Nunca color:#fff. */
.k2-boton-tinta {
  border: 0.8px solid transparent; background: var(--accent-grad); color: var(--accent-fg);
  box-shadow: var(--sombra-tinta);
}
.k2-boton-tinta:hover { background: var(--accent-grad-hover); color: var(--accent-fg); box-shadow: var(--sombra-tinta-hover); }
.k2-boton:active, .k2-boton-tinta:active { transform: scale(0.97); }
.k2-boton--grande { height: 44px; padding: 0 18px; font-size: 14px; border-radius: var(--radius-md); }
.k2-boton:disabled, .k2-boton[aria-disabled='true'],
.k2-boton-tinta:disabled, .k2-boton-tinta[aria-disabled='true'] {
  cursor: default; transform: none; background: var(--bg-2); color: var(--text-3);
  border-color: var(--border); box-shadow: none;
}
/* Botón de ícono (el tema): sin canto en reposo, filete al pasar el cursor. */
.k2-boton-icono {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0; border-radius: var(--radius);
  border: 0.8px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.k2-boton-icono:hover { background: var(--bg-active); border-color: var(--border); color: var(--text); }
.k2-boton-icono svg { width: 16px; height: 16px; }
/* El ícono del interruptor dice a dónde VA: luna en claro, sol en oscuro. */
.k2-tema-sol { display: none; }
[data-theme="dark"] .k2-tema-sol { display: block; }
[data-theme="dark"] .k2-tema-luna { display: none; }
/* Enlace de acción: en tinta neutra y subrayado, nunca en azul. */
.k2-enlace {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--text-2);
  text-decoration: underline; text-decoration-color: var(--deco); text-decoration-thickness: 1px; text-underline-offset: 3px;
  border-radius: 2px;
}
.k2-enlace:hover { color: var(--text); text-decoration-color: var(--text-3); }
.k2-enlace svg { width: 14px; height: 14px; flex: none; transition: transform 300ms var(--e-out-expo); }
.k2-enlace:hover svg { transform: translateX(2px); }

/* ── Lo elegido se ELEVA: la píldora ─────────────────────────────────────────
   Una píldora blanca (en oscuro, un escalón más clara) con filete y sombra de
   reposo. Marca lo seleccionado o una etiqueta neutra; nunca con tinta. */
.k2-pildora {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px;
  border-radius: var(--radius); border: 0.8px solid var(--border);
  background: var(--pildora); box-shadow: var(--sombra-reposo);
  font-size: 12px; font-weight: 500; line-height: 1; color: var(--text); white-space: nowrap;
}
/* Segmentado: la opción elegida sube al pulgar (--pulgar). */
.k2-seg {
  display: inline-flex; gap: 2px; padding: 2px; max-width: 100%; overflow-x: auto;
  border-radius: 9px; background: var(--seg-fondo); scrollbar-width: none;
}
.k2-seg > button, .k2-seg > a {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 28px; padding: 0 12px; border: 0.8px solid transparent; border-radius: 7px; background: transparent;
  font: inherit; font-size: 12px; font-weight: 500; line-height: 1; color: var(--text-2);
  white-space: nowrap; cursor: pointer;
  transition: background 150ms, color 150ms, box-shadow 150ms, border-color 150ms;
}
.k2-seg > :hover { color: var(--text); }
.k2-seg > [aria-pressed='true'], .k2-seg > [aria-selected='true'], .k2-seg > [aria-current]:not([aria-current='false']) {
  background: var(--pulgar); border-color: var(--border); box-shadow: var(--sombra-reposo); color: var(--text);
}
.k2-seg .k2-n { font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ── El hilo cobalto: ROL, novedad y foco. Nada más. ─────────────────────── */
/* El ROL de una causa: JetBrains Mono 500, 12 px, en --rol. No se corta. */
.k2-rol {
  font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  color: var(--rol); white-space: nowrap; font-variation-settings: normal; font-variant-numeric: tabular-nums;
}
/* Un texto que se lee carácter a carácter y NO es un ROL (una tecla, un RUT,
   el rol de un fallo de la Corte): misma letra, sin el hilo. */
.k2-codigo {
  font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  color: var(--text-2); white-space: nowrap; font-variation-settings: normal;
}
/* El punto de novedad. Siempre acompañado de texto que la diga. */
.k2-punto-novedad {
  display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--novedad); vertical-align: middle;
}
.k2-punto-novedad--halo { box-shadow: 0 0 0 3px var(--novedad-halo); }
/* Sobre la esquina de un ícono: un aro del fondo lo despega del dibujo. */
.k2-punto-novedad--aro { width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--bg-1); }

/* ── El matiz es del TIEMPO: venció · vence pronto · hecho ─────────────────── */
.k2-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: var(--radius-sm);
  background: var(--sup-chip); color: var(--text-2);
  font-size: 12px; font-weight: 500; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.k2-chip--vencio { background: var(--red-bg);   color: var(--red-text); }
.k2-chip--pronto { background: var(--amber-bg); color: var(--amber-text); }
.k2-chip--hecho  { background: var(--green-bg); color: var(--green-text); }

/* ── Filetes: 0,8 px, nunca un borde oscuro de 1 px ──────────────────────── */
.k2-filete { display: block; height: 0; margin: 0; border: 0; border-top: 0.8px solid var(--border); }
.k2-filete--punteado { border-top-style: dashed; }
.k2-filete--vertical { width: 0; height: auto; align-self: stretch; border-top: 0; border-left: 0.8px solid var(--border); }

/* ── Piezas para recortes estáticos del producto (teléfono, sin vitrina) ──── */
.k2-baldosa {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--sup-baldosa); border: 0.8px solid var(--border-in); box-shadow: var(--luz-borde); color: var(--text-2);
}
.k2-baldosa svg { width: 16px; height: 16px; }
/* El ícono de una novedad lleva el cobalto (es la novedad, no un adorno). */
.k2-baldosa--novedad { color: var(--novedad); }
.k2-lista > li + li { border-top: 0.8px dashed var(--border); }
.k2-fila {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 9px 6px;
}
.k2-fila-cuerpo { min-width: 0; }
.k2-fila-tit {
  display: block; font-size: 13px; font-weight: 500; line-height: 1.25; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.k2-fila-sub {
  display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px;
  font-size: 12px; line-height: 1.2; color: var(--text-3);
}
.k2-fila-sub > :last-child:not(.k2-rol) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k2-fila-hora { align-self: start; padding-top: 2px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Campo ───────────────────────────────────────────────────────────────────
   Canto --border-campo, el único borde que llega a 3:1 (no sobre --bg-3), y el
   foco con el anillo cobalto: el canto ya es fuerte en reposo. */
.k2-campo {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-campo); border-radius: var(--radius);
  background: var(--sup-campo); color: var(--text); box-shadow: var(--sombra-campo);
  font: inherit; font-size: 14px;
}
.k2-campo::placeholder { color: var(--text-3); }
/* El contorno transparente no se ve, salvo en contraste forzado (Windows),
   que borra las sombras y pinta el contorno con el color del sistema: sin él,
   ahí el foco dependía solo del canto. */
.k2-campo:focus, .k2-campo:focus-visible { outline: 2px solid transparent; box-shadow: 0 0 0 2px var(--focus); }
.k2-etiqueta { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text); }
/* Lo que un formulario necesita además del campo (las páginas públicas, desde
   /registro-prueba, 13-oct-2026). El selector lleva la flecha de .k-select del
   gestor, dibujada con dos degradados en --text-3: sin imagen ni color suelto. */
select.k2-campo {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px; background-repeat: no-repeat;
}
/* En contraste forzado los degradados desaparecen y el selector parecía un
   campo de texto: vuelve la flecha del sistema. */
@media (forced-colors: active) {
  select.k2-campo { appearance: auto; -webkit-appearance: auto; background-image: none; padding-right: 12px; }
}
/* Un campo con error: el canto en --red (relleno y borde llegan a 3:1; como
   TEXTO va --red-text, abajo). El mensaje dice qué falta: el color no es lo
   único que lo cuenta. */
.k2-campo[aria-invalid="true"] { border-color: var(--red); }
.k2-opcional { font-weight: 400; color: var(--text-2); }
.k2-ayuda { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.k2-ayuda--error { color: var(--red-text); }
/* La casilla con su texto: el texto es parte de la etiqueta (se pulsa entero). */
.k2-casilla {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-size: 13px; line-height: 1.5; color: var(--text-2);
}
.k2-casilla input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
/* El enlace dentro de su texto (la política de privacidad): en tinta y
   subrayado, como un enlace suelto en un párrafo. */
.k2-casilla a {
  color: var(--text); text-decoration: underline; text-decoration-color: var(--deco);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.k2-casilla a:hover { text-decoration-color: var(--text-3); }
/* Con error, un canto rojo alrededor; con el foco manda el anillo cobalto. */
.k2-casilla input[aria-invalid="true"]:not(:focus-visible) { outline: 1px solid var(--red); outline-offset: 1px; }
/* Un aviso arriba del formulario (role="alert"). */
.k2-aviso { padding: 10px 12px; border-radius: var(--radius); font-size: 13px; line-height: 1.45; }
.k2-aviso--error { background: var(--red-bg); border: 0.8px solid var(--red-border); color: var(--red-text); }

/* ── Movimiento reducido ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important; animation-duration: 1ms !important;
    animation-iteration-count: 1 !important; scroll-behavior: auto !important;
  }
  .k2-boton:active, .k2-boton-tinta:active { transform: none; }
  a.k2-tarjeta:hover, .k2-tarjeta--viva:hover { transform: none; }
}

/* ── Con el dedo: 44 px de área ──────────────────────────────────────────────
   En pointer: coarse lo que se pulsa alcanza 44 × 44 SIN cambiar su dibujo:
   un ::after transparente y centrado agranda el área (el recurso de
   sistema.css). Lo que vive en una fila que se desplaza (el segmentado) o en
   una lista apretada (la navegación) crece de verdad, porque el desplazamiento
   recortaría el área: el segmentado llega a 44 (el del gestor se queda en 40,
   y aquí el piso es 44). Los campos crecen: el dedo escribe dentro. */
@media (pointer: coarse) {
  .k2-boton::after, .k2-boton-tinta::after, .k2-boton-icono::after, .k2-enlace::after, .k2-marca::after {
    content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: max(100%, 44px); height: max(100%, 44px);
  }
  .k2-marca { position: relative; }
  .k2-nav a { height: 44px; }
  .k2-seg > button, .k2-seg > a { height: 44px; min-width: 44px; }
  /* 16 px: con menos, iOS acerca la página al enfocar el campo (/j/ ya lo
     hace en su buscador, que es más específico y no cambia). */
  .k2-campo { height: 44px; font-size: 16px; }
  .k2-casilla { min-height: 44px; align-items: center; }
  .k2-casilla input { margin-top: 0; }
}
