/* ---------------------------------------------------------------------------
   REBU para PrestaShop · familia lanabes
   La paleta es la del icono de la familia: un cuadrado verde bosque con una
   etiqueta crema. Aquí la etiqueta es literal: la de precio de la segunda mano.
   Un solo acento (el verde). Ámbar y rojo existen solo para estados.
   --------------------------------------------------------------------------- */

/* Inter (SIL Open Font License 1.1, ver fonts/OFL.txt), servida desde la propia web:
   abrir la página no avisa a ningún tercero. Variable en peso (400-600) y tamaño óptico. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg:          #F5F0E6;
  --bg-sunk:     #EEE7D8;
  --surface:     #FBF8F1;
  --surface-2:   #FFFCF7;
  --tag:         #F2EBDC;
  --tag-edge:    #E2D7C0;
  --stage:       #1F4436;
  --stage-2:     #19392D;
  --accent:      #1F4436;
  --accent-hover:#2B5A48;
  --accent-fg:   #F6F1E7;
  --accent-soft: rgba(31, 68, 54, .08);
  --text:        #16201B;
  --text-2:      #48554E;
  --text-3:      #5B6760;
  --line:        rgba(31, 68, 54, .12);
  --line-2:      rgba(31, 68, 54, .22);
  --warn-bg:     #F6E9CB;
  --warn-ink:    #6E4E0F;
  --danger-bg:   #F5DED7;
  --danger-ink:  #8E2C1C;
  --ok-ink:      #23634A;
  --ring:        #1F4436;
  --code-bg:     #18241E;
  --code-ink:    #E3EAE5;
  --code-dim:    #8FA79A;
  --shadow-sm: 0 1px 1px rgba(22, 32, 27, .04), 0 2px 8px -3px rgba(22, 32, 27, .10);
  --shadow-md: 0 1px 2px rgba(22, 32, 27, .05), 0 16px 36px -18px rgba(22, 32, 27, .28), inset 0 1px 0 rgba(255, 253, 248, .7);
  --shadow-tag: 0 1px 2px rgba(8, 26, 19, .30), 0 10px 18px -8px rgba(8, 26, 19, .35), 0 38px 60px -28px rgba(4, 18, 12, .65);

  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.3125rem;
  --fs-xl: 1.75rem;
  --fs-display: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          #0F1512;
    --bg-sunk:     #0B100D;
    --surface:     #161E1A;
    --surface-2:   #1C2621;
    --tag:         #EAE2D0;
    --tag-edge:    #CFC3A8;
    --stage:       #1A3B2E;
    --stage-2:     #143025;
    --accent:      #A6CFB7;
    --accent-hover:#BFDDCB;
    --accent-fg:   #0F1512;
    --accent-soft: rgba(166, 207, 183, .10);
    --text:        #E6EAE6;
    --text-2:      #B3BFB8;
    --text-3:      #97A49D;
    --line:        rgba(166, 207, 183, .14);
    --line-2:      rgba(166, 207, 183, .26);
    --warn-bg:     #3A2F15;
    --warn-ink:    #EBCB8B;
    --danger-bg:   #3D1E17;
    --danger-ink:  #F0A898;
    --ok-ink:      #8FD0AE;
    --ring:        #A6CFB7;
    --code-bg:     #0A0F0C;
    --code-ink:    #DCE5DF;
    --code-dim:    #7F978A;
    --kpi-bg:      #23503F;
    --kpi-fg:      #F2EBDC;
    --shadow-sm: 0 1px 1px rgba(0, 0, 0, .30), 0 2px 8px -3px rgba(0, 0, 0, .45);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .35), 0 16px 36px -18px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(230, 234, 230, .05);
    --shadow-tag: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 18px -8px rgba(0, 0, 0, .55), 0 38px 60px -28px rgba(0, 0, 0, .85);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0F1512;
  --bg-sunk:     #0B100D;
  --surface:     #161E1A;
  --surface-2:   #1C2621;
  --tag:         #EAE2D0;
  --tag-edge:    #CFC3A8;
  --stage:       #1A3B2E;
  --stage-2:     #143025;
  --accent:      #A6CFB7;
  --accent-hover:#BFDDCB;
  --accent-fg:   #0F1512;
  --accent-soft: rgba(166, 207, 183, .10);
  --text:        #E6EAE6;
  --text-2:      #B3BFB8;
  --text-3:      #97A49D;
  --line:        rgba(166, 207, 183, .14);
  --line-2:      rgba(166, 207, 183, .26);
  --warn-bg:     #3A2F15;
  --warn-ink:    #EBCB8B;
  --danger-bg:   #3D1E17;
  --danger-ink:  #F0A898;
  --ok-ink:      #8FD0AE;
  --ring:        #A6CFB7;
  --code-bg:     #0A0F0C;
  --code-ink:    #DCE5DF;
  --code-dim:    #7F978A;
  --kpi-bg:      #23503F;
  --kpi-fg:      #F2EBDC;
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, .30), 0 2px 8px -3px rgba(0, 0, 0, .45);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .35), 0 16px 36px -18px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(230, 234, 230, .05);
  --shadow-tag: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 18px -8px rgba(0, 0, 0, .55), 0 38px 60px -28px rgba(0, 0, 0, .85);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  font-optical-sizing: auto;
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
svg.i { width: 20px; height: 20px; flex: none; display: block; }
svg.i-sm { width: 16px; height: 16px; }

h1, h2, h3 { line-height: 1.1; margin: 0; font-weight: 600; color: var(--text); text-wrap: balance; }
h2 { font-size: var(--fs-xl); letter-spacing: -.022em; }
h3 { font-size: var(--fs-lg); letter-spacing: -.016em; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
strong { font-weight: 600; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); transition: text-decoration-color 120ms ease, color 120ms ease; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.num { font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--accent); color: var(--accent-fg);
  padding: 8px 14px; border-radius: var(--r); text-decoration: none; font-size: var(--fs-sm); font-weight: 500;
  transition: transform 160ms var(--ease-out);
}
.skip:focus-visible { transform: translateY(60px); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- header ---------- */

