/* ============================================================================
   calculadoraipc.cl — styles.css
   ADN: estilo valor-uf/valoruma. SaaS Premium sobrio, sin emojis, 320px-ready.
   ============================================================================ */

@font-face {
  font-family: 'Inter';
  src: local('Inter'), local('Inter-Variable');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-mono: 'SFMono-Regular', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  /* Tipografia */
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-muted: #64748b;

  /* Paleta sobria: teal-700 (cerca del puerto del portafolio) */
  --teal: #0c4a6e;
  --teal-dark: #075985;
  --teal-glow: rgba(12, 74, 110, 0.06);

  /* Lienzo */
  --paper: #ffffff;
  --canvas: #f8fafc;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;

  /* Acentos */
  --red: #be123c;
  --green: #0c4a6e;
  --amber: #b45309;

  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --radius: 4px;
  --radius-lg: 6px;
  --shell: 1120px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --ink-muted: #94a3b8;
  --teal: #38bdf8;
  --teal-dark: #0ea5e9;
  --teal-glow: rgba(56, 189, 248, 0.10);
  --paper: #0f172a;
  --canvas: #020617;
  --line: #334155;
  --line-soft: #1f2937;
  --red: #f43f5e;
  --green: #38bdf8;
  --amber: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

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

html {
  background: var(--canvas);
  font-family: var(--font-sans);
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

/* Selection personalizada */
::selection { background: color-mix(in srgb, var(--teal) 25%, transparent); color: var(--ink); }
::-moz-selection { background: color-mix(in srgb, var(--teal) 25%, transparent); color: var(--ink); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .live-dot { animation: none; }
  .market-sync-line::after { animation: none; }
}
html[data-text-size='large']  { font-size: 17.5px; }
html[data-text-size='xlarge'] { font-size: 19px; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: transparent; cursor: pointer; transition: background-color .14s, border-color .14s, color .14s, transform .14s; }
img, svg { max-width: 100%; display: block; }

/* Focus visible fuerte y consistente */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}
.btn:focus-visible,
.icon-button:focus-visible,
.text-size-control button:focus-visible,
.quick-row button:focus-visible {
  outline-offset: 2px;
}
.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

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

.shell { width: min(calc(100% - 32px), var(--shell)); margin-inline: auto; }
@media (min-width: 768px) { .shell { width: min(calc(100% - 48px), var(--shell)); } }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--ink);
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius);
}
.skip-link:focus { top: 16px; }

/* ---------- Live dot (pulse) ---------- */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(12, 74, 110, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(12, 74, 110, 0); }
}
.live-dot {
  display: inline-block; width: 7px; height: 7px; margin-right: 7px;
  border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 4px rgba(12, 74, 110, 0.15);
  animation: pulse-dot 2s ease-in-out infinite;
  vertical-align: middle;
}
:root[data-theme='dark'] .live-dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.20); }

