/* Vista pública de emergencia: liviana, sin JS, legible en un celular bajo estrés. */
:root {
	--bg: 0 0% 98%; --card: 0 0% 100%; --ink: 222 40% 9%; --muted: 222 12% 34%; --line: 222 18% 84%;
	--red: 356 82% 40%; --red-soft: 356 85% 95%; --on-red: 0 0% 100%;
	--amber-soft: 40 95% 91%; --amber: 28 90% 26%;
	--green: 146 60% 24%; --on-green: 0 0% 100%;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
	--bg: 222 28% 7%; --card: 222 24% 12%; --ink: 0 0% 96%; --muted: 222 12% 72%; --line: 222 16% 24%;
	--red: 356 80% 50%; --red-soft: 356 45% 16%;
	--amber-soft: 28 40% 16%; --amber: 38 92% 68%;
	--green: 146 55% 30%;
	}
}
:root[data-theme="dark"] {
	--bg: 222 28% 7%; --card: 222 24% 12%; --ink: 0 0% 96%; --muted: 222 12% 72%; --line: 222 16% 24%;
	--red: 356 80% 50%; --red-soft: 356 45% 16%;
	--amber-soft: 28 40% 16%; --amber: 38 92% 68%;
	--green: 146 55% 30%;
}
* { box-sizing: border-box; }
body { margin: 0; background: hsl(var(--bg)); color: hsl(var(--ink)); font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: hsl(var(--red)); color: hsl(var(--on-red)); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 15px; }
.bar .lang a { color: inherit; text-decoration: none; font-weight: 700; padding: 8px 10px; display: inline-block; min-height: 40px; border-radius: 8px; letter-spacing: 0; }
.bar .lang a[aria-current="true"] { background: hsl(0 0% 100% / .22); }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; display: grid; gap: 16px; }
.card { background: hsl(var(--card)); border-radius: 18px; padding: 18px; box-shadow: 0 0 0 1px hsl(var(--line)), 0 6px 18px -10px hsl(0 0% 0% / .25); }
.id { display: flex; align-items: center; gap: 16px; }
.id img { width: 88px; height: 88px; border-radius: 16px; object-fit: cover; flex: none; }
.id h1 { margin: 0; font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.blood { margin-inline-start: auto; text-align: center; padding: 8px 14px; border-radius: 14px; background: hsl(var(--red-soft)); color: hsl(var(--red)); flex: none; }
.blood small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.blood b { font-size: 32px; line-height: 1.1; }
.call { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 72px; padding: 14px; border-radius: 18px; background: hsl(var(--green)); color: hsl(var(--on-green)); text-decoration: none; font-weight: 800; font-size: 21px; text-align: center; box-shadow: 0 8px 20px -8px hsl(var(--green) / .7); }
.call span { font-weight: 600; font-size: 16px; opacity: .92; font-variant-numeric: tabular-nums; }
.call:active { transform: scale(.98); }
h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted)); }
.crit h2 { color: hsl(var(--red)); }
.crit { box-shadow: 0 0 0 2px hsl(var(--red)); }
.item { padding: 12px 14px; border-radius: 12px; margin-top: 8px; font-weight: 600; background: hsl(var(--amber-soft)); color: hsl(var(--amber)); overflow-wrap: anywhere; }
.crit .item { background: hsl(var(--red-soft)); color: hsl(var(--red)); font-size: 20px; font-weight: 700; }
.item small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.plain { white-space: pre-wrap; overflow-wrap: anywhere; }
.contact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid hsl(var(--line)); }
.contact:first-of-type { border-top: 0; }
.contact a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 12px; background: hsl(var(--green)); color: hsl(var(--on-green)); text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.contact small { display: block; color: hsl(var(--muted)); }
.note { font-size: 13px; color: hsl(var(--muted)); margin-top: 6px; }
.foot { text-align: center; font-size: 14px; color: hsl(var(--muted)); display: grid; gap: 6px; }
.msg { text-align: center; padding: 40px 16px; }
.msg h1 { font-size: 26px; margin: 0 0 8px; }
.msg a.btn, .msg button.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; margin-top: 16px; border-radius: 12px; border: 2px solid hsl(var(--red)); background: hsl(var(--red)); color: hsl(var(--on-red)); font: 700 16px/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer; transition: transform .15s ease-out, filter .15s; }
.msg .btn:hover { filter: brightness(1.08); }
.msg .btn:active { transform: scale(.97); }
.msg .btn:focus-visible { outline: 3px solid hsl(var(--red)); outline-offset: 3px; }
.msg .btn.ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .85; }
.msg form.stack { display: grid; gap: 4px; max-width: 360px; margin: 8px auto 0; }
.msg form.stack .btn { width: 100%; }
a:focus-visible { outline: 3px solid hsl(var(--ink)); outline-offset: 2px; }