.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: var(--text); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); letter-spacing: -.005em; border-radius: var(--r-sm); }
.brand svg { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.brand span { color: var(--text-3); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px;
  color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500;
  transition: background-color 120ms ease, color 120ms ease;
}
.nav a:hover { background: var(--accent-soft); color: var(--text); }
.nav a:active { transform: scale(.97); transition: transform 60ms var(--ease-out); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.nav .lang { border: 1px solid var(--line-2); }
@media (max-width: 560px) {
  .brand span { display: none; }
  .nav a { padding: 0 10px; }
}
@media (max-width: 380px) {
  .nav .hide-xs { display: none; }
  .brand { font-size: 0; gap: 0; }
  .nav a { padding: 0 9px; }
}
@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
}

/* ---------- buttons ---------- */

.btn {
  --btn-bg: var(--accent); --btn-fg: var(--accent-fg);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--r);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid transparent;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; letter-spacing: -.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 1px rgba(10, 30, 22, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 160ms var(--ease-out);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.97); transition: transform 60ms var(--ease-out); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn .i { width: 18px; height: 18px; }
.btn-ghost {
  --btn-bg: transparent; --btn-fg: var(--text);
  border-color: var(--line-2); box-shadow: none;
}
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--line-2); }
.btn-quiet {
  --btn-bg: transparent; --btn-fg: var(--accent);
  box-shadow: none; padding: 0 12px; min-height: 40px;
}
.btn-quiet:hover { background: var(--accent-soft); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); }

/* ---------- hero ---------- */

.hero { padding-block: clamp(40px, 7vw, 96px) clamp(48px, 7vw, 88px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: var(--fs-display); letter-spacing: -.04em; line-height: 1.02; max-width: 11ch; }
.hero .lead { margin-top: 24px; font-size: var(--fs-lg); line-height: 1.5; color: var(--text-2); max-width: 34ch; letter-spacing: -.01em; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero .assure { display: flex; align-items: center; gap: 8px; margin-top: 24px; font-size: var(--fs-sm); color: var(--text-3); }
.hero .assure .i { width: 16px; height: 16px; color: var(--ok-ink); }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: 13ch; }
}