/* ---------- Market strip (top, dark) ---------- */
.market-strip {
  background: #070a13; color: #94a3b8; font-size: 0.8125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.market-strip-inner {
  min-height: 36px; display: flex; align-items: center; justify-content: space-between;
}
.market-strip-inner > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.market-strip-inner > span:last-child  { color: #64748b; }
.market-strip-inner .live-dot { background: #38bdf8; }

@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.market-sync-line { position: relative; height: 2px; overflow: hidden; }
.market-sync-line::after {
  content: ''; display: block; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, #38bdf8 50%, transparent 100%);
  animation: shimmer 3s ease-in-out infinite;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.header-inner {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-symbol {
  position: relative; display: grid; place-items: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.brand-symbol-icon { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-wordmark { display: inline-flex; align-items: baseline; gap: 3px; font-size: 19px; letter-spacing: -0.03em; white-space: nowrap; }
.brand-wordmark > span { font-weight: 800; color: var(--ink); }
.brand-wordmark strong  { color: var(--teal); font: inherit; font-weight: 900; }

.desktop-nav { display: flex; align-items: stretch; gap: 28px; align-self: stretch; }
.desktop-nav a {
  position: relative; display: grid; place-items: center;
  color: var(--ink-soft); font-size: 0.875rem; font-weight: 600; transition: color .2s;
}
.desktop-nav a:hover, .desktop-nav a[aria-current='page'] { color: var(--ink); }
.desktop-nav a[aria-current='page']::after {
  content: ''; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--teal);
}
.desktop-nav .nav-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-glow); color: var(--teal);
  border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-button {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink-soft);
}
.icon-button:hover { border-color: var(--teal); color: var(--teal); background: var(--canvas); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#theme-toggle .icon-sun { display: none; }
#theme-toggle .icon-moon { display: block; }
:root[data-theme='dark'] #theme-toggle .icon-sun { display: block; }
:root[data-theme='dark'] #theme-toggle .icon-moon { display: none; }

.text-size-control { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.text-size-control button {
  min-width: 36px; height: 36px; padding: 0 8px;
  border: 0; border-right: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 0.8125rem; font-weight: 800;
  color: var(--ink-soft);
}
.text-size-control button:last-child { border-right: 0; }
.text-size-control button:hover, .text-size-control button[aria-pressed='true'] { background: var(--canvas); color: var(--ink); }

.mobile-menu-button { display: none; }
.mobile-nav { padding: 0 20px 18px; border-top: 1px solid var(--line); background: var(--paper); display: none; flex-direction: column; }
.mobile-nav a { display: block; padding: 12px 0; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-weight: 600; }
.mobile-nav a[aria-current='page'] { color: var(--teal); }

/* ---------- Hero ---------- */
.hero-band {
  position: relative;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 40px 0 48px;
  overflow: hidden;
}
.hero-band::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.45;
}
:root[data-theme='dark'] .hero-band::before { opacity: 0.6; }
.hero-band > .shell { position: relative; }

.hero-grid {
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; }
}

.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teal); background: var(--teal-glow);
  border: 1px solid color-mix(in srgb, var(--teal) 18%, transparent);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero-h1 {
  font-size: clamp(1.85rem, 1.2rem + 2.4vw, 2.85rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 16px;
  color: var(--ink);
}
.hero-lead {
  font-size: 1.0625rem; color: var(--ink-soft); line-height: 1.55; margin: 0 0 24px; max-width: 56ch;
}
.hero-validity {
  display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-top: 18px; border-top: 1px solid var(--line-soft);
  font-size: 0.8125rem; color: var(--ink-muted);
}
.hero-validity a { color: var(--teal); font-weight: 600; }
.hero-validity a:hover { text-decoration: underline; }

/* ---------- Hero value (left col, main) ---------- */
.hero-primary {
  display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(135deg, var(--canvas) 0%, color-mix(in srgb, var(--teal) 4%, var(--canvas)) 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 22px 24px;
  margin: 4px 0 24px;
  position: relative;
  overflow: hidden;
}
.hero-primary::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--teal) 10%, transparent) 0%, transparent 60%);
}
.hero-primary > * { position: relative; z-index: 1; }
.hero-primary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-primary-label { font-size: 0.75rem; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hero-primary-eyebrow { font-size: 0.7rem; font-weight: 700; color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); padding: 3px 8px; border-radius: 999px; letter-spacing: 0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hero-primary-value { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); font-weight: 900; letter-spacing: -0.02em; color: var(--teal); font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero-primary-sub { font-size: 0.8125rem; color: var(--ink-muted); }

.hero-spark { display: block; width: 100%; height: 56px; margin-top: 4px; }
.hero-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hero-spark .spark-line { fill: none; stroke: var(--teal); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.hero-spark .spark-area { fill: var(--teal); opacity: 0.10; }
.hero-spark .spark-dot { fill: var(--teal); }
.hero-spark .spark-zero { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.hero-spark-axis { display: flex; justify-content: space-between; font-size: 0.625rem; color: var(--ink-muted); letter-spacing: 0.04em; margin-top: -2px; font-variant-numeric: tabular-nums; }
.hero-spark-axis span { flex: 1; text-align: center; }
.hero-spark-axis span:first-child { text-align: left; }
.hero-spark-axis span:last-child  { text-align: right; }

.hero-footline { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; margin-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); font-size: 0.75rem; color: var(--ink-muted); }
.hero-footline strong { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-footline > span { white-space: nowrap; }

/* ---------- Converter card (right col) ---------- */
.converter-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 18px;
}
.converter-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; gap: 12px; }
.converter-title-group { display: flex; flex-direction: column; gap: 4px; }
.converter-title { margin: 0; font-size: 1.05rem; font-weight: 850; color: var(--ink); letter-spacing: -0.02em; }
.converter-subtitle { font-size: 0.75rem; color: var(--ink-muted); }
.converter-rate-pill {
  font-size: 0.7rem; font-weight: 800;
  background: var(--teal-glow); color: var(--teal);
  border: 1px solid color-mix(in srgb, var(--teal) 22%, transparent);
  padding: 4px 10px; border-radius: var(--radius);
  font-family: var(--font-mono); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.field-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 540px) { .field-row { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: var(--ink-muted); letter-spacing: 0.06em; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 0.9375rem;
  padding: 10px 12px; min-height: 44px;
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .14s, background .14s, box-shadow .14s;
  font-variant-numeric: tabular-nums;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--teal); background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
}
.field .hint { font-size: 0.75rem; color: var(--ink-muted); }
.field-error { color: var(--red); font-size: 0.8125rem; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius); font-weight: 800; font-size: 0.9375rem;
  cursor: pointer; border: 1px solid transparent;
  transition: background .14s, transform .14s;
}
.btn--primary { background: var(--teal); color: #fff; border-color: var(--teal-dark); }
.btn--primary:hover { background: var(--teal-dark); }
.btn--ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn--block { width: 100%; }
.btn { transition: background-color .14s, transform .1s ease, box-shadow .14s; }
.btn:active { transform: translateY(1px); }
.btn--primary:hover { box-shadow: 0 4px 12px color-mix(in srgb, var(--teal) 30%, transparent); }

/* Quick amount buttons (montos frecuentes) */
.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 4px; }
.quick-row-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: var(--ink-muted); letter-spacing: 0.06em; margin-right: 4px; }
.quick-row button {
  min-width: 52px; min-height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink-soft);
  font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.quick-row button:hover { border-color: var(--teal); color: var(--teal); }
