:root {
  --bg: #070b16; --bg2: #0d1426; --card: #111a30; --card2: #16213b; --line: #223052; --tx: #e8eefc; --mut: #8fa0c4;
  --red: #ff3b4e; --red2: #ff6b78; --blue: #4aa3ff; --amber: #ffb84a; --green: #3ddc97; --r: 16px;
  --nav-h: 62px; --vh-px: 100vh; --app-h: var(--vh-px); --top-h: calc(var(--app-h) * .4);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: var(--app-h); background: var(--bg); color: var(--tx); font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
#view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { overflow-y: auto; flex: 1; padding: 14px 16px 24px; }
.hdr { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.hdr h1 { font-size: 20px; font-weight: 700; }
.hdr small { display: block; color: var(--mut); font-size: 12.5px; font-weight: 400; }
.back { font-size: 24px; padding: 2px 8px 2px 0; color: var(--tx); }
.seg { display: flex; margin-left: auto; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--mut); white-space: nowrap; }
.seg button.on { background: #1d4f9e; color: #fff; }
.seg button[disabled] { opacity: .45; }

/* barra inferior */
nav.bar { display: flex; height: var(--nav-h); background: var(--bg2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); flex: none; }
nav.bar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--mut); }
nav.bar button svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav.bar button.on { color: var(--blue); }

