/* AIDO Tools — shared styles. Warm paper, Klein blue and one sun-yellow motif (a short bar under titles and under the key figure). */

/* Inter (body) and Bricolage Grotesque (titles, wordmark, key figure): variable, latin subset, self-hosted; no request to Google Fonts. SIL OFL licences in assets/fonts. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/herramientas/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("/herramientas/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/herramientas/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations"), url("/herramientas/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root {
  --bg: #f8f6f0;
  --surface: #ffffff;
  --surface-2: #efece3;
  --ink: #11131f;
  --ink-2: #444759;
  --ink-3: #5f6275;
  --line: #dedacd;
  --field-line: #8a8778;           /* >= 3:1 against white (WCAG 1.4.11) */
  --accent: #1f3fd1;               /* 7.8:1 on white */
  --accent-ink: #ffffff;
  --accent-soft: #e3e8ff;
  --warn-bg: #fff3d6;
  --warn-ink: #6e4600;
  --hl: #ffd23f;                   /* the yellow motif; decoration, or text on dark/blue only */
  --res-bg: #1f3fd1;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(17, 19, 31, .05), 0 14px 30px -20px rgba(17, 19, 31, .28);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Category colours (home cards, chosen by link target below) */
  --c-home: #1f3fd1;  --c-home-bg: #e3e8ff;
  --c-work: #a8300f;  --c-work-bg: #ffe0d6;
  --c-self: #6b4e00;  --c-self-bg: #ffeaa8;
  --c-save: #0b6b45;  --c-save-bg: #d3f5e3;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f1c; --surface: #151933; --surface-2: #1e2347; --ink: #f1f2ff; --ink-2: #c6cae8; --ink-3: #a0a5cf;
    --line: #2b3163; --field-line: #6b7090; --accent: #8fa3ff; --accent-ink: #0d0f1c; --accent-soft: #232a66;
    --warn-bg: #30250f; --warn-ink: #f0c070; --res-bg: #2340d6;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 30px -20px rgba(0,0,0,.7);
    --c-home: #aab8ff;  --c-home-bg: #232a66;
    --c-work: #ffb59f;  --c-work-bg: #4a2218;
    --c-self: #ffd86b;  --c-self-bg: #463a10;
    --c-save: #8ee6bb;  --c-save-bg: #10382a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); font-feature-settings: "cv11", "ss01", "tnum";
  display: flex; flex-direction: column; min-height: 100vh;
}
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 32px; padding-bottom: 64px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .brand, .sticky-result .v { font-family: var(--display); }
h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 2.9rem); line-height: 1.03; letter-spacing: -.04em; font-weight: 800; margin: 0 0 .5rem; }
h1::after { content: ""; display: block; width: 64px; height: 8px; margin-top: 16px; border-radius: 99px; background: var(--hl); }
main > h1:first-child { font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.4rem); max-width: 16ch; letter-spacing: -.05em; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; font-weight: 700; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }
.lead { color: var(--ink-2); font-size: 1.12rem; max-width: 62ch; margin-bottom: 2rem; }
.muted { color: var(--ink-3); }
small, .small { font-size: .875rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 10; }

