/* ==========================================================================
   UTMChile · sistema visual «el libro contable» (29-09-2026)
   Papel de hoja columnar, tinta verde petróleo, acento ocre de carpeta manila
   y el doble subrayado con que un contador cierra un total. Reglas y porqué
   en docs/SISTEMA-VISUAL.md. Si cambias un color, cámbialo en los tokens.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-utm.woff2?v=b9b33f16") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/publicsans-utm.woff2?v=bda32c25") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #eef0e8;
  --paper-2: #e5e9df;
  --sheet: #fbfbf7;
  --sheet-2: #f3f5ef;
  --field: #ffffff;
  --ink: #1b2422;
  --ink-2: #45514d;
  --ink-3: #5a6662;
  --rule: #d5dcd3;
  --rule-strong: #aab7b0;
  --ledger-line: #dde3da;
  --brand: #174f57;
  --brand-strong: #0f3b42;
  --brand-wash: #e1ebe8;
  --button: #174f57;
  --button-hover: #0f3b42;
  --button-step: #092a2f;
  --manila: #8a5a12;
  --manila-rule: #c9a15a;
  --manila-wash: #f3e9d3;
  --danger: #a2301f;
  --danger-wash: #f8e8e4;
  --mark-field: #174f57;
  --mark-u: #fbfbf7;
  --mark-rules: #e0b25c;
  --focus: #174f57;
  --radius-s: 6px;
  --radius: 10px;
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Public Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --t-page: clamp(2rem, 1.35rem + 2.4vw, 3.05rem);
  --t-section: clamp(1.45rem, 1.2rem + 1vw, 1.95rem);
  --t-panel: 1.25rem;
  --t-card: 1.0625rem;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

html.dark {
  color-scheme: dark;
  --paper: #121614;
  --paper-2: #181d1a;
  --sheet: #1a201d;
  --sheet-2: #202724;
  --field: #151a18;
  --ink: #e8ebe5;
  --ink-2: #bcc6c0;
  --ink-3: #9ea9a3;
  --rule: #2f3934;
  --rule-strong: #4b5750;
  --ledger-line: #1b221f;
  --brand: #8ccbc8;
  --brand-strong: #b0dfdc;
  --brand-wash: #1c3032;
  --button: #2a6f78;
  --button-hover: #327f89;
  --button-step: #163f45;
  --manila: #deb266;
  --manila-rule: #8a6a33;
  --manila-wash: #2b2519;
  --danger: #f29a87;
  --danger-wash: #3a221d;
  --mark-field: #2a6f78;
  --mark-u: #f4f6f1;
  --mark-rules: #e8bf6e;
  --focus: #8ccbc8;
}

.dark body { background: var(--paper); color: var(--ink); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--brand-strong); text-decoration-thickness: 2px; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-family: var(--font-serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-wash); color: var(--ink); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-brand { stroke: none; }
.icon-inline { width: 1em; height: 1em; margin-left: .25em; vertical-align: -.12em; }
.icon-flip { transform: scaleX(-1); }
.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; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 60; padding: .7rem 1rem; border-radius: var(--radius-s); background: var(--ink); color: var(--paper); font-weight: 600; }
.skip-link:focus { top: .75rem; }

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; }
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

/* El total contable: doble subrayado bajo la cifra que cierra un cálculo. */
.total {
  display: inline-block;
  padding-bottom: .12em;
  border-bottom: 4px double currentColor;
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.05;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 2.1rem; height: 2.1rem; flex: none; }
.brand-mark__field { fill: var(--mark-field); }
.brand-mark__u { fill: none; stroke: var(--mark-u); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark__rules { fill: none; stroke: var(--mark-rules); stroke-width: 1.8; stroke-linecap: round; }
.brand-wordmark { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.brand-wordmark strong { color: var(--brand); font-weight: 700; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}
.nav { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.nav .brand { margin-right: auto; }
.nav-links { display: flex; align-items: center; gap: .15rem; }
.nav-links a {
  position: relative;
  padding: .55rem .8rem;
  border-radius: var(--radius-s);
  color: var(--ink-2);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .15rem; height: 2px; background: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: .4rem; }
.text-size { display: flex; }
.text-size .tool-button:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.text-size .tool-button + .tool-button { margin-left: -1px; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 .6rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-s);
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}
.tool-button:hover { background: var(--paper-2); }
.tool-button span[aria-hidden] { font-family: var(--font-sans); font-size: .8rem; margin-left: .05rem; }
.theme-button .icon-sun, .dark .theme-button .icon-moon { display: none; }
.dark .theme-button .icon-sun { display: block; }
.mobile-menu { display: none; font-family: var(--font-sans); font-size: .9375rem; }
.mobile-menu .icon-close, .mobile-menu[aria-expanded="true"] .icon-open { display: none; }
.mobile-menu[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 899px) {
  .mobile-menu { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem var(--gutter) 1rem;
    border-bottom: 1px solid var(--rule);
    background: var(--sheet);
    box-shadow: 0 12px 0 -11px var(--rule-strong);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .85rem .25rem; border-bottom: 1px solid var(--rule); border-radius: 0; font-size: 1.0625rem; }
  .nav-links a[aria-current="page"]::after { left: auto; right: .25rem; top: 50%; bottom: auto; width: .5rem; height: .5rem; border-radius: 50%; transform: translateY(-50%); }
}
@media (max-width: 479px) {
  .text-size { display: none; }
  .mobile-menu span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .brand-wordmark { font-size: 1.25rem; }
}
.nav-links .text-size { display: none; }
@media (max-width: 479px) {
  .nav-links .text-size { display: flex; align-self: flex-start; margin-top: .9rem; }
  .nav-links .text-size .tool-button { border-bottom: 1px solid var(--rule-strong); }
}

/* ---------- Secciones ---------- */
.section { padding-block: clamp(2.5rem, 1.9rem + 2.4vw, 4.25rem); }
.section--sheet { background: var(--sheet); border-block: 1px solid var(--rule); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 2rem; margin-bottom: 1.75rem; }
.section-head > div { max-width: 46rem; }
.section-head h2 { font-size: var(--t-section); }
.section-head p { margin-top: .5rem; color: var(--ink-2); }
.text-link { display: inline-flex; align-items: center; color: var(--brand); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Cabeceras en papel liso: las líneas del papel rayado detrás del texto se leían
   como ruido (Pablo, 29-09-2026). El rayado queda solo en el comprobante. */
.hero, .page-hero { position: relative; background-color: var(--paper); }
/* Arriba, poco aire: el título y el conversor quedan pegados a la navegación (Pablo, 29-09). */
.hero { padding-block: clamp(1rem, .6rem + 1.2vw, 1.75rem) clamp(2.25rem, 1.5rem + 3vw, 4rem); border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; gap: 1.25rem; align-items: start; }
.hero-copy, .hero-more { min-width: 0; }
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); grid-template-rows: auto 1fr; gap: 1.5rem 3.5rem; }
  .hero-copy, .hero-more { grid-column: 1; }
  .hero-grid > .calculator-shell { grid-column: 2; grid-row: 1 / span 2; }
}
.hero-kicker { display: flex; align-items: center; gap: .5rem; color: var(--ink-2); font-size: .9375rem; font-weight: 600; }
.hero-kicker .icon { color: var(--brand); }
.hero h1 { font-size: clamp(1.5rem, 7.4vw, 2.5rem); font-weight: 600; }
.lead { margin-top: .9rem; max-width: 36rem; color: var(--ink-2); font-size: clamp(1.0625rem, 1rem + .3vw, 1.2rem); }
.current-value { margin-top: .6rem; max-width: 30rem; }
.current-value small { display: block; color: var(--ink-2); font-size: 1rem; font-weight: 600; }
.current-value > .total { margin-top: .2rem; font-size: clamp(2.75rem, 2.3rem + 1.6vw, 3.5rem); color: var(--ink); }
.value-change { margin-top: .5rem; color: var(--ink-2); font-size: 1rem; }
.leaders { margin: 0; max-width: 30rem; }
.leaders div { display: flex; align-items: baseline; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--rule); }
.leaders div:last-child { border-bottom: 1px solid var(--rule); }
.leaders dt { display: flex; flex: 1; align-items: baseline; min-width: 0; color: var(--ink-2); font-size: .9375rem; }
.leaders dt::after { content: ""; flex: 1; min-width: .75rem; margin-left: .6rem; border-bottom: 1px dotted var(--rule-strong); transform: translateY(-.3em); }
.leaders dt em { margin-left: .4rem; color: var(--manila); font-size: .8125rem; font-style: normal; font-weight: 600; white-space: nowrap; }
.leaders dd { margin: 0; font-weight: 600; white-space: nowrap; }
.hero-more .lead { font-size: 1rem; }
.source-line { margin-top: .6rem; color: var(--ink-3); font-size: .9375rem; }
.source-line a { font-weight: 600; }

