/* MHDS — Manual de Herramientas de Diseño Sostenible */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --sage: #5c7268;
  --sage-dark: #48584f;
  --sage-light: #8ba192;
  --paper: #fafaf7;
  --ink: #2c3733;
  --ink-soft: #55625c;
  --line: #e2e5e0;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(44,55,51,.08);
  --shadow-lg: 0 12px 40px rgba(44,55,51,.22);
}

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}
img { max-width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--sage) 0%, var(--sage-dark) 100%);
  color: #fff;
  padding: 76px 24px 88px;
}
.hero-inner { max-width: 880px; margin: 0 auto; }
.hero-kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; opacity: .85; margin-bottom: 14px; }
.hero-thesis {
  font-size: .8rem; letter-spacing: .1em; line-height: 1.6;
  text-transform: uppercase; font-weight: 600; opacity: .92;
}
.hero-thesis-sub { text-transform: lowercase; font-weight: 400; opacity: .85; }
.hero h1 { font-size: clamp(1.5rem, 3.4vw, 2.5rem); line-height: 1.25; font-weight: 800; letter-spacing: .01em; margin-top: 20px; }
.hero-authors { margin-top: 16px; font-weight: 600; opacity: .9; }
.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .95rem; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.btn-light { background: #fff; color: var(--sage-dark); }
.btn-outline { border: 1.5px solid rgba(255,255,255,.8); color: #fff; }

/* ---------- Nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  background: rgba(250,250,247,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 10px 22px;
}
.nav-brand { font-weight: 800; font-size: 1.15rem; color: var(--sage-dark); text-decoration: none; letter-spacing: .06em; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links > a, .nav-item > a {
  display: block; color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: 7px 12px; border-radius: 8px; white-space: nowrap;
}
.nav-links > a:hover, .nav-item > a:hover { background: var(--line); color: var(--ink); }
#searchbox {
  margin-left: auto; width: min(340px, 42vw);
  padding: 9px 16px; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: .92rem; background: #fff; color: var(--ink); outline: none;
}
#searchbox:focus { border-color: var(--sage-light); }

/* Menú desplegable (hover) */
.nav-item { position: relative; }
.nav-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; min-width: 280px; z-index: 60;
}
.nav-item:hover > .nav-menu, .nav-item:focus-within > .nav-menu { display: block; }
.nav-cat { position: relative; }
.nav-cat > a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--ink); font-size: .88rem; font-weight: 600;
}
.nav-cat > a:hover { background: #f0f3ee; }
.nav-cat .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #999); flex-shrink: 0; }
.nav-cat-name { flex: 1; }
.nav-caret { color: var(--sage-light); font-weight: 700; }
.nav-sub {
  display: none; position: absolute; left: 100%; top: -7px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; min-width: 320px; max-width: 380px;
  max-height: 70vh; overflow-y: auto; z-index: 61;
}
.nav-cat:hover > .nav-sub, .nav-cat:focus-within > .nav-sub { display: block; }
.nav-sub a {
  display: block; padding: 7px 10px; border-radius: 6px; text-decoration: none;
  color: var(--ink-soft); font-size: .82rem; line-height: 1.4;
}
.nav-sub a:hover { background: #f0f3ee; color: var(--ink); }
.nav-sub a b { color: var(--c, var(--sage)); letter-spacing: .05em; margin-right: 4px; }

/* ---------- Secciones ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 64px 22px 30px; }
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; color: var(--sage-dark);
  padding-bottom: 12px; border-bottom: 4px solid var(--sage); margin-bottom: 10px; letter-spacing: .02em;
}
.section-hint { color: var(--ink-soft); font-size: .92rem; margin-bottom: 26px; }
.results-note { padding-top: 40px; padding-bottom: 0; font-size: .95rem; color: var(--ink-soft); font-weight: 600; }

/* ---------- Bloques de introducción (compactos) ---------- */
#introduccion.section { padding-top: 46px; }
#introduccion .section-hint { margin-bottom: 16px; }
.intro-block {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; overflow: hidden;
}
.intro-block summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; font-weight: 600; font-size: .92rem; color: var(--sage-dark);
  user-select: none;
}
.intro-block summary::-webkit-details-marker { display: none; }
.intro-block summary::after { content: '+'; margin-left: auto; font-size: 1.2rem; font-weight: 400; color: var(--sage-light); transition: transform .2s; }
.intro-block[open] summary::after { transform: rotate(45deg); }
.intro-block summary:hover { background: #f4f6f3; }
.intro-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px;
  background: #eef1ec; color: var(--sage); display: grid; place-items: center;
  font-size: .76rem; font-weight: 700;
}
.intro-body { padding: 2px 20px 20px; font-size: .95rem; }
.intro-body p { margin-bottom: 12px; }
.intro-body h3 { color: var(--sage-dark); font-size: 1.05rem; margin: 16px 0 8px; letter-spacing: .02em; }
.intro-body h4 { color: var(--sage-dark); font-style: italic; margin: 12px 0 5px; }
.intro-figure {
  display: block; margin: 16px auto 6px; max-height: 380px; object-fit: contain;
  background: #fff;
}
.etiqueta-img { max-height: 330px; }

.concept-grid, .pa-grid { display: grid; gap: 12px; margin: 14px 0; }
.concept-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.concept-card { background: #f4f6f3; border-radius: 12px; padding: 16px; border-left: 5px solid var(--sage); }
.concept-card img { height: 76px; display: block; margin: 0 auto 10px; object-fit: contain; mix-blend-mode: multiply; }
.concept-card h4 { margin: 0 0 6px; }
.concept-card p { margin: 0; font-size: .93rem; }

.pa-grid { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.pa-card { border-radius: 12px; padding: 18px; }
.pa-card img { height: 100px; display: block; margin: 0 auto 12px; object-fit: contain; mix-blend-mode: multiply; }
.pa-card h4 { font-style: normal; font-size: 1.1rem; margin: 0 0 8px; letter-spacing: .05em; }
.pa-card p { margin: 0; font-size: .94rem; }
.pa-pasiva { background: #eef3e4; border-left: 5px solid #7ca23c; }
.pa-pasiva h4 { color: #5a7a24; }
.pa-activa { background: #fdeee4; border-left: 5px solid #e56f2c; }
.pa-activa h4 { color: #c2571a; }

.balde {
  display: flex; gap: 20px; align-items: center; background: #f0f5f8;
  border-radius: 12px; padding: 18px; margin: 12px 0;
}
.balde img { height: 140px; flex-shrink: 0; object-fit: contain; mix-blend-mode: multiply; }
.balde p { margin: 0; font-size: .95rem; }

.ods-badges { display: flex; gap: 22px; margin: 10px 0 18px; flex-wrap: wrap; align-items: center; justify-content: center; }
.ods-badges img { height: 62px; object-fit: contain; mix-blend-mode: multiply; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; margin: 16px 0 6px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; background: #fff; }
.k-table th, .k-table td { padding: 10px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.k-table thead th { background: #eef1ec; color: var(--sage-dark); font-size: .84rem; }
.k-table td:first-child { font-weight: 800; }
.k-table tr.lvl-a  { background: #ecf6ef; }
.k-table tr.lvl-b1 { background: #f5f8e7; }
.k-table tr.lvl-b  { background: #fdf6e2; }
.k-table tr.lvl-c  { background: #fceceb; }
.k-table tr.lvl-a  td:first-child { background: #1e8f4e; color: #fff; }
.k-table tr.lvl-b1 td:first-child { background: #a2c827; color: #3c470e; }
.k-table tr.lvl-b  td:first-child { background: #f5c31d; color: #5c4404; }
.k-table tr.lvl-c  td:first-child { background: #e6564e; color: #fff; }
.caption { font-size: .82rem; font-style: italic; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Tips ---------- */
.tipbox {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1.5px solid var(--c, var(--sage-light)); border-radius: 12px;
  padding: 14px 18px; margin: 16px 0; background: #fff;
}
.tip-icon { font-size: 1.4rem; line-height: 1.2; }
.tipbox p { margin: 0; font-size: .95rem; }
.tipbox b { color: var(--c, var(--sage-dark)); }

/* ---------- Banner de tipo (PASIVAS / ACTIVAS) ---------- */
.type-section { margin-top: 46px; }
.type-banner {
  background: linear-gradient(160deg, var(--sage) 0%, var(--sage-dark) 100%);
  color: #fff; padding: 46px 22px 40px;
}
.type-banner-inner { max-width: 1076px; margin: 0 auto; }
.type-banner-pre { font-size: 1.05rem; font-weight: 300; letter-spacing: .3em; opacity: .85; }
.type-banner h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.type-body { padding-top: 30px; }

/* Chips de categorías, dentro de la franja */
.type-banner .cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  border: 1px solid transparent; background: #fff; color: var(--ink);
  border-radius: 9px; padding: 8px 14px; font-size: .85rem; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; transition: all .15s ease;
}
.chip-cat .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c, #999); flex-shrink: 0; }
.chip-cat:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.25); }

/* ---------- Secciones de categoría (desplegables) ---------- */
.cat-section { margin-bottom: 14px; scroll-margin-top: 70px; }
.cat-header {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: stretch; gap: 0;
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.cat-header::-webkit-details-marker { display: none; }
.cat-icon {
  background: var(--c); width: 92px; min-height: 68px; flex-shrink: 0;
  display: grid; place-items: center;
}
.cat-icon img { width: 62px; height: 52px; object-fit: contain; }
.cat-header-text {
  flex: 1; background: #fff; border: 1px solid var(--line); border-left: none;
  border-radius: 0 12px 12px 0; display: flex; align-items: center; gap: 14px; padding: 10px 20px;
}
.cat-header:hover .cat-header-text { background: #f7f9f6; }
.cat-num { font-size: clamp(1rem, 2.2vw, 1.3rem); font-weight: 800; color: var(--c); letter-spacing: .03em; }
.cat-tag { color: var(--ink-soft); font-weight: 600; }
.cat-arrow { margin-left: auto; flex-shrink: 0; color: var(--c); transition: transform .2s ease; }
.cat-section[open] .cat-arrow { transform: rotate(180deg); }
.cat-content { padding: 4px 2px 26px; }

.cat-intro {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 22px; margin: 14px 0; font-size: .95rem;
}
.cat-intro p { margin-bottom: 10px; }
.cat-intro p:last-child { margin-bottom: 0; }
.group-title-inline { font-weight: 700; font-style: italic; color: var(--ink-soft); }
.veg-list { padding-left: 20px; margin: 4px 0 12px; }
.veg-list li { margin-bottom: 7px; }
.veg-list b { color: var(--c); }

.group-title { font-size: 1rem; font-weight: 700; font-style: italic; color: var(--ink-soft); margin: 22px 4px 12px; }

/* ---------- Subcategorías desplegables ---------- */
.group-section { margin: 12px 0; scroll-margin-top: 76px; }
.group-summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c, var(--sage));
  border-radius: 10px; padding: 11px 16px;
  font-weight: 700; color: var(--ink);
  transition: background .15s ease;
}
.group-summary::-webkit-details-marker { display: none; }
.group-summary:hover { background: #f7f9f6; }
.group-name { font-size: .98rem; letter-spacing: .01em; }
.group-count {
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  background: #f0f2ee; color: var(--ink-soft);
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.group-arrow { margin-left: auto; flex-shrink: 0; color: var(--c, var(--sage)); transition: transform .2s ease; }
.group-section[open] > .group-summary .group-arrow { transform: rotate(180deg); }
.group-section[open] > .group-summary { border-radius: 10px 10px 0 0; background: #f7f9f6; }
.group-content { padding: 4px 6px 10px; }

/* Etiquetas de subcategoría dentro del menú del nav */
.nav-sub-group {
  display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft) !important;
  background: #f4f6f3; padding: 6px 14px !important; margin-top: 2px;
}

/* ---------- Comparador de transmitancia (K) ---------- */
.cmp-section > .group-summary { border-left-color: var(--sage); background: #eef4f8; }
.cmp-intro { font-size: .93rem; margin: 14px 4px 16px; color: var(--ink); }
.cmp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cmp-tab { border-color: var(--line); box-shadow: var(--shadow); }
.cmp-tab.is-on { background: var(--sage); color: #fff; border-color: var(--sage); }

.cmp-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.cmp-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow); min-width: 0;
}
.cmp-label { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.cmp-select {
  width: 100%; margin-top: 6px; padding: 9px 10px; font-family: inherit; font-size: .88rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); cursor: pointer;
}
.cmp-select:focus { outline: 2px solid var(--sage-light); outline-offset: 1px; }
.cmp-card-body { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.cmp-card-data { min-width: 0; flex: 1; }
.cmp-thumb {
  width: 104px; height: 104px; flex-shrink: 0; object-fit: contain;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px;
  mix-blend-mode: multiply;
}
.cmp-k { margin: 0 0 8px; font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.cmp-k span { font-size: 2rem; font-weight: 800; color: var(--sage-dark); letter-spacing: -.02em; margin-right: 4px; }
.cmp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; }
.cmp-meta a { color: var(--sage); font-weight: 700; text-decoration: none; }
.cmp-meta a:hover { text-decoration: underline; }
.cmp-swap {
  width: 40px; height: 40px; flex-shrink: 0; cursor: pointer; font-family: inherit; font-size: 1.1rem;
  border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--sage-dark);
  transition: background .15s ease, transform .15s ease;
}
.cmp-swap:hover { background: var(--sage); color: #fff; transform: rotate(180deg); }

.cmp-verdict-box {
  background: #eef4f8; border: 1px solid #cfe3ee; border-radius: 12px;
  padding: 18px 22px; margin: 18px 0 8px;
}
.cmp-verdict { font-size: 1.05rem; line-height: 1.7; margin: 0; }
.cmp-ico {
  width: 30px; height: 30px; object-fit: contain; vertical-align: -9px;
  background: #fff; border: 1px solid #cfe3ee; border-radius: 7px; padding: 1px;
  margin-right: 4px; mix-blend-mode: multiply;
}
.cmp-ratio { color: #1c6f9c; font-size: 1.2em; }
.cmp-sub { font-size: .9rem; color: var(--ink-soft); margin: 10px 0 0; }

.cmp-rank-title { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 800; margin: 24px 0 12px; }
.cmp-rank { position: relative; }
.cmp-row { display: grid; grid-template-columns: 30px 185px 1fr 58px; gap: 10px; align-items: center; padding: 5px 0; }
.cmp-row-ico { width: 30px; height: 30px; object-fit: contain; mix-blend-mode: multiply; opacity: .75; }
.cmp-row.is-sel .cmp-row-ico { opacity: 1; }
.cmp-row-label { font-size: .82rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-row-label b { color: var(--ink); letter-spacing: .05em; margin-right: 4px; }
.cmp-bar-track { display: block; background: #eef1ec; border-radius: 5px; height: 17px; overflow: hidden; }
.cmp-bar { display: block; height: 100%; border-radius: 5px; background: var(--sage-light); transition: width .25s ease; }
.cmp-bar.iram-a { background: #1e8f4e; } .cmp-bar.iram-b { background: #f5a91d; }
.cmp-bar.iram-c { background: #a2c827; } .cmp-bar.iram-no { background: #e6564e; }
.cmp-row-k { font-size: .82rem; font-weight: 700; text-align: right; color: var(--ink); }
.cmp-row.is-sel .cmp-row-label { color: var(--ink); font-weight: 700; }
.cmp-row.is-sel .cmp-bar-track { outline: 2px solid var(--sage-dark); outline-offset: 2px; border-radius: 5px; }
.cmp-limits { position: absolute; top: 22px; bottom: 4px; left: 235px; right: 68px; pointer-events: none; }
.cmp-limit { position: absolute; top: 0; bottom: 0; }
.cmp-limit i { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed #7b8a83; }
.cmp-limit b { position: absolute; top: -18px; transform: translateX(-50%); font-size: .64rem; font-weight: 800; color: #6b7a73; letter-spacing: .06em; }
/* Botón de info del encabezado */
.info-btn {
  width: 23px; height: 23px; flex-shrink: 0; margin-left: auto; cursor: pointer;
  border: 1.5px solid var(--sage); border-radius: 50%; background: #fff;
  color: var(--sage-dark); font-family: inherit; font-size: .82rem; font-weight: 800; line-height: 1;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.info-btn:hover { background: var(--sage); color: #fff; transform: scale(1.12); }
.group-summary .info-btn + .group-arrow { margin-left: 10px; }

/* Ventana flotante con la tabla de K */
.kmodal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30,38,34,.5); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: km-fade .2s ease;
}
.kmodal[hidden] { display: none; }
.kmodal-box {
  position: relative; width: min(620px, 100%); max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 34px 32px 26px;
  animation: km-pop .24s ease;
}
@keyframes km-fade { from { opacity: 0; } }
@keyframes km-pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.kmodal-title { font-size: 1.12rem; font-weight: 800; color: var(--sage-dark); letter-spacing: .02em; }
.kmodal-lead { font-size: .9rem; color: var(--ink-soft); margin-top: 8px; }
.kmodal-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
  border: none; border-radius: 50%; background: #eef1ec; color: var(--ink);
  font-size: .95rem; font-family: inherit; cursor: pointer; transition: background .15s ease;
}
.kmodal-close:hover { background: var(--line); }
.kmodal-link { display: inline-block; margin-top: 12px; font-size: .85rem; font-weight: 700; color: var(--sage); text-decoration: none; }
.kmodal-link:hover { text-decoration: underline; }

/* Avisos generales al pie de una subcategoría */
.group-notes { margin-top: 18px; }

.cmp-legend { font-size: .78rem; font-style: italic; color: var(--ink-soft); margin-top: 14px; }

/* ---------- Fichas de estrategia (código · título | imagen | descripción) ---------- */
.st-grid { margin-bottom: 8px; }
.st-item {
  scroll-margin-top: 80px;
  display: grid; grid-template-columns: 170px 300px minmax(0, 1fr);
  gap: 10px 32px; align-items: center;
  padding: 22px 0; border-bottom: 3px solid var(--c, var(--sage));
}
.st-item.flash { animation: stflash 1.8s ease; }
@keyframes stflash {
  0%, 55% { background: #eef4e9; box-shadow: 0 0 0 8px #eef4e9; }
  100% { background: transparent; box-shadow: 0 0 0 8px transparent; }
}
.st-code { display: block; font-size: .85rem; font-weight: 800; color: var(--c); letter-spacing: .08em; margin-bottom: 6px; }
.st-title { font-size: 1.02rem; line-height: 1.3; font-weight: 800; }
.st-media { display: grid; place-items: center; }
.st-media img { max-height: 200px; object-fit: contain; }
.st-body { font-size: .92rem; min-width: 0; }
.st-text { color: var(--ink); line-height: 1.55; margin: 6px 0; }
.st-label { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; margin: 8px 0 4px; }
.st-capas { padding-left: 18px; margin: 0 0 8px; }
.st-capas li { margin-bottom: 3px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px; }
.iram-badge { font-size: .7rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; color: #fff; }
.iram-no { background: #e6564e; }
.iram-a { background: #1e8f4e; } .iram-b { background: #f5a91d; } .iram-c { background: #a2c827; color: #47530f; }
.data-badge {
  font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: #f0f2ee; color: var(--ink-soft);
}

/* ---------- Colores oscuros/claros + ventajas/desventajas ---------- */
.vd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 10px 0; }
.vd-col { border-radius: 12px; padding: 16px 18px; }
.vd-col ul { padding-left: 18px; font-size: .88rem; }
.vd-col li { margin-bottom: 7px; }
.vd-col h5 { margin: 0 0 10px; font-size: .92rem; }
.vd-col h5 small { font-weight: 400; font-size: .8rem; }
.color-oscuros { background: #3d4540; color: #fff; }
.color-oscuros h5 { color: #fff; }
.color-claros { background: #f2f1ec; border: 1px solid var(--line); }
.vd-ventajas { background: #eef5e8; } .vd-ventajas h5 { color: #55803a; }
.vd-desventajas { background: #faeceb; } .vd-desventajas h5 { color: #b8453e; }

/* Ciclos (aerotermia, caldera) y tabla de artefactos */
.ciclo { background: #f4f6f3; border-radius: 12px; padding: 16px 20px; margin: 12px 0; font-size: .9rem; }
.ciclo p.ciclo-intro { font-weight: 700; margin-bottom: 10px; }
.ciclo ol { list-style: none; }
.ciclo li { margin-bottom: 9px; }
.ciclo li b { color: var(--c, var(--sage)); }
.ae-table th, .ae-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: .85rem; }
.ae-table thead th { background: #eef1ec; }
.ae-table .tt-row td { font-weight: 800; }
.ae-table .grp td { background: #f4f6f3; font-weight: 800; letter-spacing: .06em; font-size: .78rem; }

/* ---------- Fichas con filas a todo el ancho (AE01, AE03, AE04) ---------- */
.st-row { grid-column: 1 / -1; min-width: 0; font-size: .92rem; }
.st-row .vd-grid { margin: 0; }
.st-row > .st-label:first-child { margin-top: 0; }

/* Funcionamiento: pasos numerados */
.ciclo .ciclo-pasos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px;
}
.ciclo .ciclo-paso {
  margin: 0; display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border-radius: 10px; padding: 12px 14px;
  border-top: 3px solid var(--c, var(--sage));
}
.ciclo-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--c, var(--sage)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
}
.ciclo-paso b { display: block; color: var(--ink); line-height: 1.35; }
.ciclo-paso p { margin: 4px 0 0; font-size: .86rem; line-height: 1.5; color: var(--ink-soft); }

/* AE01: consumo de agua tradicional vs eficiente */
.agua {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px 14px;
}
.agua-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 6px 20px; margin-bottom: 6px;
}
.agua-title { font-weight: 800; font-size: 1.02rem; }
.agua-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--ink-soft); }
.agua-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.agua-trad { background: #c5ccc8; }
.agua-efic { background: var(--c, #5fbd8b); }
.agua-row {
  display: grid; grid-template-columns: 200px minmax(0, 1fr) 62px; gap: 16px;
  align-items: center; padding: 11px 0; border-top: 1px solid #eef1ec;
}
.agua-name b { display: block; font-size: .93rem; }
.agua-name span { font-size: .78rem; color: var(--ink-soft); }
.agua-name em { font-style: normal; font-weight: 700; color: #2f8a5b; }
.agua-bars { display: flex; flex-direction: column; gap: 4px; padding-right: 52px; }
.agua-bar { position: relative; height: 18px; border-radius: 5px; transition: width .3s ease; }
.agua-bar span {
  position: absolute; left: calc(100% + 7px); top: 50%; transform: translateY(-50%);
  font-size: .78rem; font-weight: 700; white-space: nowrap; color: var(--ink-soft);
}
.agua-bar.agua-efic span { color: #2f8a5b; }
.agua-save {
  font-weight: 800; font-size: .86rem; text-align: center; color: #2f8a5b;
  background: #e5f5ec; border-radius: 999px; padding: 4px 0;
}
.agua-total {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  margin-top: 8px; padding: 16px 20px; background: #eef7f1; border-radius: 12px;
}
.agua-total-col { display: flex; flex-direction: column; line-height: 1.1; }
.agua-total-label { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.agua-total-num { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.agua-total-num small { font-size: .85rem; font-weight: 700; letter-spacing: 0; }
.agua-t-trad { color: #7d8782; }
.agua-t-efic { color: #2f8a5b; }
.agua-total-arrow { font-size: 1.5rem; color: #9fb3a8; }
.agua-total-save { margin-left: auto; text-align: right; }
.agua-total-save b { display: block; font-size: 1.08rem; color: #2f8a5b; }
.agua-total-save span { font-size: .85rem; color: var(--ink-soft); }
.agua-data { margin-top: 12px; }
.agua-data summary {
  cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--sage); width: max-content;
}
.agua-data summary:hover { text-decoration: underline; }
.agua .caption { margin-top: 10px; }

/* ---------- Recuadros con gráfico propio (ER03) ---------- */
.tipbox-img { align-items: center; }
.tip-img { width: 86px; height: auto; flex-shrink: 0; mix-blend-mode: multiply; }

/* Contenido extra al pie de una subcategoría (Vegetación) */
.group-extra { margin-top: 20px; }
.caption-source { font-style: normal; font-weight: 700; }

/* ---------- Asteriscos de referencia ---------- */
.ref {
  position: relative; font: inherit; font-size: 1.1em; font-weight: 800; line-height: 1;
  color: color-mix(in srgb, var(--c, var(--sage)) 70%, #000); background: none;
  border: 0; border-radius: 4px; margin: 0 1px 0 1px; padding: 0 2px;
  vertical-align: super; cursor: help; transition: background .15s ease;
}
.ref::after { content: ''; position: absolute; inset: -10px -6px; }   /* área de toque más grande */
.ref:hover, .ref:focus-visible { background: color-mix(in srgb, var(--c, var(--sage)) 22%, #fff); outline: none; }
.ref-demo { color: var(--sage-dark); font-weight: 800; font-size: 1.1em; }
.ref-pop {
  position: fixed; z-index: 250; width: max-content; max-width: min(390px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 12px 15px 11px; font-size: .84rem; line-height: 1.5; color: var(--ink);
  animation: km-fade .15s ease;
}
.ref-pop[hidden] { display: none; }
.ref-pop-kind { font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sage); margin-bottom: 4px; }
.ref-pop-text a { color: var(--sage-dark); word-break: break-all; }
.ref-pop-link { display: inline-block; margin-top: 8px; font-size: .78rem; font-weight: 700; color: var(--sage); text-decoration: none; }
.ref-pop-link:hover { text-decoration: underline; }

/* ---------- Bibliografía y fuentes: desplegable discreto al final ---------- */
.biblio { padding-top: 34px; padding-bottom: 0; }
.biblio-fold { border-top: 1px solid var(--line); }
.biblio-fold > summary {
  cursor: pointer; list-style: none; user-select: none; width: max-content; max-width: 100%;
  display: flex; align-items: center; gap: 8px; padding: 14px 2px 6px;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
}
.biblio-fold > summary::-webkit-details-marker { display: none; }
.biblio-fold > summary::after { content: '+'; font-size: 1.05rem; font-weight: 400; letter-spacing: 0; color: var(--sage-light); transition: transform .2s; }
.biblio-fold[open] > summary::after { transform: rotate(45deg); }
.biblio-fold > summary:hover { color: var(--sage-dark); }
.biblio-body { padding: 4px 0 6px; }
.biblio-hint { font-size: .8rem; color: var(--ink-soft); margin: 2px 2px 8px; }
.biblio-list { list-style: none; font-size: .82rem; color: var(--ink-soft); }
.biblio-list li {
  padding: 5px 10px 5px 30px; text-indent: -20px; border-radius: 8px; line-height: 1.5;
  scroll-margin-top: 90px;
}
.biblio-list li a { color: var(--sage-dark); word-break: break-all; }
.biblio-list li.flash { animation: stflash 1.8s ease; }
.biblio-sub { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin: 16px 2px 2px; }
.biblio-notes { font-size: .78rem; }

/* ---------- Imagen de la ficha: botón para ampliar ---------- */
.st-zoom {
  position: relative; display: block; border: 0; padding: 0; background: none;
  cursor: zoom-in; border-radius: 10px; font: inherit;
}
.st-zoom img { display: block; transition: transform .2s ease; }
.st-zoom:hover img, .st-zoom:focus-visible img { transform: scale(1.03); }
.st-zoom:focus-visible { outline: 3px solid var(--c, var(--sage)); outline-offset: 3px; }
.st-zoom-hint {
  position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(44,55,51,.78); color: #fff; font-size: .7rem; font-weight: 700;
  padding: 4px 8px 4px 6px; border-radius: 999px; opacity: 0; transform: translateY(3px);
  transition: opacity .15s ease, transform .15s ease; pointer-events: none;
}
.st-zoom:hover .st-zoom-hint, .st-zoom:focus-visible .st-zoom-hint { opacity: 1; transform: none; }
@media (hover: none) { .st-zoom-hint { opacity: .9; transform: none; padding: 4px 6px; } }

/* ---------- Ventana flotante: ficha ampliada ---------- */
.fmodal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30,38,34,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: km-fade .2s ease;
}
.fmodal[hidden] { display: none; }
.fmodal-box {
  position: relative; width: min(1000px, 100%); max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  border-top: 6px solid var(--c, var(--sage));
  padding: 30px 34px 20px; animation: km-pop .24s ease;
}
.fmodal-close { z-index: 1; }
.fm-head { padding-right: 40px; }
.fm-cat { display: flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.fm-cat .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.fm-code { margin-top: 12px; font-size: 1rem; font-weight: 800; letter-spacing: .1em; color: var(--c); }
.fm-title { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; font-weight: 800; color: var(--ink); }
.fm-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 30px;
  align-items: center; margin-top: 20px;
}
.fm-media { display: grid; place-items: center; }
.fm-media img { width: 100%; max-width: 480px; max-height: 60vh; object-fit: contain; }
.fm-body { font-size: 1.02rem; min-width: 0; }
.fm-body .st-text { font-size: 1.08rem; line-height: 1.65; }
.fm-body .badges { margin-bottom: 12px; }
.fm-body .iram-badge, .fm-body .data-badge { font-size: .8rem; padding: 3px 11px; }
.fm-body .vd-grid { grid-template-columns: 1fr; }
.fm-link { display: inline-block; margin-top: 18px; font-size: .85rem; font-weight: 700; color: var(--sage); text-decoration: none; }
.fm-link:hover { text-decoration: underline; }
.fmodal-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.fmodal-step {
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 700; padding: 8px 16px; border-radius: 999px;
  transition: background .15s ease, border-color .15s ease;
}
.fmodal-step span { letter-spacing: .06em; }
.fmodal-step:hover:not(:disabled) { background: #f0f3ee; border-color: var(--sage-light); }
.fmodal-step:disabled { visibility: hidden; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 60px; background: var(--sage-dark); color: #fff;
  text-align: center; padding: 34px 20px; font-size: .9rem;
}
.footer p { opacity: .85; }
.footer a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { text-decoration-thickness: 2px; }

.hidden { display: none !important; }
mark { background: #ffe89a; border-radius: 3px; padding: 0 1px; }

@media (max-width: 860px) {
  .nav-menu, .nav-sub { display: none !important; }
}
@media (max-width: 720px) {
  .topnav { flex-wrap: wrap; gap: 8px 14px; }
  .nav-links { flex-wrap: wrap; }
  .nav-links > a, .nav-item > a { white-space: normal; padding: 5px 8px; font-size: .86rem; }
  #searchbox { width: 100%; order: 3; margin-left: 0; }
  .hero { padding: 56px 20px 64px; }
  .balde { flex-direction: column; }
  .balde img { height: 120px; }
  .st-item { grid-template-columns: 1fr; gap: 12px; padding: 18px 0 22px; }
  .st-media img { max-height: 210px; }
  .cat-icon { width: 68px; }
  .cat-icon img { width: 48px; height: 42px; }
  .group-summary { padding: 10px 12px; gap: 8px; }
  .group-name { font-size: .9rem; }
  .cmp-pair { grid-template-columns: 1fr; }
  .cmp-swap { margin: 0 auto; transform: rotate(90deg); }
  .cmp-swap:hover { transform: rotate(270deg); }
  .cmp-verdict { font-size: .98rem; }
  .cmp-limits { display: none; }
  .cmp-row { grid-template-columns: 26px 1fr 52px; grid-template-areas: "ico label label" "bar bar value"; row-gap: 3px; }
  .cmp-row-ico { grid-area: ico; width: 26px; height: 26px; }
  .cmp-row-label { grid-area: label; white-space: normal; }
  .cmp-bar-track { grid-area: bar; }
  .cmp-row-k { grid-area: value; }
  .cmp-thumb { width: 84px; height: 84px; }
  .kmodal-box { padding: 30px 20px 22px; }
  .agua { padding: 14px 14px 12px; }
  .agua-row { grid-template-columns: minmax(0, 1fr) 56px; grid-template-areas: "name name" "bars save"; gap: 6px 12px; }
  .agua-name { grid-area: name; }
  .agua-bars { grid-area: bars; }
  .agua-save { grid-area: save; }
  .agua-total-save { margin-left: 0; text-align: left; flex-basis: 100%; }
  .agua-total-num { font-size: 1.7rem; }
  .tip-img { width: 60px; }
  .fmodal { padding: 10px; }
  .fmodal-box { padding: 22px 18px 14px; max-height: 94vh; }
  .fm-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .fm-media img { max-height: 42vh; }
  .fm-body .st-text { font-size: 1rem; }
}
@media (min-width: 721px) and (max-width: 1000px) {
  .st-item { grid-template-columns: 145px 220px minmax(0, 1fr); gap: 10px 22px; }
}
