/* calculocompuesto.com - Hoja de estilos principal (sin dependencias externas) */

/* ---------- Tokens de color: modo normal ---------- */
:root {
  color-scheme: light;
  --bg: #f3f6f5;
  --bg-grad: #e6f2ef;
  --surface: #ffffff;
  --surface-2: #f0f5f3;
  --border: #d9e3df;
  --text: #13201c;
  --text-2: #43534e;
  --muted: #5f6f6a;
  --primary: #0f766e;
  --primary-hover: #0b5f58;
  --primary-contrast: #ffffff;
  --primary-soft: #e3f3ef;
  --focus: #2563eb;
  --danger: #b42318;
  --series-1: #2a78d6;
  --series-2: #1baf7a;
  --grid: #e4e9e7;
  --axis: #9aa7a2;
  --shadow: 0 1px 2px rgba(16, 40, 34, .06), 0 8px 24px rgba(16, 40, 34, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Tokens de color: modo oscuro ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1412;
  --bg-grad: #10201c;
  --surface: #151f1c;
  --surface-2: #1b2824;
  --border: #2a3a35;
  --text: #e7efec;
  --text-2: #b9c7c2;
  --muted: #93a49e;
  --primary: #2dd4bf;
  --primary-hover: #5eead4;
  --primary-contrast: #05201c;
  --primary-soft: #133029;
  --focus: #7aa7ff;
  --danger: #ff8a7a;
  --series-1: #3987e5;
  --series-2: #199e70;
  --grid: #24322e;
  --axis: #4f625c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
/* Sin JavaScript: seguir la preferencia del sistema */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0d1412; --bg-grad: #10201c; --surface: #151f1c; --surface-2: #1b2824; --border: #2a3a35;
    --text: #e7efec; --text-2: #b9c7c2; --muted: #93a49e; --primary: #2dd4bf; --primary-hover: #5eead4;
    --primary-contrast: #05201c; --primary-soft: #133029; --focus: #7aa7ff; --danger: #ff8a7a;
    --series-1: #3987e5; --series-2: #199e70; --grid: #24322e; --axis: #4f625c;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -200px, var(--bg-grad), transparent 70%);
  background-repeat: no-repeat;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

.visually-hidden {
  position: absolute !important; 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: 12px; top: -60px; z-index: 100; background: var(--primary); color: var(--primary-contrast); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; color: var(--primary-contrast); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-header { background: var(--surface); } }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand b { color: var(--primary); font-weight: 800; }
.main-nav { display: none; margin-left: auto; gap: 4px; }
.main-nav a { color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
@media (min-width: 860px) { .main-nav { display: flex; } }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
@media (min-width: 860px) { .header-actions { margin-left: 8px; } }

.icon-btn, .lang-menu > summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 600;
}
.icon-btn:hover, .lang-menu > summary:hover { background: var(--surface-2); }
.icon-btn svg, .lang-menu svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 180px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.lang-menu li a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.lang-menu li a:hover { background: var(--surface-2); }
.lang-menu li a[aria-current="true"] { color: var(--primary); font-weight: 700; }
.lang-menu li a span { color: var(--muted); font-size: .85rem; }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 8px; text-align: center; }
.hero .eyebrow { display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .85rem; font-weight: 600; }
.hero p.lead { max-width: 720px; margin: 0 auto; color: var(--text-2); font-size: 1.05rem; }
@media (min-width: 640px) { .hero { padding: 44px 0 16px; } }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
@media (min-width: 640px) { .card { padding: 24px; } }

/* ---------- Herramienta ---------- */
.tool { padding: 16px 0 8px; }
.tool-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .tool-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; } }

.calc-form h2, .results h2 { font-size: 1.15rem; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 380px) { .field-row { grid-template-columns: 1fr; } }

