/* Cana — landing
   Hermana de Racha Solutions: misma familia (Archivo), misma honestidad.
   Sólido y ancho = cifra con fuente. Hueco y angosto = sin fuente (con etiqueta ámbar).
   El eje de anchura es información: una cifra ocupa su ancho completo solo cuando tiene de dónde salir.
   Nada se anima con el scroll. */

:root {
  --petroleo: #0B6E5F;      /* primario; blanco encima = 6.1:1 */
  --petroleo-deep: #074C42; /* largueros del rack, sombras sólidas */
  --petroleo-night: #05362F;
  --menta: #A3EED3;         /* realce sobre el verde */
  --menta-tint: #E2F6EE;    /* lo que se ve a través de la lupa */
  --ink: #0E1219;
  --ink-2: #263039;
  --niebla: #E8EEEB;        /* fondo neutro frío */
  --hoja: #FAFBFA;          /* papel de hoja de cálculo */
  --grid: #D3DCD8;          /* cuadrícula */
  --gutter-bg: #EDF1EF;
  --fog: #56625E;           /* texto secundario: 5.6:1 sobre niebla */
  --amber: #F2B33D;         /* solo para «sin fuente» */
  --amber-ink: #8A5A00;
  --amber-stroke: #D2951B;
  --cobalt: #1F2FD1;        /* solo en el pie: Racha Solutions */

  --font: "Archivo", system-ui, sans-serif;
  --pad: clamp(1rem, 4vw, 3.5rem);
  --max: 86rem;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--niebla);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, blockquote, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; background: var(--hoja); color: var(--ink); padding: .6rem 1rem; text-decoration: none; }
.skip:focus { top: 1rem; }