.quick-row button[aria-pressed='true'] { background: var(--teal); color: #fff; border-color: var(--teal); }

/* Result block inside the converter card */
.converter-result {
  border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 14px;
  display: grid; grid-template-columns: 1fr; gap: 4px;
}
.converter-result[hidden] { display: none; }
.cr-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; min-width: 0; }
.cr-row + .cr-row { border-top: 1px dashed var(--line-soft); }
.cr-row dt { color: var(--ink-muted); font-size: 0.8125rem; margin: 0; font-weight: 600; flex-shrink: 0; }
.cr-row dd { margin: 0; font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 0; text-align: right; word-break: keep-all; overflow-wrap: anywhere; }
.cr-row.is-main dd { font-size: clamp(1.125rem, 0.9rem + 0.6vw, 1.5rem); color: var(--teal); letter-spacing: -0.01em; }
.cr-row.is-pos dd { color: var(--teal); }
.cr-row.is-neg dd { color: var(--red); }

.cr-row--breakdown dd { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-fuente { font-size: 0.75rem !important; font-weight: 600 !important; color: var(--ink-muted) !important; }
.cr-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 700; color: var(--teal);
  background: transparent; border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
  padding: 2px 8px; border-radius: 999px; cursor: pointer;
}
.cr-toggle::after { content: '+'; font-size: 0.875rem; line-height: 1; transition: transform .14s; }
.cr-toggle[aria-expanded='true']::after { content: '−'; }
.cr-breakdown {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px;
  max-height: 0; overflow: hidden; transition: max-height .25s ease;
  border-top: 1px dashed var(--line-soft);
  margin-top: 4px;
}
.cr-breakdown.is-open { max-height: 500px; padding-top: 10px; margin-top: 6px; }
.cr-breakdown li {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.75rem; color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  padding: 2px 0;
}
.cr-breakdown li strong { color: var(--ink); font-weight: 700; }
.cr-breakdown li.is-neg strong { color: var(--red); }
.cr-breakdown li.is-pos strong { color: var(--teal); }
@media (max-width: 380px) { .cr-breakdown { grid-template-columns: 1fr; } }
.cr-actions { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
.cr-actions .btn { flex: 1; min-height: 36px; padding: 0 12px; font-size: 0.8125rem; }

.converter-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

/* ---------- Value band (KPI strip) ---------- */
.value-band { background: var(--canvas); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 0; }
.value-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); overflow: hidden; }
@media (min-width: 720px) { .value-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.value-cell { padding: 18px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.value-cell:nth-child(2n) { border-right: 0; }
.value-cell:nth-last-child(-n+2) { border-bottom: 0; }
@media (min-width: 720px) {
  .value-cell { border-bottom: 0; }
  .value-cell:nth-child(2n) { border-right: 1px solid var(--line); }
  .value-cell:last-child { border-right: 0; }
}
.value-cell-label { display: block; font-size: 0.7rem; font-weight: 800; color: var(--ink-muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.value-cell-value { display: block; font-size: 1.25rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.value-cell-sub { display: block; font-size: 0.75rem; color: var(--ink-muted); margin-top: 2px; }

/* ---------- Generic section ---------- */
.section { padding: 56px 0; }
.section--alt { background: var(--canvas); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.section-head .section-kicker { display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.section-head .section-link { color: var(--teal); font-size: 0.8125rem; font-weight: 800; white-space: nowrap; }
.section-head .section-link:hover { text-decoration: underline; }

.section-intro { font-size: 0.9375rem; color: var(--ink-soft); max-width: 70ch; margin: 0 0 24px; }

/* ---------- Tool cards (number grid) ---------- */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
  transition: border-color .2s, transform .2s;
  color: var(--ink);
}
.tool-card:hover { border-color: var(--teal); transform: translateY(-2px); text-decoration: none; }
.tool-card .num { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 800; color: var(--teal); letter-spacing: 0.06em; }
.tool-card h3 { margin: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.tool-card p { margin: 0; font-size: 0.875rem; color: var(--ink-soft); line-height: 1.5; }
.tool-card .more { font-size: 0.8125rem; font-weight: 800; color: var(--teal); margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.tool-card .more::after { content: '→'; transition: transform .2s; }
.tool-card:hover .more::after { transform: translateX(3px); }

/* ---------- Tool extras (calculadoras especificas) ---------- */
.tools-extras { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 880px) { .tools-extras { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .tools-extras { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-extra {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow);
}
.tool-extra-head { display: flex; gap: 14px; align-items: flex-start; }
.tool-extra-num { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 800; color: var(--teal); letter-spacing: 0.06em; padding-top: 2px; flex-shrink: 0; }
.tool-extra-head h3 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.tool-extra-head p { margin: 0; font-size: 0.8125rem; color: var(--ink-soft); line-height: 1.5; }
.tool-extra-form { display: flex; flex-direction: column; gap: 10px; }
.tool-extra-form .field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tool-extra-form .field label { font-size: 0.7rem; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tool-extra-form input,
.tool-extra-form select {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font: 500 0.9375rem/1.4 var(--font-sans);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.tool-extra-form input:focus,
.tool-extra-form select:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
}
.tool-extra-actions { margin-top: 4px; }
.tool-extra-actions .btn { width: 100%; }

/* Variante: link card. Misma visual que un tool-extra pero es un <a>
   que lleva a la pagina dedicada correspondiente. Sin form ni resultado. */
.tool-extra--link {
  display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: var(--ink);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.tool-extra--link:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06); }
.tool-extra--link .more { display: inline-block; font-size: 0.8125rem; font-weight: 800; color: var(--teal); margin-top: 4px; }
.tool-extra--link:hover .more { text-decoration: underline; }
.tool-extra-result {
  display: flex; flex-direction: column; gap: 6px;
  margin: 0; padding: 14px 0 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.875rem;
}
.tool-extra-result .cr-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tool-extra-result .cr-row dt { color: var(--ink-muted); font-size: 0.8125rem; font-weight: 500; }
.tool-extra-result .cr-row dd { margin: 0; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tool-extra-result .cr-row.is-main dt { color: var(--ink); font-weight: 700; }
.tool-extra-result .cr-row.is-main dd {
  font-size: clamp(1.25rem, 1rem + 0.7vw, 1.625rem);
  font-weight: 900; color: var(--teal); letter-spacing: -0.02em;
  min-width: 0; word-break: keep-all; overflow-wrap: anywhere;
}
.tool-extra-result .cr-row.is-pos dd { color: var(--red); }
.tool-extra-result .cr-row.is-neg dd { color: var(--teal); }
.tool-extra-result .cr-fuente { font-size: 0.75rem; color: var(--ink-muted); font-weight: 500; }
@media (max-width: 380px) {
  .tool-extra-form .field-row { grid-template-columns: 1fr; }
  .tool-extra { padding: 18px; }
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
th { background: var(--canvas); font-weight: 800; text-transform: uppercase; font-size: 0.6875rem; letter-spacing: 0.1em; color: var(--ink-muted); }
tr:last-child td { border-bottom: 0; }
tr:nth-child(even) td { background: color-mix(in srgb, var(--canvas) 50%, var(--paper)); }
tr:hover td { background: var(--teal-glow); transition: background .14s; }
tr.is-current td { background: color-mix(in srgb, var(--teal) 9%, transparent); font-weight: 700; }

/* ---------- Chart (simple bars) ---------- */
.chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 200px; padding: 24px 0 0; margin: 16px 0 8px; }
.chart-bar { background: var(--teal); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; transition: background .2s, transform .2s; }
.chart-bar:hover { background: var(--teal-dark); transform: translateY(-2px); }
.chart-bar::after {
  content: attr(data-value) '%'; position: absolute; top: -22px; left: 50%;
  transform: translateX(-50%); font-size: 0.6875rem; color: var(--ink-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transition: opacity .14s; pointer-events: none;
}
.chart-bar:hover::after { opacity: 1; }
.chart-bar.is-neg { background: var(--red); }
.chart-labels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; font-size: 0.6875rem; color: var(--ink-muted); text-align: center; margin-top: 6px; }
.chart-labels span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* En pantallas chicas, ocultar labels de meses en el grafico: el usuario ve el
   tooltip y la tabla. Asi evitamos el apiñamiento a 320-360 px. */
@media (max-width: 480px) {
  .chart-labels { display: none; }
  .chart { height: 160px; }
}

.chart-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.chart-card-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.chart-card-head strong { font-size: 0.95rem; }
.chart-card-head span { color: var(--ink-muted); font-size: 0.75rem; font-weight: 600; }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 820px; margin: 0 auto; }
.faq-item {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s; overflow: hidden;
}
.faq-item:hover { border-color: var(--teal); }
.faq-item[open] { border-color: var(--teal); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); }
.faq-question {
  margin: 0; padding: 18px 22px;
  font-size: 0.9375rem; font-weight: 800; color: var(--ink);
  letter-spacing: -0.015em; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: ''; display: block; flex: 0 0 auto;
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
  transition: transform .2s;
}
.faq-item[open] .faq-question::after { transform: rotate(180deg); }
.faq-item[open] .faq-question { color: var(--teal); }
.faq-answer { margin: 0; padding: 0 22px 18px; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.65; }
.faq-answer p { margin: 0 0 8px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer code { background: var(--canvas); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 3px; font-size: 0.85em; font-family: var(--font-mono); }

/* ---------- Info block (left-accent) ---------- */
.info-block {
  background: var(--paper); border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 24px 28px; font-size: 0.9375rem; color: var(--ink-soft);
  line-height: 1.65;
}
.info-block p { margin: 0 0 10px; }
.info-block p:last-child { margin-bottom: 0; }
.info-block strong { color: var(--ink); }
.info-block ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Contexto historico del IPC ---------- */
.hist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); overflow: hidden; margin-bottom: 28px; }
@media (min-width: 720px) { .hist-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hist-card { padding: 18px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hist-card:nth-child(2n) { border-right: 0; }
.hist-card:nth-last-child(-n+2) { border-bottom: 0; }
@media (min-width: 720px) {
  .hist-card { border-bottom: 0; }
  .hist-card:nth-child(2n) { border-right: 1px solid var(--line); }
  .hist-card:last-child { border-right: 0; }
}
.hist-label { display: block; font-size: 0.7rem; font-weight: 800; color: var(--ink-muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.hist-value { display: block; font-size: clamp(1.25rem, 0.9rem + 0.8vw, 1.625rem); font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.hist-sub { display: block; font-size: 0.75rem; color: var(--ink-muted); margin-top: 4px; line-height: 1.4; }
@media (max-width: 720px) {
  .hist-card { padding: 14px 16px; }
  .hist-value { font-size: 1.0625rem; }
}

.hist-chart-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.hist-chart-title { margin: 0 0 16px; font-size: 0.95rem; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.hist-chart { display: grid; grid-template-columns: repeat(var(--hist-cols, 9), 1fr); gap: 8px; align-items: end; height: 180px; padding: 16px 0 0; }
.hist-bar { background: var(--teal); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; transition: background .2s, transform .2s; cursor: default; }
.hist-bar.is-low { background: color-mix(in srgb, var(--teal) 50%, var(--canvas)); }
.hist-bar.is-high { background: var(--red); }
.hist-bar.is-current { background: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 30%, transparent); }
.hist-bar:hover { transform: scaleY(1.03); transform-origin: bottom; }
.hist-bar::after { content: attr(data-value); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 0.6875rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.hist-bar:hover::after { opacity: 1; }
.hist-chart-axis { display: flex; gap: 8px; margin-top: 8px; }
.hist-chart-axis span { flex: 1; text-align: center; font-size: 0.7rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.hist-footnote { font-size: 0.75rem; color: var(--ink-muted); margin: 14px 0 0; line-height: 1.5; }
@media (max-width: 720px) {
  .hist-chart-wrap { padding: 18px; }
  .hist-chart { gap: 4px; height: 140px; }
}

/* ---------- Comparison grid (UF/UTM/UTA style) ---------- */
.cmp-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .cmp-grid { grid-template-columns: repeat(3, 1fr); } }
.cmp-col { border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas); padding: 22px; display: flex; flex-direction: column; gap: 12px; transition: border-color .2s; }
.cmp-col:hover { border-color: var(--teal); }
.cmp-col-head { border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; }
.cmp-col-head h3 { margin: 0; font-size: 1.25rem; font-weight: 900; color: var(--ink); letter-spacing: -0.01em; }
.cmp-col-head span { font-size: 0.7rem; color: var(--ink-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-top: 3px; }
.cmp-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.875rem; color: var(--ink-soft); }
.cmp-col li { line-height: 1.5; }
.cmp-col li strong { color: var(--ink); }

/* ---------- Contact card ---------- */
.contact-card {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 22px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--paper);
  box-shadow: var(--shadow);
}
.contact-card .btn { margin-left: auto; }
.contact-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: var(--canvas); border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--teal); flex-shrink: 0; }
.contact-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.contact-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.contact-label { color: var(--ink-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.contact-email { font-weight: 800; color: var(--ink); font-size: 0.9375rem; font-family: var(--font-mono); word-break: break-all; }
@media (max-width: 480px) {
  .contact-card { flex-direction: column; align-items: flex-start; }
  .contact-card .btn { margin-left: 0; width: 100%; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding-top: 56px; padding-bottom: 32px; color: var(--ink-soft); font-size: 0.875rem; margin-top: 64px; position: relative; }
.site-footer::before { content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent 0%, var(--teal) 50%, transparent 100%); opacity: 0.35; }
.footer-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.footer-brand { max-width: 460px; }
.footer-brand p { margin: 10px 0 0; color: var(--ink-muted); line-height: 1.55; font-size: 0.875rem; }
.footer-data-status { display: inline-flex; align-items: center; margin-top: 14px; font-size: 0.75rem; color: var(--ink-muted); }

.footer-nav-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 36px 0; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 720px) { .footer-nav-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
.footer-nav-grid h2 { margin: 0 0 14px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--ink); letter-spacing: 0.08em; }
.footer-nav-grid a { display: block; padding: 5px 0; color: var(--ink-muted); font-size: 0.875rem; }
.footer-nav-grid a { display: block; padding: 5px 0; color: var(--ink-muted); font-size: 0.875rem; transition: color .15s, padding-left .15s; }
.footer-nav-grid a:hover { color: var(--teal); padding-left: 4px; }

.footer-bottom { display: flex; justify-content: space-between; gap: 24px; font-size: 0.75rem; color: var(--ink-muted); padding-top: 20px; flex-wrap: wrap; }
.footer-bottom a { color: var(--ink-muted); }
.footer-bottom a:hover { color: var(--teal); }

/* ---------- Mobile nav responsive ---------- */
@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .mobile-menu-button { display: grid; }
  .header-inner { min-height: 64px; }
  .hero-band { padding: 28px 0 36px; }
  .footer-intro { flex-direction: column; gap: 20px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .text-size-control { display: none; }
  .brand-wordmark { font-size: 16px; }
  .brand-symbol { width: 32px; height: 32px; }
  .brand-symbol-icon { width: 16px; height: 16px; }
}

@media (max-width: 480px) {
  .shell { width: calc(100% - 24px); }
  .market-strip-inner { min-height: 30px; }
  .market-strip-inner > span:last-child { display: none; }
  .converter-card { padding: 18px; }
  .converter-header { flex-direction: column; gap: 8px; align-items: stretch; }
  .converter-rate-pill { align-self: flex-start; }
  .hero-h1 { font-size: 1.75rem; }
  .value-cell { padding: 14px 16px; }
  .value-cell-value { font-size: 1.0625rem; }
  .faq-question { padding: 14px 18px; font-size: 0.9rem; }
  .faq-answer { padding: 0 18px 14px; font-size: 0.85rem; }
  .footer-nav-grid { grid-template-columns: 1fr; gap: 18px; padding: 24px 0; }
  .info-block { padding: 18px 20px; }
  .tool-card { padding: 18px; }
  .table-wrap th, .table-wrap td { padding: 10px 12px; font-size: 0.8125rem; }
}

/* ---------- Print ---------- */
@media print {
  .market-strip, .site-header, .site-footer, .quick-row, .converter-actions { display: none; }
  body { background: #fff; color: #000; }
}
