.hem-guide {
  --hem-ink: #17354f;
  --hem-muted: #466176;
  --hem-line: #d9e5ee;
  --hem-blue: #205982;
  background: #f3f7fa;
  color: var(--hem-ink);
  padding: clamp(16px, 3.5vw, 44px) 0;
}
.hem-shell { display: grid; gap: 18px; }
.hem-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  color: #466176;
  font-size: .82rem;
}
.hem-crumb a { color: #215e89; text-decoration: underline; text-underline-offset: .2em; }
.hem-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(265px, 37%);
  align-items: center;
  gap: clamp(18px, 3.7vw, 50px);
  padding: clamp(23px, 4.1vw, 49px);
  border-radius: 27px;
  background: radial-gradient(ellipse at 81% 26%, #286a9a 0%, #143d64 46%, #102b47 82%);
  box-shadow: 0 17px 38px #12395725;
  color: #fff;
}
.hem-kicker, .hem-section-kicker { font-size: .71rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.hem-kicker { color: #afe6f0; }
.hem-kicker span {
  display: inline-block;
  margin-left: 6px;
  padding: 4px 9px;
  border: 1px solid #ffffff40;
  border-radius: 999px;
  background: #ffffff16;
  color: #def6ff;
  text-transform: none;
  letter-spacing: 0;
}
.hem-hero h1 { color: inherit; margin: 13px 0 12px; font-size: clamp(2.3rem, 4.3vw, 3.65rem); line-height: 1.08; }
.hem-hero h1 em { display: block; color: #91e2ea; font-style: normal; }
.hem-hero p { margin: 0; color: #e1eff7; max-width: 49ch; }
.hem-guide .hem-hero-actions { margin-top: 19px; }
.hem-guide .button.hem-hero-primary { background: #9be2ed; border-color: #9be2ed; color: #123951; box-shadow: none; }
.hem-guide .button.hem-hero-primary:hover { background: #b6eff7; border-color: #b6eff7; color: #123951; }
.hem-guide .button.hem-hero-secondary { background: #ffffff10; border-color: #ffffff65; color: #fff; box-shadow: none; }
.hem-guide .button.hem-hero-secondary:hover { background: #ffffff27; color: #fff; }
.hem-anatomy {
  margin: 0 auto;
  width: min(100%, 380px);
  padding: 10px;
  border: 1px solid #fff;
  border-radius: 18px;
  background: linear-gradient(150deg, #fff, #eaf2f9);
  color: #174b70;
  box-shadow: 0 14px 35px #071e395e;
}
.hem-anatomy img { display: block; width: 100%; height: auto; border-radius: 11px; }
.hem-anatomy figcaption { padding: 7px 3px 1px; text-align: center; font-size: .76rem; line-height: 1.35; }
.hem-anatomy figcaption :is(strong, span) { display: block; }
.hem-anatomy figcaption span { color: #405f76; }
.hem-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, 25%); align-items: start; gap: 20px; }
.hem-main, .hem-sidebar { display: grid; gap: 15px; min-width: 0; }
.hem-sidebar { position: sticky; top: 94px; }
.hem-picker, .hem-panel, .hem-sources, .hem-sidecard {
  background: #fff;
  border: 1px solid var(--hem-line);
  border-radius: 20px;
  padding: clamp(15px, 2.4vw, 26px);
  box-shadow: 0 5px 19px #1d527309;
}
.hem-section-kicker { display: block; color: #176287; margin-bottom: 4px; }
.hem-picker h2, .hem-alert h2, .hem-next h2 { margin: 0 0 8px; font-size: clamp(1.32rem, 2.15vw, 1.85rem); }
.hem-picker p { margin: 0 0 12px; color: var(--hem-muted); }
.hem-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.hem-tab {
  --hem-accent: #215e89;
  --hem-tint: #e6f2f9;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: start;
  gap: 7px;
  position: relative;
  min-height: 126px;
  padding: 12px;
  border: 1px solid var(--hem-line);
  border-radius: 13px;
  background: #f9fbfc;
  color: var(--hem-ink);
  text-align: left;
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
}
.hem-violet { --hem-accent: #614883; --hem-tint: #f0eaf7; }
.hem-rose { --hem-accent: #8c3f57; --hem-tint: #f9edf1; }
.hem-amber { --hem-accent: #804f22; --hem-tint: #fbf0e4; }
.hem-tab[aria-selected="true"] { background: var(--hem-tint); border-color: var(--hem-accent); box-shadow: inset 0 0 0 1px var(--hem-accent); }
.hem-route-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: var(--hem-tint); }
.hem-route-icon span { width: 11px; height: 11px; border-radius: 50%; background: var(--hem-accent); }
.hem-tab[aria-selected="true"]::after { content: "✓"; position: absolute; top: 9px; right: 9px; color: var(--hem-accent); font-weight: 800; }
.hem-overview { margin: 13px 0 9px; border: 1px solid #c4dfed; border-radius: 13px; padding: 12px 14px; background: #eef7fb; }
.hem-overview p { margin: 0; color: #2c4b62; font-size: .92rem; }
.hem-tab strong { font-size: .95rem; }
.hem-tab small { color: var(--hem-muted); font-size: .77rem; }
.hem-guide :is(button, a, textarea, input, summary, [role="tabpanel"]):focus-visible { outline: 3px solid #2777ad; outline-offset: 3px; }
.hem-guide :is(#hem-picker-title, #hem-alarma, .hem-record h3, .hem-panel) { scroll-margin-top: 106px; }
.hem-alert-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding: 4px 14px; background: #fdf4f5; border: 1px solid #e8c2c9; border-radius: 10px; color: #7f3043; font-size: .88rem; }
.hem-alert-quick .hem-print-link { color: inherit; }
.hem-alert { border: 1px solid #e8c2c9; border-left: 4px solid #ad5060; border-radius: 13px; background: #fdf4f5; padding: 14px 18px; }
.hem-alert h2 { color: #7f3043; font-size: 1.1rem; margin-bottom: 5px; }
.hem-alert p { margin: 0; font-size: .91rem; line-height: 1.55; }
.hem-alert p + p { margin-top: 5px; }
.hem-guide [hidden] { display: none !important; }
.hem-panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 9px; }
.hem-panel-head .hem-section-kicker { margin: 0; }
.hem-print-link { background: transparent; color: var(--hem-blue); border: 0; padding: 6px 0; min-height: 44px; text-decoration: underline; text-underline-offset: .2em; font: inherit; font-size: .88rem; font-weight: 750; cursor: pointer; }
.hem-panel-tools { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px; }
.hem-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(155px, 31%); align-items: start; gap: clamp(14px, 3vw, 28px); }
.hem-panel h2 { margin: 0 0 10px; font-size: clamp(1.35rem, 2.7vw, 2rem); }
.hem-panel :is(h3, h4) { margin: 0 0 7px; }
.hem-panel h3 { font-size: 1.22rem; }
.hem-panel h4 { font-size: 1rem; }
.hem-panel p { margin: 0 0 10px; color: var(--hem-muted); }
.hem-panel ul { padding-left: 1.4em; margin: 8px 0; }
.hem-panel li + li { margin-top: 6px; }
.hem-figure { background: #f1f6fa; border: 1px solid var(--hem-line); border-radius: 13px; margin: 0; padding: 10px; }
.hem-figure svg { width: 100%; height: auto; max-height: 130px; display: block; }
.hem-figure figcaption { padding: 4px; }
.hem-figure figcaption span { display: block; color: var(--hem-muted); font-size: .87rem; margin-top: 4px; }
.hem-subsection { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hem-line); }
.hem-habits { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hem-detail, .hem-result { border: 1px solid var(--hem-line); border-radius: 12px; padding: 12px; background: #f7fafc; }
.hem-result p { margin-bottom: 0; }
.hem-detail, .hem-result { margin-top: 10px; }
.hem-options, .hem-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hem-options button { border: 1px solid #bbcfde; border-radius: 9px; background: #fff; color: var(--hem-ink); padding: 7px 11px; min-height: 44px; font: inherit; font-size: .89rem; cursor: pointer; }
.hem-options button[aria-pressed="true"] { border-color: var(--hem-blue); background: var(--hem-blue); color: #fff; }
.hem-panel > .hem-actions { margin-top: 18px; }
.hem-checks { display: grid; gap: 5px; }
.hem-checks label { display: flex; align-items: baseline; gap: 8px; }
.hem-checks input { accent-color: var(--hem-blue); flex: none; }
.hem-notes { display: grid; gap: 5px; margin: 12px 0 4px; font-weight: 700; }
.hem-notes textarea { width: 100%; max-width: 66ch; border: 1px solid #a5bccc; border-radius: 9px; background: #fff; color: inherit; padding: 8px; font: inherit; font-weight: 400; resize: vertical; }
.hem-sidecard { padding: 16px; }
.hem-sidecard h2 { font-size: 1.1rem; margin: 7px 0 8px; }
.hem-side-tag { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #e9f3f8; color: #265d80; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.hem-sidecard ul { margin: 0 0 12px; padding-left: 1.2em; font-size: .88rem; color: var(--hem-muted); }
.hem-sidecard li + li { margin-top: 5px; }
.hem-sidecard .button { width: 100%; justify-content: center; padding-inline: 9px; text-align: center; font-size: .82rem; }
.hem-profile { display: flex; align-items: center; gap: 10px; }
.hem-profile img { width: 52px; height: 57px; object-fit: cover; object-position: 50% 24%; border: 1px solid #dde8ef; border-radius: 11px; }
.hem-profile strong { display: block; font-size: .91rem; line-height: 1.2; }
.hem-profile p, .hem-motto { margin: 4px 0 0; font-size: .76rem; color: var(--hem-muted); line-height: 1.4; }
.hem-motto { margin-top: 9px; }
.hem-side-nav button { display: block; width: 100%; min-height: 38px; padding: 4px 0; border: 0; border-top: 1px solid var(--hem-line); background: transparent; color: #235b81; text-align: left; font: inherit; font-size: .84rem; cursor: pointer; }
.hem-side-nav button:hover { text-decoration: underline; }
.hem-side-nav button span { margin-right: 5px; font-weight: 750; }
.hem-next { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding: 20px 24px; border-radius: 20px; background: #102f4c; color: #fff; }
.hem-next h2 { color: #fff; }
.hem-next .hem-section-kicker { color: #9be2ed; }
.hem-next p { margin: 0; color: #e1eff7; }
.hem-sources { padding-block: 12px; }
.hem-sources summary { cursor: pointer; font-weight: 750; }
.hem-print-title, .hem-printed-notes, .hem-print-footer, .hem-print-grades { display: none; }

.hem-icon { display: inline-block; flex: none; width: 1.3em; height: 1.3em; vertical-align: -.24em; }
.hem-hero-actions .hem-icon { color: #ffc0c3; }
.hem-downloads {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--hem-line);
  border-radius: 17px;
  background: #fff;
}
.hem-downloads h2 { margin: 0; font-size: 1.12rem; }
.hem-download {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 7px 11px;
  border: 1px solid #d6e8f2;
  border-radius: 12px;
  background: #f4f9fc;
  color: #164d72;
  font-size: .88rem;
  line-height: 1.25;
}
.hem-download:hover { background: #e8f5fc; text-decoration: underline; }
.hem-download .hem-icon { width: 23px; height: 23px; color: #147598; }
.hem-download small { display: block; margin-top: 2px; color: #48667c; font-size: .75rem; }
.hem-alert-quick .hem-icon, .hem-alert h2 .hem-icon, .hem-urgent-note .hem-icon, .hem-nav-alert { color: #a1334b; }
.hem-alert h2, .hem-record h3, .hem-habit h4 { display: flex; align-items: center; gap: 8px; }
.hem-record h3 .hem-icon, .hem-habit h4 .hem-icon { color: #14708d; }
.hem-urgent-note { display: flex; align-items: start; gap: 8px; padding: 10px 12px; margin-top: 12px; border: 1px solid #ecc6ce; border-radius: 10px; background: #fff2f4; }
.hem-urgent-note p { margin: 0; color: #792f41; font-size: .9rem; }
.hem-clinical-photo, .hem-inline-details { margin: 12px 0 0; padding: 11px 13px; border: 1px solid var(--hem-line); border-radius: 11px; background: #f6fafc; }
.hem-clinical-photo summary, .hem-inline-details summary { cursor: pointer; color: #205982; font-size: .91rem; font-weight: 750; }
.hem-clinical-photo summary .hem-icon { margin-inline: 3px 5px; }
.hem-clinical-photo p, .hem-inline-details p { margin: 9px 0 0; font-size: .9rem; }
.hem-clinical-photo figure { width: min(100%, 500px); margin: 10px 0 0; }
.hem-clinical-photo img { display: block; width: 100%; height: auto; border-radius: 9px; }
.hem-clinical-photo figcaption { margin-top: 6px; color: var(--hem-muted); font-size: .75rem; }
.hem-clinical-photo figcaption a { text-decoration: underline; }
.hem-habit { overflow: hidden; border: 1px solid var(--hem-line); border-radius: 13px; background: #fff; }
.hem-habit > img { display: block; width: 100%; height: clamp(110px, 15vw, 162px); object-fit: cover; }
.hem-habit > img[src$="estrenimiento-postura.webp"] { object-fit: contain; background: #eaf2f6; }
.hem-habit-copy { padding: 12px 13px; }
.hem-habit-copy ul { margin-bottom: 0; font-size: .91rem; color: var(--hem-muted); }
.hem-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.hem-mini-grid > div { padding: 10px; border: 1px solid var(--hem-line); border-radius: 10px; background: #f9fcfe; }
.hem-mini-grid .hem-icon { color: #217797; margin-bottom: 5px; }
.hem-mini-grid strong { display: block; margin-bottom: 5px; }
.hem-mini-grid p { margin: 0; font-size: .86rem; }
.hem-simulator { display: grid; gap: 9px; padding: 12px; border: 1px solid #c5deeb; border-radius: 15px; background: #edf7fc; }
.hem-simulator > .hem-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hem-simulator > .hem-options button { text-align: left; padding: 8px; font-weight: 750; }
.hem-simulator > .hem-options small { display: block; font-weight: 500; font-size: .75rem; }
.hem-sim-frame { display: grid; grid-template-columns: minmax(145px, .8fr) minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: #fff; }
.hem-sim-frame > svg { width: 100%; max-height: 185px; }
.hem-sim-status { margin-top: 8px; min-height: 76px; padding: 8px; border-radius: 8px; background: #f1f7fa; }
.hem-sim-status p { margin: 3px 0 0; font-size: .86rem; }
.hem-simulator > small { color: var(--hem-muted); font-size: .8rem; }
.hem-sim-fold { opacity: 0; }
.hem-simulator.is-outside .hem-sim-fold { opacity: 1; }
.hem-simulator.is-outside .hem-sim-tissue { transform: translateY(87px); }

@media (prefers-reduced-motion: no-preference) {
  .hem-tab { transition: background-color .18s, border-color .18s; }
  .hem-sim-fold { transition: opacity .28s ease; }
  .hem-sim-tissue { transition: transform .48s cubic-bezier(.2,.65,.35,1); }
  @supports (animation-timeline: view()) {
    .hem-habit {
      animation: hem-habit-reveal auto linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
    @keyframes hem-habit-reveal {
      from { opacity: .68; transform: translateY(10px); }
      to { opacity: 1; transform: none; }
    }
  }
}
@media (max-width: 1200px) {
  .hem-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hem-tab { min-height: 104px; }
}
@media (max-width: 850px) {
  .hem-layout { grid-template-columns: minmax(0, 1fr); }
  .hem-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hem-side-nav { display: none; }
}
@media (max-width: 680px) {
  .hem-downloads { grid-template-columns: 1fr 1fr; }
  .hem-downloads > div { grid-column: 1 / -1; }
  .hem-hero { grid-template-columns: 1fr; gap: 13px; border-radius: 20px; padding: 19px; }
  .hem-hero h1 { font-size: clamp(1.85rem, 7.8vw, 2.25rem); }
  .hem-hero p { font-size: .87rem; }
  .hem-guide .hem-hero-actions { margin-top: 13px; }
  .hem-hero-actions .button { padding: 9px 13px; font-size: .82rem; }
  .hem-hero-actions .hem-hero-secondary { display: none; }
  .hem-anatomy { display: grid; grid-template-columns: minmax(120px, 58%) 1fr; align-items: center; gap: 7px; width: min(100%, 340px); padding: 7px; }
  .hem-anatomy figcaption { padding: 0; text-align: left; font-size: .69rem; }
}
@media (max-width: 560px) {
  .hem-split, .hem-habits, .hem-sidebar, .hem-sim-frame, .hem-mini-grid { grid-template-columns: 1fr; }
  .hem-simulator > .hem-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hem-downloads { padding: 11px; gap: 7px; }
  .hem-download { padding: 7px; gap: 5px; font-size: .8rem; }
  .hem-download .hem-icon { width: 16px; height: 16px; }
  .hem-split .hem-figure { max-width: 260px; }
  .hem-tab { padding: 9px; min-height: 116px; }
  .hem-tab strong { font-size: .86rem; }
  .hem-tab small { font-size: .72rem; }
}
@media print {
  @page hem-handout { margin: 12mm 12mm 21mm; }
  body:has(.hem-guide) { page: hem-handout; }
  body:has(.hem-guide) :is(.site-header, .site-footer, .whatsapp-fab, .toast, .skip-link) { display: none !important; }
  .hem-guide { padding: 0; background: #fff; color: #182f43; font-size: 10pt; line-height: 1.35; }
  .hem-shell { display: block; width: auto; max-width: none; }
  .hem-guide :is(.hem-crumb, .hem-anatomy, .hem-sidebar, .hem-downloads, .hem-clinical-photo, .hem-simulator, .hem-picker, .hem-next, .hem-sources, .hem-panel-head, .hem-panel-tools, .hem-alert-quick, .hem-print-link, .hem-actions, .hem-notes, .hem-screen-only, .hem-options, .hem-kicker, .hem-hero p) { display: none !important; }
  .hem-layout, .hem-main, .hem-print-grades { display: block; }
  .hem-habit { animation: none; }
  .hem-habit > img { height: 20mm; }
  .hem-hero { display: block; padding: 0 0 3mm; background: #fff; color: #182f43; box-shadow: none; }
  .hem-hero h1 em { display: inline; color: inherit; }
  .hem-hero h1 { font-size: 22pt; }
  .hem-alert, .hem-panel { padding: 3mm; margin-bottom: 3mm; background: #fff; }
  .hem-alert, .hem-result, .hem-detail, .hem-figure, .hem-habits article, .hem-record { break-inside: avoid; }
  .hem-panel h2 { font-size: 15pt; }
  .hem-panel :is(h2, h3, h4) { break-after: avoid; }
  .hem-panel p, .hem-alert p { font-size: 10pt; }
  .hem-panel .hem-print-title { display: block; font-weight: 750; }
  .hem-split { grid-template-columns: minmax(0, 1fr) minmax(38mm, 24%); gap: 3mm; }
  .hem-figure svg { max-height: 22mm; }
  .hem-habits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hem-printed-notes:not([hidden]) { display: block; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2mm; }
  .hem-print-footer { display: block; position: fixed; bottom: -14mm; left: 0; right: 0; border-top: 1px solid #b0c3d1; padding-top: 2mm; color: #182f43; font-size: 8pt; }
}