/* panel superior (dibujo) */
.top { height: var(--top-h); min-height: 190px; flex: none; display: flex; justify-content: center; align-items: center; position: relative; border-bottom: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 0%, #101a33, var(--bg)); }
.leg { position: relative; width: min(100%, calc(var(--top-h) * 1.2917)); margin: auto; }
.leg-svg { width: 100%; height: auto; display: block; }
.leg .skin { stroke: #33436a; stroke-width: 1.2; }
.leg .ctx { fill: #26324f; stroke: #3a4a72; stroke-width: .6; }
.leg .pat { fill: #1c2640; stroke: #3a4a72; stroke-width: 1; }
.leg .pat.ham { fill: none; }
.leg .mb { fill: #34456b; stroke: #5a6e9c; stroke-width: .8; transition: fill .25s, stroke .25s; }
.leg .mus { cursor: pointer; }
.leg .mus:hover .mb { fill: #3d527f; }
.leg .mf { pointer-events: none; }
.leg .mus.on .mb { stroke: #ff9aa4; }
.leg .mus.r-sel .mb { fill: #ff2b40; stroke: #ffc2c8; stroke-width: 1.2; }
.leg .mus.r-afectado .mb { fill: #e8283c; }
.leg .mus.r-agonista .mb { fill: #d92b3d; }
.leg .mus.r-sinergista .mb { fill: #b82a3c; }
.leg .mus.r-antagonista .mb { fill: #7d2a40; stroke-dasharray: 3 2; }
.leg .mus.r-tendon .mb { fill: #ff6b78; }
.leg .mus.r-cadena .mb { fill: #6a2a44; stroke-dasharray: 2 2; }
.leg .view:not(.active) { }
.leg .view.active .skin { stroke: #4aa3ff; stroke-width: 1.8; }
.leg .vt { fill: #5f7099; font-size: 13px; letter-spacing: 2px; text-anchor: middle; }
.leg .ln { fill: none; stroke: #ff5566; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.leg .ln-antagonista, .leg .ln-cadena { stroke-dasharray: 4 3; }
.leg .ln-tendon { stroke-width: 2.4; }
.leg .dot { fill: #ff5566; }
.leg .lead { stroke-width: .8; opacity: .55; stroke-dasharray: none; }
.leg .zr { fill: #ff2b40; opacity: 0; transition: opacity .3s; pointer-events: none; }
.leg .zr.on { opacity: .28; }
.leg .trp-halo { fill: #ff2b40; opacity: .35; }
.leg .trp-dot { fill: #ff2b40; stroke: #fff; stroke-width: 1; }
.pills { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.pill { position: absolute; transform: translate(-50%, -50%); background: rgba(8, 12, 24, .82); border: 1px solid #ff5566; border-radius: 8px; padding: 1px 5px; line-height: 1.1; text-align: center; white-space: nowrap; }
.pill b { display: block; font-size: 10px; font-weight: 600; }
.pill i { display: block; font-size: 8.5px; font-style: normal; color: var(--red2); }
.pill.p-sel { background: var(--red); border-color: #fff; }
.pill.p-sel i { color: #fff; }
.pill.p-antagonista, .pill.p-cadena { border-style: dashed; }
.top .note { position: absolute; left: 8px; bottom: 4px; font-size: 10.5px; color: var(--mut); background: rgba(7, 11, 22, .7); padding: 2px 6px; border-radius: 6px; }

/* panel inferior */
.bottom { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg2); }
.tools { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex: none; overflow-x: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.chip.on { background: #1d4f9e; border-color: #3b82e0; color: #fff; }
.chip.red { background: var(--red); border-color: var(--red); color: #fff; }
.cam { position: relative; flex: 1; min-height: 0; background: #000; overflow: hidden; }
.cam video, .cam canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .msg { position: absolute; left: 10px; right: 10px; bottom: 10px; background: rgba(7, 11, 22, .78); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 12.5px; z-index: 3; }
.cam .empty { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; color: var(--mut); z-index: 2; background: linear-gradient(#0d1426, #0a0f1f); }
.btn { background: var(--red); color: #fff; border-radius: 999px; padding: 11px 20px; font-weight: 600; }
.btn.ghost { background: var(--card2); border: 1px solid var(--line); color: var(--tx); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.mcard { position: absolute; top: 8px; right: 8px; width: min(62%, 270px); background: rgba(10, 18, 38, .93); border: 1px solid #2d6bd1; border-radius: 14px; padding: 10px 12px; z-index: 4; box-shadow: 0 6px 24px #0008; max-height: calc(100% - 16px); overflow: auto; }
.mcard h3 { font-size: 17px; line-height: 1.1; }
.mcard h3 em { display: block; font-size: 12px; font-style: italic; color: var(--mut); font-weight: 400; margin-top: 2px; }
.kv { margin-top: 8px; font-size: 12.5px; }
.kv b { color: var(--blue); display: block; font-size: 12px; }
.kv span { color: #cfd9f0; }
.unv { display: inline-block; font-size: 10.5px; color: var(--amber); border: 1px solid #6b5420; border-radius: 6px; padding: 0 5px; margin-top: 6px; }
.mcard .more { margin-top: 8px; width: 100%; }
.calib { position: absolute; left: 8px; top: 8px; z-index: 5; background: rgba(10, 18, 38, .93); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; max-width: 58%; }
.calib select { background: var(--card2); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }

/* listas / tarjetas */
.search { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--tx); padding: 10px 12px; font: inherit; font-size: 16px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; text-align: left; width: 100%; display: flex; gap: 10px; align-items: center; }
.item .ico { font-size: 22px; flex: none; }
.item h3 { font-size: 15px; }
.item p { font-size: 12.5px; color: var(--mut); }
.item.sel { border-color: var(--red); }
.sect { margin: 14px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.tag { display: inline-block; font-size: 11.5px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; margin: 2px 4px 2px 0; }
.tag.r { border-color: #7a2733; color: var(--red2); }
.tag.n { border-style: dashed; color: var(--mut); }
ul.pts { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; }
ul.pts li { margin: 2px 0; }
.src { font-size: 11.5px; color: var(--mut); margin-top: 6px; }
.src a { color: #7fb4ff; }
.aviso { background: #2a2110; border: 1px solid #6b5420; color: #ffd98a; border-radius: 12px; padding: 8px 12px; font-size: 12.5px; margin: 8px 0; }
.edu { text-align: center; font-size: 11px; color: var(--mut); padding: 4px 8px; flex: none; }
.hero { background: linear-gradient(135deg, #12306a, #1a1030 70%); border: 1px solid #2a4b8f; border-radius: 20px; padding: 18px; }
.hero h2 { font-size: 22px; line-height: 1.15; }
.hero p { color: #b9c7e8; margin: 6px 0 12px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.tile .ico { font-size: 26px; }
.tile b { font-size: 14.5px; }
.tile span { font-size: 12px; color: var(--mut); }

/* seguridad */
.sem { border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid; background: var(--card); }
.sem.rojo { border-color: #8a2431; background: linear-gradient(#2a1018, #14101a); }
.sem.amarillo { border-color: #7a5a1a; background: linear-gradient(#241b0c, #14121a); }
.sem.verde { border-color: #1d6b4a; background: linear-gradient(#0e2419, #0e141a); }
.sem .row { display: flex; gap: 12px; align-items: center; }
.sem .big { font-size: 38px; line-height: 1; }
.sem h3 { font-size: 16px; }
.sem .mot { font-size: 13px; color: #c9d4ee; }
.sem .act { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.rojo .act { background: #ff3b4e; color: #fff; } .amarillo .act { background: #ffb84a; color: #2a1d00; } .verde .act { background: #3ddc97; color: #04251a; }
.sem details { margin-top: 8px; font-size: 13px; }
.sem summary { color: var(--blue); cursor: pointer; }
.light { display: flex; gap: 6px; margin: 6px 0 10px; }
.light button { flex: 1; padding: 9px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 13px; }
.light button.on { outline: 2px solid #fff3; }

/* estudio */
.qbox { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin: 10px 16px; }
.prog { height: 8px; border-radius: 8px; background: var(--card2); overflow: hidden; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, #4aa3ff, #3ddc97); transition: width .3s; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.opts button { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; font-size: 14px; }
.opts button.ok { background: #145a3a; border-color: var(--green); }
.opts button.bad { background: #5a1420; border-color: var(--red); }
.qline { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mut); margin-bottom: 6px; }
.big-q { font-size: 19px; font-weight: 700; text-align: center; padding: 6px 0; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin-top: 8px; }
.bars div { flex: 1; background: linear-gradient(#4aa3ff, #1d4f9e); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
.bars span { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-size: 11px; }

/* técnicas */
.tec { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.tec svg.anim { width: 100%; height: 96px; background: #0b1224; border-radius: 12px; display: block; margin-bottom: 8px; }
.tec h3 { font-size: 16px; }
.tec .k { font-size: 12px; color: var(--blue); font-weight: 600; margin-top: 6px; display: block; }
.tec .v { font-size: 13px; color: #cfd9f0; }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.sheet > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 22px 22px 0 0; width: min(560px, 100%); max-height: calc(var(--vh-px) * .88); overflow: auto; padding: 16px 16px 28px; }
.sheet h2 { font-size: 20px; }
.sheet .x { float: right; font-size: 22px; color: var(--mut); }
.ex { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 8px; }
.ex ol { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.badge-e { font-size: 11px; border-radius: 999px; padding: 1px 8px; background: #123a66; color: #9ccaff; }
.badge-f { font-size: 11px; border-radius: 999px; padding: 1px 8px; background: #3a1230; color: #ffa0d0; }

.mcard .kv span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rel { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.rel .tag { white-space: nowrap; flex: none; }

/* ===== rediseño estilo maqueta ===== */
.hdr { padding: 14px 16px 10px; background: linear-gradient(#0b1329, var(--bg)); }
.hdr h1 { font-size: 24px; letter-spacing: -.01em; }
.hdr small { color: #7f93bd; }
.seg { background: #0d1630; border-color: #1f2d52; box-shadow: inset 0 0 0 1px #0004; }
.seg button.on { background: linear-gradient(#2a6ad0, #1b4ea3); box-shadow: 0 2px 10px #1b4ea388; }
.top { background: radial-gradient(90% 70% at 50% 30%, #12214a 0%, #0a1126 55%, var(--bg) 100%); border-bottom: 0; }
.leg .mb { fill: #3a4d78; stroke: #6a7fae; stroke-width: .7; }
.leg .mus.r-sel .mb { fill: #ff2e44; stroke: #ffd0d5; }
.lab { position: absolute; transform: translate(0, -50%); line-height: 1.15; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 3px #000c; }
.lab.L { transform: translate(-100%, -50%); text-align: right; }
.lab b { display: block; font-size: 10.5px; font-weight: 600; color: #fff; }
.lab i { display: block; font-style: normal; font-size: 9px; color: #8fa0c4; }
.lab.p-sel b { color: #ff5566; font-size: 12.5px; font-weight: 700; } .lab.p-sel i { color: #ff8a96; }
.lab.p-agonista i, .lab.p-sinergista i, .lab.p-antagonista i, .lab.p-tendon i, .lab.p-cadena i { color: #ff7d89; }
.leg .lead { stroke: #ff5566; stroke-width: .9; opacity: .75; }
.leg .ln-idle, .leg .lead.ln-idle { stroke: #7f93bd; opacity: .5; }
.leg .dot { fill: #ff4d5e; stroke: #fff; stroke-width: .8; } .leg .dot.d-idle { fill: #8fa0c4; stroke: none; }
.leg .chain { fill: none; stroke: #ff4d5e; stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .9; }
.lab.chainlab { transform: translate(-50%, -50%); text-align: center; background: #0a1126cc; border-radius: 10px; padding: 2px 6px; }
.lab.chainlab svg { width: 12px; height: 12px; stroke: #ff4d5e; fill: none; stroke-width: 2; stroke-linecap: round; display: block; margin: 0 auto 1px; }
.lab.chainlab b { font-size: 9.5px; font-weight: 500; }
.bottom { border-radius: 24px 24px 0 0; margin-top: -10px; position: relative; z-index: 2; background: linear-gradient(#0f1a38, #0a1122 40%); border-top: 1px solid #243764; box-shadow: 0 -10px 30px #0009; }
.bottom::before { content: ''; position: absolute; top: 7px; left: 50%; width: 44px; height: 4px; margin-left: -22px; background: #3b4d7a; border-radius: 4px; }
.bottom .tools { padding-top: 20px; }
.chip { background: #111d3d; border-color: #24365f; }
.cam { border-top: 1px solid #1a2850; }
.mcard { top: 14px; right: 10px; width: min(70%, 290px); padding: 0; background: linear-gradient(#0e1a38ee, #0a1226ee); border: 1.5px solid #2f7be0; border-radius: 16px; box-shadow: 0 0 0 1px #0007, 0 10px 30px #000a, 0 0 22px #2f7be033; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mc-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border-bottom: 1px solid #22345e; }
.mc-th { flex: none; width: 46px; height: 46px; border-radius: 14px; background: radial-gradient(circle at 40% 30%, #26335a, #0c1430); border: 1px solid #2a3b66; display: grid; place-items: center; }
.th { width: 34px; height: 38px; filter: drop-shadow(0 0 5px #ff2e44aa); } .th path { fill: #ee2a40; stroke: #ffb3bb; stroke-width: 1.2; }
.mc-t { flex: 1; min-width: 0; } .mc-t b { display: block; font-size: 18px; line-height: 1.1; } .mc-t i { display: block; font-style: normal; color: #9db0d6; font-size: 13px; margin-top: 1px; }
.mc-chev { font-size: 22px; color: #9db0d6; }
.mc-row { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #1c2c52; }
.mc-row:last-of-type { border-bottom: 0; }
.mc-ic { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #16264d; display: grid; place-items: center; }
.mc-ic svg { width: 16px; height: 16px; stroke: #5aa2ff; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mc-row b { display: block; color: #5aa2ff; font-size: 13.5px; } .mc-row p { font-size: 12.5px; color: #d3dcf2; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mcard .unv { margin: 0 12px 10px; }
nav.bar { background: #080e20; border-top: 1px solid #1a2850; }
nav.bar button.on { color: #3d95ff; } nav.bar button.on svg { filter: drop-shadow(0 0 6px #3d95ff88); }
@media (min-width: 640px) and (hover: hover) and (pointer: fine) {
  :root { --app-h: min(880px, calc(var(--vh-px) - 44px)); }
  html { background: radial-gradient(60% 50% at 50% 40%, #0d1a3a, #02040a); }
  body { height: var(--app-h); margin: 22px auto; max-width: 410px; border: 11px solid #0a0e1a; border-radius: 52px; box-shadow: 0 0 0 2px #243457, 0 40px 90px #000c, 0 0 80px #1b4ea322; position: relative; }
  body::before { content: ''; position: absolute; top: 8px; left: 50%; width: 112px; height: 28px; margin-left: -56px; background: #000; border-radius: 20px; z-index: 80; }
  body #view { padding-top: 26px; }
}

.hdr h1 { font-size: 22px; } .hdr small { font-size: 12px; white-space: nowrap; }
.hdr .seg button { padding: 6px 10px; font-size: 12.5px; }
.lab b { font-size: 10px; } .lab i { font-size: 8.8px; }
.bottom { margin-top: 0; }

/* ===== compatibilidad iPhone/Android ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
body { touch-action: manipulation; -webkit-font-smoothing: antialiased; }
#view { padding-top: env(safe-area-inset-top); }
nav.bar { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.scroll, .tools, .rel, .chips, .mcard, .sheet > div { -webkit-overflow-scrolling: touch; }
.calib select, .search, input, select { font-size: 16px; }
@media (max-height: 680px) { :root { --top-h: calc(var(--app-h) * .34); } .hdr { padding-top: 8px; padding-bottom: 4px; } nav.bar button svg { width: 21px; height: 21px; } }
@media (max-width: 340px) { .hdr h1 { font-size: 19px; } .hdr small { display: none; } .seg button { padding: 5px 8px; font-size: 12px; } .tile { padding: 11px 9px; } }

/* ===== contracción: rojo + pulso ===== */
@keyframes contrae { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, .965); } }
@keyframes latido { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.leg .mus.r-sel .mb, .leg .mus.r-agonista .mb, .leg .mus.r-sinergista .mb, .leg .mus.r-afectado .mb { transform-box: fill-box; transform-origin: 50% 50%; animation: contrae 1.5s ease-in-out infinite; }
.leg .mus.r-agonista .mb, .leg .mus.r-sinergista .mb, .leg .mus.r-afectado .mb { fill: #e0283c; }
.leg .mus.r-antagonista .mb { fill: #6b3a5c; }
.leg .dot.d-sel { animation: latido 1.2s ease-in-out infinite; }
.lab.p-afectado b, .lab.p-agonista b, .lab.p-sinergista b { color: #ffd9dd; } .lab.p-afectado i { color: #ff7d89; }
.tag.pulse { animation: latido 1.4s ease-in-out infinite; }
.tag.a { border-color: #35507f; color: #9ccaff; }
.rel .chip.sm { padding: 4px 10px; font-size: 12px; flex: none; } .rel .sep { flex: none; width: 1px; background: #24365f; margin: 0 4px; }
@media (prefers-reduced-motion: reduce) { .leg .mus .mb, .tag.pulse, .leg .dot, .hero *, #view > * { animation: none !important; } }

/* ===== bacán: movimiento y detalles ===== */
@keyframes sube { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#view > * { animation: sube .35s ease both; }
.tile, .item, .chip, .btn { transition: transform .12s, background .2s, border-color .2s; }
.tile:active, .item:active, .chip:active, .btn:active { transform: scale(.96); }
.tile:hover, .item:hover { border-color: #2f4a8a; }
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 120% at 100% 0%, #1a3f8f 0%, #12183a 55%, #130d24 100%); }
.hero > *:not(.herobg) { position: relative; z-index: 1; }
.hero .herobg { position: absolute; top: -18px; right: -70px; width: 330px; opacity: .55; pointer-events: none; z-index: 0; -webkit-mask-image: linear-gradient(to left, #000 45%, transparent); mask-image: linear-gradient(to left, #000 45%, transparent); }
.hero .herobg .leg { width: 100%; } .hero h2 { font-size: 24px; text-shadow: 0 2px 12px #0008; }
/* sin barras de scroll visibles (en celular ya son táctiles) */
.tools, .rel, .chips, .scroll, .mcard { scrollbar-width: none; }
.tools::-webkit-scrollbar, .rel::-webkit-scrollbar, .chips::-webkit-scrollbar, .scroll::-webkit-scrollbar, .mcard::-webkit-scrollbar { display: none; }

/* ===== regiones ===== */
.top { position: relative; }
.regsw { position: absolute; top: 8px; left: 8px; display: flex; background: rgba(8, 14, 32, .75); border: 1px solid #1f2d52; border-radius: 999px; padding: 2px; z-index: 3; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.regsw button { padding: 4px 9px; font-size: 11.5px; border-radius: 999px; color: #8fa0c4; }
.regsw button.on { background: linear-gradient(#2a6ad0, #1b4ea3); color: #fff; }
.leg .deco { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: .8; pointer-events: none; }

/* etiquetas: tamaños relativos (JS fija el font-size del contenedor según el ancho) */
.pills { font-size: 10px; }
.lab b { font-size: 1em; } .lab i { font-size: .88em; } .lab.p-sel b { font-size: 1.2em; } .lab.chainlab b { font-size: .95em; }

.leg .mus:focus { outline: none; } .leg .mus:focus-visible .mb { stroke: #fff; stroke-width: 1.6; }

/* el atributo hidden debe ganar siempre (antes la capa «Activar cámara» tapaba el video) */
[hidden] { display: none !important; }

/* con la cámara activa, más espacio para la cámara */
#view.camon { --top-h: calc(var(--app-h) * .3); }
.cam .msg { font-size: 12.5px; line-height: 1.3; }

/* controles sobre la cámara */
.camctl { position: absolute; left: 8px; top: 8px; z-index: 5; display: flex; gap: 6px; }
.camctl button { background: rgba(8, 14, 32, .78); border: 1px solid #2a3c6b; border-radius: 999px; padding: 6px 11px; font-size: 12px; color: #fff; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.camctl button:active { transform: scale(.95); }

/* con la cámara activa la tarjeta es compacta para no tapar tu cuerpo */
#view.camon .mcard { width: min(56%, 230px); top: 8px; right: 8px; }
#view.camon .mc-row:nth-of-type(n+2), #view.camon .mcard .unv { display: none; }
#view.camon .mc-head { padding: 8px 10px; } #view.camon .mc-th { width: 38px; height: 38px; } #view.camon .mc-t b { font-size: 15px; }

/* ===== Trabajos ===== */
#view.modo-lista .top { display: none; }
.srch { position: relative; margin-bottom: 4px; }
.srch input { width: 100%; background: linear-gradient(#111d3d, #0d1731); border: 1px solid #2a4b8f; border-radius: 16px; color: var(--tx); padding: 13px 40px 13px 40px; font: inherit; font-size: 16px; box-shadow: 0 4px 18px #0006; outline: none; }
.srch input:focus { border-color: #4aa3ff; box-shadow: 0 0 0 3px #4aa3ff33, 0 4px 18px #0006; }
.srch .lupa { position: absolute; left: 14px; top: 12px; font-size: 17px; pointer-events: none; }
.srch #qx { position: absolute; right: 8px; top: 7px; width: 32px; height: 32px; border-radius: 50%; color: var(--mut); font-size: 15px; }
.sugs { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; z-index: 20; background: #0e1830; border: 1px solid #2a4b8f; border-radius: 14px; overflow: hidden; box-shadow: 0 12px 34px #000b; }
.sugs button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid #1c2c52; font-size: 14px; }
.sugs button:last-child { border-bottom: 0; } .sugs button b { font-weight: 600; } .sugs button span { color: var(--mut); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips .lbl { align-self: center; font-size: 12px; color: var(--mut); white-space: nowrap; padding-right: 2px; }
.chip.sm { padding: 5px 11px; font-size: 12px; }
.zc { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; margin: 2px 4px 2px 0; border: 1px solid; background: #0b1226; }
.zc.z1 { color: #ff9b6e; border-color: #7a3a22; } .zc.z2 { color: #ffd34d; border-color: #6e5a14; } .zc.z3 { color: #6ee0ac; border-color: #1d6b4a; }
.zc.z4 { color: #7cb6ff; border-color: #24508f; } .zc.z5 { color: #cfa3ff; border-color: #5a3a8a; } .zc.z6 { color: #ff8fb4; border-color: #7a2a49; }
.chip.zc.on { background: #1d4f9e; color: #fff; border-color: #3b82e0; }
.tcard { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; background: linear-gradient(#111a30, #0e1629); border: 1px solid var(--line); border-radius: 18px; padding: 13px; margin-bottom: 10px; }
.tcard:active { transform: scale(.985); } .tcard:hover { border-color: #2f4a8a; }
.emo { font-size: 30px; width: 48px; height: 48px; flex: none; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #1d2c52, #0c1430); border: 1px solid #243764; border-radius: 15px; }
.emo.big { width: 56px; height: 56px; font-size: 34px; }
.tc-b { flex: 1; min-width: 0; } .tc-b h3 { font-size: 15.5px; } .tc-b p { font-size: 12.5px; color: var(--mut); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 4px; }
.tc-m { font-size: 12px; color: #ffb3bb; margin-top: 2px; } .tc-m i { color: var(--mut); font-style: normal; }
.tc-why { margin-top: 5px; font-size: 11.5px; color: #9ccaff; background: #0f2144; border-radius: 8px; padding: 3px 8px; display: inline-block; }
.chev { color: #5f7099; font-size: 22px; }
.vacio { background: var(--card); border: 1px dashed var(--line); border-radius: 16px; padding: 16px; text-align: center; } .vacio p { color: var(--mut); font-size: 13px; margin-top: 4px; }
.thead { display: flex; gap: 12px; align-items: center; margin: 12px 0 8px; } .thead h2 { font-size: 21px; line-height: 1.15; }
.resumen { background: linear-gradient(#15244a, #0e1730); border: 1px solid #2a4b8f; border-radius: 16px; padding: 10px 12px; margin: 8px 0 12px; } .resumen b { font-size: 12px; color: #9ccaff; text-transform: uppercase; letter-spacing: .06em; }
.sec { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 13px; margin-bottom: 10px; }
.sec h3 { font-size: 15px; display: flex; align-items: center; gap: 7px; margin-bottom: 6px; } .sec h3 em { color: var(--mut); font-style: normal; font-weight: 400; font-size: 13px; }
.sec > p { font-size: 14px; color: #d3dcf2; } details.sec summary { cursor: pointer; font-weight: 600; }
.zg h4 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin: 12px 0 6px; } .zg h4.z1 { color: #ff9b6e; } .zg h4.z2 { color: #ffd34d; } .zg h4.z3 { color: #6ee0ac; } .zg h4.z4 { color: #7cb6ff; } .zg h4.z5 { color: #cfa3ff; } .zg h4.z6 { color: #ff8fb4; }
.mrow { display: flex; gap: 10px; align-items: stretch; background: #0b1226; border: 1px solid #1c2c52; border-radius: 14px; padding: 9px 10px 9px 0; margin-bottom: 7px; overflow: hidden; }
.mrow .bar { flex: none; width: 5px; border-radius: 0 4px 4px 0; background: #5f7099; } .mrow.z1 .bar { background: #ff9b6e; } .mrow.z2 .bar { background: #ffd34d; } .mrow.z3 .bar { background: #6ee0ac; } .mrow.z4 .bar { background: #7cb6ff; } .mrow.z5 .bar { background: #cfa3ff; } .mrow.z6 .bar { background: #ff8fb4; }
.mrow.foco { border-color: #ff4d5e; box-shadow: 0 0 0 1px #ff4d5e55, 0 0 14px #ff4d5e33; }
.mb2 { flex: 1; min-width: 0; } .mb2 b { display: block; font-size: 14.5px; } .mb2 em { display: block; font-size: 11px; color: var(--mut); }
.mb2 .why { display: block; font-size: 13px; color: #d3dcf2; margin-top: 3px; line-height: 1.35; } .mb2 .why i { color: var(--mut); }
.tg { display: inline-block; font-size: 10.5px; margin-top: 5px; padding: 1px 7px; border-radius: 999px; border: 1px dashed #6b5420; color: var(--amber); } .tg.ok { border: 1px solid #1d6b4a; color: #6ee0ac; }
.acc { display: flex; flex-direction: column; gap: 6px; justify-content: center; } .acc button { font-size: 12px; padding: 6px 10px; border-radius: 999px; background: #16264d; border: 1px solid #24365f; white-space: nowrap; } .acc button[disabled] { opacity: .45; }
.acc button:first-child:not([disabled]) { background: linear-gradient(#2a6ad0, #1b4ea3); border-color: #3b82e0; color: #fff; }
