:root{
  --bg:#18212a;--bg2:#1f2a34;--card:#25323e;--card2:#2c3a47;--line:#3a4a58;
  --tx:#eaf0f4;--mut:#9fb1c0;--acc:#f0a030;--acc2:#ffbf55;--red:#d93d3d;--red2:#ff5a5a;
  --ok:#3fb27f;--warn:#e8b33a;--blue:#3fa9f5;--r:16px;--sh:0 6px 20px rgba(0,0,0,.25)
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--tx);font-family:system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,sans-serif;font-size:16px;line-height:1.45;-webkit-tap-highlight-color:transparent}
body{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--acc2)}
.hidden{display:none!important}
/* Cabecera */
.top{position:sticky;top:0;z-index:20;background:rgba(24,33,42,.96);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.top .in{max-width:860px;margin:auto;padding:10px 16px;display:flex;align-items:center;gap:12px}
.top img{width:42px;height:42px;border-radius:50%}
.brand b{display:block;font-size:1.05rem;letter-spacing:.04em}
.brand b span{color:var(--acc)}
.brand small{color:var(--mut);font-size:.72rem;letter-spacing:.08em;text-transform:uppercase}
.top .fam{margin-left:auto;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:6px 12px;font-size:.85rem;cursor:pointer}
main{max-width:860px;margin:auto;padding:16px}
h1{font-size:1.45rem;margin:4px 0 12px}
h2{font-size:1.1rem;margin:22px 0 10px}
h3{font-size:1rem;margin:0 0 6px}
p{margin:6px 0}
.mut{color:var(--mut)}.small{font-size:.85rem}.tiny{font-size:.75rem}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:14px;margin:10px 0;box-shadow:var(--sh)}
.card.flat{box-shadow:none}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.row.nw{flex-wrap:nowrap}
.sp{flex:1}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
@media(max-width:520px){.grid3{grid-template-columns:1fr 1fr}}
/* Métricas */
.stat{background:var(--card2);border:1px solid var(--line);border-radius:14px;padding:12px}
.stat .v{font-size:1.5rem;font-weight:800}
.stat .l{color:var(--mut);font-size:.8rem}
.stat.ok .v{color:var(--ok)}.stat.warn .v{color:var(--warn)}.stat.bad .v{color:var(--red2)}
.bar{height:10px;border-radius:99px;background:var(--bg2);overflow:hidden;margin-top:8px}
.bar i{display:block;height:100%;background:linear-gradient(90deg,var(--acc),var(--ok));width:0}
.hero{background:linear-gradient(135deg,#2c3843,#1f2a34);border:1px solid var(--line);border-radius:20px;padding:18px}
.hero .big{font-size:2.4rem;font-weight:900;line-height:1}
.hero .lim{color:var(--acc2);font-weight:700}
/* Botones */
.btn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);background:var(--card2);border-radius:12px;padding:10px 14px;cursor:pointer;font-weight:600;min-height:44px}
.btn:active{transform:scale(.98)}
.btn.pri{background:var(--acc);border-color:var(--acc);color:#1b1b1b}
.btn.red{background:var(--red);border-color:var(--red);color:#fff}
.btn.ok{background:var(--ok);border-color:var(--ok);color:#0e1b14}
.btn.ghost{background:transparent}
.btn.sm{min-height:34px;padding:6px 10px;font-size:.85rem;border-radius:10px}
.btn.full{width:100%}
.icon-btn{width:40px;height:40px;border-radius:10px;border:1px solid var(--line);background:var(--card2);cursor:pointer;font-size:1.1rem;font-weight:800}
.icon-btn.del{color:var(--red2)}
/* Formularios */
label{display:block;font-size:.8rem;color:var(--mut);margin:8px 0 4px}
input,select,textarea{width:100%;background:var(--bg2);border:1px solid var(--line);border-radius:10px;padding:10px 12px;min-height:44px}
textarea{min-height:70px;resize:vertical}
input:focus,select:focus,textarea:focus{outline:2px solid var(--acc);outline-offset:1px}
input[type=checkbox],input[type=radio]{width:20px;height:20px;min-height:0;accent-color:var(--acc)}
.chk{display:flex;align-items:center;gap:8px;font-size:.9rem;color:var(--tx);margin:4px 0}
/* Chips */
.chips{display:flex;gap:8px;overflow-x:auto;padding:4px 0 8px;scrollbar-width:none}
.chip{white-space:nowrap;border:1px solid var(--line);background:var(--card);border-radius:999px;padding:7px 12px;font-size:.85rem;cursor:pointer}
.chip.on{background:var(--acc);border-color:var(--acc);color:#1b1b1b;font-weight:700}
.tag{display:inline-block;font-size:.72rem;padding:2px 8px;border-radius:999px;background:var(--bg2);border:1px solid var(--line);color:var(--mut);margin:2px 4px 2px 0}
.tag.red{color:#fff;background:var(--red);border-color:var(--red)}
.tag.warn{color:#1b1b1b;background:var(--warn);border-color:var(--warn)}
.tag.ok{color:#0e1b14;background:var(--ok);border-color:var(--ok)}
/* Lista inventario */
.item{display:flex;gap:10px;align-items:center;padding:12px;border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0}
.item .ic{font-size:1.4rem;width:32px;text-align:center}
.item .nm{font-weight:700}
.item .qty{min-width:34px;text-align:center;font-weight:800}
.list{background:var(--card);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.edit{background:var(--bg2);padding:12px;border-bottom:1px solid var(--line)}
.alt{background:var(--bg2);padding:10px 12px;border-bottom:1px solid var(--line);font-size:.88rem}
/* Menús */
.day{border-left:4px solid var(--acc)}
.meal{padding:10px 0;border-top:1px dashed var(--line)}
.meal:first-of-type{border-top:0}
.meal .mt{font-size:.75rem;text-transform:uppercase;letter-spacing:.08em;color:var(--acc2)}
.meal .rn{font-weight:700;cursor:pointer;text-decoration:underline dotted}
.ing{font-size:.85rem;color:var(--mut)}
/* Guías */
.gcard{cursor:pointer;display:flex;gap:12px;align-items:flex-start}
.gcard .em{font-size:1.4rem}
.urg{border-color:#7b2b2b;background:linear-gradient(135deg,#3a2326,#25323e)}
.step{display:grid;grid-template-columns:34px 1fr;gap:10px;margin:14px 0}
.step .n{width:34px;height:34px;border-radius:50%;background:var(--acc);color:#1b1b1b;font-weight:900;display:flex;align-items:center;justify-content:center}
.figure{background:#eef3f6;border-radius:14px;padding:6px;margin-top:8px}
.ill{width:100%;height:auto;display:block;max-height:240px}
.ill .sk{fill:#f1c7a1;stroke:#3b3b3b;stroke-width:2}
.ill .cl{fill:#5a7d9a;stroke:#2f4458;stroke-width:2}
.ill .cl2{fill:#7d93a8;stroke:#2f4458;stroke-width:2}
.ill .cr{fill:#d9534f;stroke:#7a2020;stroke-width:2}
.ill .lm{stroke:#d9534f;stroke-width:7;stroke-linecap:round;fill:none}
.ill .leg{stroke:#2f4458;stroke-width:9;stroke-linecap:round;fill:none}
.ill .body{stroke:#5a7d9a;stroke-width:22;stroke-linecap:round;fill:none}
.ill .hand{fill:#e9b48a;stroke:#3b3b3b;stroke-width:2}
.ill .ln{stroke:#3b3b3b;stroke-width:2.5;fill:none;stroke-linecap:round}
.ill .gr{stroke:#9aa7b1;stroke-width:2;stroke-dasharray:6 5}
.ill .ar{stroke:#e67e22;stroke-width:4;stroke-linecap:round}
.ill .arh{fill:#e67e22}
.ill .tx{fill:#1f2a34;font-size:13px;font-weight:600;font-family:system-ui,sans-serif}
.ill .txs{fill:#33414d;font-size:11.5px;font-family:system-ui,sans-serif}
.ill .txb{fill:#b03a2e;font-size:15px;font-weight:800;font-family:system-ui,sans-serif}
.ill .txw{fill:#fff;font-size:14px;font-weight:800;font-family:system-ui,sans-serif}
.ill .wn{fill:#f0b429;stroke:#7a5a00;stroke-width:2}
.ill .dea{fill:#2e9e5b;stroke:#14532d;stroke-width:2}
.ill .pad{fill:#fff;stroke:#333;stroke-width:1.5}
.ill .wire{stroke:#333;stroke-width:2;fill:none}
.ill .blood{fill:#b81d1d}
.ill .gauze{fill:#fff;stroke:#999;stroke-width:1.5}
.ill .band{fill:#222;stroke:#000}
.ill .tap{fill:#9aa7b1;stroke:#555;stroke-width:2}
.ill .water{stroke:#3fa9f5;stroke-width:5;fill:none;stroke-linecap:round}
.ill .burn{fill:#e36a4d;opacity:.8}
.ill .splint{fill:#c79a5b;stroke:#7a5a2a;stroke-width:1.5}
.ill .sling{fill:#f4e3b5;stroke:#9a8650;stroke-width:2;opacity:.85}
.ill .mat{fill:#8a9aa6}
.ill .blanket{fill:#c9a227;stroke:#7a6210;stroke-width:2}
.ill .shade{fill:#7d93a8}
.ill .wet{fill:#9fd3fb;stroke:#3fa9f5}
.ill .drop{fill:#3fa9f5;stroke:#1f6fae}
.ill .ink{fill:#333}
.ill .pen{fill:#f0b429;stroke:#7a5a00;stroke-width:2}
.ill .pentip{fill:#3fa9f5;stroke:#1f6fae}
.ill .cushion{fill:#9fd3fb;stroke:#3fa9f5}
.ill .clock{fill:#fff;stroke:#333;stroke-width:2.5}
.ill .phone{fill:#2c3843;stroke:#111;stroke-width:2}
.ill .cut{stroke:#b81d1d;stroke-width:3}
.ill .bottle,.ill .bottlew{fill:#d8eefc;stroke:#3fa9f5;stroke-width:2}
.ill .tube{fill:#e67e22;stroke:#8a4a10;stroke-width:2}
.ill .juice{fill:#f0a030;stroke:#8a5a10;stroke-width:2}
.ill .pot{fill:#9aa7b1;stroke:#444;stroke-width:2}
.ill .bub{fill:#d8eefc;stroke:#3fa9f5}
.ill .flame{fill:#f39c12;stroke:#c0392b;stroke-width:1.5}
.ill .bleach{fill:#3fa9f5;stroke:#1f6fae;stroke-width:2}
.ill .spoon{fill:#fff;stroke:#555;stroke-width:1.5}
.ill .spoonS{fill:#e0e0e0;stroke:#555;stroke-width:1.5}
.no{background:#3a2326;border:1px solid #7b2b2b;border-radius:12px;padding:10px 12px;margin-top:12px}
.no li{margin:4px 0}
.disc{border:1px dashed var(--line);border-radius:12px;padding:10px;color:var(--mut);font-size:.82rem;margin-top:16px}
/* SOS */
.hold{position:relative;width:100%;border:0;border-radius:22px;padding:22px 14px;font-weight:900;font-size:1.3rem;cursor:pointer;color:#fff;overflow:hidden;user-select:none;-webkit-user-select:none;touch-action:none}
.hold small{display:block;font-weight:600;font-size:.8rem;opacity:.9;margin-top:4px}
.hold.r112{background:var(--red);box-shadow:0 0 0 4px rgba(217,61,61,.25)}
.hold.morse{background:#2c3843;border:2px solid var(--acc)}
.hold::after{content:"";position:absolute;left:0;bottom:0;height:6px;width:calc(var(--p,0)*100%);background:#fff;opacity:.85}
.medcard{background:#fff;color:#111;border-radius:16px;padding:14px;margin:10px 0}
.medcard h3{font-size:1.25rem;margin:0 0 4px}
.medcard .k{font-size:.75rem;text-transform:uppercase;color:#666;letter-spacing:.06em}
.medcard .v{font-size:1.1rem;font-weight:700;margin-bottom:6px}
.medcard .blood{display:inline-block;background:#c0392b;color:#fff;border-radius:8px;padding:2px 10px;font-weight:900}
.msg{background:var(--bg2);border:1px solid var(--line);border-radius:12px;padding:12px;white-space:pre-wrap;word-break:break-word}
#flash{position:fixed;inset:0;z-index:100;background:#000;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding:40px 16px}
#flash.on{background:#fff}
#flash .stop{background:var(--red);color:#fff;border:0;border-radius:20px;padding:22px 40px;font-size:1.4rem;font-weight:900;width:100%;max-width:420px}
#flash .info{color:#888;text-align:center;margin-bottom:16px;font-size:.9rem}
/* Navegación */
nav.tabs{position:fixed;bottom:0;left:0;right:0;z-index:30;background:rgba(24,33,42,.98);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
nav.tabs .in{max-width:860px;margin:auto;display:grid;grid-template-columns:repeat(6,1fr)}
nav.tabs a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px 9px;text-decoration:none;color:var(--mut);font-size:.68rem;font-weight:600}
nav.tabs a .e{font-size:1.25rem;line-height:1.2}
nav.tabs a.on{color:var(--acc2)}
nav.tabs a.sos .e{background:var(--red);border-radius:8px;padding:0 6px;color:#fff;font-size:.8rem;font-weight:900;line-height:1.6;margin:2px 0}
.menu-list a{display:flex;align-items:center;gap:12px;padding:14px;border-bottom:1px solid var(--line);color:var(--tx);text-decoration:none}
.menu-list a:last-child{border-bottom:0}
.menu-list .e{font-size:1.4rem}
.toast{position:fixed;left:50%;bottom:92px;transform:translateX(-50%);background:#111;color:#fff;padding:10px 16px;border-radius:12px;z-index:200;font-size:.9rem;max-width:90vw;box-shadow:var(--sh)}
.empty{text-align:center;color:var(--mut);padding:24px}
.back{display:inline-block;margin-bottom:8px;color:var(--mut);text-decoration:none}
details summary{cursor:pointer;font-weight:700;padding:6px 0}
table.shop{width:100%;border-collapse:collapse;font-size:.9rem}
table.shop td{padding:8px 4px;border-bottom:1px solid var(--line);vertical-align:top}
@media(min-width:700px){.grid-wide{display:grid;grid-template-columns:1fr 1fr;gap:12px}}
@media print{nav.tabs,.top,.noprint{display:none!important}body{background:#fff;color:#000}.card{box-shadow:none;border-color:#ccc;background:#fff}}
a.card,a.item,a.chip{text-decoration:none;color:inherit}

.map{height:340px;border-radius:14px;overflow:hidden;border:1px solid var(--line);margin:10px 0;background:#cfd8de}
.leaflet-container{font:inherit}
.dot{width:14px;height:14px;border-radius:50%;display:inline-block;background:#2fbf71}
.dot[data-c="1"]{background:#f0a030}.dot[data-c="2"]{background:#3fa9f5}
.item.cur{background:rgba(240,160,48,.18)}
ol.small{padding-left:20px;margin:6px 0}ol.small li{margin:4px 0}

.assist{display:block}
.ring{width:58px;height:58px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:none;background:var(--bg2)}
.ring span{width:44px;height:44px;border-radius:50%;background:var(--card);display:flex;align-items:center;justify-content:center;font-weight:900}
.wxstrip{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(70px,1fr);gap:8px;overflow-x:auto;padding-bottom:6px}
.wxd{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:8px;text-align:center}
.wxe{font-size:1.6rem}
.alert{border-left:5px solid var(--warn)}.alert.lv2{border-left-color:#ff8a2a}.alert.lv3{border-left-color:var(--red2)}
.alert ul{margin:6px 0 8px;padding-left:18px}
.tag.ora{background:#ff8a2a;border-color:#ff8a2a;color:#1b1b1b}
.warnt{color:var(--warn)}
.btn.emg{flex-direction:column;min-height:84px;text-align:center}.btn.emg .em{font-size:1.6rem}
.emgbtn{background:#3a2326;border-color:#7b2b2b;color:#fff;margin-bottom:12px}
.emgbar{display:block;background:var(--red);color:#fff;font-weight:800;text-decoration:none;padding:10px 14px;border-radius:12px;margin-bottom:12px}

.talk{margin:-2px 0 12px;background:#2c3843;border-color:var(--acc)}
.fab{position:fixed;right:16px;bottom:calc(84px + env(safe-area-inset-bottom));z-index:40;width:58px;height:58px;border-radius:50%;border:2px solid var(--acc);background:#2c3843;font-size:1.6rem;box-shadow:var(--sh);cursor:pointer}
.fdot{position:absolute;top:4px;right:4px;width:14px;height:14px;border-radius:50%;background:var(--red2);border:2px solid #2c3843}
body.chat-open .fab{display:none}
#chat{position:fixed;inset:0;z-index:60;background:var(--bg);display:none;flex-direction:column;padding-bottom:env(safe-area-inset-bottom)}
#chat.open{display:flex}
@media(min-width:700px){#chat{left:auto;width:420px;border-left:1px solid var(--line)}}
.chat-h{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--line);background:var(--bg2)}
.chat-b{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.msg-bot,.msg-me{max-width:88%;padding:10px 12px;border-radius:14px;line-height:1.45}
.msg-bot{background:var(--card);border:1px solid var(--line);align-self:flex-start;border-bottom-left-radius:4px}
.msg-me{background:var(--acc);color:#1b1b1b;align-self:flex-end;border-bottom-right-radius:4px;font-weight:600}
.msg-bot ol{margin:6px 0;padding-left:20px}
.acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.chat-s{padding:4px 12px}
.chat-i{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--line);background:var(--bg2)}
#vMic.on{background:var(--red);border-color:var(--red);animation:pul 1s infinite}
@keyframes pul{50%{transform:scale(1.08)}}
#metro{position:fixed;inset:0;z-index:110;background:#14080a;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;text-align:center}
#metro .mbig{font-size:3rem}#metro .mcount{font-size:5rem;font-weight:900;color:#fff;transition:transform .08s}#metro .mcount.pulse{transform:scale(1.12)}
#metro .info{color:#ccc;max-width:420px}
#metro .stop{background:#333;color:#fff;border:0;border-radius:18px;padding:18px 40px;font-size:1.2rem;font-weight:900;width:100%;max-width:420px}

.center{text-align:center}.big2{font-size:2.2rem;font-weight:900}
.compass{display:flex;justify-content:center;margin:16px 0}
.dial{width:230px;height:230px;border-radius:50%;border:6px solid var(--line);background:radial-gradient(circle,var(--card2),var(--bg2));position:relative;display:flex;align-items:center;justify-content:center}
.dial .n{position:absolute;top:6px;left:50%;transform:translateX(-50%);color:var(--red2);font-weight:900}
.arrow{font-size:7rem;line-height:1;color:var(--acc);transition:transform .25s ease-out;filter:drop-shadow(0 4px 8px rgba(0,0,0,.4))}
.pin-emo{font-size:20px;line-height:26px;text-align:center;background:#fff;border-radius:50%;box-shadow:0 1px 4px rgba(0,0,0,.4)}
.qrbox{background:#fff;padding:12px;border-radius:12px;max-width:340px;margin:12px auto}.qrbox svg{width:100%;height:auto;display:block}
button.item{width:100%;background:transparent;border:0;border-bottom:1px solid var(--line);color:inherit;cursor:pointer}
#lock{position:fixed;inset:0;z-index:200;background:var(--bg);display:none;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center}
#lock.open{display:flex}#lock input{max-width:240px;text-align:center;font-size:1.6rem;letter-spacing:.4em}#lock .btn{max-width:320px}#lock img{border-radius:50%}
.emgbar{border:0;width:100%;text-align:left;cursor:pointer}
.sheet{background:#fff;color:#111;border-radius:12px;padding:18px;margin-top:10px}
.sheet h2{margin:0 0 4px;font-size:1.2rem}.sheet h3{margin:14px 0 6px;font-size:1rem;border-bottom:2px solid #c0392b;padding-bottom:2px}
.sheet table{width:100%;border-collapse:collapse;font-size:.88rem}.sheet td{border-bottom:1px solid #ddd;padding:4px 6px;vertical-align:top}
.sheet p{font-size:.88rem}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px;margin-top:12px}
.pcard{background:#fff;color:#111;border:2px dashed #999;border-radius:10px;padding:10px;font-size:.78rem;line-height:1.35;min-height:150px}
.pcard span{background:#c0392b;color:#fff;border-radius:4px;padding:0 6px;font-weight:800}
@media print{.fab,#chat,#metro,#flash,.noprint,.emgbar{display:none!important}main{padding:0;max-width:none}.sheet{border-radius:0;padding:0}.cards{page-break-before:always;grid-template-columns:repeat(2,85.6mm)}.pcard{width:85.6mm;min-height:54mm;break-inside:avoid}}
