/* Estilos comunes de las páginas locales y de la aplicación: neutra y clara, Avenir y un azul de acento.
   Las reglas de elementos y clases van en :where(... :not(.pv *)): sin especificidad (cada página manda sobre ellas)
   y sin tocar las pantallas del cliente que dibuja el estudio de diseño (.pv). Las Avenir llegan de ~/.laketab/fuentes. */
@font-face { font-family: "Avenir LakeTab"; font-weight: 400; src: url("fuentes/Avenir%20Book.ttf"); }
@font-face { font-family: "Avenir LakeTab"; font-weight: 500; src: url("fuentes/Avenir%20Medium.ttf"); }
@font-face { font-family: "Avenir LakeTab"; font-weight: 600 900; src: url("fuentes/Avenir%20Heavy.ttf"); }
:root {
  --fondo: #F6F7F9; --superficie: #FFFFFF; --hundido: #F1F3F6; --borde: #E2E5EA; --borde-fuerte: #C5CBD3;
  --texto: #16181D; --secundario: #5C6370; --acento: #2D6BE0; --acento-suave: #E8EFFC; --sobre-acento: #FFFFFF;
  --ok: #1B7A4C; --ok-suave: #E3F2EA; --mal: #B8322A; --mal-suave: #FBE7E5; --atencion: #9A5B0F; --atencion-suave: #FBF0DC;
  --letra: "Avenir LakeTab", Avenir, "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radio: 10px; --radio-peq: 8px; --control: 34px; --curva: cubic-bezier(.2, 0, 0, 1); --dur: 160ms;
  --sombra: 0 12px 30px rgb(15 20 30 / .18);
  color-scheme: light;
  /* Nombres de antes, para las páginas que aún los usan */
  --bg: var(--fondo); --panel: var(--superficie); --fg: var(--texto); --muted: var(--secundario); --line: var(--borde); --suave: var(--hundido);
  --petroleo: var(--acento); --teal: var(--acento); --banda-fg: var(--sobre-acento); --display: var(--letra); --body: var(--letra);
  --pen: var(--borde-fuerte); --cur: var(--acento); --rev: var(--atencion); --blo: var(--mal);
  --pen-bg: var(--hundido); --cur-bg: var(--acento-suave); --rev-bg: var(--atencion-suave); --ok-bg: var(--ok-suave); --blo-bg: var(--mal-suave);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --fondo: #0F1114; --superficie: #171A1F; --hundido: #1E2228; --borde: #2A2F37; --borde-fuerte: #434A55;
  --texto: #E8EAEE; --secundario: #9AA1AD; --acento: #6E9BEF; --acento-suave: #1C2A45; --sobre-acento: #0F1114;
  --ok: #57C48F; --ok-suave: #173126; --mal: #F07C71; --mal-suave: #3A1F1C; --atencion: #E0A84A; --atencion-suave: #33291A;
  --sombra: 0 12px 30px rgb(0 0 0 / .45); color-scheme: dark; } }
:root[data-theme="dark"] {
  --fondo: #0F1114; --superficie: #171A1F; --hundido: #1E2228; --borde: #2A2F37; --borde-fuerte: #434A55;
  --texto: #E8EAEE; --secundario: #9AA1AD; --acento: #6E9BEF; --acento-suave: #1C2A45; --sobre-acento: #0F1114;
  --ok: #57C48F; --ok-suave: #173126; --mal: #F07C71; --mal-suave: #3A1F1C; --atencion: #E0A84A; --atencion-suave: #33291A;
  --sombra: 0 12px 30px rgb(0 0 0 / .45); color-scheme: dark; }
@media (prefers-reduced-motion: reduce) { :root { --dur: 0ms; } }

* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 400 14px/1.5 var(--letra); -webkit-font-smoothing: antialiased; }
:where(h1:not(.pv *), h2:not(.pv *), h3:not(.pv *)) { font-family: var(--letra); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
:where(h2:not(.pv *)) { font-size: 18px; }
:where(code:not(.pv *)) { font: .88em var(--mono); background: var(--hundido); padding: 1px 5px; border-radius: 4px; }
:where(a:not(.pv *)) { color: var(--acento); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

/* Botones: el mismo en todas (bare o .b), primario azul, pequeño con .peq */
:where(button:not(.pv *), .boton:not(.pv *), .b:not(.pv *)) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control); padding: 0 13px;
  font: 500 13.5px/1 var(--letra); color: var(--texto); background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-peq);
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: border-color var(--dur) var(--curva), background var(--dur) var(--curva), transform var(--dur) var(--curva); }
:where(button:not(.pv *):hover, .boton:not(.pv *):hover, .b:not(.pv *):hover) { border-color: var(--borde-fuerte); }
:where(button:not(.pv *):active, .boton:not(.pv *):active, .b:not(.pv *):active) { transform: scale(.97); }
:where(button:not(.pv *):disabled, .b:not(.pv *):disabled) { opacity: .45; cursor: default; transform: none; }
:where(button.primario:not(.pv *), .b.pri:not(.pv *)) { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); }
:where(button.primario:not(.pv *):hover, .b.pri:not(.pv *):hover) { border-color: var(--acento); filter: brightness(1.06); }
:where(.b.peq:not(.pv *)) { height: 28px; padding: 0 9px; font-size: 12.5px; }

