/* ==========================================================================
   Arecore ERP — Dirección 03: PIEDRA
   Mineral paper, basalt stone, lichen green, tight grotesque typography.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --paper-1: #f6f4ee;
  --paper-2: #efece3;
  --paper-3: #e7e2d5;
  --stone-bg: #f6f4ef;
  --stone-bg-2: #eeebe3;

  --ink: #171614;
  --ink-2: #4b4841;
  --ink-muted: #847e74;
  --stone-display: #b7b1a6;

  --dark-1: #23221f;
  --dark-2: #191816;
  --dark-side: #2b2a27;
  --dark-side-2: #22211e;

  --lichen: #496045;
  --lichen-soft: #eaf0e7;
  --lichen-line: rgba(73, 96, 69, 0.24);
  --ochre: #8f6b2d;
  --ochre-soft: #f5eee0;
  --rust: #8c3f32;
  --rust-soft: #f6eae7;

  --line: rgba(23, 22, 20, 0.09);
  --line-strong: rgba(23, 22, 20, 0.16);
  --shadow-soft: 0 1px 2px rgba(23, 22, 20, 0.04), 0 8px 24px -10px rgba(23, 22, 20, 0.08);
  --shadow-card: 0 1px 2px rgba(23, 22, 20, 0.05), 0 16px 36px -18px rgba(23, 22, 20, 0.12);
  --shadow-app: 0 32px 80px -24px rgba(23, 22, 20, 0.22), 0 4px 18px -4px rgba(23, 22, 20, 0.08);

  --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-frame: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --max-w: 1140px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.mono,
.kpi-v,
.tbl td.r,
.ledger td.r,
.ledger tfoot td,
.kv dd,
.plan-p span,
.n {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--ink-muted);
}

.r,
.tbl th.r,
.tbl td.r,
.ledger th.r,
.ledger td.r {
  text-align: right;
}

/* ==========================================================================
   Frame & Grain
   ========================================================================== */

.frame {
  width: 100%;
  padding: 14px 14px 0;
  overflow-x: clip;
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ==========================================================================
   Brand Mark (3x3 mineral matrix) & Buttons
   ========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-size: 1.05rem;
  color: var(--ink);
}

.mark {
  display: block;
  width: 24px;
  height: 17px;
  color: var(--ink);
  flex: none;
}

.mark rect {
  fill: currentColor;
}

.mark .dot-accent {
  fill: var(--lichen);
}