/* the stage: the family icon, made real. A green square with a cream tag hanging */
.stage {
  position: relative;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--stage), var(--stage-2));
  box-shadow: 0 1px 2px rgba(8, 26, 19, .25), 0 30px 60px -32px rgba(8, 26, 19, .6), inset 0 1px 0 rgba(242, 235, 220, .08);
  padding: 88px clamp(20px, 5vw, 56px) clamp(32px, 5vw, 48px);
  min-height: 520px;
  display: grid; place-items: start center;
  isolation: isolate;
  overflow: hidden;
}
.stage .string {
  position: absolute; left: 50%; top: 0; width: 160px; height: 124px; margin-left: -80px;
  z-index: 2; pointer-events: none;
}
.stage .string .twine { stroke: #C8B184; }
.stage .string .twine-shadow { stroke: rgba(6, 22, 15, .30); }

.tag {
  position: relative; z-index: 1;
  width: min(100%, 340px);
  margin-top: -40px;
  transform-origin: 50% 34px;
  transform: rotate(-2deg);
  filter: drop-shadow(0 1px 1px rgba(8, 26, 19, .30)) drop-shadow(0 10px 14px rgba(8, 26, 19, .28)) drop-shadow(0 30px 34px rgba(4, 18, 12, .38));
}
.tag-cap { display: block; width: 100%; height: 74px; margin-bottom: -1px; }
.tag-cap path { fill: var(--tag); }
.tag-cap .hole { fill: var(--stage); stroke: rgba(31, 68, 54, .35); stroke-width: 1.5; }
.tag-body {
  position: relative;
  background: var(--tag);
  color: #1B2A22;
  border-radius: 0 0 18px 18px;
  padding: 0 26px 24px;
}
.tag-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding-block: 8px; }
.tag-row label, .tag-row .k { font-size: var(--fs-sm); color: #44544B; font-weight: 500; }
.tag-input {
  display: inline-flex; align-items: baseline; gap: 4px;
  border-radius: var(--r-sm);
  padding: 2px 8px; margin-right: -8px;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
.tag-input:hover { background: rgba(31, 68, 54, .07); }
.tag-input:focus-within { background: #FFFCF6; box-shadow: 0 0 0 2px #1F4436; }
.tag-input input {
  width: 6.5ch; border: 0; background: transparent; padding: 0; margin: 0;
  font: inherit; font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.015em; color: #16201B;
  text-align: right; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.tag-input input:focus { outline: none; }
.tag-input input::-webkit-outer-spin-button, .tag-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tag-input span { font-size: var(--fs-lg); font-weight: 600; color: #16201B; }
.tag-perf {
  height: 0; margin: 12px -26px; border-top: 2px dotted rgba(31, 68, 54, .32);
}
.tag-row .v { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.015em; color: #16201B; font-variant-numeric: tabular-nums; }
.tag-total { padding-top: 6px; }
.tag-total .k { color: #1F4436; font-weight: 600; }
.tag-total .v { font-size: var(--fs-xl); letter-spacing: -.025em; color: #1F4436; }
.tag-rates { display: flex; gap: 6px; margin-top: 4px; }
.tag-rates button {
  min-height: 32px; min-width: 52px; padding: 0 10px; border-radius: 999px;
  border: 1px solid rgba(31, 68, 54, .25); background: transparent; color: #1F4436;
  font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 160ms var(--ease-out);
}
.tag-rates button:hover { background: rgba(31, 68, 54, .08); }
.tag-rates button:active { transform: scale(.96); transition: transform 60ms var(--ease-out); }
.tag-rates button[aria-pressed="true"] { background: #1F4436; color: #F6F1E7; border-color: #1F4436; }
.tag-rates button:focus-visible { outline: 2px solid #1F4436; outline-offset: 2px; }
.tag-note { margin-top: 14px; font-size: var(--fs-xs); line-height: 1.5; color: #4C5B53; }
.tag-note strong { color: #16201B; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-caption {
  position: relative; z-index: 1; margin-top: 28px; max-width: 34ch; text-align: center;
  font-size: var(--fs-sm); color: #D8D1C1; line-height: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  .tag { animation: tag-in 900ms var(--ease-expo) both 120ms; }
  .tag.swing { animation: tag-swing 520ms var(--ease-out); }
}
@keyframes tag-in {
  from { opacity: 0; transform: translateY(-16px) rotate(-9deg); }
  to   { opacity: 1; transform: rotate(-2deg); }
}
@keyframes tag-swing {
  0%   { transform: rotate(-2deg); }
  35%  { transform: rotate(-3.6deg); }
  100% { transform: rotate(-2deg); }
}
@media (max-width: 480px) {
  .stage { min-height: 0; padding: 72px 28px 32px; border-radius: 22px; }
  .tag { width: min(100%, 300px); }
  .tag-body { padding-inline: 20px; }
  .tag-perf { margin-inline: -20px; }
}

/* ---------- sections ---------- */

.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { max-width: 54ch; }
.section-head p { margin-top: 16px; color: var(--text-2); font-size: var(--fs-lg); line-height: 1.5; letter-spacing: -.01em; }

.band { background: var(--bg-sunk); border-block: 1px solid var(--line); }
.section-link { margin-top: 24px; }
.section-link a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-decoration: none; border-radius: 4px; }
.section-link a:hover { text-decoration: underline; }

/* worked example: a single, real calculation laid out like a receipt */
.example {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.example > div { padding: 20px 22px; }
.example > div + div { border-left: 1px solid var(--line); }
.example dt { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
.example dd { margin: 6px 0 0; font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.example .hl { background: var(--accent-soft); }
.example .hl dd { color: var(--accent); }
.example .op { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--text-3); font-weight: 400; letter-spacing: 0; }
@media (max-width: 760px) {
  .example { grid-template-columns: 1fr 1fr; }
  .example > div + div { border-left: 0; }
  .example > div { border-top: 1px solid var(--line); }
  .example > div:nth-child(-n+2) { border-top: 0; }
  .example > div:nth-child(even) { border-left: 1px solid var(--line); }
  .example > div:last-child { grid-column: 1 / -1; border-left: 0; }
}

/* ---------- guide layout with a sticky table of contents ---------- */

.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 32px); font-size: var(--fs-sm); }
.toc p { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 1px solid transparent;
  color: var(--text-3); text-decoration: none; line-height: 1.35;
  transition: color 120ms ease, border-color 120ms ease;
}
.toc a:hover { color: var(--text); }
.toc a[aria-current="true"] { color: var(--text); border-left-color: var(--accent); font-weight: 500; }
@media (max-width: 960px) {
  .guide { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}

.prose { max-width: 720px; }
.prose p, .prose li, .faq .a p { max-width: 60ch; }
.prose > * + * { margin-top: 20px; }
.prose h2 { margin-top: 72px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 40px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--text-3); }
.prose .muted { color: var(--text-2); }
.prose .ctas-inline { display: flex; flex-wrap: wrap; gap: 12px; max-width: none; }
.prose code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; padding: .3em .45em; border-radius: 5px; background: var(--accent-soft); color: var(--text);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.path { font-weight: 600; color: var(--text); }
.path .sep { color: var(--text-3); padding-inline: .3em; font-weight: 400; }

/* steps: the order is real information, so the numbers stay */
.steps { list-style: none; padding: 0 !important; counter-reset: step; }
.step { counter-increment: step; position: relative; padding-left: 56px; }
.step + .step { margin-top: 56px !important; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg);
  font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}
.step h3 { margin-top: 0; padding-top: 4px; }
.step > * + * { margin-top: 16px; }
.step ul { padding-left: 1.25em; }
@media (max-width: 560px) {
  .step { padding-left: 0; }
  .step::before { position: static; display: grid; margin-bottom: 12px; }
}

/* a field as it reads in PrestaShop */
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; padding: 16px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-sm); }
.fields dt { color: var(--text-3); }
.fields dd { margin: 0; font-weight: 500; }
@media (max-width: 480px) { .fields { grid-template-columns: 1fr; gap: 2px; } .fields dd { margin-bottom: 8px; } }

figure { margin: 0; }
.shot {
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.shot img { width: 100%; }
figure figcaption { margin-top: 10px; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.5; }
:root[data-theme="dark"] .shot img, :root:not([data-theme="light"]) .shot img { filter: none; }

/* callouts: a tinted surface plus an icon, never a coloured side stripe */
.note {
  display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start;
  padding: 16px 20px; border-radius: var(--r-lg);
  background: var(--accent-soft); color: var(--text);
  font-size: var(--fs-sm); line-height: 1.55;
}
.note .i { margin-top: 1px; color: var(--accent); }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.warn .i { color: var(--warn-ink); }
.note strong { font-weight: 600; }
.note p + p { margin-top: 8px; }

/* SQL block */
.code {
  position: relative; border-radius: var(--r-lg); background: var(--code-bg); color: var(--code-ink);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-bottom: 1px solid rgba(220, 229, 223, .10); font-size: var(--fs-xs); color: var(--code-dim); }
.code pre { margin: 0; padding: 18px; overflow-x: auto; font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.65; tab-size: 2; }
.code pre code { background: none; padding: 0; border-radius: 0; color: inherit; font-size: inherit; font-family: inherit; }
.code .kw { color: #A6CFB7; }
.copy {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 8px;
  border: 1px solid rgba(220, 229, 223, .18); background: rgba(220, 229, 223, .06); color: var(--code-ink);
  font: inherit; font-size: var(--fs-xs); font-weight: 500; cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 160ms var(--ease-out);
}
.copy:hover { background: rgba(220, 229, 223, .12); }
.copy:active { transform: scale(.96); transition: transform 60ms var(--ease-out); }
.copy:focus-visible { outline-color: #A6CFB7; }
.copy .i { width: 16px; height: 16px; }
.copy .ok { display: none; }
.copy.done .ok { display: block; color: #8FD0AE; }
.copy.done .idle { display: none; }

/* covers / doesn't cover */
.scope { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scope > div { padding: 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.scope h3 { display: flex; align-items: center; gap: 10px; font-size: var(--fs-base); letter-spacing: -.01em; }
.scope h3 .i { color: var(--ok-ink); }
.scope .no h3 .i { color: var(--warn-ink); }
.scope ul { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; }
.scope li { padding-left: 16px; position: relative; }
.scope li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 1.5px; background: var(--line-2); border-radius: 2px; }
@media (max-width: 760px) { .scope { grid-template-columns: 1fr; } }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0; font-weight: 500; letter-spacing: -.008em; border-radius: var(--r-sm);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { width: 18px; height: 18px; flex: none; color: var(--text-3); transition: transform 200ms var(--ease-out); }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq summary:hover { color: var(--accent); }
.faq .a { padding: 0 0 22px; color: var(--text-2); max-width: 68ch; }
.faq .a > * + * { margin-top: 12px; }

/* waitlist */
.waitlist {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center;
  padding: clamp(28px, 5vw, 56px); border-radius: 28px;
  background: linear-gradient(180deg, var(--stage), var(--stage-2)); color: #EDE6D6;
  box-shadow: 0 30px 60px -36px rgba(8, 26, 19, .6);
}
.waitlist h2 { color: #F6F1E7; }
.waitlist p { margin-top: 14px; color: rgba(237, 230, 214, .82); }
.waitlist ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: var(--fs-sm); }
.waitlist li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; }
.waitlist li .i { color: #A6CFB7; }
.waitlist .btn { --btn-bg: #F2EBDC; --btn-fg: #1F4436; margin-top: 28px; }
.waitlist .btn:hover { --btn-bg: #FBF7EE; }
.waitlist .btn:focus-visible { outline-color: #F2EBDC; }
.waitlist small { display: block; margin-top: 12px; font-size: var(--fs-xs); color: rgba(237, 230, 214, .72); line-height: 1.5; }
.waitlist small a { color: #F2EBDC; }
@media (max-width: 860px) { .waitlist { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); padding-block: 40px 56px; font-size: var(--fs-sm); color: var(--text-3); }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
.foot p + p { margin-top: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: flex-end; align-content: start; }
.foot nav a { color: var(--text-2); text-decoration: none; border-radius: 4px; }
.foot nav a:hover { color: var(--text); text-decoration: underline; }
.foot .disclaimer { color: var(--text-2); max-width: 60ch; }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: 1fr; } .foot nav { justify-content: flex-start; } }

/* ---------- calculator ---------- */

.calc-head { padding-block: clamp(40px, 6vw, 72px) 32px; }
.calc-head h1 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem); letter-spacing: -.035em; line-height: 1.05; }
.calc-head .lead { margin-top: 16px; max-width: 54ch; color: var(--text-2); font-size: var(--fs-lg); line-height: 1.5; letter-spacing: -.01em; }
.calc-head .assure { display: flex; gap: 8px; align-items: center; margin-top: 20px; font-size: var(--fs-sm); color: var(--text-2); }
.calc-head .assure .i { color: var(--ok-ink); width: 18px; height: 18px; }

.panel { border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-md); border: 1px solid var(--line); }

.drop {
  position: relative;
  display: grid; justify-items: center; text-align: center; gap: 16px;
  padding: clamp(40px, 7vw, 72px) 24px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1.5px dashed var(--line-2);
  transition: border-color 160ms ease, background-color 160ms ease;
}
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.drop-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.drop-icon .i { width: 26px; height: 26px; }
.drop h2 { font-size: var(--fs-lg); letter-spacing: -.015em; }
.drop p { color: var(--text-2); font-size: var(--fs-sm); max-width: 46ch; }
.drop .row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }
.drop .help { font-size: var(--fs-sm); color: var(--text-3); }

.state { display: grid; justify-items: center; text-align: center; gap: 14px; padding: clamp(40px, 6vw, 64px) 24px; }
.state .badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-bg); color: var(--danger-ink); }
.state .badge .i { width: 24px; height: 24px; }
.state h2 { font-size: var(--fs-lg); letter-spacing: -.015em; }
.state p { color: var(--text-2); font-size: var(--fs-sm); max-width: 52ch; }
.state .row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

/* skeleton shaped like the real summary */
.skel { padding: 28px; display: grid; gap: 16px; }
.skel span { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-sunk), color-mix(in srgb, var(--bg-sunk) 50%, var(--surface)), var(--bg-sunk)); background-size: 200% 100%; }
.skel .big { height: 40px; width: 38%; }
.skel .w60 { width: 60%; } .skel .w80 { width: 80%; } .skel .w40 { width: 40%; }
@media (prefers-reduced-motion: no-preference) { .skel span { animation: shimmer 1.4s linear infinite; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* column mapping */
.mapping { padding: clamp(24px, 4vw, 36px); }
.mapping h2 { font-size: var(--fs-lg); letter-spacing: -.015em; }
.mapping > p { margin-top: 8px; color: var(--text-2); font-size: var(--fs-sm); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.field { display: grid; gap: 6px; align-content: start; font-size: var(--fs-sm); }
.field label { font-weight: 500; }
.field small { color: var(--text-3); font-size: var(--fs-xs); }
.select, .input {
  min-height: 40px; width: 100%; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: var(--fs-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.select:hover, .input:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.select:focus-visible, .input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field.missing .select { border-color: var(--danger-ink); }
.mapping .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

/* results */
.result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.sample-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg);
  background: var(--warn-bg); color: var(--warn-ink); font-size: var(--fs-sm); font-weight: 500;
}
.sample-banner .i { flex: none; }
.sample-banner span { flex: 1 1 220px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.file-chip { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--fs-sm); color: var(--text-2); }
.file-chip b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.file-chip .i { color: var(--text-3); }
.toolbar .row { display: flex; flex-wrap: wrap; gap: 8px; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-sunk); border: 1px solid var(--line); }
.segmented button {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }

.summary { padding: clamp(20px, 3vw, 32px); }
.summary-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: end; }
.summary-top h2 { font-size: var(--fs-lg); letter-spacing: -.015em; }
.summary-top .sub { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-3); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.kpi { padding: 18px 20px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.kpi dt { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
.kpi dd { margin: 6px 0 0; font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi.main { background: var(--kpi-bg, var(--accent)); border-color: transparent; }
.kpi.main dt { color: color-mix(in srgb, var(--kpi-fg, var(--accent-fg)) 78%, transparent); }
.kpi.main dd { color: var(--kpi-fg, var(--accent-fg)); }
@media (max-width: 680px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi.main { grid-column: 1 / -1; }
  .kpi dd { font-size: var(--fs-lg); }
  .kpi.main dd { font-size: var(--fs-xl); }
}

.table-wrap { overflow-x: auto; margin-top: 24px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-weight: 500; color: var(--text-3); font-size: var(--fs-xs); padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--surface); }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
table.data td:not(.prod), table.data .nowrap { white-space: nowrap; }
@media (max-width: 600px) { table.data .opt { display: none; } }
table.data tfoot td { font-weight: 600; background: var(--surface); border-top: 1px solid var(--line-2); border-bottom: 0; }
.legal-line { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; font-size: var(--fs-xs); color: var(--text-2); line-height: 1.55; }
.legal-line .i { width: 16px; height: 16px; color: var(--text-3); margin-top: 1px; }

.lines { padding: clamp(20px, 3vw, 32px); }
.lines-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.lines-top h2 { font-size: var(--fs-lg); letter-spacing: -.015em; }
.lines-top p { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-3); }
table.lines-table td { padding-block: 8px; }
table.lines-table tr.off td { color: var(--text-3); }
table.lines-table tr.off td.prod { text-decoration: line-through; text-decoration-color: var(--line-2); }
table.lines-table td.prod { min-width: 200px; max-width: 320px; }
table.lines-table td.prod .name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.lines-table td.prod small { display: block; color: var(--text-3); font-size: var(--fs-xs); }
.cell-input {
  width: 9ch; min-height: 34px; padding: 0 8px; border-radius: 8px; text-align: right;
  border: 1px solid transparent; background: transparent; color: var(--text);
  font: inherit; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.cell-input:hover { border-color: var(--line-2); background: var(--surface); }
.cell-input:focus-visible { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.cell-input.edited { background: var(--accent-soft); }
.cell-input.bad { border-color: var(--danger-ink); }
.cell-select { min-height: 34px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.cell-select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.check { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.neg { color: var(--danger-ink); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; }
.flag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn-ink); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap;
}
.flag .i { width: 13px; height: 13px; }
.flag.info { background: var(--accent-soft); color: var(--text-2); }
.more { display: flex; justify-content: center; margin-top: 16px; }
.empty-filter { padding: 32px 16px; text-align: center; color: var(--text-3); font-size: var(--fs-sm); }

/* add a sale by hand */
.add > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px clamp(20px, 3vw, 32px); border-radius: var(--r-xl);
  transition: background-color 120ms ease;
}
.add > summary::-webkit-details-marker { display: none; }
.add > summary:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.add > summary .chev { width: 18px; height: 18px; flex: none; color: var(--text-3); transition: transform 200ms var(--ease-out); }
.add[open] > summary .chev { transform: rotate(180deg); }
.add-title { display: grid; gap: 2px; }
.add-title b { font-size: var(--fs-base); font-weight: 600; letter-spacing: -.01em; }
.add-title small { font-size: var(--fs-sm); color: var(--text-3); }
.add-form {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 16px;
  padding: 4px clamp(20px, 3vw, 32px) clamp(20px, 3vw, 28px);
}
.add-form .wide { grid-column: span 3; }
.add-form .opt { font-weight: 400; color: var(--text-3); font-size: var(--fs-xs); }
.add-form .input[aria-invalid="true"] { border-color: var(--danger-ink); }
.add-actions { grid-column: 2 / -1; align-self: end; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.add-error { margin: 0 auto 0 0; display: flex; gap: 8px; align-items: center; color: var(--danger-ink); font-size: var(--fs-sm); font-weight: 500; }
@media (max-width: 760px) {
  .add-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .add-form .wide, .add-actions { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .add-form { grid-template-columns: minmax(0, 1fr); }
}
.btn-remove {
  min-height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font: inherit; font-size: var(--fs-xs); font-weight: 500; cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn-remove:hover { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger-ink) 45%, transparent); background: var(--danger-bg); }
.drop .help-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 0; }
.drop .help-row .help { display: inline-flex; align-items: center; gap: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg);
  font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--shadow-md);
  transition: transform 220ms var(--ease-out), opacity 160ms var(--ease-out);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- invoice / purchase document model ---------- */

.answer {
  display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start;
  margin-top: 28px; padding: 18px 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: var(--fs-base); line-height: 1.55; max-width: 72ch;
}
.answer .i { color: var(--accent); margin-top: 3px; }
.answer strong { font-weight: 600; }

.doc { display: grid; gap: 16px; max-width: 820px; }
.doc-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-sunk); border: 1px solid var(--line); justify-self: start; }
.doc-tabs button {
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.doc-tabs button:hover { color: var(--text); }
.doc-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }
.doc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.doc-bar p { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-sm); color: var(--text-2); max-width: 60ch; }
.doc-bar p .i { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.doc-bar .row { display: flex; flex-wrap: wrap; gap: 8px; }

/* the sheet is paper in both themes: it previews what gets printed */
.sheet {
  --ink: #17201B; --ink-2: #4E5A53; --ink-3: #6A756F; --rule: rgba(23, 32, 27, .14); --rule-2: rgba(23, 32, 27, .28);
  position: relative; overflow: hidden;
  max-width: 820px; padding: clamp(24px, 5vw, 56px);
  background: #FFFDF8; color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(22, 32, 27, .08), 0 24px 48px -24px rgba(22, 32, 27, .30), 0 0 0 1px rgba(22, 32, 27, .06);
  font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums;
}
.sheet-print { display: none; }
.sample-mark {
  position: absolute; top: 26px; right: -46px; transform: rotate(35deg);
  width: 190px; padding: 6px 0; text-align: center;
  background: #F6E9CB; color: #6E4E0F; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(110, 78, 15, .2);
}
.sheet h3 { font-size: 28px; letter-spacing: -.025em; color: var(--ink); }
.sheet h4 { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 0 0 8px; letter-spacing: .02em; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px 32px; padding-bottom: 24px; border-bottom: 1px solid var(--rule-2); }
.sheet-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, auto)); gap: 4px 24px; }
.sheet-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; padding: 24px 0; }
.sf { display: grid; gap: 1px; padding: 3px 0; }
.sl { font-size: 12px; color: var(--ink-3); }
.sv { color: var(--ink); }
.si {
  width: 100%; min-height: 32px; padding: 4px 8px; margin: 0 -8px; box-sizing: content-box; max-width: calc(100% - 16px);
  border: 1px solid transparent; border-bottom-color: var(--rule-2); border-radius: 6px 6px 0 0;
  background: rgba(31, 68, 54, .035); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.si:hover { background: rgba(31, 68, 54, .07); }
.si:focus-visible { outline: none; border-color: #1F4436; border-radius: 6px; background: #FFFFFB; box-shadow: 0 0 0 3px rgba(31, 68, 54, .18); }
select.si { appearance: auto; padding-right: 4px; }
.si.n { text-align: right; }
.sheet-lines { width: 100%; border-collapse: collapse; margin-top: 4px; }
.sheet-lines th { font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule-2); }
.sheet-lines td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.sheet-lines .n { text-align: right; white-space: nowrap; }
.sheet-lines th.n:last-child, .sheet-lines td.n:last-child { padding-right: 0; }
.sheet-lines td.d { width: 58%; }
.sheet-lines td.n .si { width: 7ch; }
.line-x {
  margin-left: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3);
  font-size: 18px; line-height: 1; cursor: pointer; vertical-align: middle;
  transition: background-color 120ms ease, color 120ms ease;
}
.line-x:hover { background: #F5DED7; color: #8E2C1C; }
.add-line { margin-top: 8px; color: #1F4436; }
.sheet-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--rule-2); }
.sheet-total span { color: var(--ink-2); }
.sheet-total strong { font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.sheet-mention, .sheet-foot { padding-top: 20px; display: grid; gap: 6px; }
.mention-text { font-weight: 600; font-size: 15px; color: var(--ink); }
.vat-note { font-size: 12px; color: var(--ink-2); }
.sheet-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; font-size: 12px; color: var(--ink-3); }
.sheet-signs span { display: block; height: 56px; border-bottom: 1px solid var(--rule-2); margin-bottom: 6px; }
@media (max-width: 640px) {
  .sheet-parties { grid-template-columns: 1fr; }
  .sheet-lines td.d { width: auto; }
  .sheet-signs { gap: 20px; }
}

/* ---------- the calculation, step by step (example pages) ----------
   Controls on the page surface; the result is a paper receipt, cream in both themes
   like the price tag, so the numbers always read as "the ticket for this piece". */

/* no card around it: the controls sit on the page and the receipt is the only object */
.walk {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(28px, 5vw, 64px);
  padding-block: 8px clamp(8px, 2vw, 16px); align-items: start;
}
.walk-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; min-width: 0; }
.walk-in h2 { font-size: var(--fs-lg); letter-spacing: -.015em; }
.walk-in > p { margin-top: -12px; color: var(--text-2); font-size: var(--fs-sm); }
.walk-field { display: grid; gap: 8px; font-size: var(--fs-sm); }
.walk-field > label, .walk-field > span { font-weight: 500; color: var(--text); }
.money {
  display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 16px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.money:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.money:has(input[aria-invalid="true"]) { border-color: var(--danger-ink); }
.money input {
  flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; padding: 0; color: var(--text);
  font: inherit; font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums;
}
.money input:focus { outline: none; }
.money span { font-size: var(--fs-lg); font-weight: 600; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font: inherit; font-size: var(--fs-xs); font-weight: 500; cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 160ms var(--ease-out);
}
.chips button:hover { background: var(--accent-soft); color: var(--text); }
.chips button:active { transform: scale(.97); transition: transform 60ms var(--ease-out); }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.walk-err { display: flex; gap: 8px; align-items: center; color: var(--danger-ink); font-size: var(--fs-sm); font-weight: 500; }
.walk-err .i { width: 18px; height: 18px; }

.walk-out {
  --ink: #17201B; --ink-2: #4E5A53; --ink-3: #66726B; --rule: rgba(23, 32, 27, .16);
  position: relative; align-self: start; min-width: 0;
  padding: 8px 28px 28px; border-radius: 16px;
  background: #FBF6EA; color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 32, 27, .10), 0 18px 36px -22px rgba(22, 32, 27, .45), 0 0 0 1px rgba(22, 32, 27, .06);
  font-variant-numeric: tabular-nums;
}
.walk-out h3 { padding: 18px 0 6px; font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.walk-steps { list-style: none; margin: 0; padding: 0; }
.walk-steps li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  padding: 16px 0; border-top: 1.5px dotted var(--rule);
}
.walk-steps li:first-child { border-top: 0; }
.walk-steps .n {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(31, 68, 54, .09); color: #1F4436; font-size: var(--fs-xs); font-weight: 600;
}
.walk-steps b { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); letter-spacing: -.005em; }
.walk-steps .f { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-3); overflow-wrap: anywhere; }
.walk-steps output { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.015em; color: var(--ink); text-align: right; white-space: nowrap; }
.walk-steps .total { position: relative; margin-top: 14px; padding-top: 22px; border-top: 2px dotted rgba(31, 68, 54, .32); }
/* the tear line of a ticket: two notches in the page colour */
.walk-steps .total::before, .walk-steps .total::after {
  content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg);
}
.walk-steps .total::before { left: -36px; }
.walk-steps .total::after { right: -36px; }
.walk-steps .total .n { background: #1F4436; color: #F6F1E7; }
.walk-steps .total b { color: #1F4436; }
.walk-steps .total output { font-size: var(--fs-xl); letter-spacing: -.025em; color: #1F4436; }
.walk.is-negative .walk-steps li:first-child output { color: #8E2C1C; }
.walk.is-invalid .walk-out { opacity: .55; }
.walk-neg { margin-top: 2px; font-size: var(--fs-xs); color: #6E4E0F; background: #F6E9CB; padding: 10px 12px; border-radius: 10px; line-height: 1.5; }
@media (prefers-reduced-motion: no-preference) {
  .walk-steps.tick output { animation: settle 320ms var(--ease-out); }
}
@keyframes settle { from { opacity: .3; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.walk-compare { display: grid; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--rule); }
.walk-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; font-size: var(--fs-xs); color: var(--ink-2); }
.walk-bar b { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); white-space: nowrap; }
.walk-bar i { grid-column: 1 / -1; position: relative; display: block; height: 8px; border-radius: 999px; background: rgba(31, 68, 54, .08); overflow: hidden; }
/* the fill slides in from the left (transform only, no layout work) */
.walk-bar i::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: #B8A47E;
  transform: translateX(calc(var(--w, 0%) - 100%));
  transition: transform 520ms var(--ease-expo);
}
.walk-bar.rebu i::after { background: #1F4436; }
.walk-bar.rebu b { color: #1F4436; }

@media (max-width: 860px) {
  .walk { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .walk-out { padding-inline: 20px; }
  .walk-steps .total::before { left: -28px; }
  .walk-steps .total::after { right: -28px; }
  /* narrow phones: the figure drops under its label instead of squeezing it */
  .walk-steps li { grid-template-columns: 24px minmax(0, 1fr); gap: 2px 12px; align-items: start; }
  .walk-steps .n { width: 24px; height: 24px; margin-top: 1px; }
  .walk-steps output { grid-column: 2; text-align: left; font-size: var(--fs-lg); }
  .walk-steps .total output { font-size: var(--fs-xl); }
}

/* a small trimester laid out as the 303 would group it */
.quarter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.quarter > div { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.quarter dt { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
.quarter dd { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); color: var(--text-2); }
.quarter dd strong { color: var(--text); font-size: var(--fs-lg); letter-spacing: -.015em; }
@media (max-width: 560px) { .quarter { grid-template-columns: minmax(0, 1fr); } }

/* ---------- libro registro: the template, previewed as a spreadsheet ---------- */

.download {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 20px; align-items: center;
  padding: 20px 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.download .file-icon {
  width: 52px; height: 60px; border-radius: 8px; display: grid; place-items: end center; padding-bottom: 8px; align-self: start;
  background: linear-gradient(180deg, #23634A, #1F4436); color: #F2EBDC; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 14px -8px rgba(8, 26, 19, .6);
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}
.download h2 { font-size: var(--fs-base); letter-spacing: -.01em; }
.download p { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-2); }
.download .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 720px) {
  .download { grid-template-columns: auto minmax(0, 1fr); }
  .download .row { grid-column: 1 / -1; justify-content: flex-start; }
}

.xl { overflow-x: auto; margin-top: 16px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.xl table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 1180px; }
.xl th, .xl td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 10px; white-space: nowrap; text-align: left; }
.xl thead th { background: var(--bg-sunk); color: var(--text-3); font-weight: 500; font-size: 11px; text-align: center; padding-block: 4px; }
.xl tbody th { background: var(--bg-sunk); color: var(--text-3); font-weight: 500; font-size: 11px; text-align: center; width: 36px; padding-inline: 6px; position: sticky; left: 0; }
.xl .hdr td { font-weight: 600; color: var(--text); background: var(--accent-soft); }
.xl .ex td { color: var(--text-2); }
.xl .ex td.k { color: var(--warn-ink); font-weight: 500; }
.xl td.r { text-align: right; }
.xl td.fx { color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); }
.xl .blank td { height: 33px; }
.xl-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; font-size: var(--fs-xs); color: var(--text-3); }
.xl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.xl-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--line-2); }
.xl-legend i.fx { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- «¿puede ir esta pieza por el REBU?» ----------
   Two plain questions as option rows; the answer sits beside them and takes the
   colour of its verdict. Native radios, so keyboard and screen readers just work. */

.decide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: start; padding-block: 8px; }
.decide fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.decide fieldset + fieldset { margin-top: 28px; }
.decide legend { padding: 0; margin-bottom: 12px; font-weight: 600; font-size: var(--fs-base); letter-spacing: -.01em; }
.decide legend .n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 10px; border-radius: 50%;
  background: var(--accent); color: var(--accent-fg); font-size: var(--fs-xs); vertical-align: 1px;
}
.choices { display: grid; gap: 8px; }
.choice {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface);
  cursor: pointer; font-size: var(--fs-sm); line-height: 1.45;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.choice input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.choice input:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.choice b { display: block; font-weight: 600; color: var(--text); }
.choice small { display: block; margin-top: 2px; color: var(--text-3); font-size: var(--fs-xs); }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); box-shadow: 0 0 0 1px var(--accent) inset; }