/* Campos */
:where(input:not(.pv *), select:not(.pv *), textarea:not(.pv *)) { font: 400 14px/1.4 var(--letra); color: var(--texto); background: var(--superficie); border: 1px solid var(--borde);
  border-radius: var(--radio-peq); padding: 8px 10px; width: 100%; }
:where(input[type=checkbox]:not(.pv *), input[type=radio]:not(.pv *), input[type=color]:not(.pv *)) { width: auto; padding: 0; }
:where(input:not(.pv *):focus, select:not(.pv *):focus, textarea:not(.pv *):focus) { border-color: var(--acento); outline: none; box-shadow: 0 0 0 3px var(--acento-suave); }
:where(textarea:not(.pv *)) { min-height: 64px; resize: vertical; }
:where(label:not(.pv *)) { font-size: 13px; font-weight: 500; display: block; margin-bottom: 4px; }

/* Piezas compartidas */
:where(.envoltorio:not(.pv *)) { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
:where(.banda:not(.pv *)) { background: var(--superficie); border-bottom: 1px solid var(--borde); }
:where(.banda:not(.pv *) .envoltorio) { padding-block: 22px 18px; }
:where(.banda:not(.pv *) h1) { font-size: 24px; }
:where(.sub:not(.pv *)) { color: var(--secundario); font-size: 13.5px; margin: 4px 0 0; }
:where(.panel:not(.pv *)) { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; }
:where(.pill:not(.pv *)) { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 99px; background: var(--hundido); color: var(--texto); }
:where(.pill.ok:not(.pv *)) { background: var(--ok-suave); color: var(--ok); } :where(.pill.blo:not(.pv *)) { background: var(--mal-suave); color: var(--mal); }
:where(.pill.rev:not(.pv *)) { background: var(--atencion-suave); color: var(--atencion); } :where(.pill.cur:not(.pv *)) { background: var(--acento-suave); color: var(--acento); }
:where(.aviso:not(.pv *)) { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; max-width: min(92vw, 560px); padding: 11px 16px; border-radius: var(--radio);
  background: var(--texto); color: var(--superficie); font-size: 14px; font-weight: 500; box-shadow: var(--sombra); z-index: 30; }
:where(.aviso.error:not(.pv *)) { background: var(--mal); color: #fff; }
:where(.avance:not(.pv *)) { height: 8px; border-radius: 99px; background: var(--hundido); overflow: hidden; display: flex; margin-top: 14px; }
:where(.avance:not(.pv *) i) { display: block; height: 100%; }
:where(.avance:not(.pv *)) .ok { background: var(--ok); } :where(.avance:not(.pv *)) .blo { background: var(--mal); }
@media (prefers-reduced-motion: no-preference) { :where(.avance:not(.pv *) i) { transition: width .3s ease; } }
/* Control segmentado: .segmento (bordes) y .seg (hundido, el de los estudios) */
:where(.segmento:not(.pv *)) { display: inline-flex; border: 1px solid var(--borde); border-radius: var(--radio-peq); overflow: hidden; }
:where(.segmento:not(.pv *) button) { border: 0; border-radius: 0; min-width: 96px; }
:where(.segmento:not(.pv *) button + button) { border-left: 1px solid var(--borde); }
:where(.segmento:not(.pv *) button[aria-pressed="true"]) { background: var(--hundido); font-weight: 600; }
:where(.seg:not(.pv *)) { display: flex; flex-wrap: wrap; padding: 3px; gap: 2px; background: var(--hundido); border-radius: 9px; }
:where(.seg:not(.pv *) button) { height: 30px; padding: 0 11px; border: 0; background: none; border-radius: 7px; color: var(--secundario); font-size: 13px; }
:where(.seg:not(.pv *) button[aria-pressed="true"]) { background: var(--superficie); color: var(--texto); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--borde); }

/* Dentro de la aplicación (?embebido=1): sin cabecera propia ni chat, al 100 % del iframe */
.embebido .solo-fuera { display: none !important; }