.mark-lg {
  width: 34px;
  height: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-sm {
  padding: 9px 17px;
  font-size: 0.875rem;
}

.btn-dark {
  background: var(--dark-2);
  color: #f7f5f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(23, 22, 20, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-dark:hover {
  background: #2c2a26;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(23, 22, 20, 0.2);
}

.btn-light {
  background: #f6f4ee;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-light:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn-line {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-line:hover {
  background: var(--stone-bg);
  border-color: rgba(23, 22, 20, 0.3);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  padding: 8px 4px;
  transition: color 0.2s ease;
}

.link-arrow span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.link-arrow:hover {
  color: var(--lichen);
}

.link-arrow:hover span {
  transform: translateX(3px);
}

/* ==========================================================================
   Typography — Two-tone tight grotesque display
   ========================================================================== */

.display {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.display .l1 {
  color: var(--ink);
  display: block;
}

.display .l2 {
  color: var(--stone-display);
  display: block;
}

h1.display {
  font-size: clamp(2.85rem, 5.5vw, 4.85rem);
  font-weight: 500;
}

.display.h2 {
  font-size: clamp(2.1rem, 3.6vw, 3.25rem);
  letter-spacing: -0.042em;
  line-height: 1.02;
}

.display.h3 {
  font-size: clamp(1.55rem, 2.3vw, 2.05rem);
  letter-spacing: -0.038em;
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ==========================================================================
   STICKY NAVBAR
   ========================================================================== */

.nav-shell {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0 28px;
  pointer-events: none;
  transition: top 0.25s ease;
}

.nav-shell.is-scrolled {
  top: 12px;
}

.nav {
  pointer-events: auto;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 26px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease, backdrop-filter 0.25s ease;
}

.nav-shell.is-scrolled .nav {
  background: rgba(246, 244, 238, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: rgba(23, 22, 20, 0.1);
  box-shadow: 0 12px 32px -18px rgba(23, 22, 20, 0.22);
  padding: 10px 22px;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.nav-login {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.18s ease;
}

.nav-login:hover {
  color: var(--ink);
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  border-radius: var(--radius-frame);
  overflow: hidden;
  padding-top: 84px;
  background:
    radial-gradient(120% 70% at 50% 0%, #faf8f3 0%, rgba(250, 248, 243, 0) 62%),
    linear-gradient(180deg, var(--paper-1) 0%, var(--paper-2) 54%, var(--paper-3) 100%);
  border: 1px solid rgba(23, 22, 20, 0.06);
}

/* Hero Copy */
.hero-copy {
  position: relative;
  z-index: 5;
  max-width: 780px;
  margin: 14px auto 0;
  padding: 0 24px;
  text-align: center;
}

.lede {
  margin: 18px auto 0;
  max-width: 560px;
  font-size: 1.0625rem;
  line-height: 1.52;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

.hero-ctas {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* Proof strip below hero header */
.proof {
  position: relative;
  z-index: 5;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 28px 12px;
  text-align: center;
}

.wordmarks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 38px;
  color: #8c867c;
  mask-image: linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%);
}

.wm {
  font-size: 0.92rem;
  line-height: 1;
  user-select: none;
  opacity: 0.86;
  white-space: nowrap;
}

.wm-1 { font-weight: 600; letter-spacing: -0.03em; }
.wm-2 { font-weight: 600; letter-spacing: 0.08em; font-size: 0.8rem; }
.wm-2 small { font-weight: 400; letter-spacing: 0.02em; font-size: 0.72rem; opacity: 0.8; margin-left: 3px; }
.wm-3 { font-weight: 500; letter-spacing: -0.02em; }
.wm-4 { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: -0.02em; }
.wm-5 { font-weight: 600; letter-spacing: 0.1em; font-size: 0.77rem; }
.wm-6 { font-weight: 600; letter-spacing: -0.035em; font-style: italic; }

/* ==========================================================================
   STAGE: ERP Dashboard embedded between foreground basalt rock formations
   ========================================================================== */

.stage {
  position: relative;
  width: 100%;
  margin-top: 38px;
  padding: 0 110px;
  isolation: isolate;
}

/* Rocks */
.rock {
  position: absolute;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

/* Left rock: large foreground basalt outcrop cradling the dark sidebar like Veridical */
.rock-front {
  left: -24px;
  bottom: -28px;
  width: clamp(340px, 37.5vw, 545px);
  height: auto;
  z-index: 4;
  filter: drop-shadow(18px -6px 28px rgba(18, 16, 14, 0.28));
}

/* Right rock: foreground crag framing and tucking gently over bottom-right edge without covering Estado */
.rock-back {
  right: -54px;
  bottom: -30px;
  width: clamp(220px, 22.5vw, 330px);
  height: auto;
  z-index: 3;
  filter: drop-shadow(-14px -4px 24px rgba(18, 16, 14, 0.22));
}

/* ERP Dashboard Mockup */
.app {
  position: relative;
  z-index: 2;
  max-width: 1020px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 204px 1fr;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-bottom: 0;
  box-shadow: var(--shadow-app);
  overflow: hidden;
  text-align: left;
}

/* Sidebar (fiel a Layout.jsx + nav.js en tema Piedra) */
.app-side {
  background: linear-gradient(180deg, var(--dark-side) 0%, var(--dark-side-2) 100%);
  color: rgba(246, 244, 238, 0.72);
  padding: 0 0 22px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-side-head {
  height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: none;
}

.app-side-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #f6f4ee;
  display: grid;
  place-items: center;
  flex: none;
}

.app-side-logo .dot-accent {
  fill: #a5c49e;
}

.app-side-brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.app-side-brand b {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f6f4ee;
}

.app-side-brand em {
  font-style: normal;
  font-size: 0.54rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a5c49e;
  margin-top: 3px;
}

.app-nav {
  list-style: none;
  margin: 0;
  padding: 10px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-nav > li:not(.app-sub-wrap) {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6.5px 10px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(246, 244, 238, 0.68);
}

.app-nav > li > span {
  flex: 1;
  min-width: 0;
}

.app-nav > li.is-active {
  background: #f5f3ee;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.app-nav > li.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2.5px;
  border-radius: 99px;
  background: var(--lichen);
}

.app-nav > li.is-open {
  color: #f6f4ee;
}

.app-sub-wrap {
  padding: 0;
}

.app-sub {
  list-style: none;
  margin: 2px 0 4px 19px;
  padding: 0 0 0 11px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-sub li {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.69rem;
  font-weight: 500;
  color: rgba(246, 244, 238, 0.56);
}

.sico {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  opacity: 0.82;
}

.is-active .sico,
.is-on .sico {
  opacity: 1;
}

.chev {
  width: 5px;
  height: 5px;
  border-right: 1.3px solid currentColor;
  border-bottom: 1.3px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.45;
  flex: none;
}

.chev.is-down {
  transform: rotate(45deg);
  margin-top: -2px;
}

/* Dashboard Main Area */
.app-main {
  background: #f6f4ee;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-top {
  height: 46px;
  padding: 0 18px;
  background: rgba(250, 248, 244, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.app-top-spacer {
  flex: 1;
}

.app-topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 210px;
  padding: 5px 10px 5px 11px;
  border-radius: 999px;
  background: #eeebe3;
  border: 1px solid rgba(23, 22, 20, 0.06);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.app-topbar-search > span:first-of-type {
  flex: 1;
}

.app-kbds {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.app-kbds kbd {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid rgba(23, 22, 20, 0.1);
  color: var(--ink-muted);
  display: grid;
  place-items: center;
}

.app-top-r {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eeebe3;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  flex: none;
}

.app-theme-pick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: #eeebe3;
}

.app-theme-pick i {
  width: 23px;
  height: 23px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
}

.app-theme-pick i.is-on {
  background: #ffffff;
  color: var(--lichen);
  box-shadow: 0 1px 2px rgba(23, 22, 20, 0.1);
}

.app-theme-pick .sico {
  width: 11px;
  height: 11px;
}

.app-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  background: #eeebe3;
  color: var(--ink);
  font-size: 0.72rem;
}

.app-user-pill b {
  font-weight: 600;
}

.app-user-pill .chev {
  width: 4.5px;
  height: 4.5px;
  opacity: 0.55;
}

.app-body {
  padding: 14px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.pill-soft {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2efe9;
  border: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.filters .pill-soft {
  cursor: pointer;
}

.filters .pill-soft.is-on,
.filters .pill-soft:hover {
  background: var(--dark-2);
  color: #f6f4ee;
  border-color: var(--dark-2);
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lichen);
  color: #f6f4ee;
  font-size: 0.65rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}

/* KPI Row */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kpi-h {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.kpi-h em {
  font-style: normal;
  font-size: 0.64rem;
  color: var(--ink-muted);
}

.kpi-v {
  margin: 2px 0 0;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}

.kpi-v small {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.kpi-d {
  margin: 2px 0 0;
  font-size: 0.66rem;
  color: var(--ink-muted);
}

.kpi-d.up {
  color: var(--lichen);
  font-weight: 500;
}

.kpi-d.warn {
  color: var(--ochre);
  font-weight: 500;
}

/* Micro-visualizations echoing Veridical */
.gauge {
  height: 28px;
  width: 68px;
  position: relative;
  overflow: hidden;
  margin-top: 2px;
}

.gauge::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from -90deg,
      rgba(23, 22, 20, 0.75) 0deg 3.5deg,
      transparent 3.5deg 8deg
    );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
}

.gauge::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: conic-gradient(from -90deg, transparent 0deg 132deg, rgba(255, 255, 255, 0.75) 132deg 180deg, transparent 180deg);
}

.ticks {
  height: 22px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-top: 4px;
}

.ticks i {
  display: block;
  width: 2px;
  border-radius: 1px;
  background: rgba(23, 22, 20, 0.14);
}

.ticks i.on {
  background: var(--ink);
}

.ticks i.hi {
  background: var(--lichen);
}

.meter {
  height: 6px;
  border-radius: 999px;
  background: #edeae3;
  overflow: hidden;
  margin: 12px 0 8px;
}

.meter i {
  display: block;
  height: 100%;
  width: var(--w, 70%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lichen) 0%, #647e5f 100%);
}

.steps {
  height: 22px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  margin-top: 4px;
}

.steps i {
  flex: 1;
  height: var(--h, 50%);
  border-radius: 2px 2px 0 0;
  background: #e5e1d8;
}

.steps i:nth-child(4) {
  background: var(--ochre);
}

.steps i:nth-child(5) {
  background: var(--dark-1);
}

/* Barcode Trend Chart (Veridical signature chart) */
.chart-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px 10px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-t {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.chart-s {
  margin: 2px 0 0;
  font-size: 0.68rem;
  color: var(--ink-muted);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.68rem;
  color: var(--ink-2);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lg {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.lg-v { background: var(--ink); }
.lg-c { background: var(--lichen); }

.barcode {
  position: relative;
  height: 126px;
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  align-items: center;
  gap: 4px;
  padding: 50px 4px 6px;
}

.barcode::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 66%;
  height: 1px;
  background: rgba(23, 22, 20, 0.06);
}

.bc-col {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}

.bc-top,
.bc-bot {
  width: 2px;
  border-radius: 2px;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.bc-top {
  background: rgba(23, 22, 20, 0.19);
  align-self: center;
}

.bc-bot {
  background: rgba(73, 96, 69, 0.24);
  align-self: center;
}

.bc-col:hover .bc-top,
.bc-col.is-hi .bc-top {
  background: var(--ink);
  width: 2.5px;
}

.bc-col:hover .bc-bot,
.bc-col.is-hi .bc-bot {
  background: var(--lichen);
  width: 2.5px;
}

.bc-tip {
  position: absolute;
  top: 0;
  left: 76%;
  transform: translateX(-50%);
  z-index: 4;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 122px;
  pointer-events: none;
  transition: left 0.18s ease;
}

.bc-tip b {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--ink);
}

.bc-tip span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.64rem;
  color: var(--ink-muted);
}

.bc-tip em {
  font-style: normal;
  font-family: var(--font-mono);
  color: var(--ink);
  font-weight: 500;
}

.bc-axis {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-muted);
}

/* Dashboard Table */
.tbl-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px 8px;
}

.tbl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.filters {
  display: flex;
  gap: 5px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}

.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 0.66rem;
  color: var(--ink-muted);
  padding: 5px 6px 7px;
  border-bottom: 1px solid var(--line);
}

.tbl td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(23, 22, 20, 0.05);
  color: var(--ink);
  white-space: nowrap;
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl tr.is-hidden {
  display: none;
}

/* Status pills */
.st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 500;
  white-space: nowrap;
}

.st::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.st-ok {
  background: var(--lichen-soft);
  color: var(--lichen);
}

.st-void {
  background: var(--rust-soft);
  color: var(--rust);
}

.st-wait {
  background: var(--ochre-soft);
  color: var(--ochre);
}

/* ==========================================================================
   MAIN SECTIONS — Editorial Rhythm
   ========================================================================== */

main {
  position: relative;
}

.sec {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 84px 28px;
  scroll-margin-top: 86px;
}

.sec-head {
  margin-bottom: 40px;
}

.sec-head.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: end;
  gap: 36px;
}

.sec-lede {
  margin: 0;
  font-size: 1rem;
  line-height: 1.58;
  color: var(--ink-2);
  max-width: 480px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   TRAZABILIDAD (Veridical node diagram + interactive leg cross-highlight)
   ========================================================================== */

.trace {
  padding-top: 64px;
}

.diagram {
  position: relative;
  padding: 18px 0 12px;
}

/* Floating verification chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 9px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.ck {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--dark-2);
  position: relative;
  flex: none;
}

.ck::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  width: 6px;
  height: 4px;
  border-left: 1.6px solid #f6f4ee;
  border-bottom: 1.6px solid #f6f4ee;
  transform: rotate(-45deg);
}

.chip-b .ck,
.chip-d .ck,
.chip-inline .ck {
  background: var(--lichen);
}

.chip-a,
.chip-b,
.chip-c,
.chip-d {
  position: absolute;
  z-index: 3;
}

.chip-a { top: 14px; left: 4%; }
.chip-b { top: 14px; right: 4%; }
.chip-c { bottom: -18px; left: 10%; }
.chip-d { bottom: -18px; right: 10%; }

/* Root node tile */
.node-root {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}

/* Fine hairline elbow connector splitting left & right */
.elbows {
  position: relative;
  width: 62%;
  height: 44px;
  margin: 0 auto;
}

.elbows::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 22px;
  background: var(--line-strong);
}

.elbows span {
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  bottom: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  border-radius: 14px 14px 0 0;
}

.flow {
  display: grid;
  grid-template-columns: 1fr 84px 1.12fr;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 2;
}

/* Cards */
.card {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.card-h {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.card-h > div {
  min-width: 0;
  flex: 1;
}

.card-h b {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.card-h em {
  display: block;
  font-style: normal;
  font-size: 0.74rem;
  color: var(--ink-muted);
  margin-top: 1px;
}

.card-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--stone-bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}

.card-ico.dark {
  background: var(--dark-2);
  color: #f6f4ee;
  border-color: var(--dark-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--stone-bg);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.badge.ok {
  background: var(--lichen-soft);
  border-color: var(--lichen-line);
  color: var(--lichen);
}

/* Document key-values */
.kv {
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kv > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.8125rem;
}

.kv dt {
  color: var(--ink-muted);
}

.kv dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
}

.kv .tot {
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-strong);
  font-weight: 600;
}

.kv .tot dt {
  color: var(--ink);
}

.kv .tot dd {
  font-size: 0.86rem;
  font-weight: 600;
}

/* Veridical 4-segment bar */
.segs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 14px;
}

.segs i {
  display: block;
  height: 3.5px;
  border-radius: 99px;
  background: #e9e6de;
}

.segs i.on {
  background: var(--dark-1);
}

.card-f {
  margin: 11px 0 0;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--ink-muted);
}

/* Center bidirectional connector */
.link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 12px;
}

.link-line {
  width: 100%;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  transition: background-color 0.2s ease;
}

.link-line::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3.5px;
  width: 7px;
  height: 7px;
  border-top: 1.3px solid var(--ink-2);
  border-right: 1.3px solid var(--ink-2);
  transform: rotate(45deg);
  transition: border-color 0.2s ease;
}

.link-line.back::after {
  right: auto;
  left: 0;
  transform: rotate(-135deg);
}

.link-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--stone-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  text-align: center;
  line-height: 1.25;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.link-tag.ghost {
  background: transparent;
  border: 0;
  color: var(--lichen);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 2px 4px;
  cursor: pointer;
}

.link-tag.ghost:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Interactive traceability leg highlight */
.trace-row {
  cursor: pointer;
  transition: background-color 0.18s ease, opacity 0.2s ease, box-shadow 0.18s ease;
}

.kv .trace-row {
  margin: 0 -8px;
  padding: 5px 8px;
  border-radius: 7px;
}

.kv .tot.trace-row {
  margin-top: 4px;
  padding-top: 8px;
}

.kv .trace-row:hover,
.kv .trace-row:focus-visible {
  background: var(--stone-bg);
  outline: none;
}

.ledger tbody tr.trace-row td {
  transition: background-color 0.18s ease, color 0.18s ease, opacity 0.2s ease, padding 0.18s ease;
}

.ledger tbody tr.trace-row:hover td,
.ledger tbody tr.trace-row:focus-visible td {
  background: var(--stone-bg);
}

.ledger tbody tr.trace-row:focus-visible {
  outline: none;
}

.diagram.has-leg .trace-row:not(.is-linked) {
  opacity: 0.36;
}

.kv .trace-row.is-linked {
  background: var(--lichen-soft);
  box-shadow: inset 3px 0 0 var(--lichen);
}

.kv .trace-row.is-linked dt,
.kv .trace-row.is-linked dd {
  color: var(--ink);
  font-weight: 600;
}

.ledger tbody tr.trace-row.is-linked td {
  background: var(--lichen-soft);
  color: var(--ink);
  font-weight: 500;
}

.ledger tbody tr.trace-row.is-linked td:first-child {
  box-shadow: inset 3px 0 0 var(--lichen);
  padding-left: 10px;
  border-radius: 6px 0 0 6px;
}

.ledger tbody tr.trace-row.is-linked td:last-child {
  padding-right: 8px;
  border-radius: 0 6px 6px 0;
}

.ledger tbody tr.trace-row.is-linked .acc {
  color: var(--lichen);
  font-weight: 500;
}

.diagram.has-leg .link-line {
  background: var(--lichen);
}

.diagram.has-leg .link-line::after {
  border-color: var(--lichen);
}

.diagram.has-leg .link-tag:not(.ghost) {
  background: var(--lichen-soft);
  border-color: var(--lichen-line);
  color: var(--lichen);
  font-weight: 600;
}

.trace-hint {
  margin: 44px auto 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

@keyframes docPulse {
  0% { box-shadow: var(--shadow-soft), 0 0 0 0 rgba(73, 96, 69, 0.35); border-color: var(--lichen); }
  70% { box-shadow: var(--shadow-soft), 0 0 0 10px rgba(73, 96, 69, 0); border-color: var(--lichen); }
  100% { box-shadow: var(--shadow-soft), 0 0 0 0 rgba(73, 96, 69, 0); border-color: var(--line-strong); }
}

.card.is-pulse {
  animation: docPulse 0.9s ease;
}

/* Ledger table inside Entry card */
.ledger {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.78rem;
}

.ledger th {
  text-align: left;
  font-size: 0.67rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 4px 0 7px;
  border-bottom: 1px solid var(--line);
}

.ledger td {
  padding: 8px 0;
  border-bottom: 1px solid rgba(23, 22, 20, 0.05);
  vertical-align: middle;
}

.ledger td.r {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: nowrap;
  padding-left: 10px;
}

.ledger td.in {
  padding-left: 14px;
}

.ledger .acc {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  margin-right: 7px;
}

.ledger tfoot td {
  padding-top: 10px;
  border-bottom: 0;
  border-top: 1px solid var(--line-strong);
  font-weight: 600;
}

.ledger tfoot td.r {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--lichen);
}

/* Facts strip below diagram */
.facts {
  list-style: none;
  margin: 36px 0 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.facts li {
  font-size: 0.92rem;
  line-height: 1.56;
  color: var(--ink-2);
}

.facts b {
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================================
   02 · MÓDULOS (Asymmetric sticky intro + architectural ledger index)
   ========================================================================== */

.modules {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 56px;
  align-items: start;
}

.mod-intro {
  position: sticky;
  top: 96px;
}

.mod-intro .sec-lede {
  margin-top: 20px;
}

.mod-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}

.mod-list li {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: baseline;
  gap: 16px;
  padding: 20px 12px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.18s ease, padding-left 0.18s ease;
}

.mod-list li:hover {
  background: var(--stone-bg);
  padding-left: 18px;
}

.mod-list h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.mod-list p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ==========================================================================
   03 · MULTIEMPRESA (Mineral stone surface + org-tree diagram)
   ========================================================================== */

.multi {
  max-width: none;
  margin: 0;
  padding: 76px max(28px, calc((100% - var(--max-w)) / 2 + 28px));
  background: var(--stone-bg);
  border-radius: var(--radius-frame);
  border: 1px solid rgba(23, 22, 20, 0.06);
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 48px;
  align-items: center;
}

.multi-copy .sec-lede {
  margin-top: 18px;
}

.ticks-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticks-list li {
  position: relative;
  padding-left: 24px;
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.ticks-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lichen-soft);
  border: 1px solid var(--lichen-line);
}

.ticks-list li::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 9px;
  width: 6px;
  height: 3.5px;
  border-left: 1.5px solid var(--lichen);
  border-bottom: 1.5px solid var(--lichen);
  transform: rotate(-45deg);
}

/* Org Tree */
.tree {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tree-root {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 18px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.tree-root b {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.tree-root em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.tree-lines {
  position: relative;
  width: 52%;
  height: 36px;
}

.tree-lines::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 18px;
  background: var(--line-strong);
}

.tree-lines span {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  bottom: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  border-radius: 10px 10px 0 0;
}

.tree-cos {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.co {
  padding: 16px;
}

.co .card-h {
  padding-bottom: 11px;
}

.co .card-h b {
  font-size: 0.85rem;
}

.branches {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.branches li {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--stone-bg);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.branches li.off {
  background: transparent;
  border-style: dashed;
  color: var(--ink-muted);
}

.chip-e {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

/* ==========================================================================
   04 · IMPUESTOS & 05 · SEGURIDAD (Mineral stone surface + Architectural Panels)
   ========================================================================== */

.taxes {
  max-width: none;
  margin: 0;
  padding: 76px max(28px, calc((100% - var(--max-w)) / 2 + 28px));
  background: var(--stone-bg);
  border-radius: var(--radius-frame);
  border: 1px solid rgba(23, 22, 20, 0.06);
}

.tax-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 32px;
  align-items: start;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
}

.panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tbl-tax {
  font-size: 0.84rem;
}

.tbl-tax th {
  font-size: 0.72rem;
  padding: 6px 4px 10px;
}

.tbl-tax td {
  padding: 11px 4px;
}

.tbl-tax tfoot td {
  padding: 13px 4px 6px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
  font-weight: 600;
  color: var(--ink);
}

.panel-f {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chip-inline {
  box-shadow: none;
  background: var(--lichen-soft);
  border-color: var(--lichen-line);
  color: var(--lichen);
  padding: 5px 11px 5px 7px;
  font-size: 0.75rem;
}

.panel-f .muted {
  font-size: 0.74rem;
}

.tax-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}

.tax-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.tax-list .n {
  display: inline-flex;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink);
}

.tax-list p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.52;
  color: var(--ink-2);
}

/* Security */
.security {
  padding-top: 40px;
}

.sec-grid {
  display: grid;
  grid-template-columns: 1.28fr 0.72fr;
  gap: 24px;
  align-items: stretch;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.log li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.log li:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.log .t {
  font-size: 0.75rem;
  color: var(--ink-muted);
  padding-top: 2px;
}

.log p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink);
  line-height: 1.38;
}

.log p .mono {
  font-size: 0.77rem;
  background: var(--stone-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

.log em {
  display: block;
  font-style: normal;
  font-size: 0.76rem;
  color: var(--ink-muted);
  margin-top: 3px;
}

.perms {
  display: flex;
  flex-direction: column;
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.matrix th {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-align: center;
  padding: 6px 4px 10px;
  border-bottom: 1px solid var(--line);
}

.matrix th:first-child,
.matrix td:first-child {
  text-align: left;
  padding-left: 0;
}

.matrix td {
  text-align: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.matrix tbody tr:last-child td {
  border-bottom: 0;
}

.matrix .y,
.matrix .n {
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

.matrix .y {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lichen-soft);
  border: 1px solid var(--lichen-line);
}

.matrix .y::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 4px;
  width: 6px;
  height: 3.5px;
  border-left: 1.5px solid var(--lichen);
  border-bottom: 1.5px solid var(--lichen);
  transform: rotate(-45deg);
}

.matrix .n {
  width: 10px;
  height: 1.5px;
  border-radius: 2px;
  background: rgba(23, 22, 20, 0.2);
}

.panel-note {
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ==========================================================================
   ASISTENTE IA INTEGRADO (Framed stone panel + animated ERP chat)
   ========================================================================== */

.assistant {
  max-width: none;
  margin: 16px 0 0;
  padding: 76px max(28px, calc((100% - var(--max-w)) / 2 + 28px));
  background: var(--stone-bg);
  border-radius: var(--radius-frame);
  border: 1px solid rgba(23, 22, 20, 0.06);
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 48px;
  align-items: center;
}

.ai-copy .sec-lede {
  margin-top: 18px;
}

.ai-copy .ticks-list strong {
  color: var(--ink);
  font-weight: 600;
}

.ai-controls {
  margin-top: 26px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-controls .pill-soft {
  cursor: pointer;
  padding: 7px 14px;
  font-size: 0.8rem;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink-2);
}

.ai-controls .pill-soft.is-on {
  background: var(--dark-2);
  border-color: var(--dark-2);
  color: #f6f4ee;
}

.ai-replay {
  margin-left: 4px;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.16s ease;
}

.ai-replay:hover {
  color: var(--ink);
}

/* Embedded ERP Assistant Window */
.ai-shell {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ai-bar {
  background: linear-gradient(180deg, var(--dark-side) 0%, var(--dark-side-2) 100%);
  color: #f6f4ee;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-bar-l {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9fc297;
  box-shadow: 0 0 0 3px rgba(159, 194, 151, 0.22);
  flex: none;
}

.ai-bar b {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.ai-bar em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: rgba(246, 244, 238, 0.56);
  white-space: nowrap;
}

.ai-role {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(246, 244, 238, 0.78);
  white-space: nowrap;
}

.ai-body {
  padding: 18px 18px 16px;
  background: #faf9f6;
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 392px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.msg-meta b {
  color: var(--ink-2);
  font-weight: 600;
}

.msg-user {
  align-items: flex-end;
}

.msg-user .msg-bubble {
  max-width: 88%;
  background: var(--dark-2);
  color: #f6f4ee;
  padding: 11px 14px;
  border-radius: 13px 13px 3px 13px;
  font-size: 0.84rem;
  line-height: 1.46;
  letter-spacing: -0.01em;
}

.msg-steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-2);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.msg-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.msg-steps .st-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lichen);
  flex: none;
}

.msg-bot .msg-bubble {
  max-width: 94%;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 13px;
  border-radius: 13px 13px 13px 3px;
  font-size: 0.84rem;
  line-height: 1.46;
}

.ai-doc {
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 13px 15px;
  box-shadow: var(--shadow-soft);
}

.ai-doc-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ai-doc-h b {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.ai-doc-h em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.ai-tbl {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 0.76rem;
}

.ai-tbl td {
  padding: 5.5px 0;
  color: var(--ink);
  border-bottom: 1px solid rgba(23, 22, 20, 0.05);
}

.ai-tbl tr.sub td {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.ai-tbl tfoot td {
  padding: 8px 0 2px;
  border-bottom: 0;
  border-top: 1px solid var(--line-strong);
  font-weight: 600;
  font-size: 0.82rem;
}

.ai-doc-f {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.69rem;
  color: var(--ink-muted);
}

.ai-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.ai-placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-placeholder.is-typing {
  color: var(--ink);
}

.ai-placeholder.is-typing::after {
  content: '';
  display: inline-block;
  width: 1.5px;
  height: 0.95em;
  background: var(--lichen);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blinkCaret 0.75s steps(1) infinite;
}

@keyframes blinkCaret {
  50% { opacity: 0; }
}

.ai-send {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--dark-2);
  color: #f6f4ee;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: grid;
  place-items: center;
  flex: none;
}

/* Animation staging states (only active while playing) */
.ai-shell.is-playing [data-step] {
  opacity: 0;
  transform: translateY(8px);
}

.ai-shell.is-playing [data-step].is-show {
  opacity: 1;
  transform: none;
}

.ai-shell.is-playing .msg-steps span {
  opacity: 0.22;
}

.ai-shell.is-playing .msg-steps span.is-done {
  opacity: 1;
}

/* ==========================================================================
   PRECIOS & CONTADORES
   ========================================================================== */

.pricing {
  padding-top: 72px;
}

.ai-addon-bar {
  margin-bottom: 22px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--stone-bg);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.ai-addon-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-addon-copy b {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.ai-addon-copy span {
  font-size: 0.84rem;
  color: var(--ink-2);
}

.ai-switch {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
}

.ai-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ai-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d9d4c7;
  border: 1px solid rgba(23, 22, 20, 0.14);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  flex: none;
}

.ai-track i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(23, 22, 20, 0.25);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-switch input:checked + .ai-track {
  background: var(--lichen);
  border-color: var(--lichen);
}

.ai-switch input:checked + .ai-track i {
  transform: translateX(18px);
}

.ai-switch input:focus-visible + .ai-track {
  outline: 2px solid var(--lichen);
  outline-offset: 2px;
}

.ai-switch-txt {
  font-size: 0.84rem;
  color: var(--ink-2);
}

.ai-switch-txt strong {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--lichen);
  margin-left: 4px;
}

.plan-ai-note {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--lichen);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}

.plans.has-ai .plan-ai-note {
  max-height: 24px;
  opacity: 1;
}

.plans:not(.has-ai) .plan-ai-note {
  margin-bottom: 0;
}

.plan-main .plan-ai-note {
  color: #bfd7b9;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.plan {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
}

.plan-main {
  background: linear-gradient(180deg, #252420 0%, #1a1917 100%);
  color: #f6f4ee;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 56px -22px rgba(23, 22, 20, 0.42);
}

.plan-n {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-main .badge.ok {
  background: rgba(133, 173, 125, 0.16);
  border-color: rgba(133, 173, 125, 0.32);
  color: #bfd7b9;
}

.plan-p {
  margin: 18px 0 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.plan-p span {
  font-size: 2.15rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.plan-p small {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.plan-main .plan-p small {
  color: rgba(246, 244, 238, 0.56);
}

.plan-d {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.45;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.plan-main .plan-d {
  color: rgba(246, 244, 238, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.plan ul {
  list-style: none;
  margin: 18px 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.plan li {
  position: relative;
  padding-left: 18px;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.plan li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lichen);
}

.plan-main li {
  color: rgba(246, 244, 238, 0.84);
}

.plan-main li::before {
  background: #a5c49e;
}

.plan .btn {
  width: 100%;
}

/* Accountants architectural bar */
.acct {
  margin-top: 28px;
  padding: 32px 34px;
  border-radius: 16px;
  background: var(--stone-bg);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.05fr 1fr auto;
  align-items: center;
  gap: 28px;
}

.acct .eyebrow {
  margin-bottom: 8px;
}

.acct > p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.56;
  color: var(--ink-2);
}

/* ==========================================================================
   CLOSING (Full-bleed twilight stone landscape covering CTA + Footer)
   ========================================================================== */

.closing {
  position: relative;
  width: 100%;
  margin-top: 28px;
  overflow: hidden;
  isolation: isolate;
  background: #171614;
  color: #f6f4ee;
  scroll-margin-top: 86px;
}

.closing-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('assets/footer-stone.jpg') center center / cover no-repeat;
}

.closing-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(20, 19, 17, 0.42) 0%,
      rgba(20, 19, 17, 0.32) 38%,
      rgba(17, 16, 14, 0.68) 72%,
      rgba(14, 13, 12, 0.84) 100%
    );
}

.final {
  position: relative;
  z-index: 2;
  padding: 124px 24px 96px;
  text-align: center;
}

.final-copy {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.final .display {
  font-size: clamp(2.4rem, 4.4vw, 3.85rem);
}

.final .display .l1 {
  color: #f7f5f0;
}

.final .display .l2 {
  color: rgba(246, 244, 238, 0.62);
}

.final .lede {
  color: rgba(246, 244, 238, 0.82);
}

.final .link-arrow {
  color: #f6f4ee;
}

.final .link-arrow:hover {
  color: #c6dcc0;
}

/* ==========================================================================
   FOOTER (Over full-bleed closing image)
   ========================================================================== */

.foot {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 52px 28px 36px;
  border-top: 1px solid rgba(246, 244, 238, 0.16);
}

.foot .brand {
  color: #f6f4ee;
}

.foot .mark {
  color: #f6f4ee;
}

.foot .mark .dot-accent {
  fill: #a5c49e;
}

.foot-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(246, 244, 238, 0.14);
}

.foot-by {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: rgba(246, 244, 238, 0.82);
}

.foot-by a {
  color: #f6f4ee;
  border-bottom: 1px solid rgba(246, 244, 238, 0.32);
  padding-bottom: 1px;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.foot-by a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.foot-muted {
  color: rgba(246, 244, 238, 0.56);
}

.foot-cols {
  display: flex;
  gap: 56px;
}

.foot-cols > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.foot-cols p {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #f6f4ee;
  letter-spacing: -0.01em;
}

.foot-cols a {
  font-size: 0.84rem;
  color: rgba(246, 244, 238, 0.74);
  transition: color 0.16s ease;
}

.foot-cols a:hover {
  color: #ffffff;
}

.foot-bot {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: rgba(246, 244, 238, 0.62);
}

.foot-legal {
  display: inline-flex;
  gap: 18px;
}

.foot-bot a {
  color: rgba(246, 244, 238, 0.72);
  transition: color 0.16s ease;
}

.foot-bot a:hover {
  color: #ffffff;
}

/* ==========================================================================
   RESPONSIVE — 1080px / 900px / 640px (390px Mobile)
   ========================================================================== */

@media (max-width: 1100px) {
  .stage {
    padding: 0 44px;
  }

  .rock-front {
    width: clamp(230px, 31vw, 370px);
    left: -34px;
  }

  .rock-back {
    width: clamp(180px, 22vw, 270px);
    right: -34px;
  }

  .app {
    grid-template-columns: 176px 1fr;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .elbows {
    display: none;
  }

  .link {
    flex-direction: column;
    justify-content: center;
    padding: 4px 0;
    gap: 6px;
  }

  .link-line {
    width: 1px;
    height: 16px;
  }

  .link-line::after {
    left: -3px;
    right: auto;
    top: auto;
    bottom: 0;
    transform: rotate(135deg);
  }

  .link-line.back {
    display: none;
  }

  .chip-a,
  .chip-b,
  .chip-c,
  .chip-d {
    position: static;
  }

  .diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .diagram .flow {
    width: 100%;
    order: 2;
  }

  .diagram .node-root {
    order: 1;
  }

  .diagram .chip {
    order: 3;
  }
}

@media (max-width: 900px) {
  .sec-head.split,
  .modules,
  .multi,
  .assistant,
  .tax-grid,
  .sec-grid,
  .plans,
  .acct {
    grid-template-columns: minmax(0, 1fr);
  }

  .sec-head.split > *,
  .modules > *,
  .multi > *,
  .assistant > *,
  .tax-grid > *,
  .sec-grid > *,
  .plans > *,
  .acct > *,
  .tree,
  .tree-cos,
  .card,
  .panel {
    min-width: 0;
    max-width: 100%;
  }

  .mod-intro {
    position: static;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .nav {
    grid-template-columns: auto 1fr;
  }

  .nav-links {
    display: none;
  }

  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-side {
    display: none;
  }

  .tree-cos {
    grid-template-columns: minmax(0, 1fr);
  }

  .tree-lines {
    display: none;
  }

  .tree-root {
    margin-bottom: 14px;
  }
}

@media (max-width: 640px) {
  .frame {
    padding: 8px 8px 0;
  }

  .nav-shell {
    top: 10px;
    padding: 0 12px;
  }

  .nav-shell.is-scrolled {
    top: 8px;
  }

  .nav {
    padding: 11px 14px;
  }

  .nav-shell.is-scrolled .nav {
    padding: 9px 14px;
  }

  .hero,
  .multi,
  .taxes,
  .assistant {
    border-radius: 18px;
  }

  .hero {
    padding-top: 70px;
  }

  .nav-login {
    display: none;
  }

  .hero-copy {
    margin-top: 10px;
    padding: 0 14px;
  }

  h1.display {
    font-size: 2.3rem;
    line-height: 1;
    letter-spacing: -0.045em;
  }

  .display.h2 {
    font-size: 1.95rem;
  }

  .lede {
    font-size: 0.93rem;
    margin-top: 14px;
  }

  .hero-ctas {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }

  .hero-ctas .btn {
    width: 100%;
    max-width: 240px;
  }

  .proof {
    margin-top: 26px;
    padding: 0 12px;
  }

  .wordmarks {
    gap: 8px 14px;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .wm {
    font-size: 0.74rem;
  }

  .stage {
    margin-top: 20px;
    padding: 0 10px;
  }

  .app {
    border-radius: 12px 12px 0 0;
  }

  .app-body {
    padding: 11px 10px 26px;
    gap: 9px;
  }

  .app-top {
    padding: 0 10px;
    gap: 6px;
  }

  .app-top-spacer {
    display: none;
  }

  .app-topbar-search {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .app-kbds,
  .app-theme-pick,
  .app-user-pill b,
  .app-user-pill .chev {
    display: none;
  }

  .app-user-pill {
    padding: 2px;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .kpi {
    padding: 8px 9px;
    min-width: 0;
  }

  .kpi-v {
    font-size: 0.84rem;
    letter-spacing: -0.03em;
  }

  .kpi-v small {
    font-size: 0.64rem;
  }

  .kpi-d {
    font-size: 0.62rem;
  }

  .chart-card {
    padding: 10px 10px 8px;
  }

  .chart-head {
    flex-direction: column;
    gap: 6px;
  }

  .barcode {
    height: 106px;
    gap: 2px;
    padding: 46px 2px 4px;
  }

  .bc-tip {
    min-width: 106px;
    padding: 5px 8px;
  }

  .tbl-card {
    padding: 10px 10px 8px;
    overflow: hidden;
  }

  .tbl-head {
    flex-wrap: wrap;
    gap: 6px;
  }

  .tbl {
    font-size: 0.69rem;
    table-layout: fixed;
  }

  .tbl th,
  .tbl td {
    padding: 6px 3px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tbl th:nth-child(2),
  .tbl td:nth-child(2),
  .tbl th:nth-child(3),
  .tbl td:nth-child(3),
  .tbl th:nth-child(5),
  .tbl td:nth-child(5) {
    display: none;
  }

  .tbl th:nth-child(1),
  .tbl td:nth-child(1) { width: 42%; }
  .tbl th:nth-child(4),
  .tbl td:nth-child(4) { width: 34%; }
  .tbl th:nth-child(6),
  .tbl td:nth-child(6) { width: 24%; text-align: right; }

  /* Rocks subtly framing lower corners on mobile without obscuring data */
  .rock-front {
    width: 132px;
    left: -36px;
    bottom: -24px;
  }

  .rock-back {
    width: 104px;
    right: -34px;
    bottom: -26px;
  }

  .sec {
    padding: 56px 14px;
  }

  .sec-head {
    margin-bottom: 28px;
  }

  .multi,
  .taxes,
  .assistant {
    padding: 48px 14px;
    gap: 32px;
  }

  .ai-bar em {
    display: none;
  }

  .ai-body {
    padding: 14px 12px;
    min-height: 0;
  }

  .ai-doc-h {
    flex-wrap: wrap;
  }

  .ai-doc-f {
    flex-wrap: wrap;
  }

  .chip {
    white-space: normal;
    font-size: 0.73rem;
    max-width: 100%;
  }

  .tree-root {
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px 14px;
    gap: 8px;
  }

  .tree-root em {
    border-left: 0;
    padding-left: 0;
  }

  .mod-list li {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 15px 4px;
  }

  .card {
    padding: 14px 13px;
  }

  .card-h {
    flex-wrap: wrap;
  }

  .kv > div {
    font-size: 0.76rem;
  }

  .kv dd {
    font-size: 0.73rem;
  }

  .ledger {
    font-size: 0.71rem;
  }

  .ledger td.r,
  .ledger tfoot td.r {
    font-size: 0.69rem;
    padding-left: 6px;
  }

  .ledger td.in {
    padding-left: 6px;
  }

  .ledger .acc {
    display: block;
    margin-right: 0;
    font-size: 0.64rem;
  }

  .panel {
    padding: 15px 13px;
  }

  .panel-h {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .tbl-tax {
    font-size: 0.72rem;
    table-layout: auto;
  }

  .tbl-tax th:nth-child(n),
  .tbl-tax td:nth-child(n) {
    display: table-cell;
    width: auto;
    white-space: normal;
  }

  .tbl-tax td.r,
  .tbl-tax th.r {
    white-space: nowrap;
    padding-left: 6px;
  }

  .tax-list li {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
  }

  .log li {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 5px 10px;
  }

  .log .st {
    grid-column: 2;
    justify-self: start;
  }

  .matrix {
    font-size: 0.75rem;
  }

  .acct {
    padding: 22px 16px;
    gap: 16px;
  }

  .final {
    padding: 76px 16px 64px;
  }

  .final .display {
    font-size: 2.05rem;
  }

  .foot {
    padding: 40px 16px 28px;
  }

  .foot-top {
    flex-direction: column;
    gap: 24px;
  }

  .foot-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
  }

  .foot-bot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .rock {
    transform: none !important;
  }
}