/* Voz tipográfica: titulares angostos y pesados (eco de Racha); cifras anchas y tabulares */
.display {
  font-weight: 820;
  font-variation-settings: "wdth" 62;
  line-height: .93;
  letter-spacing: -0.005em;
  font-size: clamp(2.6rem, 6.6vw, 6.2rem);
  text-wrap: balance;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .7rem 1.35rem;
  font-weight: 680; font-size: 1rem; line-height: 1.15; text-decoration: none; text-align: center;
  border-radius: 4px; border: 2px solid transparent; cursor: pointer;
  transition: background-color .18s, color .18s, border-color .18s, transform .18s;
}
.btn:active { transform: translateY(1px); }
.btn--mint { background: var(--menta); color: var(--ink); box-shadow: 4px 4px 0 var(--petroleo-night); }
.btn--mint:hover { background: #fff; }
.btn--line { border-color: rgb(255 255 255 / .6); color: #fff; }
.btn--line:hover { border-color: #fff; background: rgb(255 255 255 / .08); }
.btn--big { font-size: clamp(1.05rem, 2vw, 1.35rem); min-height: 3.75rem; padding: 1rem 1.8rem; }
.btn--sheet { background: var(--ink); color: var(--hoja); font-size: .95rem; min-height: 2.75rem; }
.btn--sheet:hover:not(:disabled) { background: var(--petroleo-night); box-shadow: 0 0 0 2px var(--menta); }
.btn--sheet:disabled { background: transparent; color: rgb(255 255 255 / .62); border: 2px dashed rgb(255 255 255 / .35); cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: .4rem 0; color: #fff; text-decoration: underline; text-underline-offset: .25em; cursor: pointer; font-size: .95rem; font-weight: 550; }
.link-btn:hover { color: var(--menta); }

/* ---------- Hero ---------- */
.hero {
  background: var(--petroleo);
  color: #fff;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: var(--max); margin-inline: auto;
  padding: 1.1rem var(--pad);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; }
.brand__mark { width: 1.9rem; height: 1.8rem; fill: currentColor; }
.brand__word { height: 1.05rem; width: auto; fill: currentColor; }
.brand__name { font-size: 1.35rem; font-weight: 760; font-variation-settings: "wdth" 118; letter-spacing: -0.01em; }
.nav__links { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.9rem); font-size: .95rem; }
.nav__links a { text-decoration: none; font-weight: 520; color: rgb(255 255 255 / .86); }
.nav__links a:hover { color: #fff; text-decoration: underline; text-underline-offset: .3em; }
.nav__links .nav__cta {
  color: var(--ink); background: var(--menta); font-weight: 680;
  padding: .55rem .95rem; border-radius: 4px;
}
.nav__links .nav__cta:hover { background: #fff; text-decoration: none; }

.intro {
  max-width: var(--max); margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--pad) clamp(3rem, 6vw, 5rem);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 4vw, 4.5rem); align-items: start;
}

/* El titular descansa en tres largueros, como el logotipo. Cada línea se ajusta al ancho del larguero con el eje wdth. */
.shelf-title {
  font-weight: 850; line-height: .9; letter-spacing: -0.01em;
  font-size: clamp(3rem, 6.2vw, 6.4rem);
  display: grid; gap: .16em;
  margin-top: .2em;
}
.shelf-title__line {
  display: block; position: relative; white-space: nowrap;
  font-variation-settings: "wdth" var(--w, 62);
  padding-bottom: .1em;
}
.shelf-title__line::after {
  content: ""; position: absolute; left: calc(-1 * var(--pad) - 50vw); right: 0; bottom: -.06em;
  height: .13em; background: var(--petroleo-deep);
}
.intro__lead { margin-top: clamp(1.75rem, 3vw, 2.5rem); max-width: 31rem; font-size: clamp(1.08rem, 1.4vw, 1.22rem); line-height: 1.5; }
.intro__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.intro__for { margin-top: 1.5rem; font-size: .95rem; color: rgb(255 255 255 / .82); }
.key { margin-top: clamp(2rem, 4vw, 3.25rem); display: grid; gap: .9rem; max-width: 30rem; border-top: 1px solid rgb(255 255 255 / .22); padding-top: 1.4rem; }
.key > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.key dt { display: flex; align-items: center; gap: .45rem; }
.key dd { margin: 0; font-size: .92rem; line-height: 1.35; color: rgb(255 255 255 / .88); }
.key__solid { font-size: 1.35rem; font-weight: 700; font-variation-settings: "wdth" 118; font-variant-numeric: tabular-nums; line-height: 1; }
.key__hollow { font-size: 1.7rem; font-weight: 800; line-height: 1; color: transparent; -webkit-text-stroke: 1.4px var(--amber); font-variation-settings: "wdth" 62; }
.key .tag { font-size: .7rem; }
.key__lens { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 3.5px solid var(--menta); position: relative; margin-left: .15rem; }
.key__lens::after { content: ""; position: absolute; width: 4px; height: 11px; background: var(--menta); left: 100%; top: 100%; transform: translate(-3px, -3px) rotate(-45deg); transform-origin: 50% 0; border-radius: 1px; }
.bench__lens-hint { display: none; }

/* ---------- La pieza: rack + hoja + lupa ---------- */
.bench { position: relative; }

.rack {
  position: relative;
  padding: 0 1.1rem;
  --post: var(--petroleo-night);
}
/* Postes perforados del rack */
.rack::before, .rack::after {
  content: ""; position: absolute; top: 1.6rem; bottom: -1.5rem; width: 12px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 7px, var(--petroleo) 7px 12px) center / 4px 100% no-repeat,
    var(--post);
  border-radius: 1px;
}
.rack::before { left: 0; }
.rack::after { right: 0; }
.rack__hint { font-size: .92rem; color: rgb(255 255 255 / .85); padding: 0 0 .75rem; min-height: 1.6rem; }
.rack__shelf {
  --gap: .7rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem var(--gap);
  position: relative; z-index: 2;
}
.rack__shelf > li { position: relative; padding-bottom: 12px; display: flex; }
/* Larguero bajo cada archivo, continuo de poste a poste */
.rack__shelf > li::after {
  content: ""; position: absolute; bottom: 0; height: 12px;
  left: calc(-1 * var(--gap) / 2 - 1px); right: calc(-1 * var(--gap) / 2 - 1px);
  background: var(--menta);
  box-shadow: inset 0 -3px 0 rgb(14 18 25 / .18);
}
.rack__shelf > li:first-child::after { left: -1.1rem; }
.rack__shelf > li:last-child::after { right: -1.1rem; }

.file {
  position: relative; width: 100%; text-align: left;
  display: grid; grid-template-rows: auto 1fr auto; gap: .2rem;
  padding: .7rem .75rem .65rem;
  min-height: 6.4rem;
  background: var(--hoja); color: var(--ink);
  border: 0; border-radius: 3px 14px 3px 3px;
  box-shadow: 3px 3px 0 var(--petroleo-night);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .28s cubic-bezier(.3, 1.35, .5, 1), box-shadow .2s, background-color .2s, opacity .2s;
}
.rack__shelf li:nth-child(1) .file { --tilt: -1.6deg; }
.rack__shelf li:nth-child(2) .file { --tilt: 1.1deg; }
.rack__shelf li:nth-child(3) .file { --tilt: -.7deg; }
.rack__shelf li:nth-child(4) .file { --tilt: 1.8deg; }
/* esquina doblada */
.file::before {
  content: ""; position: absolute; top: 0; right: 0; width: 14px; height: 14px;
  background: linear-gradient(225deg, var(--petroleo) 50%, #C9D6D0 50%);
  border-radius: 0 14px 0 3px;
}
.file:hover { --tilt: 0deg; }
.file__ext {
  justify-self: start;
  font-size: .72rem; font-weight: 750; font-variation-settings: "wdth" 120; letter-spacing: .02em;
  color: #fff; background: var(--petroleo); padding: .18rem .4rem .2rem; border-radius: 2px; line-height: 1;
}
.file__name { font-weight: 720; font-size: 1rem; line-height: 1.12; font-variation-settings: "wdth" 88; align-self: end; }
.file__dot { color: var(--fog); font-weight: 500; }
.file__meta { font-size: .78rem; color: var(--fog); line-height: 1.25; }
.file__state { display: none; }

.file.is-lifted {
  cursor: grabbing; z-index: 30;
  transition: box-shadow .2s, background-color .2s;
  box-shadow: 12px 16px 0 rgb(5 54 47 / .55);
}
.file[aria-pressed="true"] {
  background: transparent; color: rgb(255 255 255 / .9);
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .45);
  --tilt: 0deg;
}
.file[aria-pressed="true"]::before { display: none; }
.file[aria-pressed="true"] .file__ext { background: transparent; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .6); }
.file[aria-pressed="true"] .file__dot,
.file[aria-pressed="true"] .file__meta { color: rgb(255 255 255 / .7); }
.file[aria-pressed="true"] .file__meta { display: none; }
.file[aria-pressed="true"] .file__state { display: block; font-size: .78rem; font-weight: 650; color: var(--menta); }
.file[aria-pressed="true"]:hover { box-shadow: inset 0 0 0 2px #fff; }

@keyframes nudge {
  0%, 100% { transform: rotate(var(--tilt)) translateY(0); }
  30% { transform: rotate(-4deg) translateY(-9px); }
  55% { transform: rotate(1deg) translateY(-2px); }
}
.file.is-nudging { animation: nudge .9s cubic-bezier(.3, 1.2, .5, 1) 1; }

/* La hoja */
.sheet {
  position: relative; z-index: 1;
  margin-top: 1.5rem;
  background: var(--hoja); color: var(--ink);
  border-radius: 4px;
  box-shadow: 10px 10px 0 var(--petroleo-deep);
  overflow: hidden;
}
.sheet__bar {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .6rem .85rem; background: var(--petroleo-deep); color: #fff; font-size: .85rem;
}
.sheet__file { font-weight: 600; font-variation-settings: "wdth" 92; }
.sheet__demo { font-size: .78rem; color: var(--menta); font-weight: 600; }

.fx {
  display: grid; grid-template-columns: 3.4rem auto minmax(0, 1fr); align-items: center;
  border-bottom: 1px solid var(--grid); font-size: .92rem; min-height: 2.3rem;
}
.fx__ref {
  align-self: stretch; display: grid; place-items: center;
  border-right: 1px solid var(--grid); font-weight: 650; font-variation-settings: "wdth" 110; background: var(--gutter-bg);
}
.fx__sym { padding: 0 .6rem; color: var(--fog); font-style: italic; font-weight: 500; font-variation-settings: "wdth" 80; border-right: 1px solid var(--grid); align-self: stretch; display: grid; place-items: center; }
.fx__formula {
  padding: .35rem .7rem; font-variation-settings: "wdth" 72; font-weight: 560; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx__src {
  padding: .45rem .75rem; font-size: .84rem; line-height: 1.3; color: var(--fog);
  border-bottom: 1px solid var(--grid); min-height: 2.05rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx__src.is-missing { color: var(--amber-ink); font-weight: 600; }

/* Cuadrícula */
.ws-wrap { position: relative; }
.ws {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  font-size: .95rem;
}
.ws col.c-n { width: 2.4rem; }
.ws col.c-a { width: 31%; }
.ws col.c-b { width: 28%; }
.ws col.c-c { width: auto; }
.ws th, .ws td {
  height: 2.2rem; padding: 0 .6rem; border: 1px solid var(--grid);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: left; font-weight: 400;
}
.ws tr > :first-child { border-left: 0; }
.ws tr > :last-child { border-right: 0; }
.ws__letters th {
  height: 1.6rem; background: var(--gutter-bg); color: var(--fog); text-align: center;
  font-size: .78rem; font-weight: 600; font-variation-settings: "wdth" 110; border-top: 0;
}
.ws .rn {
  background: var(--gutter-bg); color: var(--fog); text-align: center; padding: 0;
  font-size: .78rem; font-weight: 600; font-variation-settings: "wdth" 100; font-variant-numeric: tabular-nums;
}
.ws .r-title td.span { font-weight: 760; font-variation-settings: "wdth" 104; font-size: 1rem; }
.ws .r-head td { font-weight: 650; color: var(--fog); font-size: .82rem; background: #F2F5F4; }
.ws .lbl { color: var(--ink-2); }
.ws .r-total td { border-top: 2px solid var(--ink); }
.ws .r-total .lbl { font-weight: 760; color: var(--ink); }

.ws td.val { padding: 0; text-align: right; position: relative; overflow: visible; }
.cell {
  width: 100%; height: 100%; min-height: 2.2rem;
  display: flex; align-items: center; justify-content: flex-end; gap: .45rem;
  padding: 0 .6rem; background: transparent; border: 0; cursor: cell;
  font-variant-numeric: tabular-nums; text-align: right;
}
.cell:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.num {
  font-weight: 640; font-size: 1rem; letter-spacing: -0.005em;
  font-variation-settings: "wdth" 118;
  transition: font-variation-settings .5s cubic-bezier(.3, 1.2, .5, 1), color .3s, -webkit-text-stroke-color .3s;
}
.r-total .num { font-size: 1.12rem; font-weight: 800; font-variation-settings: "wdth" 125; }
/* sin fuente: hueco, angosto, ámbar */
.is-nosrc .num {
  color: transparent; -webkit-text-stroke: 1.4px var(--amber-stroke);
  font-variation-settings: "wdth" 62; font-weight: 800; font-size: 1.5rem; line-height: 1;
}
.is-nosrc.is-derived .num { -webkit-text-stroke-color: #A9B5B0; }
.is-nosrc.is-derived:not(.r-total) .cell .tag { display: none !important; }
.ws td.src.is-wait { color: var(--fog); font-weight: 500; }
.tag {
  display: inline-block; font-size: .7rem; font-weight: 720; line-height: 1;
  padding: .3rem .45rem .32rem; border-radius: 2px;
  background: var(--amber); color: var(--ink); white-space: nowrap;
  font-variation-settings: "wdth" 96;
}
.cell .tag { display: none; }
.is-nosrc .cell .tag { display: inline-block; }

.ws td.src { font-size: .82rem; color: var(--fog); font-variation-settings: "wdth" 90; }
.ws td.src.is-missing { color: var(--amber-ink); font-weight: 620; }
.ok { display: inline-block; margin-left: .35rem; font-size: .72rem; font-weight: 720; color: #fff; background: var(--petroleo); padding: .2rem .4rem; border-radius: 2px; line-height: 1; }

/* Celda seleccionada, con su manija de relleno como en Excel */
tr.is-sel td.val { box-shadow: inset 0 0 0 2px var(--petroleo); z-index: 2; }
tr.is-sel td.val::after {
  content: ""; position: absolute; right: -3px; bottom: -3px; width: 6px; height: 6px;
  background: var(--petroleo); outline: 1.5px solid var(--hoja); z-index: 3;
}
tr.is-sel .rn { background: #CFE6DD; color: var(--ink); }

/* Fila que acaba de recibir su fuente */
@keyframes landed { from { background-color: var(--menta); } to { background-color: transparent; } }
tr.just-landed td:not(.rn) { animation: landed 1.1s ease-out; }

/* Capa de fórmulas que se ve a través de la lupa */
.ws--lens {
  position: absolute; inset: 0 0 auto; z-index: 4; pointer-events: none;
  background: var(--menta-tint);
  clip-path: circle(var(--lr, 64px) at var(--lx, 70%) var(--ly, 85%));
}
.ws--lens th, .ws--lens td { border-color: #B9DCCD; }
.ws--lens .rn, .ws--lens .ws__letters th { background: #CDEBDF; }
.ws--lens td.f {
  overflow: visible; padding: 0 .6rem; text-align: left;
  font-variation-settings: "wdth" 66; font-weight: 600; color: var(--petroleo-night);
  font-size: .9rem; position: relative;
}
.ws--lens td.f .miss { color: var(--amber-ink); font-weight: 650; margin-left: .4rem; font-variation-settings: "wdth" 80; }
.ws--lens td.f-c { border-left-color: transparent; }
.ws-wrap.lens-anim .ws--lens { transition: clip-path .7s cubic-bezier(.6, 0, .2, 1); }
.ws-wrap.lens-glide .ws--lens { transition: clip-path .35s cubic-bezier(.3, 1.2, .5, 1); }
.ws-wrap.lens-glide .lens { transition: transform .35s cubic-bezier(.3, 1.2, .5, 1), opacity .25s; }
.ws-wrap.is-export .lens { opacity: 0; pointer-events: none; }

.lens {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: calc(var(--lr, 64px) * 2); height: calc(var(--lr, 64px) * 2);
  transform: translate(calc(var(--lx-px, 0px) - var(--lr, 64px)), calc(var(--ly-px, 0px) - var(--lr, 64px)));
  border-radius: 50%;
  border: 5px solid var(--petroleo);
  box-shadow: 0 0 0 1.5px var(--ink), inset 0 0 0 1.5px rgb(14 18 25 / .25);
  cursor: grab; touch-action: none;
  transition: opacity .25s;
}
.lens.is-moving { cursor: grabbing; }
.lens__handle {
  position: absolute; width: 14px; height: 46px; left: 100%; top: 100%;
  background: var(--ink); border-radius: 3px;
  transform-origin: 50% 0; transform: translate(-12px, -14px) rotate(-45deg);
}

.tabs {
  display: flex; gap: 2px; padding: 0 .4rem; min-height: 2.15rem; align-items: stretch;
  background: var(--gutter-bg); border-top: 1px solid var(--grid);
  overflow: hidden; flex-wrap: nowrap;
}
.tab {
  display: flex; align-items: center; padding: 0 .75rem; font-size: .8rem; color: var(--fog);
  white-space: nowrap; border-right: 1px solid var(--grid); font-variation-settings: "wdth" 92;
}
.tab--on { background: var(--hoja); color: var(--ink); font-weight: 680; box-shadow: inset 0 -3px 0 var(--petroleo); }
.tab--file { color: var(--petroleo-night); font-weight: 600; }
@keyframes stamp { from { transform: translateY(-120%) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tab--new { animation: stamp .4s cubic-bezier(.2, 1.4, .4, 1); }

.sheet__drop {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  background: rgb(226 246 238 / .82); outline: 3px dashed var(--petroleo); outline-offset: -10px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.sheet__drop span { font-weight: 760; font-size: 1.15rem; color: var(--petroleo-night); background: var(--hoja); padding: .5rem .9rem; border-radius: 3px; }
.sheet.is-over .sheet__drop { opacity: 1; }
.bench.is-dragging .sheet { box-shadow: 10px 10px 0 var(--petroleo-deep), 0 0 0 3px var(--menta); }

.bench__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  margin-top: 1.4rem;
}
.bench__status { max-width: 30rem; font-size: .98rem; line-height: 1.4; }
.bench__actions { display: flex; align-items: center; gap: 1.1rem; }


/* ---------- Página ---------- */
.page > section:not(.rule) { max-width: var(--max); margin-inline: auto; padding: clamp(4.5rem, 10vw, 8.5rem) var(--pad); }

/* Archivos sueltos */
.mess__head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.5rem 4rem; align-items: end; }
.mess__head h2 { max-width: 16ch; }
.mess__head p { max-width: 30rem; font-size: 1.15rem; color: var(--ink-2); }
.pile {
  display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center;
  margin-top: clamp(2.5rem, 5vw, 4rem); padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  border-block: 2px solid var(--ink);
}
.pile li {
  font-size: clamp(1rem, 1.6vw, 1.3rem); font-weight: 560; line-height: 1.2;
  padding: .45rem .7rem; background: var(--hoja);
  border: 1px solid var(--grid); border-radius: 2px;
  color: var(--ink-2);
}
/* Cada archivo con su propio desorden: ancho, peso, giro */
.pile li:nth-child(1) { transform: rotate(-2deg); font-variation-settings: "wdth" 70; }
.pile li:nth-child(2) { transform: rotate(1.5deg) translateY(.4rem); font-variation-settings: "wdth" 112; }
.pile li:nth-child(3) { transform: rotate(-.6deg); font-variation-settings: "wdth" 85; background: transparent; border-style: dashed; }
.pile li:nth-child(4) { transform: rotate(2.4deg) translateY(-.3rem); font-variation-settings: "wdth" 62; font-weight: 760; }
.pile li:nth-child(5) { transform: rotate(-1.4deg) translateY(.5rem); font-variation-settings: "wdth" 125; font-weight: 450; }
.pile li:nth-child(6) { transform: rotate(.8deg); font-variation-settings: "wdth" 96; }
.pile li:nth-child(7) { transform: rotate(-2.6deg) translateY(-.2rem); font-variation-settings: "wdth" 76; text-decoration: line-through; text-decoration-color: var(--amber-stroke); text-decoration-thickness: 2px; }
.pile li:nth-child(8) { transform: rotate(1.2deg) translateY(.3rem); font-variation-settings: "wdth" 104; }
.pile li:nth-child(9) { transform: rotate(-.9deg); font-variation-settings: "wdth" 66; }
.mess__cost { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem clamp(1.5rem, 3vw, 3rem); margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.mess__cost h3 { font-size: clamp(1.45rem, 2.3vw, 1.9rem); font-weight: 800; font-variation-settings: "wdth" 72; line-height: 1.02; }
.mess__cost p { margin-top: .6rem; color: var(--ink-2); max-width: 30rem; }

/* Cómo se conecta */
.page > .flow { padding-top: clamp(2rem, 5vw, 4rem); }
.flow__head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.5rem 4rem; align-items: end; }
.flow__head h2 { max-width: 11ch; }
.flow__head p { max-width: 30rem; font-size: 1.15rem; color: var(--ink-2); }
.flow__line {
  display: grid; grid-template-columns: 1fr 1.1fr 1.15fr 1.1fr; gap: 0;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  counter-reset: none;
}
.flow__stop { position: relative; padding: 1.4rem 2.6rem 1.6rem 1.4rem; min-height: 15rem; }
.flow__stop h3 { font-size: 1.4rem; font-weight: 800; font-variation-settings: "wdth" 80; line-height: 1.05; }
.flow__stop p { margin-top: .6rem; color: var(--ink-2); font-size: 1rem; }
/* conector: línea + punta, dibujados, no caracteres */
.flow__stop:not(:last-child)::after {
  content: ""; position: absolute; top: 2.05rem; right: .7rem; width: 1.3rem; height: 1.3rem;
  background: var(--ink);
  clip-path: polygon(0 40%, 55% 40%, 55% 10%, 100% 50%, 55% 90%, 55% 60%, 0 60%);
}
.flow__stop--wms { background: transparent; border: 2px dashed var(--fog); }
.flow__stop--files { background: var(--hoja); border-block: 2px solid var(--ink); }
.flow__stop--wv { background: var(--petroleo); color: #fff; }
.flow__stop--wv p { color: rgb(255 255 255 / .9); }
.flow__stop--wv::after { background: var(--menta) !important; }
.flow__stop--out { background: var(--ink); color: #fff; }
.docs { margin-top: .9rem; display: grid; gap: .45rem; }
.docs li {
  font-size: .92rem; font-weight: 600; font-variation-settings: "wdth" 88;
  padding: .35rem .55rem; border: 1px solid var(--grid); background: #fff; border-radius: 2px; justify-self: start;
}
.docs--out li { background: transparent; border-color: rgb(255 255 255 / .3); color: var(--menta); }
.flow__facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}
.flow__facts li { padding-top: .9rem; border-top: 3px solid var(--petroleo); color: var(--ink-2); max-width: 26rem; }

/* Módulos como libro de Excel */
.mods h2 { max-width: 12ch; }
.book {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  background: var(--hoja); border: 1px solid var(--grid);
  box-shadow: -10px 10px 0 var(--petroleo);
}
.book__letters, .book__row {
  display: grid; grid-template-columns: 2.6rem minmax(0, .9fr) minmax(0, 2fr) minmax(0, .95fr);
}
.book__letters > * {
  padding: .45rem .9rem; font-size: .85rem; font-weight: 600; color: var(--fog);
  background: var(--gutter-bg); border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid);
}
.book__letters > :last-child, .book__row > :last-child { border-right: 0; }
.book__l { display: inline-block; min-width: 1.2rem; color: var(--ink); font-weight: 720; font-variation-settings: "wdth" 110; }
.book__row > * { padding: 1.4rem .9rem 1.5rem; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.book__row:last-child > * { border-bottom: 0; }
.book__n { background: var(--gutter-bg); color: var(--fog); text-align: center; padding-inline: 0 !important; font-size: .85rem; font-weight: 600; }
.book__row h3 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); font-weight: 820; font-variation-settings: "wdth" 70; line-height: 1.02; }
.book__row p { color: var(--ink-2); max-width: 44rem; }
.book__out { display: flex; flex-wrap: wrap; align-content: start; gap: .4rem; }
.out-cell {
  display: inline-block; font-weight: 650; font-size: .95rem; line-height: 1.2;
  padding: .4rem .55rem; box-shadow: inset 0 0 0 2px var(--petroleo); color: var(--petroleo-night);
  font-variation-settings: "wdth" 96;
}
.out-cell--f { font-variation-settings: "wdth" 66; font-weight: 640; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.out-cell--folio { font-variation-settings: "wdth" 125; font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* ---------- Regla #1 ---------- */
.rule { background: var(--ink); color: #fff; }
.rule__inner { max-width: var(--max); margin-inline: auto; padding: clamp(4.5rem, 10vw, 8.5rem) var(--pad); }
.rule__title {
  font-weight: 860; font-variation-settings: "wdth" 62; line-height: .9; letter-spacing: -0.01em;
  font-size: clamp(3.2rem, 10.5vw, 10.5rem); max-width: 11ch;
}
.rule__tag {
  display: block; width: max-content; margin-bottom: .45em;
  font-size: max(1rem, .16em); font-weight: 720; font-variation-settings: "wdth" 110; letter-spacing: 0;
  color: var(--ink); background: var(--menta); padding: .3em .55em; line-height: 1;
}
.rule__body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2rem clamp(2rem, 5vw, 5rem); margin-top: clamp(2.5rem, 5vw, 4rem); align-items: start; }
.rule__quote p {
  font-size: clamp(1.3rem, 2.3vw, 1.85rem); line-height: 1.3; font-weight: 520; font-variation-settings: "wdth" 96;
  padding-left: 1.1rem; border-left: 4px solid var(--menta);
}
.rule__specimen > p { color: #C4CCD4; max-width: 32rem; }
.specimen { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 1.4rem; background: #2A3440; border: 1px solid #2A3440; }
.specimen > div { background: var(--ink); padding: 1rem 1.1rem 1.1rem; display: grid; gap: .4rem; }
.specimen__k { font-size: .85rem; color: #A9B3BE; }
.specimen__v { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; font-variation-settings: "wdth" 120; line-height: 1; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.specimen__no .specimen__v { color: #6E7884; text-decoration: line-through; text-decoration-thickness: 2px; }
.specimen .hollow { color: transparent; -webkit-text-stroke: 2px var(--amber); font-variation-settings: "wdth" 62; }
.specimen .tag { font-size: .8rem; }

.pallet {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 2.5rem clamp(2rem, 5vw, 5rem);
  margin-top: clamp(4rem, 8vw, 6.5rem); padding-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 2px solid #2A3440;
}
.pallet h3 { font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 830; font-variation-settings: "wdth" 66; line-height: .95; max-width: 13ch; }
.pallet__text p { margin-top: 1rem; color: #C4CCD4; max-width: 34rem; }
.pallet__text p:first-of-type { margin-top: 1.5rem; }

.switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #1D2631; border-radius: 4px; }
.switch button {
  background: transparent; border: 0; color: #C4CCD4; cursor: pointer;
  padding: .55rem .85rem; border-radius: 3px; font-size: .92rem; font-weight: 620; font-variation-settings: "wdth" 92;
  transition: background-color .2s, color .2s;
}
.switch button:hover { color: #fff; }
.switch button[aria-pressed="true"] { background: var(--menta); color: var(--ink); }

.pt { width: 100%; border-collapse: collapse; margin-top: 1.1rem; font-variant-numeric: tabular-nums; background: var(--hoja); color: var(--ink); }
.pt caption { caption-side: bottom; text-align: left; font-size: .85rem; color: #A9B3BE; padding-top: .6rem; }
.pt th { text-align: left; font-size: .8rem; font-weight: 650; color: var(--fog); background: var(--gutter-bg); padding: .45rem .75rem; border: 1px solid var(--grid); }
.pt td { padding: .5rem .75rem; border: 1px solid var(--grid); font-weight: 600; font-variation-settings: "wdth" 110; height: 2.4rem; }
.pt td:nth-child(2) { width: 4.5rem; }
.pt td:first-child { white-space: nowrap; width: 7rem; }
.pt__note { font-size: .82rem; font-weight: 600 !important; font-variation-settings: "wdth" 88 !important; color: var(--amber-ink); }
.pt__merge { display: none; }
.pt tr > td:not(.pt__note) { transition: color .25s, background-color .25s; }
.pallet[data-mode="embarque"] tr[data-dupe] td:not(.pt__note) { color: #A3ADA9; text-decoration: line-through; background: #FFF6E3; }
.pallet[data-mode="embarque"] tr[data-dupe] .pt__merge { display: inline; }
.pt__count { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; margin-top: 1.3rem; }
.pt__num { font-size: clamp(3rem, 6vw, 4.6rem); font-weight: 820; font-variation-settings: "wdth" 125; line-height: .9; font-variant-numeric: tabular-nums; }
.pt__unit { font-size: 1.1rem; font-weight: 600; }
.pt__verdict { font-size: 1rem; font-weight: 650; color: var(--amber); }
.pallet[data-mode="recibo"] .pt__verdict { color: var(--menta); }

/* ---------- Puestos ---------- */
.roles__head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.5rem 4rem; align-items: end; }
.roles__head h2 { max-width: 11ch; }
.roles__head p { max-width: 30rem; font-size: 1.15rem; color: var(--ink-2); }
.roles__list { margin-top: clamp(2.5rem, 5vw, 4rem); border-top: 3px solid var(--ink); }
.role {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, .9fr); gap: .6rem clamp(1.5rem, 3vw, 3rem);
  padding: 1.5rem 0 1.6rem; border-bottom: 1px solid #BFCAC5; align-items: baseline;
}
.role h3 { font-size: clamp(1.35rem, 2.3vw, 1.9rem); font-weight: 760; font-variation-settings: "wdth" 116; line-height: 1.05; letter-spacing: -0.01em; }
.role > p { color: var(--ink-2); max-width: 38rem; }
.role__mods { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.role__mods li { font-size: .82rem; font-weight: 620; padding: .28rem .5rem; border-radius: 2px; color: var(--petroleo-night); box-shadow: inset 0 0 0 1.5px var(--petroleo); white-space: nowrap; }
.roles__admin { margin-top: 1.4rem; color: var(--fog); }

/* ---------- Contacto ---------- */
.cta {
  background: var(--petroleo); color: #fff;
  padding: clamp(5rem, 11vw, 9rem) max(var(--pad), (100% - var(--max)) / 2 + var(--pad));
  position: relative; overflow: hidden; isolation: isolate;
}
.cta__mark { position: absolute; z-index: -1; right: -8vw; top: 50%; width: min(56vw, 46rem); height: auto; transform: translateY(-50%); fill: var(--petroleo-deep); }
.cta__inner { position: relative; }
.cta h2 { max-width: 14ch; }
.cta p { margin-top: 1.5rem; max-width: 33rem; font-size: 1.2rem; }
.cta .btn { margin-top: 2.2rem; }
.cta .cta__mail { margin-top: 1.4rem; font-size: 1rem; color: rgb(255 255 255 / .85); }
.cta__mail a { color: #fff; font-weight: 600; text-underline-offset: .2em; }

/* ---------- Pie ---------- */
.foot {
  background: var(--hoja); color: var(--fog);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.25rem 2rem;
  padding: 1.75rem max(var(--pad), (100% - var(--max)) / 2 + var(--pad)) 2rem; font-size: .95rem;
}
.foot__wv { display: flex; align-items: center; gap: .55rem; }
.foot__wv svg { width: 1.4rem; height: 1.4rem; fill: var(--petroleo); }
.foot__racha { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); font-weight: 520; }
.foot__racha svg { width: 8.5rem; height: auto; color: var(--cobalt); transition: color .2s; }
.foot__racha:hover svg { color: var(--ink); }
.foot__racha:hover span { text-decoration: underline; text-underline-offset: .25em; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .intro { grid-template-columns: minmax(0, 1fr); }
  .intro__copy { max-width: 46rem; }
  .shelf-title { font-size: clamp(3rem, 10vw, 6.4rem); }
  .shelf-title__line::after { right: auto; width: calc(100% + var(--pad) + 50vw); }
  .key { display: none; }
  .bench__lens-hint { display: block; margin-top: .8rem; font-size: .9rem; color: rgb(255 255 255 / .82); }
}
@media (max-width: 900px) {
  .nav__links li:not(:last-child) { display: none; }
  .mess__head, .flow__head, .roles__head, .rule__body, .pallet { grid-template-columns: minmax(0, 1fr); }
  .mess__cost, .flow__facts { grid-template-columns: minmax(0, 1fr); }
  .flow__line { grid-template-columns: minmax(0, 1fr); }
  .flow__stop { min-height: 0; padding: 1.3rem 1.3rem 2.6rem; }
  .flow__stop:not(:last-child)::after { top: auto; bottom: .55rem; right: auto; left: 1.3rem; transform: rotate(90deg); }
  .book__letters { display: none; }
  .book__row { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .book__row > * { border-right: 0; border-bottom: 0; padding: .3rem 1rem; }
  .book__n { grid-row: span 3; border-right: 1px solid var(--grid) !important; padding-top: 1.3rem !important; }
  .book__row h3 { padding-top: 1.3rem; }
  .book__row .book__out { padding-bottom: 1.4rem; }
  .book__row { border-bottom: 1px solid var(--grid); }
  .book__row:last-child { border-bottom: 0; }
  .role { grid-template-columns: minmax(0, 1fr); }
  .role__mods { justify-content: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .brand__name { font-size: 1.15rem; }
  .brand__mark { width: 1.7rem; height: 1.6rem; }
  .brand__word { height: .95rem; }
  .nav__links .nav__cta { font-size: .85rem; padding: .5rem .7rem; }
  .intro__actions .btn { flex: 1 1 auto; }
  .rack { padding: 0 .9rem; }
  .rack__shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rack__shelf > li:nth-child(odd)::after { left: -.9rem; }
  .rack__shelf > li:nth-child(even)::after { right: -.9rem; }
  .file { min-height: 5.6rem; }
  .sheet { box-shadow: 6px 6px 0 var(--petroleo-deep); }
  .ws col.c-a { width: 52%; }
  .ws col.c-b { width: auto; }
  .ws col.c-c { width: 0; }
  .ws th:nth-child(4), .ws td:nth-child(4) { display: none; }
  .ws { font-size: .9rem; }
  .ws .r-title td.span { font-size: .9rem; }
  .display { font-size: clamp(2.6rem, 12vw, 3.4rem); max-width: none !important; }
  .pt td:first-child { width: 5.6rem; }
  .pt td, .pt th { font-size: .95rem; }
  .ws th, .ws td { padding: 0 .45rem; }
  .fx { grid-template-columns: 2.9rem auto minmax(0, 1fr); }
  .fx__src { white-space: normal; }
  .book { box-shadow: -6px 6px 0 var(--petroleo); }
  .specimen { grid-template-columns: minmax(0, 1fr); }
  .switch { display: grid; grid-template-columns: minmax(0, 1fr); }
  .pt td, .pt th { padding-inline: .5rem; }
  .cta__mark { width: 90vw; right: -30vw; top: auto; bottom: -12vw; transform: none; }
  .foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