.input-wrap { position: relative; display: flex; align-items: stretch; }
.input-wrap .unit {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 0 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-weight: 600;
}
.input-wrap .unit.pre { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-wrap .unit.post { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
input[type="number"], input[type="text"], input[type="email"], select {
  width: 100%; min-width: 0; height: 46px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem; font-variant-numeric: tabular-nums;
}
.input-wrap .unit.pre + input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-wrap input:has(+ .unit.post) { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
input[aria-invalid="true"] { border-color: var(--danger); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field-error { min-height: 0; margin: 4px 0 0; color: var(--danger); font-size: .85rem; font-weight: 500; }
.field-error:empty { display: none; }

/* Selector de moneda (segmentado) */
.currency-switch { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.currency-switch legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.segmented label .sym { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font-size: .85rem; }
.segmented input:checked + label { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented input:checked + label .sym { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; }

details.advanced { margin: 4px 0 16px; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 0 14px; }
details.advanced > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--text-2); }
details.advanced[open] > summary { margin-bottom: 4px; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn-primary { flex: 1 1 auto; background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-contrast); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }

/* Resultados */
.results { position: relative; }
.result-main { margin: 0 0 4px; padding: 18px; border-radius: 12px; background: var(--primary-soft); }
.result-main .result-label { display: block; font-size: .9rem; font-weight: 600; color: var(--text-2); }
.result-main output { display: block; font-size: clamp(1.8rem, 6vw, 2.5rem); font-weight: 800; line-height: 1.15; color: var(--primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-mult { margin: 8px 0 0; font-size: .9rem; color: var(--text-2); font-weight: 500; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.result-stats > div { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
.result-stats dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.result-stats dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-stats .is-interest dd { color: var(--text); }
.result-stats .is-interest dt::before, .result-stats .is-contrib dt::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.result-stats .is-contrib dt::before { background: var(--series-1); }
.result-stats .is-interest dt::before { background: var(--series-2); }
.result-stats .wide { grid-column: 1 / -1; }
.ratio-bar { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--series-2); margin-bottom: 14px; }
.ratio-bar span { display: block; height: 100%; }
.ratio-bar .ratio-contrib { background: var(--series-1); width: 50%; transition: width .3s ease; }
.ratio-bar .ratio-interest { flex: 1; background: var(--series-2); }
.result-summary { color: var(--text-2); font-size: .95rem; }

/* Compartir */
.share { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.share-title { font-weight: 700; font-size: .95rem; margin-bottom: 10px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .88rem; cursor: pointer; font-family: inherit;
}
.share-btn svg { width: 18px; height: 18px; flex: none; }
.share-btn:hover { color: #fff; border-color: transparent; }
.share-facebook svg { color: #1877f2; } .share-facebook:hover { background: #1877f2; }
.share-whatsapp svg { color: #1fa855; } .share-whatsapp:hover { background: #128c4b; }
.share-x svg { color: var(--text); } .share-x:hover { background: #000; }
.share-telegram svg { color: #229ed9; } .share-telegram:hover { background: #1c88bb; }
.share-copy svg { color: var(--primary); } .share-copy:hover { background: var(--primary); color: var(--primary-contrast); }
.share-btn:hover svg { color: inherit; }
.share-status { min-height: 1.4em; margin: 8px 0 0; font-size: .85rem; color: var(--primary); font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 479px) { .share-btn .label { display: none; } .share-btn { width: 44px; height: 44px; justify-content: center; padding: 0; } }

/* Gráfico */
.chart-card { margin-top: 16px; }
@media (min-width: 900px) { .chart-card { margin-top: 20px; } }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.chart-head h3 { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: .88rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.swatch.s1 { background: var(--series-1); }
.swatch.s2 { background: var(--series-2); }
.chart-wrap { position: relative; }
.chart { width: 100%; min-height: 240px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .s1 { fill: var(--series-1); }
.chart .s2 { fill: var(--series-2); }
.chart .bar { transition: opacity .15s; }
.chart svg:hover .bar { opacity: .55; }
.chart svg:hover .bar.is-active { opacity: 1; }
.chart-tip {
  position: absolute; z-index: 5; transform: translateX(-50%); pointer-events: none;
  min-width: 170px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: .82rem; line-height: 1.5; color: var(--text);
}
.chart-tip strong { display: block; margin-bottom: 2px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text-2); }
.chart-tip .tip-row b { color: var(--text); margin-left: auto; padding-left: 8px; font-variant-numeric: tabular-nums; }
.chart-tip i.swatch { width: 10px; height: 10px; }

/* Tabla */
.table-card { margin-top: 16px; padding: 0; }
.table-card > summary { cursor: pointer; padding: 18px 20px; font-weight: 700; list-style-position: inside; }
.table-card[open] > summary { border-bottom: 1px solid var(--border); }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 0; }
.table-wrap { overflow-x: auto; padding: 14px 20px 20px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
thead th { position: sticky; top: 0; background: var(--surface-2); font-size: .8rem; color: var(--text-2); font-weight: 700; }
tbody th, thead th:first-child { text-align: center; }
tbody tr:hover { background: var(--surface-2); }
table .col-real { display: none; }
table.has-real .col-real { display: table-cell; }

/* ---------- Contenido (guía y FAQ) ---------- */
.section { padding: 40px 0 8px; }
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose .formula {
  margin: 1em 0; padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--mono); font-size: clamp(.95rem, 3vw, 1.15rem); text-align: center; color: var(--text); overflow-x: auto;
}
.prose .note { padding: 14px 16px; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; color: var(--text); }
.prose table { margin: 1em 0; }
.prose .table-wrap { padding: 0; }
.prose td, .prose th { text-align: left; }
.prose td.num, .prose th.num { text-align: right; }

.faq-list { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.faq-item > summary {
  cursor: pointer; list-style: none; position: relative; padding: 16px 48px 16px 18px; font-weight: 700;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--primary); line-height: 1;
}
.faq-item[open] > summary::after { content: "\2212"; }
.faq-item .faq-answer { padding: 0 18px 16px; color: var(--text-2); }
.faq-item .faq-answer p:last-child { margin-bottom: 0; }
.section-title { text-align: center; }
.section-intro { text-align: center; color: var(--text-2); max-width: 680px; margin: 0 auto 24px; }

/* Páginas legales / contacto */
.page { padding: 32px 0 24px; }
.page .card { max-width: 820px; margin: 0 auto; }
.page .updated { color: var(--muted); font-size: .9rem; }
.breadcrumb { max-width: 820px; margin: 0 auto 12px; font-size: .9rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }
.contact-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; background: var(--primary-soft); margin: 1em 0; }
.contact-box .email { font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; }

/* ---------- Zonas de publicidad (vacías = ocultas) ---------- */
.ad-slot { margin: 24px auto; text-align: center; overflow: hidden; }
.ad-slot:empty { display: none; }
.ad-slot--leaderboard { max-width: 970px; min-height: 90px; }
.ad-slot--rectangle { max-width: 336px; min-height: 280px; }
.ad-slot--inarticle { max-width: 820px; min-height: 250px; }

/* ---------- Pie de página ---------- */
.site-footer { margin-top: 56px; padding: 36px 0 28px; background: var(--surface); border-top: 1px solid var(--border); font-size: .92rem; color: var(--text-2); }
.disclaimer { padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 24px; }
.disclaimer strong { color: var(--text); }
.disclaimer p { margin: 0; }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h2 { font-size: .95rem; margin-bottom: 10px; color: var(--text); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
.footer-langs { display: flex; flex-wrap: wrap; gap: 6px 12px; list-style: none; margin: 0; padding: 0; }
.footer-langs a { color: var(--text-2); text-decoration: none; }
.footer-langs a[aria-current="true"] { color: var(--primary); font-weight: 700; }
.copyright { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }

/* ---------- Página raíz (selector de idioma) / 404 ---------- */
.lang-picker { max-width: 640px; margin: 48px auto; text-align: center; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.lang-grid a { display: block; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.lang-grid a:hover { border-color: var(--primary); color: var(--primary); }
.lang-grid small { display: block; color: var(--muted); font-weight: 400; }

/* ---------- Impresión ---------- */
@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --text: #000; --text-2: #222; --muted: #444; --border: #ccc; --primary: #0f766e; --primary-soft: #eef7f5; --series-1: #2a78d6; --series-2: #1baf7a; }
  body { background: #fff; }
  .site-header, .calc-form, .share, .ad-slot, #guide, #faq, .footer-grid, .table-actions, .skip-link, .chart-tip { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
  .tool-grid { display: block; }
  .table-card > summary { display: none; }
  thead th { position: static; }
}
.faq-item .faq-q { display: inline; margin: 0; font-size: 1rem; line-height: 1.45; letter-spacing: 0; }
.lang-picker > p:first-child svg { width: 56px; height: 56px; }
.nowrap { white-space: nowrap; }

/* ---------- Datos legales en imagen (modo normal / oscuro) ---------- */
.data-img img { max-width: 100%; height: auto; }
.data-img--block { margin: 0 0 1em; }
.data-img--block img { display: block; }
.data-img--inline img { display: inline-block; vertical-align: middle; max-height: 1.6em; width: auto; }
.theme-img--dark { display: none !important; }
:root[data-theme="dark"] .theme-img--light { display: none !important; }
:root[data-theme="dark"] .data-img--block .theme-img--dark { display: block !important; }
:root[data-theme="dark"] .data-img--inline .theme-img--dark { display: inline-block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-img--light { display: none !important; }
  :root:not([data-theme]) .data-img--block .theme-img--dark { display: block !important; }
  :root:not([data-theme]) .data-img--inline .theme-img--dark { display: inline-block !important; }
}
@media print {
  .theme-img--dark { display: none !important; }
  .data-img--block .theme-img--light { display: block !important; }
  .data-img--inline .theme-img--light { display: inline-block !important; }
}

/* ---------- Formulario de contacto ---------- */
.contact-form { margin: 1.5em 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
@media (min-width: 640px) { .contact-form { padding: 24px; } }
.prose .contact-form h2.contact-title { margin-top: 0; font-size: 1.2rem; }
.contact-form .field-row { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .contact-form .field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form select, textarea { background: var(--surface); }
textarea {
  width: 100%; min-width: 0; min-height: 150px; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
  font: inherit; font-size: 1rem; line-height: 1.5;
}
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.prose .contact-form .hint, .contact-form .hint { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
.hp-field { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.captcha-img { line-height: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #eef3f1; }
.captcha-img img { display: block; width: 200px; height: 70px; transition: opacity .2s; }
.captcha-img img.is-loading { opacity: .35; }
.captcha-field input { max-width: 220px; text-transform: uppercase; letter-spacing: .2em; font-weight: 700; }
.consent-field { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; }
.consent-field input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); }
.consent-field label { margin: 0; font-weight: 500; }
.consent-field .field-error { grid-column: 1 / -1; }
input[type="checkbox"][aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.prose .form-info, .form-info { font-size: .8rem; line-height: 1.5; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.prose .form-info strong { color: var(--text-2); }
.btn[disabled] { opacity: .65; cursor: progress; }
.form-status { margin: 12px 0 0; font-weight: 600; }
.form-status:empty { display: none; }
.form-status.is-error { color: var(--danger); }
.form-status.is-success { color: var(--primary); padding: 12px 14px; border-radius: 10px; background: var(--primary-soft); }
.form-status.is-info { color: var(--text-2); }
.prose .alt-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