.hp { position: absolute; inset-inline-start: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* trampa para bots: ninguna persona lo ve ni lo toca */
.callpage { text-align: center; padding: 28px 16px; display: grid; gap: 14px; justify-items: center; }
.callpage h1 { margin: 0; font-size: 24px; }
.callpage .num { font: 800 clamp(26px, 8vw, 40px)/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; letter-spacing: .01em; overflow-wrap: anywhere; }
.callpage .call { width: 100%; box-sizing: border-box; }
.callpage form { width: 100%; }
.callpage button.call { border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 21px; }
.back { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: inherit; }

/* El nombre nunca se parte letra por letra: si no entra junto a la foto y el grupo sanguíneo, estos bajan de línea */
.id { flex-wrap: wrap; row-gap: 12px; }
.id h1 { flex: 1 1 160px; min-width: 0; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
@media (max-width: 420px) {
	.id img { width: 72px; height: 72px; }
	.id h1 { font-size: 26px; }
	.blood { margin-inline-start: 0; flex: 1 1 100%; display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 8px 14px; }
	.blood small { display: inline; }
	.blood b { font-size: 28px; }
}

/* WhatsApp, idioma del viaje */
.callrow { display: grid; gap: 10px; }
.call.wa { background: hsl(158 78% 22%); box-shadow: 0 8px 20px -8px hsl(158 78% 22% / .7); min-height: 56px; font-size: 18px; flex-direction: row; gap: 8px; }
.contact .btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.contact .btns a.wa { background: hsl(158 78% 22%); }
.chip-lang { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; font-weight: 800; text-decoration: none; background: hsl(var(--card)); color: inherit; box-shadow: 0 0 0 2px hsl(var(--red)); }
.bar .langsel summary { background: hsl(0 0% 100% / .2); color: #fff; }
.bar .langsel summary:hover { background: hsl(0 0% 100% / .3); }

.item .it { font-weight: inherit; }

.orig { display: block; margin-top: 6px; font-size: 13px; font-weight: 500; line-height: 1.4; opacity: .9; }
.orig b { font-weight: 800; }

/* Números de emergencia locales (geo.js) */
.sos .sos-where { font-weight: 700; margin: 0 0 10px; }
.sos .sos-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.sos .sosnum { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; min-height: 64px; padding: 8px 16px; border-radius: 14px; background: hsl(var(--red)); color: hsl(var(--on-red)); text-decoration: none; text-align: center; }
.sos .sosnum b { font: 800 26px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.sos .sosnum span { font-size: 12px; font-weight: 700; opacity: .95; }
.sos .sosnum:active { transform: scale(.97); }
.sosbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; margin-top: 6px; border-radius: 12px; border: 0; cursor: pointer; font: 700 16px/1 inherit; background: hsl(var(--ink)); color: hsl(var(--bg)); }
.sosbtn:disabled { opacity: .6; cursor: wait; }
.sosbtn[hidden] { display: none; }
.sos .chip-lang { margin: 6px 0; }

/* Cabecera: etiqueta + idioma, y debajo quién es */
.hero { background: hsl(var(--red)); color: hsl(var(--on-red)); padding: 10px 16px 16px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 12.5px; }
.hero .langsel summary { background: hsl(0 0% 100% / .2); color: #fff; }
.hero-id { display: flex; align-items: center; gap: 12px; margin: 10px auto 0; max-width: 640px; }
.hero-id img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; background: hsl(0 0% 100% / .2); }
.hero-id h1 { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 26px; line-height: 1.1; overflow-wrap: break-word; hyphens: auto; }
.hero .blood { margin: 0; background: hsl(0 0% 100%); color: hsl(var(--red)); padding: 6px 12px; }
.hero .blood b { font-size: 28px; }
.hero-top { max-width: 640px; margin-inline: auto; }
@media (max-width: 360px) { .hero-id h1 { font-size: 23px; } .hero-id img { width: 52px; height: 52px; } }

/* Alertas críticas: compactas para que entren varias sin scrollear */
.crit { padding: 14px; }
.crit h2 { margin-bottom: 4px; }
.crit .item { padding: 10px 12px; margin-top: 6px; font-size: 19px; }

/* Barra fija inferior: número de emergencia local + primer contacto */
.wrap { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.dock { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: hsl(var(--card)); box-shadow: 0 -1px 0 hsl(var(--line)), 0 -12px 24px -14px hsl(0 0% 0% / .35); }
.dk { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-height: 64px; padding: 8px 14px; border-radius: 16px; text-decoration: none; color: hsl(var(--on-red)); background: hsl(var(--red)); min-width: 0; }
.dk span { grid-row: 1 / span 2; font-size: 24px; }
.dk b { font: 800 20px/1.1 system-ui, sans-serif; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk small { font-size: 12.5px; font-weight: 700; opacity: .95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-contact { background: hsl(var(--green)); color: hsl(var(--on-green)); }
.dk-contact.wa { background: hsl(158 78% 22%); }
.dk:active { transform: scale(.97); }
.dock { max-width: 640px; margin-inline: auto; border-radius: 20px 20px 0 0; }

/* Otros números: plegado */
details.sos > summary { cursor: pointer; font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted)); list-style: none; min-height: 32px; display: flex; align-items: center; justify-content: space-between; }
details.sos > summary::-webkit-details-marker { display: none; }
details.sos > summary::after { content: "▾"; transition: transform .25s; }
details.sos[open] > summary::after { transform: rotate(180deg); }
details.sos[open] > summary { margin-bottom: 10px; }

/* Ajustes de la cabecera y la barra en pantallas angostas */
.hero-id { flex-wrap: wrap; row-gap: 8px; }
.hero-id h1 { flex: 1 1 140px; hyphens: manual; overflow-wrap: break-word; }
.hero .blood { flex: none; display: block; text-align: center; padding: 4px 12px 6px; }
.hero .blood small { display: block; font-size: 10px; }
.hero .blood b { font-size: 26px; line-height: 1; }
.dk { padding: 8px 10px; column-gap: 6px; }
.dk span { font-size: 20px; }
.dk b { font-size: 18px; }
@media (max-width: 360px) { .dk span { display: none; } .dk { grid-template-columns: 1fr; } .dk b, .dk small { grid-column: 1; text-align: center; } }

/* Datos importantes en la cabecera */
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 10px auto 0; padding: 0; max-width: 640px; }
.facts li { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border-radius: 999px; background: hsl(0 0% 100% / .18); font-size: 14px; }
.facts b { font-weight: 800; font-variant-numeric: tabular-nums; }
.facts small { font-size: 12px; opacity: .85; font-weight: 600; }

/* La marca del sitio va arriba (en lugar de la etiqueta fija) */
.brand-tag { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; letter-spacing: .02em; text-transform: none; }
.brand-tag .brand-logo { max-height: 24px; width: auto; border-radius: 4px; }
.brand-tag .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.doclink { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; margin-top: 8px; border-radius: 12px; background: hsl(var(--amber-soft)); color: hsl(var(--amber)); text-decoration: none; font-size: 17px; }
.doclink b { overflow-wrap: anywhere; }

/* Ícono de la app, selector de tema y de idioma agrupados a la derecha */
.app-ico { flex: none; border-radius: 7px; }
.top-actions { display: inline-flex; align-items: center; gap: 8px; }
.hero .theme-btn, .bar .theme-btn { background: hsl(0 0% 100% / .2); color: #fff; width: 40px; height: 40px; }
.hero .theme-btn:hover, .bar .theme-btn:hover { background: hsl(0 0% 100% / .3); }
.hero .brand-tag, .bar .brand-tag { font-weight: 800; }

.foot .rev { font-size: 13px; opacity: .85; }
.foot .rev.stale { color: hsl(var(--amber)); font-weight: 700; opacity: 1; }

.locate h2 { font-size: 18px; margin: 0 0 6px; }
.locate .loc-note { display: block; margin: 10px 0; font-size: 14px; }
.locate .loc-note input { display: block; width: 100%; min-height: 46px; margin-top: 4px; padding: 8px 12px; border-radius: 12px; border: 1px solid hsl(var(--line)); background: hsl(var(--bg)); color: inherit; font: inherit; }
.locate .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.locate .sosbtn { display: block; width: 100%; min-height: 54px; }
.locate .linkbtn { display: block; margin: 10px auto 0; background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; min-height: 44px; cursor: pointer; }
.locate button:disabled { opacity: .55; cursor: default; }

.care { border: 2px solid hsl(var(--red)); }
.care h2 { font-size: 22px; margin: 0 0 6px; }
.care h3 { font-size: 14px; margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.care .care-msg { font-size: 17px; line-height: 1.45; margin: 0 0 12px; }
.care .care-noname { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: hsl(var(--red) / .1); font-weight: 600; }
.care .care-call { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 12px 16px; border-radius: 16px; background: hsl(var(--red)); color: hsl(var(--on-red)); font-size: 20px; font-weight: 800; text-decoration: none; text-align: center; }
.care h2, .locate h2 { text-transform: none; letter-spacing: 0; }
.care h2 { font-size: 24px; line-height: 1.2; }
.locate .sosbtn { background: hsl(var(--red)); color: hsl(var(--on-red)); border: 0; border-radius: 16px; font-size: 18px; font-weight: 800; cursor: pointer; }
.locate .loc-wa { margin-top: 14px; padding-top: 12px; border-top: 1px solid hsl(var(--line)); display: grid; gap: 10px; }
.locate .loc-wa a { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 10px 14px; border-radius: 16px; background: #1f7a45; color: #fff; font-size: 17px; font-weight: 800; text-decoration: none; text-align: center; }
.cgrp { margin: 14px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: hsl(var(--muted)); }
.cgrp:first-of-type { margin-top: 4px; }
.locate.flat { background: none; box-shadow: none; padding: 14px 0 0; margin-top: 14px; border-radius: 0; border-top: 1px solid hsl(var(--line)); }
.locate.flat h2 { font-size: 18px; }
.care-acts { display: grid; gap: 10px; margin-top: 14px; }
.care-acts .wa { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 10px 14px; border-radius: 16px; background: #1f7a45; color: #fff; font-size: 18px; font-weight: 800; text-decoration: none; text-align: center; }
.care h3:first-of-type { margin-top: 10px; }
.locate .loc-more { margin: 8px 0; }
.locate .loc-more summary { cursor: pointer; font-size: 14px; min-height: 36px; display: flex; align-items: center; }
.locate .loc-more .loc-note { margin: 6px 0 0; }
.locate.flat p { margin: 4px 0 10px; font-size: 15px; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.care-acts a, .locate .sosbtn, .locate .loc-wa a, .care-call { gap: 10px; }
.care-acts .ic, .locate .sosbtn .ic { width: 24px; height: 24px; }
.locate .sosbtn { display: flex; align-items: center; justify-content: center; }
.dk span .ic { width: 26px; height: 26px; display: block; }

/* Ficha clara y resumida: números visibles, contactos arriba, condiciones en chips */
.sos h2 { margin-bottom: 8px; }
.sos .sos-where { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: hsl(var(--muted)); }
.sos .sos-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 0 0 6px; }
.sos .sosnum { width: 100%; min-height: 62px; }
.sos .linkbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; }
.sos .linkbtn[hidden] { display: none; }
.sos .note { margin: 4px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 7px 13px; border-radius: 999px; font-weight: 700; background: hsl(var(--amber-soft)); color: hsl(var(--amber)); overflow-wrap: anywhere; }
.chip small { display: inline; margin-inline-end: 6px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.chip .it { font-weight: inherit; }
.contact .cname { font-weight: 700; font-size: 17px; }
.sos .chip-lang { display: inline-flex; min-height: 40px; padding: 4px 14px; font-size: 14px; margin: 6px 0 2px; }

.app-ico { width: 26px; height: 26px; }