.page-hero { padding-block: clamp(1rem, .7rem + 1vw, 1.75rem) clamp(1.75rem, 1.2rem + 2vw, 3rem); border-bottom: 1px solid var(--rule); }
.page-hero h1 { margin-top: .65rem; max-width: 22ch; font-size: var(--t-page); }
.page-hero .lead { max-width: 44rem; }
.page-hero--404 { padding-block: 4rem 5rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .15rem .4rem; margin: 0; padding: 0; list-style: none; color: var(--ink-3); font-size: .875rem; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--rule-strong); }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink-3); }
/* En celular la miga actual repite el título: se deja solo el camino. */
@media (max-width: 639px) { .breadcrumb li:last-child:not(:first-child) { display: none; } }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Botones ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  padding: 0 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: var(--button);
  box-shadow: 0 2px 0 var(--button-step);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .15s var(--ease), transform .1s var(--ease);
}
.button:hover { background: var(--button-hover); color: #fff; }
.button:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--button-step); }
.button.secondary { background: var(--sheet); border-color: var(--rule-strong); box-shadow: 0 2px 0 var(--rule-strong); color: var(--ink); }
.button.secondary:hover { background: var(--paper-2); color: var(--ink); }
.button.secondary:active { box-shadow: 0 1px 0 var(--rule-strong); }
.button.quiet { min-height: 2.75rem; padding: 0 .85rem; border-color: var(--rule); background: transparent; box-shadow: none; color: var(--ink-2); font-size: .9375rem; }
.button.quiet:hover { background: var(--paper-2); color: var(--ink); }
.button.quiet .icon-brand { color: #1b8a4c; }
.dark .button.quiet .icon-brand { color: #57c486; }

/* ---------- Calculadoras ---------- */
.calculator-shell {
  container-type: inline-size;
  position: relative;
  min-width: 0;
  padding: clamp(1rem, .7rem + 1.5vw, 1.6rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 2px 0 var(--rule);
}
.calculator-top { display: flex; align-items: flex-start; gap: .85rem; margin-bottom: 1.15rem; }
.calculator-icon { width: 2.5rem; height: 2.5rem; padding: .5rem; border-radius: var(--radius-s); background: var(--brand-wash); color: var(--brand); }
.calculator-top h2 { font-size: var(--t-panel); }
.calculator-top p { margin-top: .2rem; color: var(--ink-2); font-size: .9375rem; line-height: 1.45; }

.field { display: grid; gap: .35rem; min-width: 0; }
.field > label, .field-set legend { color: var(--ink); font-size: .875rem; font-weight: 600; }
.control {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-s);
  background: var(--field);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.control:hover { border-color: var(--ink-3); }
.control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.control input, .control select {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: .6rem .8rem;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink);
  font-size: max(16px, 1rem);
  font-variant-numeric: tabular-nums;
  appearance: none;
}
.control input:focus, .control select:focus { outline: none; }
.control select { padding-right: 2.4rem; cursor: pointer; }
/* La lista desplegable la pinta el sistema con el fondo del <select>: si queda
   transparente, Chrome usa blanco y en modo oscuro los títulos de grupo se pierden
   (captura de Pablo, 29-09). El select lleva fondo propio y los grupos, su color. */
.control select { background-color: var(--field); }
.control select option { background-color: var(--field); color: var(--ink); font-weight: 400; }
.control select optgroup { background-color: var(--sheet-2); color: var(--ink-2); font-style: normal; font-weight: 700; }
.control--select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1rem;
  width: .5rem;
  height: .5rem;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.unit {
  display: flex;
  align-items: center;
  flex: none;
  padding: 0 .8rem;
  border-left: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}
.control input[aria-invalid="true"] { color: var(--danger); }
.control:has(input[aria-invalid="true"]) { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .875rem; font-weight: 600; }
.field-error:empty { display: none; }
.field-hint { color: var(--ink-3); font-size: .875rem; line-height: 1.45; }
.field-hint--block { display: block; margin-top: .75rem; }
.field-grid { display: grid; gap: .9rem; margin-top: .9rem; }
.field-grid:first-child { margin-top: 0; }
.field-set { min-width: 0; margin: 1rem 0 0; padding: 0; border: 0; }
.field-set legend { padding: 0; margin-bottom: .1rem; }
.field-set .field-grid { margin-top: .35rem; }
@container (min-width: 380px) { .field-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Mes y año van siempre juntos: el mes necesita más ancho que el año. */
.field-grid--date { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@container (max-width: 400px) {
  .field-grid--date .control select { padding-left: .6rem; padding-right: 1.9rem; }
  .field-grid--date .control--select::after { right: .75rem; }
}
@container (min-width: 560px) { .field-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Resultado: la cifra final con su doble subrayado. */
.result-panel { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.result-panel small { display: block; color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.result-panel output { margin-top: .3rem; color: var(--ink); font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem); overflow-wrap: anywhere; }
.result-note { display: block; margin-top: .55rem; color: var(--ink-2); font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.result-note:empty { display: none; }
.result-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.data-panel--calculator .result-panel output { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.3rem); }

/* Conversor de portada */
.calculator-shell--converter { box-shadow: 0 3px 0 var(--rule-strong); }
.calculator-shell--converter .calculator-top { margin-bottom: .75rem; }
.calculator-shell--converter .calculator-icon { width: 2rem; height: 2rem; padding: .35rem; }
/* Un campo y la frase del resultado: el mismo lugar para el ejemplo, la cifra y el error. */
.calculator-shell--converter { --result-slot: 4.5rem; }
.calculator-shell--converter .field { position: relative; }
.converter-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .75rem; }
.field > .converter-head > label { color: var(--ink); font-size: 1.0625rem; font-weight: 700; }
.converter-swap { min-height: 2.25rem; padding: .25rem .7rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--field); color: var(--brand); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.converter-swap:hover { border-color: var(--brand); background: var(--brand-wash); }
.converter-link { display: inline-flex; align-items: center; min-height: 2rem; padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.control--big input { min-height: 3.75rem; font-family: var(--font-serif); font-size: 1.85rem; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.control--big input { flex: 1 1 0; width: 0; max-width: 100%; }
.control--big input::placeholder { color: var(--ink-3); font-family: var(--font-sans); font-size: 1.125rem; font-weight: 400; letter-spacing: 0; opacity: 1; }
.control--big .unit { justify-content: center; width: 4.25rem; padding: 0; font-size: .9375rem; }
.result-panel--sentence { margin-top: .5rem; padding-top: 0; border-top: 0; }
.result-sentence { display: flex; flex-wrap: wrap; align-content: center; align-items: baseline; gap: 0 .5rem; min-height: var(--result-slot); margin: 0; font-size: 1rem; }
.result-sentence .result-note { margin: 0; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.35; }
.result-panel--sentence .result-sentence .total { color: var(--ink); font-size: 2.125rem; overflow-wrap: anywhere; }
.result-sentence .total:empty { display: none; }
.result-panel--sentence .result-sentence .total.is-long { font-size: 1.125rem; }
.result-sentence:has(.is-long) .result-note { font-size: .9375rem; }
.result-panel.result-panel--sentence.is-updating output { animation: none; }
.calculator-shell--converter .field-error { position: absolute; inset: 100% 0 auto; z-index: 1; min-height: var(--result-slot); margin-top: .5rem; padding-top: .35rem; background: var(--sheet); font-size: 1rem; }
.period-note { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .75rem; color: var(--ink-2); font-size: .9375rem; line-height: 1.45; }
.calculator-shell--converter[data-period-state="proximo"] .period-note span { color: var(--manila); font-weight: 600; }
/* El mes: un selector que ya trae el valor de cada mes, abierto solo si se pide. */
.period-panel { margin-top: .4rem; padding: .75rem 0 .15rem; border-top: 1px dashed var(--rule); }
.period-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .85rem; }
.period-line label { color: var(--ink); font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.period-line .control { flex: 1 1 15rem; min-width: 0; }
.period-line select { min-height: 2.9rem; font-weight: 600; }
@media (max-width: 380px) {
  .period-line .control select { padding-left: .65rem; padding-right: 2rem; }
  .period-line .control--select::after { right: .8rem; }
}
.period-more { display: inline-block; margin-top: .55rem; font-size: .9375rem; font-weight: 600; }
.calculator-shell--converter button:disabled { opacity: .5; cursor: not-allowed; }
.calculator-shell--converter > .result-actions { margin-top: .85rem; }
/* Se ven con un resultado; su lugar queda reservado para que nada salte al escribir. */
.calculator-shell--converter:not([data-has-result="true"]) > .result-actions { visibility: hidden; }
.quick-values { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .6rem; }
.quick-values > span { width: 100%; color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.chip {
  min-width: 2.75rem;
  min-height: 2.5rem;
  padding: 0 .7rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-s);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chip:hover { background: var(--paper-2); }
.chip.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.dark .chip.active { color: var(--paper); }

/* ---------- Montos más buscados ---------- */
.amount-ledger { margin: 0; padding: 0; list-style: none; columns: 1; column-gap: 2.5rem; border-top: 2px solid var(--ink); }
@media (min-width: 640px) { .amount-ledger { columns: 2; } }
@media (min-width: 1000px) { .amount-ledger { columns: 3; } }
.amount-ledger li { break-inside: avoid; border-bottom: 1px solid var(--rule); }
.amount-row {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  width: 100%;
  min-height: 2.9rem;
  padding: .65rem .35rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.amount-row:hover { background: var(--paper-2); }
.amount-row span { color: var(--ink-2); white-space: nowrap; }
.amount-row i { flex: 1; min-width: .75rem; border-bottom: 1px dotted var(--rule-strong); transform: translateY(-.3em); }
.amount-row strong { font-weight: 700; white-space: nowrap; }

/* ---------- Centro de datos ---------- */
.data-summary-grid { display: grid; margin: 0 0 1.75rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.data-summary-card { padding: 1rem .25rem; }
.data-summary-card + .data-summary-card { border-top: 1px solid var(--rule); }
@media (min-width: 720px) {
  .data-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-summary-card { padding: 1.1rem 1.4rem; }
  .data-summary-card:first-child { padding-left: .25rem; }
  .data-summary-card + .data-summary-card { border-top: 0; border-left: 1px solid var(--rule); }
}
.data-summary-card dt { color: var(--ink-2); font-size: .9375rem; font-weight: 600; }
.data-summary-card dd { margin: 0; }
.data-summary-card strong { display: block; margin-top: .2rem; font-family: var(--font-serif); font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.3rem); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; line-height: 1.1; }
.data-summary-card small { display: block; margin-top: .25rem; color: var(--ink-3); font-size: .875rem; }
.official-data-grid { display: grid; gap: 1.25rem; }
@media (min-width: 1000px) { .official-data-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; } }
.data-panel { min-width: 0; }
.data-panel--chart { padding: clamp(1rem, .7rem + 1.5vw, 1.6rem); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.data-panel-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; margin-bottom: 1rem; }
.data-panel-heading h3 { font-size: var(--t-panel); }
.data-panel-heading a { font-size: .875rem; font-weight: 600; }
.utm-chart { margin: 0; }
.chart-scale { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; margin-bottom: .6rem; color: var(--ink-3); font-size: .8125rem; }
.chart-scale strong { color: var(--ink); font-weight: 600; }
.chart-plot { position: relative; }
.chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-gridline { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-point line { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-point circle { fill: var(--sheet); stroke: var(--brand); stroke-width: 2; r: 7px; vector-effect: non-scaling-stroke; }
.chart-point.is-current circle { fill: var(--brand); }
.chart-point.is-future circle { stroke: var(--manila); stroke-dasharray: 3 2; }
.chart-labels { position: relative; height: 1.6rem; margin-top: .3rem; }
.chart-labels span { position: absolute; top: 0; transform: translateX(-50%); color: var(--ink-3); font-size: .75rem; line-height: 1.6rem; }
.chart-labels .is-current { color: var(--brand); font-weight: 700; }
.chart-labels .is-future { color: var(--manila); }
.utm-chart figcaption { margin-top: .75rem; color: var(--ink-3); font-size: .8125rem; line-height: 1.45; }
@media (max-width: 479px) { .chart-labels span { font-size: .6875rem; } .chart-labels span:nth-child(even):not(.is-current) { visibility: hidden; } }
.utm-chart.motion-ready .chart-line { stroke-dasharray: 1600; stroke-dashoffset: 1600; }
.utm-chart.motion-ready .chart-point { opacity: 0; }
.utm-chart.motion-ready.is-visible .chart-line { animation: chart-draw 1.1s var(--ease) forwards; }
.utm-chart.motion-ready.is-visible .chart-point { animation: fade-in .3s ease-out forwards; animation-delay: calc(.2s + var(--point-index, 0) * .06s); }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

.official-table-disclosure { margin-top: 1.25rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.official-table-disclosure summary { display: flex; align-items: center; gap: .6rem; min-height: 3.25rem; padding: .75rem 1rem; font-weight: 600; cursor: pointer; list-style: none; }
.official-table-disclosure summary::-webkit-details-marker { display: none; }
.official-table-disclosure summary::before { content: ""; width: .5rem; height: .5rem; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); transition: transform .15s var(--ease); }
.official-table-disclosure[open] summary::before { transform: rotate(45deg); }
.official-table-disclosure .table-wrap { padding: 0 1rem 1rem; }
.data-shortcuts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.data-shortcuts a { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: 0 .9rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--sheet); color: var(--ink); font-size: .9375rem; font-weight: 600; text-decoration: none; }
.data-shortcuts a:hover { border-color: var(--brand); color: var(--brand); }
.data-shortcuts .icon { color: var(--brand); }

/* ---------- Carpetas: comprobante y planilla ---------- */
.workbench-entry-grid { display: grid; gap: 2.5rem 1.5rem; padding-top: 1.6rem; }
@media (min-width: 760px) { .workbench-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.folder {
  position: relative;
  display: grid;
  gap: .45rem;
  padding: 1.35rem 1.35rem 1.2rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  background: var(--sheet);
  box-shadow: 0 2px 0 var(--rule-strong);
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s var(--ease);
}
.folder:hover { color: var(--ink); transform: translateY(-2px); }
.folder-tab {
  position: absolute;
  top: calc(-1.75rem - 1px);
  left: -1px;
  display: flex;
  align-items: center;
  height: 1.75rem;
  padding: 0 .9rem;
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
  border-radius: var(--radius-s) var(--radius-s) 0 0;
  background: var(--manila-wash);
  color: var(--manila);
  font-size: .8125rem;
  font-weight: 700;
}
.folder-icon { width: 2rem; height: 2rem; color: var(--brand); }
.folder h3 { margin-top: .2rem; font-size: 1.4rem; }
.folder p { color: var(--ink-2); }
.folder-go { display: inline-flex; align-items: center; margin-top: .35rem; color: var(--brand); font-weight: 600; }

/* ---------- Índices: calculadoras y guías ---------- */
/* Columnas y no grilla: la lista larga (8) va sola y las tres cortas se apilan al lado. */
.tool-index-grid { column-gap: 3rem; }
@media (min-width: 800px) { .tool-index-grid { columns: 2; } }
.tool-group { break-inside: avoid; padding-bottom: 2rem; }
.tool-group:last-child { padding-bottom: 0; }
.tool-group h3 { font-size: var(--t-panel); }
.tool-group > p { margin: .3rem 0 .75rem; color: var(--ink-2); font-size: .9375rem; }
.entry-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.entry-list li { border-bottom: 1px solid var(--rule); }
.entry {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-height: 3.25rem;
  padding: .8rem .35rem;
  color: var(--ink);
  text-decoration: none;
  transition: background-color .15s var(--ease);
}
.entry:hover { background: var(--paper-2); color: var(--ink); }
.section--sheet .entry:hover, .sidebar-card .entry:hover { background: var(--sheet-2); }
.entry-icon { width: 1.5rem; height: 1.5rem; color: var(--brand); }
.entry-text { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.entry-text strong { font-size: var(--t-card); font-weight: 600; line-height: 1.35; }
.entry-text span { color: var(--ink-2); font-size: .9375rem; line-height: 1.45; }
.entry-go { width: 1.1rem; height: 1.1rem; color: var(--ink-3); transition: transform .15s var(--ease), color .15s var(--ease); }
.entry:hover .entry-go { color: var(--brand); transform: translateX(3px); }
.entry-list--compact .entry { min-height: 2.9rem; padding-block: .6rem; }
.entry-list--compact .entry-text strong { font-size: 1rem; font-weight: 600; }
.entry-list--guides .entry { align-items: flex-start; padding-block: 1rem; }
.entry-list--guides .entry-icon { margin-top: .15rem; }
.entry-list--guides .entry-go { margin-top: .3rem; }

.directory { display: grid; gap: 2.5rem; margin-top: 2rem; }
.calculator-group { display: grid; gap: 1rem 3rem; scroll-margin-top: 5rem; }
@media (min-width: 900px) { .calculator-group { grid-template-columns: 17rem minmax(0, 1fr); } }
.calculator-group-head h2 { font-size: var(--t-section); }
.calculator-group-head p { margin-top: .4rem; color: var(--ink-2); }

/* ---------- Páginas de herramienta y contenido ---------- */
.tool-layout, .content-grid { display: grid; gap: 2.5rem; }
@media (min-width: 1000px) {
  .tool-layout, .content-grid { grid-template-columns: minmax(0, 1fr) 19rem; gap: 3.5rem; align-items: start; }
}
.tool-main { display: grid; gap: 2.5rem; min-width: 0; }
.aside { display: grid; gap: 1.25rem; min-width: 0; }
/* Hueco de columnas (ORDEN-20261023, anexo): en escritorio la columna lateral acompaña
   la lectura en vez de terminar 1.500-3.000 px antes que el artículo. Si no cabe en la
   pantalla (1208×570), se recorre dentro de sí misma con la rueda o el teclado.
   Sin overscroll-behavior: contain, que dejaba la página quieta con el puntero encima. */
@media (min-width: 1000px) {
  .tool-layout > .aside, .content-grid > .aside {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 2px;
    margin: -2px;
  }
}
.workbench-page .calculator-shell { position: static; }
.workbench-editorial { margin-top: 3rem; }
.calculator-shell--inheritance + .workbench-editorial { margin-top: 3rem; }

.prose { min-width: 0; max-width: 46rem; }
.prose > * + * { margin-top: 1rem; }
.prose h2 { margin-top: 2.25rem; font-size: 1.6rem; }
.prose h3 { margin-top: 1.75rem; font-size: 1.25rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 + *, .prose h3 + * { margin-top: .7rem; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.25rem; }
/* Formulario de sugerencias con Turnstile (10-10-2026). */
.suggest-form { display: grid; gap: .6rem; }
.suggest-form label { color: var(--ink); font-weight: 600; }
.suggest-optional { color: var(--ink-2); font-weight: 400; }
.suggest-form textarea, .suggest-form input[type="email"] { width: 100%; min-width: 0; padding: .75rem .9rem; border: 1px solid var(--rule-strong); border-radius: var(--radius-s); background: var(--field); color: var(--ink); font: inherit; }
.suggest-form textarea { min-height: 8.5rem; resize: vertical; }
.suggest-form textarea:focus-visible, .suggest-form input[type="email"]:focus-visible { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 2px; }
.suggest-trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.suggest-form .suggest-send { justify-self: start; margin-top: .25rem; cursor: pointer; }
.suggest-form .suggest-send:disabled { opacity: .7; cursor: progress; }
.prose .suggest-status { --suggest-error: var(--danger); min-height: 1.4em; margin: 0; color: var(--ink-2); }
.prose .suggest-done { padding: .75rem .9rem; border: 1px solid var(--brand); border-radius: var(--radius-s); color: var(--brand); font-weight: 600; }
.prose .suggest-or { color: var(--ink-2); }
.suggest-or a { overflow-wrap: anywhere; }
.prose .suggest-copy { margin-top: .5rem; cursor: pointer; }
.prose li + li { margin-top: .4rem; }
.check-list, .caution-list { padding-left: 0 !important; list-style: none; }
.check-list li, .caution-list li { position: relative; padding-left: 1.6rem; }
.check-list li::before { content: ""; position: absolute; left: .15rem; top: .45em; width: .7rem; height: .4rem; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.caution-list li::before { content: ""; position: absolute; left: .2rem; top: .75em; width: .75rem; height: 2px; background: var(--manila); }
.step-list { padding-left: 0 !important; list-style: none; counter-reset: paso; }
.step-list li { position: relative; padding-left: 2.4rem; counter-increment: paso; }
.step-list li::before { content: counter(paso); position: absolute; left: 0; top: -.05rem; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border: 1px solid var(--rule-strong); border-radius: 50%; color: var(--brand); font-family: var(--font-serif); font-size: .95rem; font-weight: 700; }
.answer-box { padding: 1rem 1.15rem; border-left: 4px solid var(--brand); border-radius: 0 var(--radius-s) var(--radius-s) 0; background: var(--brand-wash); }
.answer-box p { color: var(--ink); }
.directory-intro { margin-bottom: 1.5rem; }
.notice { display: flex; gap: .75rem; padding: 1rem 1.15rem; border-left: 4px solid var(--manila-rule); border-radius: 0 var(--radius-s) var(--radius-s) 0; background: var(--manila-wash); }
.notice-icon { margin-top: .15rem; color: var(--manila); }
.notice p { margin: 0; }
.formula-box { padding: .9rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--sheet); overflow-x: auto; }
.formula-box code { font-family: var(--font-mono); font-size: .9375rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-card { padding: 1rem 0 0; border-top: 3px double var(--rule-strong); }
.source-card strong { display: block; font-size: .9375rem; }
.source-card p { margin-top: .25rem; color: var(--ink-2); font-size: .9375rem; }

.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .6rem .7rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); color: var(--ink-2); font-size: .8125rem; font-weight: 700; white-space: nowrap; }
tbody th { font-weight: 600; }
td { white-space: nowrap; }
.ledger-table td { text-align: right; }
.ledger-table thead th:not(:first-child) { text-align: right; }
.ledger-table tr.is-current th, .ledger-table tr.is-current td { background: var(--brand-wash); }
.uta-amounts tbody th { white-space: nowrap; }
.period-status { display: inline-block; color: var(--ink-3); font-size: .8125rem; font-weight: 600; }
.period-status.is-current { color: var(--brand); }
.period-status.is-next { color: var(--manila); }
.status-inline { display: none; margin-left: .3rem; font-weight: 600; }
/* Tablas del impuesto único (/tablas/impuesto-unico/). */
.tax-table caption { padding: .5rem 0 .35rem; color: var(--ink-2); font-size: .875rem; font-weight: 600; text-align: left; }
@media (max-width: 640px) {
  .tax-table--pesos thead { display: none; }
  .tax-table--pesos caption { display: block; }
  .tax-table--pesos, .tax-table--pesos tbody { display: block; width: 100%; }
  .tax-table--pesos tbody tr { display: block; padding: .45rem 0; border-bottom: 1px solid var(--rule); }
  .tax-table--pesos td { display: flex; justify-content: space-between; gap: 1rem; padding: .12rem 0; border: 0; }
  .tax-table--pesos td::before { content: attr(data-label); color: var(--ink-3); font-size: .8125rem; font-weight: 600; }
  .tax-table--pesos .col-from { display: none; }
  .tax-table--pesos tr:last-child .col-from { display: flex; }
}
@media (max-width: 640px) {
  .ledger-table .col-wide { display: none; }
  .status-inline { display: block; margin-left: 0; font-size: .8125rem; }
  .official-table-disclosure .table-wrap { padding: 0 .5rem .75rem; }
}

.faq-list { border-top: 1px solid var(--rule); }
.faq-list details { border-bottom: 1px solid var(--rule); }
.faq-list summary { position: relative; display: block; padding: .95rem 2.25rem .95rem 0; font-weight: 600; line-height: 1.45; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: .35rem; top: .75rem; color: var(--brand); font-family: var(--font-serif); font-size: 1.5rem; line-height: 1; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { margin: 0 0 1rem; color: var(--ink-2); }

.sidebar-card { padding: 1.15rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.section--sheet .sidebar-card { background: var(--sheet-2); }
.sidebar-card h2 { margin-bottom: .6rem; font-family: var(--font-sans); font-size: 1rem; font-weight: 700; letter-spacing: 0; }
.sidebar-card ul:not(.entry-list) { margin: 0; padding: 0; list-style: none; }
.sidebar-card ul:not(.entry-list) li { border-top: 1px solid var(--rule); }
.sidebar-card ul:not(.entry-list) a { display: block; padding: .55rem 0; font-weight: 600; text-decoration: none; }
.sidebar-card ul:not(.entry-list) a:hover { text-decoration: underline; }
.sidebar-card .entry-list { margin-bottom: .75rem; }
.review-card { display: grid; gap: .15rem; margin-top: 1rem; padding-top: .9rem; border-top: 3px double var(--rule-strong); font-size: .9375rem; }
.review-card span { color: var(--ink-2); }
.aside-figure { display: grid; gap: .15rem; }
.aside-figure span { color: var(--ink-2); font-size: .875rem; }
.aside-figure strong { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; line-height: 1.1; }
.aside-source { margin-top: .6rem; font-size: .875rem; }

/* ---------- Histórico ---------- */
.decades { display: grid; gap: 1.75rem; }
.decade { display: grid; gap: .75rem 2rem; padding-top: 1rem; border-top: 2px solid var(--ink); }
@media (min-width: 800px) { .decade { grid-template-columns: 9rem minmax(0, 1fr); } }
.decade h3 { font-size: 1.35rem; }
.decade ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(7.25rem, 100%), 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .decade ul { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.year-card { display: grid; gap: .1rem; padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--sheet); color: var(--ink); text-decoration: none; }
.year-card:hover { border-color: var(--brand); color: var(--ink); }
.year-card strong { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; line-height: 1.2; }
.year-card span { color: var(--ink-3); font-size: .8125rem; white-space: nowrap; }
.year-card.is-current { border-color: var(--brand); background: var(--brand-wash); }
.year-card em { color: var(--brand); font-size: .75rem; font-style: normal; font-weight: 700; }
.month-notes { display: grid; border-top: 2px solid var(--ink); }
@media (min-width: 720px) { .month-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; } }
.month-note { padding: .9rem 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 5rem; }
.prose .month-note h3 { margin: 0; font-size: 1.125rem; }
.prose .month-note p { margin-top: .3rem; color: var(--ink-2); font-size: .9375rem; }
.month-note:target { background: var(--brand-wash); }
.year-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; max-width: 30rem; margin-top: 1.25rem; }
.year-nav a { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: 0 .85rem; border: 1px solid var(--rule-strong); border-radius: var(--radius-s); background: var(--sheet); color: var(--ink); font-weight: 600; text-decoration: none; }
.year-nav a:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Trámites varios ---------- */
.legacy-service-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 900px) { .legacy-service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.legacy-service-grid section { display: grid; align-content: start; gap: .6rem; padding: 1.15rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.legacy-service-grid h2 { margin: 0 !important; font-size: 1.25rem; }
.legacy-service-grid p { margin: 0 !important; }
.service-icon { width: 1.75rem; height: 1.75rem; color: var(--brand); }
.service-source { font-size: .875rem; }

/* ---------- Mesa de trabajo: herencias, comprobante y planilla ---------- */
.inheritance-fields { grid-template-columns: 1fr; }
@container (min-width: 620px) {
  .inheritance-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.inheritance-detail-title { margin-top: 1.5rem; font-weight: 700; }
.inheritance-breakdown { display: grid; gap: 0; margin: .6rem 0 0; border-top: 2px solid var(--ink); }
.inheritance-breakdown div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.inheritance-breakdown dt { color: var(--ink-2); }
.inheritance-breakdown dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
@container (min-width: 700px) {
  .inheritance-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
}
.privacy-note { margin-top: .9rem; color: var(--ink-3); font-size: .875rem; }

.document-workspace { display: grid; gap: 1.5rem; }
@container (min-width: 820px) { .document-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } }
.document-form { display: grid; gap: 1rem; }
.document-form .field-grid { margin-top: 0; }
@container (min-width: 480px) { .document-form .field-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, .8fr); } }
.document-guidance { padding: .9rem 1rem; border-left: 4px solid var(--manila-rule); background: var(--manila-wash); font-size: .9375rem; }
.document-guidance:empty { display: none; }
.receipt {
  position: relative;
  min-width: 0;
  padding: 1.25rem 1.25rem 1.1rem 2.1rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-s);
  background-color: #fffffb;
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(1.75rem - 1px), #e5ebe2 calc(1.75rem - 1px) 1.75rem);
  box-shadow: 0 2px 0 var(--rule-strong);
  color: #1b2422;
}
.receipt::before, .receipt::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: #c9a15a; left: 1.05rem; }
.receipt::after { left: 1.3rem; }
.receipt.is-unavailable { border-color: #c9a15a; }
.receipt-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem; padding-bottom: .9rem; border-bottom: 1px solid #cfd8cd; }
.receipt-kicker { display: flex; align-items: center; gap: .4rem; color: #45514d; font-size: .8125rem; font-weight: 600; }
.receipt-mark { width: 1.3rem; height: 1.3rem; --mark-field: #174f57; --mark-u: #fbfbf7; --mark-rules: #e0b25c; }
.receipt-head h3 { margin-top: .3rem; color: #1b2422; font-size: 1.35rem; }
.receipt-badge { padding: .25rem .6rem; border: 2px solid #8a5a12; border-radius: 4px; color: #8a5a12; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transform: rotate(-4deg); }
.receipt-label { margin-top: .9rem; color: #45514d; font-size: .875rem; font-weight: 600; }
.receipt-result { padding: .6rem 0 .9rem; }
.receipt-result span { display: block; color: #45514d; font-size: .875rem; }
.receipt-result strong { margin-top: .2rem; color: #1b2422; font-size: clamp(2rem, 1.6rem + 2vw, 2.6rem); overflow-wrap: anywhere; }
.receipt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; margin: 0; border-top: 2px solid #1b2422; }
.receipt-grid div { padding: .55rem 0; border-bottom: 1px solid #cfd8cd; min-width: 0; }
.receipt-grid dt { color: #5a6662; font-size: .8125rem; }
.receipt-grid dd { margin: .1rem 0 0; color: #1b2422; font-weight: 600; overflow-wrap: anywhere; }
.receipt-formula { margin-top: .9rem; }
.receipt-formula span, .receipt-source > span { display: block; color: #5a6662; font-size: .8125rem; }
.receipt-formula code { display: block; margin-top: .2rem; color: #1b2422; font-family: var(--font-mono); font-size: .9375rem; white-space: normal; overflow-wrap: anywhere; }
.receipt-source { margin-top: .8rem; }
.receipt-source a { color: #174f57; font-weight: 600; }
.receipt-source small { display: block; margin-top: .2rem; color: #5a6662; }
.receipt-disclaimer { margin-top: .9rem; padding-top: .7rem; border-top: 1px solid #cfd8cd; color: #45514d; font-size: .8125rem; }
.workbench-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }

.worksheet-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.worksheet-toolbar p { flex: 1 1 18rem; color: var(--ink-2); font-size: .9375rem; }
.worksheet { border: 1px solid var(--rule); border-radius: var(--radius-s); overflow: hidden; background: var(--sheet); }
.worksheet-header { display: none; }
.worksheet-row-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem; align-items: end; }
.worksheet-remove { justify-self: start; }
@container (min-width: 480px) {
  .worksheet-row-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worksheet-row-fields .field:first-child, .worksheet-remove { grid-column: 1 / -1; }
}
@container (min-width: 760px) {
  .worksheet-header, .worksheet-row-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .65fr) minmax(0, .85fr) 5.5rem; gap: .65rem; align-items: end; }
  .worksheet-row-fields .field:first-child, .worksheet-remove { grid-column: auto; justify-self: stretch; }
  .worksheet-header { padding: .6rem 1rem; border-bottom: 2px solid var(--ink); color: var(--ink-2); font-size: .8125rem; font-weight: 700; }
  .worksheet-row .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.worksheet-row { padding: 1rem; border-top: 1px solid var(--rule); }
.worksheet-row:first-child { border-top: 0; }
.worksheet-row.is-unavailable { background: var(--manila-wash); }
.worksheet-row .control input, .worksheet-row .control select { min-height: 2.75rem; }
.worksheet-remove { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 .8rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: transparent; color: var(--danger); font-size: .875rem; font-weight: 600; }
.worksheet-remove:hover { border-color: var(--danger); background: var(--danger-wash); }
.worksheet-row-result { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; margin-top: .6rem; color: var(--ink-2); font-size: .875rem; }
.worksheet-row-result strong { color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.worksheet-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; padding: 1rem; border-top: 2px solid var(--ink); background: var(--sheet-2); }
.worksheet-total .total { font-size: 1.6rem; }

/* Pensión: meses atrasados */
.breakdown { margin-top: 1rem; border-top: 1px solid var(--rule); }
.breakdown summary { padding: .8rem 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.breakdown .table-wrap { max-height: 22rem; overflow-y: auto; }

/* ---------- Pie ---------- */
.site-footer { margin-top: 0; padding-block: 3rem 2rem; border-top: 4px double var(--rule-strong); background: var(--sheet); color: var(--ink); }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .footer-about { grid-column: 1 / -1; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); } .footer-about { grid-column: auto; } }
.footer-copy { max-width: 26rem; margin-top: .9rem; color: var(--ink-2); font-size: .9375rem; }
.footer-share { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 1.25rem; }
.footer-share > span { width: 100%; color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.share-button { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--rule-strong); border-radius: var(--radius-s); background: var(--sheet); color: var(--ink-2); }
.share-button:hover { background: var(--paper-2); color: var(--ink); }
.share-button .share-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.footer-column { display: grid; align-content: start; gap: .1rem; }
.footer-column h2 { margin-bottom: .5rem; font-family: var(--font-sans); font-size: .9375rem; font-weight: 700; letter-spacing: 0; }
.footer-column a { padding: .3rem 0; color: var(--ink-2); font-size: .9375rem; text-decoration: none; }
.footer-column a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: .875rem; }

/* ---------- Avisos del sistema ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 80;
  max-width: calc(100% - 2rem);
  padding: .75rem 1.1rem;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  transform: translate(-50%, 200%);
  transition: transform .25s var(--ease);
}
.toast.show { transform: translate(-50%, 0); }
.result-panel.is-updating output { animation: result-refresh .25s ease-out; }
@keyframes result-refresh { from { opacity: .55; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* ---------- Publicidad ---------- */
/* ≥ 32 px entre un anuncio y cualquier control (MANUAL-GOOGLE-ADSENSE §8) y rótulo
   «Anuncios» solo cuando el anuncio se llenó: un hueco vacío no lleva rótulo. */
.ad-zone { width: 100%; min-width: 0; margin-block: 2rem; overflow: hidden; clear: both; }
.ad-zone:has(.adsbygoogle[data-ad-status="filled"])::before { content: "Anuncios"; display: block; margin-bottom: .35rem; color: var(--ink-3); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.ad-reserved { display: block; width: 100%; min-height: 90px; }
.ad-reserved[data-ad-state="mounted"] > .adsbygoogle { display: block !important; width: 100% !important; max-width: 100% !important; min-width: 200px; min-height: 90px; margin: 0 auto; }
.ad-reserved[data-ad-state="mounted"] > .adsbygoogle > div,
.ad-reserved[data-ad-state="mounted"] iframe { max-width: 100% !important; }
/* Un espacio que AdSense no llenó no debe quedar como un hueco en la página. */
.ad-reserved:has(> .adsbygoogle[data-ad-status="unfilled"]) { min-height: 0; }
.ad-reserved > .adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
@media (max-width: 640px) { .ad-zone { margin-block: 2rem; } .ad-reserved[data-ad-state="mounted"] > .adsbygoogle { min-height: 60px; } }

/* ---------- Pantallas angostas ---------- */
@media (max-width: 480px) {
  th, td { padding: .55rem .45rem; }
  .ledger-table { font-size: .9375rem; }
}
@media (max-width: 800px) {
  .result-actions .button { flex: 1 1 auto; }
  .workbench-actions .button { flex: 1 1 12rem; }
  td { white-space: nowrap; }
}
@media (max-width: 380px) {
  .result-actions .button span { font-size: .875rem; }
  .calculator-shell { padding: .9rem; }
  .calculator-shell--converter .calculator-icon { display: none; }
  .field > .converter-head > label { font-size: 1rem; }
  .converter-head { gap: .25rem .4rem; }
  .converter-swap { padding: .25rem .45rem; font-size: .875rem; }
  .calculator-shell--converter .chip { min-width: 2.5rem; padding: 0 .4rem; }
  .calculator-shell--converter > .result-actions { flex-wrap: nowrap; gap: .35rem; }
  .calculator-shell--converter > .result-actions .button { flex: 1 1 0; min-width: 0; padding: 0 .2rem; }
  .calculator-shell--converter > .result-actions .button svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .utm-chart.motion-ready .chart-line { stroke-dasharray: none; stroke-dashoffset: 0; }
  .utm-chart.motion-ready .chart-point { opacity: 1; }
}

/* ---------- Impresión del comprobante y la planilla ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body.printing { background: #fff !important; }
  body.printing * { visibility: hidden !important; }
  body.printing .print-target,
  body.printing .print-target * { visibility: visible !important; }
  body.printing .print-target {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    color: #1b2422 !important;
    background-color: #fff !important;
  }
  body.printing .worksheet-remove { display: none !important; }
  body.printing .worksheet { overflow: visible; }
  body.printing .worksheet-row { break-inside: avoid; }
  body.printing .worksheet-row input,
  body.printing .worksheet-row select { border: 0; background: transparent; }
  .site-header, .site-footer, .ad-zone { display: none !important; }
}