/* Header / footer */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.1rem; letter-spacing: -.03em; }
.brand { white-space: nowrap; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: 4px; align-items: center; font-size: .925rem; }
.site-nav a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }
/* Very narrow screens: the wordmark already links home, so the plain link gives way to the language switch */
@media (max-width: 380px) { .site-nav a:not(.lang) { display: none; } }
.site-nav a:not(.lang):hover { color: var(--accent); text-decoration: none; }
.site-nav .lang { background: var(--surface); border: 1.5px solid var(--field-line); border-radius: 999px; min-height: 40px; padding: 0 14px; color: var(--ink); font-weight: 600; }
/* Footer: a dark band that closes the page; its own ink scale keeps the text readable in both themes */
.site-footer { background: #11131f; margin-top: 40px; padding: 32px 0 40px; color: #b4b8d2; --ink-2: #d5d8ee; --ink-3: #b4b8d2; font-size: .85rem; }
.site-footer a { color: var(--ink-2); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 12px 0; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
@media (prefers-color-scheme: dark) { .site-footer { background: #070816; } }
.footer-note { max-width: 72ch; }
.copy { margin: 0; }

/* Home grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.card-link { position: relative; display: block; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px 24px 26px; color: var(--ink); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.card-link:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 14px 28px -18px rgba(17, 19, 31, .45); }
.card-link h2 { margin: 10px 0 6px; font-size: 1.1rem; }
.card-link p { margin: 0; padding-right: 26px; color: var(--ink-2); font-size: .925rem; }
.card-link .icon { width: 46px; height: 46px; border-radius: 14px; background: var(--cat-bg, var(--accent-soft)); color: var(--cat, var(--accent)); display: grid; place-items: center; }
.card-link .icon svg { width: 24px; height: 24px; }
/* The arrow appears on hover or focus */
.card-link::after { content: ""; position: absolute; right: 20px; bottom: 20px; width: 20px; height: 20px; background: var(--cat, var(--accent)); opacity: 0; transform: translateX(-6px); transition: opacity .18s ease, transform .18s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.card-link:hover::after, .card-link:focus-visible::after { opacity: 1; transform: none; }
/* Category colour, picked from the link target (no markup needed) */
.card-link[href*="/hipoteca/"], .card-link[href*="/amortizacion-anticipada/"], .card-link[href*="/gastos-compra-vivienda/"], .card-link[href*="/comprar-o-alquilar/"], .card-link[href*="/rentabilidad-alquiler/"] { --cat: var(--c-home); --cat-bg: var(--c-home-bg); }
.card-link[href*="/sueldo-neto/"], .card-link[href*="/finiquito/"], .card-link[href*="/baja-incapacidad-temporal/"], .card-link[href*="/dias-laborables/"] { --cat: var(--c-work); --cat-bg: var(--c-work-bg); }
.card-link[href*="/cuota-autonomos/"], .card-link[href*="/tarifa-hora-autonomo/"], .card-link[href*="/iva/"] { --cat: var(--c-self); --cat-bg: var(--c-self-bg); }
.card-link[href*="/interes-compuesto/"], .card-link[href*="/prestamo-personal/"] { --cat: var(--c-save); --cat-bg: var(--c-save-bg); }

/* Calculator layout */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
.calc > * { min-width: 0; }
@media (max-width: 820px) { .calc { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 28px; }
.panel h2 { margin-top: 0; font-size: 1.15rem; }
/* Result: a flat Klein-blue block with a soft glow in the corner. Inside it the colour tokens are
   remapped (white ink, yellow accent), so every result component reads correctly without extra rules. */
.results {
  position: sticky; top: 20px; overflow: hidden; border: 0; border-radius: 26px; color: #fff;
  background: radial-gradient(circle at 100% 0, rgba(255, 255, 255, .07), transparent 45%), var(--res-bg);
  box-shadow: 0 28px 50px -26px rgba(31, 63, 209, .7);
  --ink: #fff; --ink-2: #eef1ff; --ink-3: #e9edff; --line: rgba(255, 255, 255, .26);
  --accent: var(--hl); --accent-ink: #11131f;
  --surface: rgba(255, 255, 255, .12); --surface-2: rgba(255, 255, 255, .14); --accent-soft: rgba(255, 255, 255, .16);
  --warn-bg: #fff3d6; --warn-ink: #6e4600; /* the notice stays a light card on the blue, in both themes */
}
.results a { color: #fff; }
.field { margin-bottom: 18px; }
.field:focus-within label { color: var(--accent); }
.field label { display: block; font-weight: 600; font-size: .925rem; margin-bottom: 6px; }
.field .hint { display: block; color: var(--ink-3); font-size: .8rem; margin-top: 5px; }
.control { display: flex; align-items: center; background: var(--surface); border: 1.5px solid var(--field-line); border-radius: 12px; transition: border-color .15s; }
.control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.control input, .control select { flex: 1; width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem; font-weight: 600; padding: 11px 12px; outline: none; -moz-appearance: textfield; }
.control input::-webkit-outer-spin-button, .control input::-webkit-inner-spin-button { -webkit-appearance: none; }
.control input[type="date"] { -webkit-appearance: none; appearance: none; text-align: left; min-height: 50px; display: block; }
.control input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.4em; }
.control input[type="date"]::-webkit-datetime-edit { padding: 0; }
.control .unit { padding: 0 12px; color: var(--ink-2); font-size: .9rem; font-weight: 600; background: var(--surface-2); border-left: 1.5px solid var(--line); border-radius: 0 10px 10px 0; align-self: stretch; display: flex; align-items: center; }
.control select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a8a83' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.hint-line { color: var(--ink-3); font-size: .8rem; margin: -8px 0 18px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.row > * { min-width: 0; }
@media (max-width: 480px) { .row { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.check { display: flex; align-items: center; gap: 10px; font-size: .925rem; font-weight: 500; }
.field label.check, .check { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--field-line); border-radius: 7px; background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 3px; }
.segmented label { margin: 0; display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; font-size: .875rem; font-weight: 600; padding: 8px 6px; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + label { background: var(--ink); color: var(--bg); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); }
details.more { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 500; font-size: .925rem; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; }
details.more[open] summary::before { content: "−"; }
details.more > :not(summary) { margin-top: 14px; }

/* Results */
.hero-result { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.hero-result .label { color: var(--ink-2); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.hero-result .value { display: inline-block; padding-bottom: .06em; font-family: var(--display); font-size: clamp(2.6rem, 1.6rem + 3.6vw, 4rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.1; color: var(--accent);
  background: linear-gradient(var(--hl), var(--hl)) 0 100% / 100% .14em no-repeat; }
.results .hero-result .value { color: #fff; }
.hero-result .sub { color: var(--ink-3); font-size: .9rem; margin-top: 6px; }
.kv { display: grid; gap: 8px; margin: 0; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.kv dt { color: var(--ink-2); min-width: 0; }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv .total dt { font-weight: 700; color: var(--ink); }
.kv .total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.kv .total dd { color: var(--accent); }
.kv .neg dd { color: var(--ink-3); }
.verdict { background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; font-weight: 500; }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 14px; padding: 12px 14px; font-size: .875rem; margin: 16px 0 0; }
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; }
.bars { display: grid; gap: 10px; margin-top: 16px; }
.bar { font-size: .875rem; }
.bar .track { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s ease; }
.bar.alt .fill { background: var(--ink-3); }
.results .bar .track { background: rgba(255, 255, 255, .24); }
.bar .meta { display: flex; justify-content: space-between; }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 12px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); font-weight: 700; border-bottom: 2px solid var(--ink); }
tbody td:first-child { font-weight: 600; }
tbody tr:hover td { background: var(--surface-2); }
.results table th, .results table td { border-color: rgba(255, 255, 255, .22); }
tbody tr:last-child td { border-bottom: 0; }
.btn { display: inline-flex; align-items: center; min-height: 44px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--ink); background: var(--surface); border: 1.5px solid var(--field-line); border-radius: 12px; padding: 8px 16px; cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.results .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .4); color: #fff; }
.results .btn:hover { background: rgba(255, 255, 255, .26); border-color: #fff; }
.results .btn.primary { background: var(--hl); border-color: var(--hl); color: #11131f; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Chart */
.chart { width: 100%; height: auto; margin-top: 16px; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .area-contrib { fill: var(--ink-3); opacity: .35; }
.chart .area-interest { fill: var(--accent); opacity: .75; }
.results .chart .area-interest { opacity: .9; }
.results .chart .area-contrib { fill: #fff; opacity: .3; }
.results .chart text { fill: #e8edff; }
.chart text { fill: var(--ink-3); font-size: 12px; font-family: var(--font); }
.legend { display: flex; gap: 18px; font-size: .825rem; color: var(--ink-2); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend .l-contrib::before { background: var(--ink-3); }
.legend .l-interest::before { background: var(--accent); }

/* Explainer */
.explain { margin-top: 48px; }
.explain > :not(.table-wrap) { max-width: 72ch; }
.table-wrap { max-width: 920px; }
.explain ol, .explain ul { padding-left: 1.3rem; }
.explain li { margin-bottom: .4rem; }
.formula { background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; overflow-x: auto; }
.sources { font-size: .875rem; color: var(--ink-2); }
.disclaimer { border-left: 3px solid var(--line); padding-left: 14px; color: var(--ink-3); font-size: .875rem; margin-top: 32px; }

/* Legal / text pages */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2rem; }

/* Compact tables on small screens so more columns fit */
@media (max-width: 560px) {
  th, td { padding: 9px 6px; font-size: .8rem; }
  .panel { padding: 20px; }
}

/* Mobile: results stay visible while editing (shown only when the results panel is below the fold) */
.sticky-result { display: none; }
@media (max-width: 819px) {
  .sticky-result { position: fixed; top: 0; left: 0; right: 0; z-index: 20; align-items: baseline; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 20px 10px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); font: inherit; color: inherit; width: 100%; text-align: left; cursor: pointer; border-left: 0; border-right: 0; border-top: 0; }
  .sticky-result.visible { display: flex; }
  .sticky-result .l { color: var(--ink-2); font-size: .85rem; }
  .sticky-result .v { color: var(--accent); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Holiday list in the working-days calculator */
.holiday-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.holiday-list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.holiday-list li:last-child { border-bottom: 0; }
.holiday-list li span:first-child { color: var(--ink-2); white-space: nowrap; }
.holiday-list li span:last-child { text-align: right; font-weight: 500; }

/* Result actions: copy, share, print */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.actions .btn { margin: 0; font-size: .85rem; padding: 8px 12px; }
.toast { color: var(--accent); font-size: .85rem; font-weight: 500; min-height: 1.2em; }

/* Printing: only the calculation and its table, on white, in one column */
@media print {
  @page { margin: 16mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --ink: #111; --ink-2: #333; --ink-3: #555; --line: #ccc; --accent: #0b2a9a; --accent-soft: #fff; }
  body { background: #fff; color: #111; display: block; min-height: 0; font-size: 11pt; }
  .site-header, .site-footer, .actions, .sticky-result, .skip, details.more summary, .explain:not(.table-section), .lead, details.more:not([open]) { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .calc { display: block; }
  .panel { box-shadow: none; border: 1px solid #ccc; margin-bottom: 14px; break-inside: avoid; padding: 16px; }
  .results { position: static; background: #fff; color: #111; box-shadow: none; border-radius: var(--radius); --ink: #111; --ink-2: #333; --ink-3: #555; --line: #ccc; --accent: #0b2a9a; --surface: #fff; --surface-2: #f3f3f3; }
  .results a { color: inherit; }
  .hero-result .value, .results .hero-result .value { color: #0b2a9a; background: none; }
  .reviewed::before, .card-link::after, h1::after { display: none; }
  .comp-bar > span, .comp-swatch { border: 1px solid #111; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; max-width: none; }
  tr { break-inside: avoid; }
  .disclaimer { margin-top: 12px; font-size: 9pt; }
  a { color: inherit; text-decoration: none; }
  .results::after { content: "AIDO Tools · aidoapps.com/herramientas"; display: block; margin-top: 12px; font-size: 9pt; color: #555; }
}

/* The "reviewed" line carries a small seal (trust signal) */
.reviewed::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M7.5 12.5l3 3 6-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M7.5 12.5l3 3 6-6.5'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Related links and guides */
.related { margin-top: 56px; }
.related h2 { margin-top: 0; }
.related-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.related .card-link, .guides .card-link { padding: 18px 20px; }
.related .card-link { border-left: 5px solid var(--cat, var(--line)); }
.card-link h3 { margin: 6px 0 6px; font-size: 1.05rem; letter-spacing: -.01em; }
.card-link .badge { margin-bottom: 4px; }
.guides { margin-top: 48px; }
.guides h2 { margin-top: 0; }
.guide .lead { margin-bottom: 1.5rem; }
.guide h2 { margin-top: 2.2rem; }
.guide .table-wrap { margin: 1rem 0 1.25rem; }
@media print { .related, .guides { display: none !important; } }

/* Static explanatory tables inside the prose may wrap, so uppercase headings do not push the page wider than a 320 px screen */
.explain > table th, .explain > table td { white-space: normal; }

/* Guide tables: headings may wrap so every column fits the reading width */
.guide th { white-space: normal; vertical-align: bottom; line-height: 1.3; }
.guide th, .guide td { padding: 9px 8px; }
.guide td:nth-child(2), .guide th:nth-child(2) { text-align: left; }

/* Links inside running text are underlined, so they do not rely on colour alone (WCAG 1.4.1) */
main p a:not(.btn), main li a:not(.btn), main dd a:not(.btn) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* "Datos revisados el ..." line under each result */
.reviewed { margin: 14px 0 0; color: var(--ink-3); font-size: .78rem; line-height: 1.5; }
.reviewed a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media print { .reviewed { font-size: 8pt; } }

/* Composition bar: what the main result is made of (shared by the calculators that show it).
   Built by renderComposition() in common.js. Each part has a name, a whole-number percentage and
   an amount as real text, and the second part is hatched, so nothing depends on colour alone. */
.composition { --comp-1: var(--accent); --comp-2: var(--ink-3); --comp-3: var(--line); --hatch: rgba(17, 19, 31, .38); margin: 0 0 20px; }
.results .composition { --comp-1: #fff; --comp-2: var(--hl); --comp-3: rgba(255, 255, 255, .6); }
.composition-title { margin: 0 0 10px; color: var(--ink-2); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.comp-bar { display: flex; gap: 3px; height: 16px; border-radius: 99px; overflow: hidden; }
.comp-bar > span { flex: 0 1 var(--w, 0%); min-width: 4px; }
.comp-seg-1 { background: var(--comp-1); }
.comp-seg-2 { background: repeating-linear-gradient(135deg, var(--hatch) 0 3px, transparent 3px 7px), var(--comp-2); }
/* Parts 3 and 4 are for calculators with three or four components (e.g. net salary); the mortgage uses two */
.comp-seg-3 { background: var(--comp-3); }
.comp-seg-4 { background: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 5px), var(--comp-3); }
.comp-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.comp-legend li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.comp-legend .comp-swatch { flex: none; width: 12px; height: 12px; border-radius: 3px; align-self: center; }
.comp-legend .name { flex: 1 1 9rem; color: var(--ink); }
.comp-legend .pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.comp-legend .amt { min-width: 6.5em; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .comp-legend .amt { min-width: 0; margin-left: auto; } }
@media (prefers-reduced-motion: no-preference) {
  .comp-bar > span { transition: flex-basis .45s ease; animation: comp-bar-in .5s ease both; transform-origin: left; }
  @keyframes comp-bar-in { from { transform: scaleX(0); } }
}

/* Print (after the .results rules above so it wins): black and white, the legend carries the numbers */
@media print {
  .composition, .results .composition { break-inside: avoid; --comp-1: #111; --comp-2: #fff; --comp-3: #bbb; --hatch: #111; }
}

/* Reduced motion: no hover or width animations */
@media (prefers-reduced-motion: reduce) {
  .card-link, .card-link::after, .btn, .control, .bar .fill, .check input { transition: none; }
}

/* Ad slot: a reserved, clearly separated box with a small label. Its height is fixed so the page
   does not move whether or not an ad is served (250x300 / 336x280 and responsive formats fit).
   Only emitted in review builds with AD_PLACEHOLDERS=1 for now (scripts/build/adslots.mjs). */
.ad-slot { display: flex; flex-direction: column; gap: 6px; margin: 56px 0; min-height: 250px; }
@media (min-width: 820px) { .ad-slot { min-height: 280px; } }
.ad-slot .ad-label { color: var(--ink-3); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.ad-slot .ad-fill { flex: 1; display: grid; place-items: center; padding: 16px; text-align: center; background: var(--surface-2); border: 1.5px dashed var(--field-line); border-radius: var(--radius); color: var(--ink-3); font-size: .85rem; }
@media print { .ad-slot { display: none; } }
