/* AVMB · NeuroLab 3D v2 */
:root { --bg: #0c0c0f; --card: rgba(16,16,19,.86); --card2: rgba(255,255,255,.035); --line: rgba(255,255,255,.085); --line2: rgba(255,255,255,.16); --tx: #f1edeb; --mut: #a39e9c; --red: #e3202f; --red2: #ff3a4a; --ok: #3ecf8e; --warn: #f2b33d; --r: 16px; --shadow: 0 24px 60px rgba(0,0,0,.45); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--tx); font-family: Montserrat, system-ui, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

/* barra superior */
.nl-bar { position: fixed; inset: 0 0 auto 0; height: 60px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; padding-top: env(safe-area-inset-top); background: linear-gradient(180deg, rgba(12,12,15,.98), rgba(12,12,15,.78)); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.nl-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.nl-brand img { border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 1px var(--line2); }
.nl-brand strong { display: block; font-size: 15px; letter-spacing: .03em; white-space: nowrap; }
.nl-brand strong i, .nl-load-logo i { color: var(--red); font-style: normal; }
.nl-brand small { display: block; font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; }
.nl-links { display: flex; gap: 8px; flex: none; }
.nl-links a { text-decoration: none; font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line2); transition: .2s; }
.nl-links a:hover { background: rgba(255,255,255,.06); }
.nl-links .nl-app { background: var(--red); border-color: var(--red); box-shadow: 0 6px 20px rgba(227,32,47,.35); }

.nl-stage { position: fixed; inset: 60px 0 0 0; }
.nl-canvas { position: absolute; inset: 0; }
.nl-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* pantalla de carga */
.nl-loading { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #1d0c0f 0%, #0c0c0f 65%); transition: opacity .8s; }
.nl-loading.done { opacity: 0; pointer-events: none; }
.nl-load-card { text-align: center; width: min(360px, 80vw); }
.nl-load-logo { font-weight: 800; font-size: 46px; letter-spacing: .04em; }
.nl-load-k { margin: 4px 0 26px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--mut); }
.nl-load-bar { height: 3px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.nl-load-bar i { display: block; height: 100%; width: 4%; background: linear-gradient(90deg, var(--red), var(--red2)); box-shadow: 0 0 12px var(--red); transition: width .35s; }
.nl-load-t { font-size: 12.5px; color: var(--mut); margin-top: 14px; min-height: 1.4em; }

/* panel de salas */
.nl-panel { position: absolute; top: 16px; left: 16px; bottom: 88px; width: 310px; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(16px) saturate(1.2); z-index: 10; box-shadow: var(--shadow); }
.nl-panel-t { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px 16px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 700; font-size: 14px; }
.nl-panel-t b { font-size: 10.5px; color: var(--mut); font-weight: 600; letter-spacing: .02em; }
.nl-panel-b { overflow-y: auto; padding: 12px; flex: 1; }
.nl-panel.collapsed { bottom: auto; } .nl-panel.collapsed .nl-panel-b { display: none; } .nl-panel.collapsed .nl-panel-t { border-bottom: 0; }
.nl-intro { font-size: 12.5px; line-height: 1.55; color: var(--mut); margin: 2px 4px 12px; } .nl-intro b { color: var(--tx); }
.lr { border-radius: 12px; margin-bottom: 3px; transition: background .2s; }
.lr-h { width: 100%; display: flex; align-items: center; gap: 11px; background: none; border: 0; padding: 9px 8px; border-radius: 12px; text-align: left; font-size: 13.5px; font-weight: 600; }
.lr-h:hover { background: rgba(255,255,255,.045); }
.lr-h b { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--red); font-size: 12px; box-shadow: 0 0 0 2px rgba(255,255,255,.9) inset, 0 4px 12px rgba(227,32,47,.35); }
.lr-h span { flex: 1; } .lr-h em { font-style: normal; font-size: 11px; color: var(--mut); }
.lr-b { display: none; padding: 2px 0 8px 44px; }
.lr.on { background: linear-gradient(90deg, rgba(227,32,47,.12), rgba(227,32,47,.02)); } .lr.on .lr-b { display: block; }
.lt { display: flex; gap: 8px; align-items: flex-start; width: 100%; background: none; border: 0; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; text-align: left; color: #d8d3d1; line-height: 1.35; }
.lt i { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 5px; } .lt:hover { background: rgba(255,255,255,.06); } .lt.on { background: var(--red); color: #fff; }
.nl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--mut); margin: 14px 6px 6px; }
.nl-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.nl-note { font-size: 11px; color: #7d7876; margin: 8px 6px 0; line-height: 1.5; }

/* ficha */
.nl-detail { position: absolute; top: 16px; right: 16px; bottom: 88px; width: 410px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(16px) saturate(1.2); z-index: 12; box-shadow: var(--shadow); transform: translateX(calc(100% + 32px)); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.nl-detail.open { transform: none; }
.ld-body { padding: 20px 22px 18px; }
.ld-x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(12,12,15,.7); font-size: 20px; line-height: 1; backdrop-filter: blur(6px); }
.ld-insp { position: relative; height: 290px; background: radial-gradient(ellipse at 50% 58%, #4a4a52 0%, #2a2a30 50%, #17171b 100%); border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; overflow: hidden; }
#inspCanvas { position: absolute; inset: 0; } #inspCanvas canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#inspLabels { position: absolute; inset: 0; pointer-events: none; }
#inspLabels .il { position: absolute; left: 0; top: 0; transition: opacity .25s; }
#inspLabels .il i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--red2); box-shadow: 0 0 0 2px #fff, 0 0 10px var(--red2); }
#inspLabels .il b { position: absolute; left: 34px; top: calc(-11px + var(--dy, 0px)); white-space: nowrap; font-size: 10.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(10,10,12,.82); border: 1px solid var(--line2); }
#inspLabels .il b::before { content: ''; position: absolute; right: 100%; top: 50%; width: 28px; height: 1px; background: rgba(255,255,255,.55); transform-origin: right; transform: rotate(calc(var(--dy, 0px) * -1.4deg)); }
#inspLabels .il.l b { left: auto; right: 34px; }
#inspLabels .il.l b::before { right: auto; left: 100%; transform-origin: left; transform: rotate(calc(var(--dy, 0px) * 1.4deg)); }
.ld-insp-hint { position: absolute; left: 14px; bottom: 10px; font-size: 10.5px; color: rgba(255,255,255,.45); letter-spacing: .04em; }
.ld-k { font-size: 11px; color: var(--mut); margin: 0 34px 6px 0; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; line-height: 1.5; }
.ld-link { background: none; border: 0; padding: 0; color: var(--red2); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; font-size: 11px; }
.nl-detail h2 { font-size: 22px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
.nl-detail h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--mut); margin: 20px 0 9px; }
.nl-detail p { font-size: 13.5px; line-height: 1.62; margin: 0 0 10px; color: #dcd7d5; }
.ld-lead { font-size: 14.5px !important; color: #fff !important; }
.ld-st { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); margin-bottom: 14px; }
.ld-st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.ld-uso { padding: 13px 14px; border-radius: 12px; background: linear-gradient(120deg, rgba(227,32,47,.16), rgba(227,32,47,.04)); border: 1px solid rgba(227,32,47,.38); margin-bottom: 12px; }
.ld-uso b { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--red2); } .ld-uso p { margin: 5px 0 0 !important; color: #fff !important; font-size: 14px !important; font-weight: 500; }
.ld-model { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ld-model div { padding: 10px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.ld-model b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--mut); margin-bottom: 4px; } .ld-model span { font-size: 12.5px; line-height: 1.45; display: block; }
.nl-detail dl { margin: 12px 0 0; } .nl-detail dt { font-size: 11px; font-weight: 700; color: var(--red2); text-transform: uppercase; letter-spacing: .07em; margin-top: 13px; } .nl-detail dd { margin: 4px 0 0; font-size: 13.5px; line-height: 1.62; color: #dcd7d5; }
.ld-specs { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ld-specs li { font-size: 12.8px; line-height: 1.5; padding: 9px 12px 9px 30px; position: relative; border-bottom: 1px solid var(--line); background: var(--card2); } .ld-specs li:last-child { border-bottom: 0; }
.ld-specs li::before { content: ''; position: absolute; left: 13px; top: 15px; width: 6px; height: 6px; border-radius: 2px; background: var(--red2); transform: rotate(45deg); }
.ld-chips { display: flex; flex-wrap: wrap; gap: 6px; } .ld-chips span { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); }
.ld-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ld-two > div, .ld-box { border-radius: 12px; padding: 11px 12px; background: var(--card2); border: 1px solid var(--line); }
.ld-two .ok { border-color: rgba(62,207,142,.3); } .ld-two .lim { border-color: rgba(242,179,61,.3); }
.ld-two b, .ld-box b { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; } .ld-two p, .ld-box p { font-size: 12.5px !important; margin: 4px 0 0 !important; }
.ld-box { margin-top: 10px; }
.ld-tools { display: grid; gap: 6px; }
.ld-tools button { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 11px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; transition: .2s; }
.ld-tools button:hover { border-color: var(--red); transform: translateX(2px); }
.ld-tools i { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; } .ld-tools small { display: block; font-weight: 500; color: var(--mut); font-size: 11.8px; margin-top: 3px; line-height: 1.45; }
.ld-walk, .ld-app { display: block; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--red); border: 0; text-decoration: none; font-weight: 700; font-size: 13.5px; text-align: center; box-shadow: 0 8px 22px rgba(227,32,47,.3); }
.ld-note { font-size: 11px !important; color: #7d7876 !important; margin-top: 14px !important; }
.ld-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.ld-nav button { flex: 1; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); font-size: 12.5px; font-weight: 600; }

/* barra inferior */
.nl-tools { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 15; padding-bottom: env(safe-area-inset-bottom); }
.nl-seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; backdrop-filter: blur(16px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.nl-seg button { border: 0; background: none; padding: 9px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: #cfcac8; transition: .2s; }
.nl-seg button:hover { color: #fff; } .nl-seg button[aria-pressed="true"] { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(227,32,47,.4); }

/* recorrido y quiz */
.nl-float { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); width: min(580px, calc(100% - 28px)); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; backdrop-filter: blur(16px); z-index: 14; box-shadow: var(--shadow); }
.lt-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.lt-top button { background: none; border: 1px solid var(--line2); border-radius: 999px; padding: 4px 10px; font-size: 11px; }
.nl-float h3 { font-size: 17px; margin: 10px 0 6px; display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.nl-float h3 b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--red); font-size: 13px; flex: none; }
.nl-float p { font-size: 13.5px; line-height: 1.55; margin: 0 0 10px; color: #dcd7d5; }
.lt-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; } .lt-tools button { font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(227,32,47,.45); background: rgba(227,32,47,.1); }
.lt-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lt-nav button { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); font-weight: 600; font-size: 13px; } .lt-nav button#tNext { background: var(--red); border-color: var(--red); } .lt-nav button:disabled { opacity: .35; cursor: default; }
.lt-dots { display: flex; gap: 6px; } .lt-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.2); } .lt-dots i.on { background: var(--red2); box-shadow: 0 0 8px var(--red2); }
.lq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.lq-opts button { text-align: left; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); font-size: 13px; font-weight: 600; line-height: 1.3; }
.lq-opts button:not(:disabled):hover { border-color: var(--red); } .lq-opts button.ok { background: rgba(62,207,142,.18); border-color: var(--ok); } .lq-opts button.bad { background: rgba(227,32,47,.18); border-color: var(--red); }
.lq-fb { min-height: 1em; margin: 0 !important; } .lq-next { margin-left: 6px; background: var(--red); border: 0; border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 12.5px; }

/* modo caminar */
.nl-walk { position: absolute; inset: 0; pointer-events: none; z-index: 13; }
.nl-cross { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.nl-walk-bar { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(14px); font-size: 12.5px; font-weight: 600; pointer-events: auto; white-space: nowrap; }
.nl-walk-bar kbd { font: inherit; font-size: 11px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line2); background: rgba(255,255,255,.06); }
.nl-walk-hint { color: var(--mut); font-weight: 500; }
.nl-walk-bar button { border: 0; background: var(--red); border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: 12px; }
.is-walk .nl-panel { opacity: .92; }

.nl-tip { position: fixed; top: 0; left: 0; z-index: 40; pointer-events: none; background: #fff; color: #111; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 8px; opacity: 0; transition: opacity .15s; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.nl-tip.on { opacity: 1; }
.nl-toast { position: absolute; top: 72px; left: 50%; transform: translate(-50%, -16px); background: #fff; color: #111; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; opacity: 0; transition: .3s; z-index: 41; pointer-events: none; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.nl-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) { .nl-detail { width: 360px; } .nl-panel { width: 280px; } }
@media (max-width: 820px) {
  .nl-bar { height: 54px; padding: 0 10px; } .nl-stage { top: 54px; } .nl-brand small { display: none; } .nl-links a:first-child { display: none; }
  .nl-panel { top: 10px; left: 10px; right: 10px; width: auto; bottom: auto; max-height: 50vh; } .nl-panel:not(.collapsed) .nl-panel-b { max-height: calc(50vh - 52px); }
  .nl-detail { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 70vh; border-radius: 20px 20px 0 0; transform: translateY(105%); z-index: 25; padding-bottom: env(safe-area-inset-bottom); }
  .ld-insp { height: 220px; border-radius: 20px 20px 0 0; }
  .nl-tools { left: 8px; right: 8px; transform: none; bottom: 10px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; } .nl-tools::-webkit-scrollbar { display: none; }
  .nl-seg button { padding: 8px 11px; font-size: 12px; }
  .nl-float { bottom: 66px; padding: 14px; } .lq-opts { grid-template-columns: 1fr; }
  .nl-walk-bar { top: 70px; } .nl-walk-hint, .nl-walk-bar kbd { display: none; }
}