.verdict {
  position: sticky; top: calc(var(--header-h) + 24px);
  padding: 24px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-md);
  transition: background-color 200ms ease, border-color 200ms ease;
}
.verdict-head { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; }
.verdict .badge {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin-top: -2px;
  background: var(--bg-sunk); color: var(--text-3);
}
.verdict .badge .i { width: 18px; height: 18px; }
.verdict .badge .i { display: none; }
.verdict[data-tone="idle"] .b-idle, .verdict[data-tone="yes"] .b-yes, .verdict[data-tone="no"] .b-no, .verdict[data-tone="maybe"] .b-maybe { display: block; }
.verdict h3 { font-size: var(--fs-lg); letter-spacing: -.015em; line-height: 1.25; }
.verdict p { margin-top: 10px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; }
.verdict .extra { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 14px; }
.verdict .fine { margin-top: 16px; font-size: var(--fs-xs); color: var(--text-3); }
.verdict[data-tone="yes"] { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.verdict[data-tone="yes"] .badge { background: var(--accent); color: var(--accent-fg); }
.verdict[data-tone="yes"] h3 { color: var(--accent); }
.verdict[data-tone="no"] .badge { background: var(--danger-bg); color: var(--danger-ink); }
.verdict[data-tone="maybe"] .badge { background: var(--warn-bg); color: var(--warn-ink); }
@media (prefers-reduced-motion: no-preference) {
  .verdict.tick h3, .verdict.tick p { animation: settle 280ms var(--ease-out); }
}
@media (max-width: 860px) {
  .decide { grid-template-columns: minmax(0, 1fr); }
  .verdict { position: static; }
}

/* ---------- the waitlist, where the need is felt ----------
   A quiet green-tinted strip under a result or a download: one sentence, one button.
   It only exists when there is a real form behind it (waitlist.js / waitlist-url.js). */
.nudge {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: center;
  margin-top: 20px; padding: 18px 22px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
}
.result .nudge { margin-top: 0; }
.nudge p { margin: 0; max-width: 62ch; }
.nudge b { display: block; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.nudge span:not(.sr-only) { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
.nudge .btn .i { width: 16px; height: 16px; }
@media (max-width: 640px) { .nudge { grid-template-columns: minmax(0, 1fr); } .nudge .btn { justify-self: start; } }
.verdict .cta { margin-top: 14px; }
.verdict .cta a { font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }
.verdict .cta a:hover { text-decoration: underline; }
.verdict .cta .i { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-left: 2px; }

[hidden] { display: none !important; }

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

@media print {
  @page { size: A4; margin: 14mm; }
  .top, .foot, .toolbar .row, .lines, .drop, .skip, .toast, .sample-banner .btn, .add { display: none !important; }
  body.doc-page main > *:not(.print-keep), body.doc-page .no-print, body.doc-page .print-keep .wrap > *:not(.doc) { display: none !important; }
  body.doc-page .print-keep { padding: 0 !important; }
  body.doc-page .sheet { box-shadow: none; max-width: none; padding: 0; border-radius: 0; background: #FFFFFF00; }
  body.doc-page .si { border: 0; background: none; padding: 0; margin: 0; min-height: 0; }
  body.doc-page .sheet.is-edit { display: none !important; }
  body.doc-page .sheet-print { display: block !important; }
  body { background: #FFFDF8; color: #16201B; }
  .panel { box-shadow: none; border-color: #CCC5B5; }
  .kpi.main { background: #FFFDF8; border-color: #1F4436; }
  .kpi.main dd, .kpi.main dt { color: #1F4436; }
}
