*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg: #F6F2E9; --surface: #FFFFFF; --surface-elev: #FCFAF5;
    --border: #E3DCC9; --border-hover: #D0C6AC;
    --gold: #84652A; --gold-light: #7D5C12; --gold-accent: #C9A255;
    --text: #1E1B16; --text-secondary: #3D382F; --text-body: #5A5346; --text-muted: #6E675A;
    --terra: #A9603A; --terra-deep: #B0503F;
    --c-fund: #2A2622; --c-fund-fill: rgba(42,38,34,0.05);
    --terra-fill: rgba(169,96,58,0.08); --marker-bg: rgba(255,255,255,0.96);
    --bg-deep: #ECE6D6;
    --radius: 3px; --radius-lg: 3px;
  }
  [data-theme="dark"] {
    --bg: #0F0E0D; --surface: #161513; --surface-elev: #1C1A18;
    --border: #2A2825; --border-hover: #3D3830;
    --gold: #C9A255; --gold-light: #EFE4C2; --gold-accent: #C9A255;
    --text: #F0ECE4; --text-secondary: #C8C0B2; --text-body: #9B9080; --text-muted: #8A7D6A;
    --terra: #D08B5C; --terra-deep: #C76B4A;
    --c-fund: #F0ECE4; --c-fund-fill: rgba(240,236,228,0.06);
    --terra-fill: rgba(208,139,92,0.10); --marker-bg: rgba(22,21,19,0.96);
    --bg-deep: #0A0908;
  }
  body { font-family: 'Inter', sans-serif; font-weight: 400; background: var(--bg); color: var(--text); font-size: 15.5px; line-height: 1.65; }
  .sheet { max-width: 720px; margin: 0 auto; background: var(--bg); min-height: min(100vh, 1200px); }
  @media (min-width: 768px) {
    body { background: var(--bg-deep); }
    .sheet { box-shadow: 0 0 0 1px var(--border), 0 12px 40px rgba(30,27,22,0.08); margin: 32px auto; min-height: 0; border-radius: var(--radius-lg); overflow: hidden; }
  }
  ::selection { background: rgba(201,162,85,0.28); color: var(--text); }

  /* NAV Y FOOTER DEL SITIO */
  :root { --nav-bg: rgba(246,242,233,0.97); }
  [data-theme="dark"] { --nav-bg: rgba(0,0,0,0.94); }
  body { padding-top: 64px; }
  .site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
  .site-nav-in { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
  .site-brand { font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 400; color: var(--text); letter-spacing: 0.03em; text-decoration: none; line-height: 1.2; }
  .site-brand span { display: block; font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }
  .site-links { display: none; list-style: none; gap: 26px; margin: 0; padding: 0; }
  .site-links a { color: var(--text-muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; transition: color 0.2s; }
  .site-links a:hover, .site-links a.on { color: var(--gold); }
  .site-links a.pill, .site-links a.pill.on { background: var(--gold); color: #fff; padding: 7px 16px; border-radius: 3px; }
  .site-links a.pill:hover { opacity: 0.85; color: #fff; }
  .site-burger { background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; gap: 5px; padding: 8px; }
  .site-burger span { display: block; width: 22px; height: 1.5px; background: var(--text); transition: all 0.3s; }
  .site-burger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
  .site-burger.open span:nth-child(2) { opacity: 0; }
  .site-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }
  .site-menu { display: none; background: var(--nav-bg); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 6px 20px 14px; }
  .site-menu.open { display: block; }
  .site-menu a.pill { background: var(--gold); color: #fff !important; border-radius: 3px; text-align: center; border-bottom: none !important; margin: 8px 0; }
  .site-menu a { display: block; padding: 13px 0; color: var(--text); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--border); }
  @media (min-width: 768px) {
    body { padding-top: 72px; }
    .site-nav-in { padding: 0 40px; height: 72px; }
    .site-links { display: flex; }
    .site-burger, .site-menu { display: none !important; }
  }
  #avisoBar { display: none; position: fixed; top: 64px; left: 0; right: 0; z-index: 90; background: var(--surface); border-bottom: 2px solid var(--gold-accent); box-shadow: 0 8px 24px rgba(30,27,22,.15); }
  #avisoBar .in { max-width: 1280px; margin: 0 auto; padding: 11px 20px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
  #avisoBar p { flex: 1; min-width: 240px; font-size: 12.5px; color: var(--text-body); line-height: 1.55; margin: 0; }
  #avisoBar strong { color: var(--text); }
  @media (min-width: 768px) { #avisoBar { top: 72px; } }
  .site-footer { border-top: 1px solid var(--border); padding: 32px 20px; }
  .site-footer-in { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px; }
  .sf-name { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 500; color: var(--text); }
  .sf-reg { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.8; }
  .sf-reg a, .sf-right a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
  .sf-ver { font-size: 10px; letter-spacing: 0.12em; color: var(--text-muted); text-transform: uppercase; margin-top: 10px; }
  .sf-right { font-size: 12px; color: var(--text-muted); text-align: right; line-height: 2; margin-left: auto; }

  /* HEADER */
  .header { background: var(--surface); padding: 2.5rem 1.5rem 2rem; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
  .header::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--gold-accent); }
  .header-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.85rem; }
  .header h1 { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 400; color: var(--text); line-height: 1.15; margin-bottom: 0.75rem; }
  .header h1 em { color: var(--gold); font-style: italic; font-weight: 400; }
  .header-sub { font-size: 13px; color: var(--text-body); line-height: 1.6; }
  .header-meta { margin-top: 1.5rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
  .meta-item { display: flex; flex-direction: column; gap: 2px; }
  .meta-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
  .meta-value { font-size: 15px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }

  /* SLIDERS PANEL */
  .sliders-panel {
    background: var(--surface-elev);
    border-bottom: 2px solid var(--gold);
    padding: 1rem 1.25rem;
  }
  .sliders-title {
    font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 0.75rem;
  }
  .slider-group { margin-top: 1.9rem; }
  .slider-group:first-of-type { margin-top: 0.35rem; }
  .header-inv { margin-top: 1.5rem; }
  .header-inv .slider-item { max-width: 520px; }
  .group-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 0.85rem; }
  .group-title { font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 0; padding: 4px 12px; border-radius: 20px; display: inline-block; }
  .group-title.gt-fund { color: var(--c-fund); background: var(--c-fund-fill); }
  .group-title.gt-prop { color: var(--terra); background: var(--terra-fill); }
  .group-title-note { font-size: 12.5px; font-weight: 600; color: var(--terra); font-variant-numeric: tabular-nums; }
  .slider-item--gap { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px dashed var(--border); }
  .sliders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 1.25rem;
  }
  .slider-item { display: flex; flex-direction: column; gap: 2px; }
  .slider-header { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
  .slider-item label { font-size: 13.5px; color: var(--text-secondary); line-height: 1.3; flex: 1; min-width: 0; }
  .slider-val {
    font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
    color: var(--gold); white-space: nowrap; flex-shrink: 0;
  }
  .slider-item input[type=range] {
    width: 100%; height: 6px; appearance: none; -webkit-appearance: none;
    background: var(--border); border-radius: 2px; outline: none; cursor: pointer;
    margin: 1px 0;
  }
  .slider-item input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
    background: var(--gold); cursor: pointer; border: 2px solid var(--surface-elev);
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  }
  .slider-item input[type=range]::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--gold); cursor: pointer; border: 2px solid var(--surface-elev);
  }
  .slider-ref { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
  .ref-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .sliders-footer { display: flex; justify-content: flex-end; margin-top: 0.65rem; }
  .reset-btn {
    padding: 8px 14px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; font-family: 'Inter', sans-serif;
    background: transparent; border: 1px solid var(--border-hover); color: var(--text-body);
    border-radius: var(--radius); cursor: pointer; letter-spacing: 0.05em; transition: all 0.2s;
  }
  .reset-btn:hover { border-color: var(--gold); color: var(--gold); }
  @media (max-width: 560px) {
    .sliders-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 600px) {
    .hdr-btns { position: static; flex-direction: row; justify-content: flex-end; margin: 0 0 14px; }
    .chart-container { margin-left: -1.25rem; margin-right: -1.25rem; border-left: 0; border-right: 0; border-radius: 0; padding-left: 0.5rem; padding-right: 0.5rem; }
    .chart-wrap { height: 300px; }
  }

  /* MAIN */
  .main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
  .intro-box { background: transparent; border: 0; padding: 0.25rem 0; margin: 1.5rem 0; font-size: 14px; color: var(--text-body); line-height: 1.7; }
  @media (min-width: 768px) {
    .intro-box { background: var(--surface); border-left: 3px solid var(--gold-accent); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; padding: 1rem 1.25rem; }
  }
  .intro-box strong { color: var(--text); font-weight: 400; }

  /* SECTION */
  .section-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 2rem 0 0.6rem; }
  .section-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); margin-bottom: 1rem; line-height: 1.3; }
  .assump-disclaimer { font-size: 11.5px; font-style: italic; color: var(--text-muted); line-height: 1.4; margin: -0.6rem 0 1rem; }

  /* SUPUESTOS */
  .supuestos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1.5rem; }
  .supuesto-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.9rem 1rem; }
  .supuesto-card .s-label { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; line-height: 1.3; }
  .supuesto-card .s-val { font-size: 19px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
  .supuesto-card .s-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
  .supuesto-card.accent .s-val { color: var(--gold); }

  /* METRICS */
  .metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1.5rem; }
  .metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; position: relative; transition: all 0.3s; }
  .metric-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .metric-card.fund::before { background: var(--c-fund); }
  .metric-card.prop::before { background: var(--terra); }
  .metric-card.dep::before  { background: var(--gold); }
  .metric-card.diff::before { background: var(--gold-accent); }
  .metric-card .m-label { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; line-height: 1.3; }
  .metric-card .m-val { font-size: 20px; font-weight: 600; line-height: 1.1; transition: color 0.3s; font-variant-numeric: tabular-nums; }
  .metric-card.fund .m-val { color: var(--text); }
  .metric-card.prop .m-val { color: var(--terra); }
  .metric-card.dep  .m-val { color: var(--gold); }
  .metric-card.diff .m-val { color: var(--gold-light); }
  .metric-card .m-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

  /* CHART */
  .chart-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1rem 1rem; margin-bottom: 1.5rem; }
  .chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1rem; }
  .leg-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-body); }
  .leg-sq { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
  .chart-wrap { position: relative; width: 100%; height: 280px; }

  /* TABLA */
  .table-wrap { overflow-x: auto; margin-bottom: 1.5rem; -webkit-overflow-scrolling: touch; }
  table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 460px; font-variant-numeric: tabular-nums; }
  thead tr { background: var(--surface-elev); }
  thead th { color: var(--gold); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; padding: 8px 10px; text-align: right; white-space: nowrap; }
  thead th:first-child { text-align: left; }
  tbody tr:nth-child(even) { background: var(--surface); }
  tbody tr:nth-child(odd)  { background: var(--bg); }
  tbody tr:last-child { background: var(--surface-elev); }
  tbody tr:last-child td { color: var(--text); font-weight: 500; }
  tbody td { padding: 7px 10px; text-align: right; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
  tbody td:first-child { text-align: left; font-weight: 400; color: var(--text); }
  .td-fund { color: var(--text-secondary); font-weight: 500; }
  .td-prop { color: var(--terra); font-weight: 500; }
  .td-gasto { color: var(--terra-deep); }
  .td-note { display: block; font-size: 10px; line-height: 1.3; color: var(--text-secondary); font-weight: 400; margin-top: 1px; white-space: normal; }
  .td-dep  { color: var(--gold); }
  .td-total { color: var(--gold); font-weight: 500; }

  /* FISCAL */
  .fiscal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.5rem; }
  .fiscal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; }
  .fiscal-card h4 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
  .f-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border); gap: 6px; color: var(--text-body); }
  .f-row:last-child { border-bottom: none; font-weight: 500; font-size: 13px; color: var(--text); padding-top: 8px; }
  .f-row .famt { white-space: nowrap; font-weight: 400; color: var(--text-secondary); }
  .f-row .fneg { white-space: nowrap; font-weight: 500; color: var(--terra-deep); }
  .f-row .ftotal-fund { color: var(--text); font-weight: 600; }
  .f-row .ftotal-prop { color: var(--terra); font-weight: 600; }

  /* CALLOUT */
  .callout { background: rgba(201,162,85,0.06); border: 1px solid rgba(201,162,85,0.22); border-left: 3px solid var(--gold-accent); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.5rem; color: var(--text-body); font-size: 14px; line-height: 1.7; }
  .callout strong { color: var(--gold-light); font-weight: 400; }

  .verdict-box { background: rgba(201,162,85,0.06); border: 1px solid rgba(201,162,85,0.22); border-left: 3px solid var(--gold-accent); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; margin: 0 0 1.5rem; }
  .verdict-title { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; color: var(--gold-light); margin-bottom: 0.35rem; }
  .verdict { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--text-body); }
  .verdict strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
  .verdict .vd-diff { color: var(--gold); }
  .cta { background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--gold-accent); border-radius: var(--radius-lg); padding: 1.5rem 1.25rem; margin: 2rem 0 1.25rem; }
  .cta-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); margin-bottom: 0.5rem; }
  .cta-text { font-size: 14px; color: var(--text-body); line-height: 1.7; margin-bottom: 1rem; }
  .cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .cta-btn { display: inline-block; padding: 11px 18px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--gold-light); background: var(--surface-elev); border: 1px solid var(--border-hover); border-radius: var(--radius); cursor: pointer; font-family: 'Inter', sans-serif; }
  .cta-btn.primary { border-color: var(--gold); color: var(--gold); }
  .cta-btn:hover { border-color: var(--gold); }
  .disclaimer { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
  .disclaimer strong { color: var(--text-secondary); font-weight: 400; }
  .disclaimer a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

  /* FOOTER */
  .footer { background: var(--surface); padding: 1.25rem 1.5rem; text-align: center; border-top: 1px solid var(--border); }
  .footer-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-weight: 400; color: var(--text); letter-spacing: 0.05em; margin-bottom: 4px; }
  .footer-sub { font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }

  .hdr-btns { position: absolute; top: 14px; right: 14px; z-index: 5; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
  .share-mini { display: inline-flex; align-items: center; padding: 7px 10px; }
  .sec-row { display: flex; justify-content: space-between; align-items: center; margin: 2rem 0 0.6rem; }
  .theme-btn { background: var(--surface-elev); border: 1px solid var(--border); color: var(--gold-light); font-family: 'Inter'; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 7px 12px; border-radius: var(--radius); cursor: pointer; }
  .theme-btn:hover { border-color: var(--gold); }
  .footer-version { font-size: 10px; letter-spacing: 0.12em; color: var(--text-muted); text-transform: uppercase; margin-top: 8px; }
  .tbl-details { margin: 2rem 0 1.5rem; }
  .tbl-details summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
  .tbl-details summary::-webkit-details-marker { display: none; }
  .tbl-details summary::before { content: '▸'; color: var(--gold); font-size: 13px; transition: transform 0.2s; }
  .tbl-details[open] summary::before { transform: rotate(90deg); }
  @media (max-width: 480px) {
    .header { padding: 2rem 1.25rem 1.75rem; }
    .chart-wrap { height: 240px; }
    .metric-card .m-val { font-size: 1.3rem; }
  }
  @media (max-width: 560px) {
    .supuestos-grid, .metrics-grid, .fiscal-cols { grid-template-columns: 1fr; }
  }
.js-required-msg { position: fixed; inset: 0; z-index: 998; background: #0F0E0D; color: #C8C0B2; display: flex; align-items: center; justify-content: center; text-align: center; padding: 32px; font-family: sans-serif; line-height: 1.7; }
  .js .js-required-msg { display: none; }