/* AVMB Cerebro · app */
:root { --bg: #0b0b0d; --bg2: #141417; --card: #17171b; --line: rgba(255,255,255,.08); --tx: #efebe9; --mut: #a29d9b; --red: #e3202f; --red2: #ff2a3a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--tx); font-family: Montserrat, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--red2); }

.app { display: grid; height: 100dvh; grid-template-rows: auto 40dvh 1fr auto; grid-template-areas: "top" "viewer" "content" "tabs"; }
.top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tx); min-width: 0; }
.brand img { border-radius: 9px; flex: none; }
.brand strong { display: block; font-size: 15px; white-space: nowrap; }
.brand strong i { color: var(--red); font-style: normal; }
.brand small { display: block; font-size: 10.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl { flex: none; background: var(--red); border: 0; border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 13px; color: #fff; }
.is-app .dl { display: none; }

.viewer { grid-area: viewer; position: relative; background: radial-gradient(ellipse at 50% 45%, #2a1418 0%, #120c0e 55%, #0b0b0d 100%); overflow: hidden; }
#brain { position: absolute; inset: 0; }
#brain canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mut); font-size: 13px; }
.legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; max-width: 70%; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; background: rgba(11,11,13,.72); padding: 4px 9px; border-radius: 999px; width: max-content; max-width: 100%; backdrop-filter: blur(6px); }
.legend i { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.vbtns { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.vbtns button { background: rgba(11,11,13,.7); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 11.5px; font-weight: 600; backdrop-filter: blur(6px); }
.vbtns button[aria-pressed="true"] { border-color: var(--red); color: #fff; }
.hint { position: absolute; right: 12px; bottom: 10px; margin: 0; font-size: 10.5px; color: rgba(255,255,255,.4); pointer-events: none; }

.content { grid-area: content; overflow-y: auto; padding: 12px 12px 24px; -webkit-overflow-scrolling: touch; }
.tabs { grid-area: tabs; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { background: none; border: 0; padding: 8px 2px 9px; font-size: 10.5px; font-weight: 600; color: var(--mut); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tabs button span { font-size: 17px; line-height: 1; }
.tabs button[aria-current="true"] { color: #fff; }
.tabs button[aria-current="true"] span { color: var(--red2); text-shadow: 0 0 12px rgba(255,42,58,.6); }

/* chips */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips button { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--bg2); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chips button i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chips button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.chips button[aria-pressed="true"] i { background: #fff; }
.chips button em { font-style: normal; color: var(--mut); font-weight: 700; }
.chips button.h b { color: var(--c); }

.search { margin-bottom: 10px; }
.search input, .search select { width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 14px; outline: none; }
.search input:focus, .search select:focus { border-color: var(--red); }

/* tarjeta */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; }
.ch { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.ch .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: 0 0 16px var(--c); flex: none; }
.ch h2 { margin: 0; font-size: 21px; line-height: 1.2; }
.sub { margin: 3px 0 0; font-size: 12px; color: var(--mut); }
.sym-b { min-width: 48px; height: 48px; padding: 0 6px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); font-weight: 800; font-size: 14px; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); flex: none; }
.card h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--mut); margin: 20px 0 9px; }
.card h4 { font-size: 12px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.card p { font-size: 14px; line-height: 1.6; margin: 0 0 8px; color: #dcd7d5; }
.lead { font-size: 15px !important; color: #fff !important; }

.hlist, .rlist, .sym, .bul, .slist, .src { list-style: none; margin: 0; padding: 0; }
.hlist li + li, .rlist li + li { margin-top: 6px; }
.hlist button, .rlist button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hlist button:hover, .rlist button:hover { border-color: rgba(255,255,255,.22); }
.arr { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: var(--a); background: color-mix(in srgb, var(--a) 15%, transparent); }
.hn { flex: 1; min-width: 0; }
.hn b, .rlist b { display: block; font-size: 14px; }
.hn small, .rlist small { display: block; font-size: 12.5px; color: #bdb7b5; line-height: 1.45; margin-top: 2px; }
.go { color: var(--mut); font-size: 20px; }

.bodywrap { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.bodywrap.sm { grid-template-columns: 90px 1fr; align-items: center; margin-top: 12px; }
.bodywrap.pick { grid-template-columns: 150px 1fr; }
.body { width: 100%; height: auto; }
.bz { cursor: pointer; }
.sym li { font-size: 13.5px; line-height: 1.45; padding: 7px 0; border-bottom: 1px solid var(--line); color: #dcd7d5; }
.sym li b { display: block; font-size: 11px; color: var(--c); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1px; }
.bul li { position: relative; padding: 4px 0 4px 18px; font-size: 14px; line-height: 1.5; color: #dcd7d5; }
.bul li::before { content: ''; position: absolute; left: 3px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--red)); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12.5px; padding: 6px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); line-height: 1.35; }
.au { margin-top: 10px !important; font-size: 13px !important; color: var(--mut) !important; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.two > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.two p { font-size: 13px !important; }
.two ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: #dcd7d5; }
.two .up h4 { color: #ff5a6a; } .two .down h4 { color: #6fa8ff; }
.dl dt { font-size: 11.5px; font-weight: 700; color: var(--c, var(--red2)); text-transform: uppercase; letter-spacing: .06em; margin-top: 12px; }
.dl dd { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: #dcd7d5; }
.lk { background: none; border: 0; padding: 0; color: #fff; text-decoration: underline; text-decoration-color: var(--c); text-underline-offset: 3px; font-size: 14px; }
.myth { margin-top: 16px; background: rgba(242,179,61,.08); border: 1px solid rgba(242,179,61,.3); border-radius: 12px; padding: 12px; }
.myth b { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: #f2b33d; }
.myth p { margin: 4px 0 0 !important; font-size: 13.5px !important; }
.warn { margin-top: 16px !important; font-size: 12px !important; color: var(--mut) !important; border-left: 2px solid var(--red); padding-left: 10px; }
.note { font-size: 12.5px !important; color: var(--mut) !important; }
.acts { display: flex; gap: 8px; margin-top: 14px; }
.acts button { flex: 1; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 13px; font-weight: 600; }

.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 6px; margin-bottom: 12px; }
.hgrid button { text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; min-height: 62px; }
.hgrid button b { display: block; color: var(--c); font-size: 13px; }
.hgrid button span { display: block; font-size: 11.5px; line-height: 1.3; margin-top: 3px; color: #cfcac8; }
.hgrid button[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--bg2)); }

.zlist { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.zlist button { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 600; }
.zlist button em { font-style: normal; color: var(--mut); margin-left: 3px; }
.zlist button[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.count { font-size: 12px !important; color: var(--mut) !important; margin-top: 14px !important; }
.slist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.slist li > span { display: block; font-size: 14px; margin-bottom: 6px; }
.slist li > div { display: flex; flex-wrap: wrap; gap: 5px; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.mini i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.mini.h { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); }

.big { width: 100%; margin: 6px 0 8px; padding: 14px; background: var(--red); border: 0; border-radius: 14px; font-weight: 800; font-size: 15px; color: #fff; }
.off { font-size: 13px !important; color: #3ecf8e !important; }
.how { display: grid; gap: 8px; margin-top: 10px; }
.how > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.how b { font-size: 13px; } .how p { margin: 3px 0 0 !important; font-size: 13px !important; }
.links { display: grid; gap: 6px; }
.links a { display: block; text-decoration: none; color: var(--tx); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 13.5px; font-weight: 600; }
.src { counter-reset: s; } .src li { font-size: 12px; line-height: 1.5; color: var(--mut); padding: 5px 0 5px 22px; position: relative; } .src li::before { counter-increment: s; content: counter(s) '.'; position: absolute; left: 0; color: #666; }

.modal { background: var(--card); color: var(--tx); border: 1px solid var(--line); border-radius: 18px; padding: 20px; max-width: 420px; width: calc(100% - 32px); }
.modal::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.modal h2 { margin: 0 0 10px; font-size: 18px; } .modal ol { padding-left: 20px; line-height: 1.6; font-size: 14px; } .modal p { font-size: 13.5px; color: #cfcac8; line-height: 1.55; }
.mclose { width: 100%; background: var(--red); border: 0; border-radius: 12px; padding: 11px; font-weight: 700; color: #fff; margin-top: 6px; }
.toast { position: fixed; left: 50%; top: 70px; transform: translate(-50%, -16px); background: #fff; color: #111; font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 999px; opacity: 0; transition: .3s; pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 980px) {
  .app { grid-template-columns: 1fr minmax(440px, 520px); grid-template-rows: auto 1fr auto; grid-template-areas: "top top" "viewer content" "viewer tabs"; }
  .content { padding: 16px 18px 28px; border-left: 1px solid var(--line); }
  .tabs { border-left: 1px solid var(--line); }
  .legend span { font-size: 12.5px; }
}
@media (max-width: 380px) { .dl span { display: none; } .bodywrap { grid-template-columns: 96px 1fr; } .two { grid-template-columns: 1fr; } }

@media print {
  .top, .viewer, .tabs, .chips, .search, .hgrid, .acts, .toast, .modal { display: none !important; }
  html, body, .app { height: auto; display: block; background: #fff; color: #111; }
  .content { overflow: visible; padding: 0; }
  .card { background: #fff; border: 0; color: #111; padding: 0; }
  .card p, .dl dd, .sym li, .bul li, .two ul, .hn small, .rlist small, .tags span { color: #222 !important; }
  .hlist button, .rlist button, .two > div, .tags span, .myth { background: #fff !important; border-color: #ccc !important; color: #111; }
  .body path { fill: #f3f3f3; stroke: #999; }
  .card::before { content: 'AVMB Cerebro · avmb-analyticvision.com/cerebro-app'; display: block; font-size: 11px; color: #888; margin-bottom: 10px; }
}
.arr { font-family: system-ui, "Segoe UI Symbol", sans-serif; }
@media (max-width: 979px) {
  .hgrid { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .hgrid::-webkit-scrollbar { display: none; }
  .hgrid button { flex: none; width: 112px; }
}
@media (max-width: 979px) { .legend { gap: 3px; } .legend span { font-size: 10.5px; padding: 3px 8px; } .hint { display: none; } }
