/* biblical-earth · componentes de las maquetas
   Requiere tokens.css. Prefijo be- en todas las clases. Ver README.md de mockups para ejemplos. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";   /* Inter: a de un piso y dígitos claros */
}
.be-serif { font-family: var(--font-serif); }
.be-he { font-family: var(--font-hebrew); direction: rtl; unicode-bidi: isolate; }
.be-muted { color: var(--ink-3); }
.be-caps { text-transform: uppercase; letter-spacing: var(--tracking-caps); font-size: var(--fs-2xs); font-weight: 600; }
.be-num { font-variant-numeric: tabular-nums; }

/* ---------- Iconos (los inyecta icons.js en [data-icon]) ---------- */
.be-i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.be-i svg { width: 100%; height: 100%; display: block; }
.be-i--sm { width: 14px; height: 14px; vertical-align: -2px; }
.be-i--lg { width: 22px; height: 22px; }

/* ---------- Esqueleto de la aplicación ---------- */
.be-app {
  width: 100%; height: 100vh; overflow: hidden;   /* 100%, no 100vw: 100vw cuenta la barra de desplazamiento y desborda */
  display: grid;
  grid-template-columns: 1fr var(--panel-w);
  grid-template-rows: var(--topbar-h) 1fr var(--timeline-h);
  grid-template-areas: "top top" "map panel" "time time";
  background: var(--paper);
}
.be-app > .be-topbar { grid-area: top; }
.be-app > .be-map { grid-area: map; }
.be-app > .be-panel { grid-area: panel; }
.be-app > .be-timeline { grid-area: time; }

/* ---------- Barra superior ---------- */
.be-topbar {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-4) 0 var(--sp-5);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 5;
}
.be-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.be-logo__mark { flex: none; width: 28px; height: 28px; background: url("../logo.svg") center / contain no-repeat; }
.be-logo small { font-family: var(--font-sans); font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-3); letter-spacing: var(--tracking-caps); text-transform: uppercase; margin-left: 2px; }

.be-search {
  flex: 1; max-width: 560px; height: 40px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; border-radius: var(--r-md);
  background: var(--paper); border: 1px solid var(--line);
  color: var(--ink-3); font-size: var(--fs-md);
}
.be-search--focus { background: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 15%, transparent); color: var(--ink); }
.be-search__text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.be-search__text b { color: var(--ink); font-weight: 600; }
.be-kbd { font-family: var(--font-sans); font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); }

/* Desplegable de resultados de búsqueda */
.be-results { position: absolute; top: calc(var(--topbar-h) - 6px); width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 6px; z-index: 20; }
.be-results__group { padding: 8px 10px 4px; }
.be-result { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); }
.be-result--active { background: var(--gold-soft); }
.be-result__title { font-weight: 600; }
.be-result__meta { margin-left: auto; color: var(--ink-3); font-size: var(--fs-sm); }

.be-spacer { flex: 1; }

/* Fecha activa en la barra */
.be-date { display: flex; align-items: baseline; gap: 8px; padding: 4px 14px; border-radius: var(--r-md); background: var(--gold-soft); border: 1px solid var(--gold-line); white-space: nowrap; }
.be-date__value { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--gold-ink); line-height: 1.1; }
.be-date__hint { font-size: var(--fs-xs); color: var(--gold-hint); font-weight: 500; }

/* ---------- Botones, chips, insignias ---------- */
.be-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 var(--fs-sm)/1 var(--font-sans); white-space: nowrap; }
.be-btn--primary { background: var(--ink); border-color: var(--ink); color: #fbf7ef; }
.be-btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.be-btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.be-btn--icon { width: 36px; padding: 0; }
.be-btn--sm { height: 28px; padding: 0 10px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.be-btn--round { border-radius: 50%; }

.be-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.be-chip--active { background: var(--ink); border-color: var(--ink); color: #fbf7ef; }
.be-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Referencia bíblica: se pulsa para leer en wol.jw.org */
.be-ref { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 7px; border-radius: var(--r-pill); background: var(--tier1-soft); color: var(--tier1); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; text-decoration: none; border: 1px solid var(--tier1-line); }
.be-ref::before { content: ""; width: 10px; height: 12px; border-radius: 1.5px; border: 1.5px solid currentColor; border-left-width: 3px; opacity: .85; }

/* Enlace de salida a wol.jw.org (nunca copiamos su contenido: enlazamos) */
.be-wol { display: inline-flex; align-items: center; gap: 6px; color: var(--link); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; }
.be-wol::after { content: "↗"; font-weight: 500; }

/* Insignias de nivel de fuente */
.be-tier { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 4px; border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.be-tier::before { content: attr(data-n); display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: #fff; font-size: 10px; }
.be-tier--1 { background: var(--tier1-soft); color: var(--tier1); }
.be-tier--1::before { background: var(--tier1); }
.be-tier--2 { background: var(--tier2-soft); color: var(--tier2); }
.be-tier--2::before { background: var(--tier2); }
.be-tier--unverified { background: var(--unverified-soft); color: var(--unverified); }
.be-tier--unverified::before { content: "?"; background: var(--unverified); }

/* Chips de cronología: TNM principal, secular como nota */
.be-chrono { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.be-chrono--tnm { background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); }
.be-chrono--secular { background: var(--secular-soft); color: var(--secular); border: 1px dashed #b8c2cf; }
.be-chrono--approx { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-2); }
.be-chrono small { font-weight: 500; opacity: .8; }

/* Control segmentado (p. ej. mapa Antiguo | Actual) */
.be-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md); background: var(--paper-2); border: 1px solid var(--line); }
.be-seg__opt { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.be-seg__opt--on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Panel lateral ---------- */
.be-panel { background: var(--surface); border-left: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; position: relative; z-index: 3; }
.be-panel__head { padding: 14px 18px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.be-panel__body { flex: 1; overflow: hidden; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
/* Las tarjetas conservan su alto natural; el panel se desplaza. El degradado inferior indica que hay más contenido. */
.be-panel__body > * { flex-shrink: 0; }
.be-panel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--surface-2) 85%); }
.be-panel--noscroll::after { display: none; }
.be-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
.be-crumbs > span:last-child { color: var(--ink); }
.be-crumbs .be-sep { color: var(--ink-3); }

.be-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 10px -18px -12px; padding: 0 18px; }
.be-tab { padding: 8px 0 10px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.be-tab--on { color: var(--ink); border-color: var(--ink); }
.be-tab b { font-weight: 600; color: var(--ink-4); margin-left: 4px; }

/* Tarjeta */
.be-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.be-card__pad { padding: 14px 16px; }
.be-card__eyebrow { display: flex; align-items: center; gap: 8px; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink-3); }
.be-card__title { font-family: var(--font-serif); font-size: var(--fs-2xl); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.01em; margin: 4px 0 2px; }
.be-card__sub { color: var(--ink-3); font-size: var(--fs-sm); }
.be-card__body { font-size: var(--fs-md); color: var(--ink-2); line-height: var(--lh-body); margin: 10px 0 0; }
.be-card__body p { margin: 0 0 8px; }
.be-card__foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.be-card--compact .be-card__title { font-size: var(--fs-xl); }
.be-card--accent { border-left: 3px solid var(--accent); }

/* Filas de datos clave */
.be-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: var(--fs-sm); }
.be-kv dt { color: var(--ink-3); font-weight: 500; }
.be-kv dd { margin: 0; color: var(--ink); font-weight: 500; }

/* Lista de vecinos del grafo (personas, lugares, hechos conectados) */
.be-list { display: flex; flex-direction: column; }
.be-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line); }
.be-row:first-child { border-top: 0; }
.be-row__title { font-weight: 600; font-size: var(--fs-md); line-height: 1.25; }
.be-row__meta { color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.3; }
.be-row__end { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--ink-3); }

/* Avatar de nodo (círculo con icono del tipo) */
.be-node { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--font-serif); font-weight: 600; font-size: 15px; background: var(--ink-3); box-shadow: inset 0 0 0 2px rgba(255,255,255,.28); }
.be-node .be-i { width: 16px; height: 16px; }
.be-node--persona { background: var(--node-persona); }
.be-node--lugar { background: var(--node-lugar); }
.be-node--evento { background: var(--node-evento); }
.be-node--periodo { background: var(--node-periodo); }
.be-node--hallazgo { background: var(--node-hallazgo); }
.be-node--texto { background: var(--node-texto); }
.be-node--lg { width: 56px; height: 56px; font-size: 24px; }
.be-node--sm { width: 22px; height: 22px; font-size: 11px; }
.be-node--sm .be-i { width: 12px; height: 12px; }

/* Dos extremos: ciudad de origen y ciudad de destino de una carta */
.be-ends { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: stretch; gap: 0; margin-top: 12px; }
.be-end { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.be-end__label { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink-3); }
.be-end__place { font-family: var(--font-serif); font-size: var(--fs-xl); font-weight: 600; line-height: 1.2; margin: 2px 0 4px; }
.be-end__text { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.4; }
.be-ends__arrow { display: grid; place-items: center; color: var(--gold); font-size: 18px; }

/* Foto con crédito (obligatorio) */
.be-photo { position: relative; margin: 0; background: #d9cfbd; overflow: hidden; }
.be-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.be-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 8px; background: linear-gradient(transparent, rgba(20, 14, 6, .72)); color: #fff; font-size: var(--fs-xs); line-height: 1.35; }
.be-photo figcaption b { font-weight: 600; display: block; font-size: var(--fs-sm); }
.be-photo__credit { display: block; opacity: .82; font-size: var(--fs-2xs); margin-top: 2px; }
.be-photo__badge { position: absolute; top: 10px; left: 10px; }

/* Aviso de incertidumbre o de cronología alternativa */
.be-note { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.4; background: var(--secular-soft); color: #3d4a5c; }
.be-note--uncertain { background: #efe9f4; color: #4d3f62; }
.be-note--warn { background: var(--unverified-soft); color: var(--unverified); }

/* ---------- Mapa ---------- */
.be-map { position: relative; overflow: hidden; background: #cdd8d2; }
.be-map__base { position: absolute; left: 0; top: 0; max-width: none; user-select: none; image-rendering: auto; }
.be-map__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.be-map__html { position: absolute; inset: 0; pointer-events: none; }
.be-map--actual { background: #bcd6e6; }
/* Viñeta suave para dar profundidad y separar los controles */
.be-map::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(60, 45, 20, .10); }

/* Marcador de ciudad: punto + etiqueta. Posición la calcula geo.js */
.be-city { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; pointer-events: auto; }
.be-city__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); box-shadow: 0 0 0 1.5px rgba(255,255,255,.65); flex: none; }
.be-city__label { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--font-serif); font-size: 15.5px; font-weight: 600; color: var(--map-label); white-space: nowrap; line-height: 1;
  text-shadow: 0 0 2px var(--map-label-halo), 0 0 3px var(--map-label-halo), 0 0 6px var(--map-label-halo), 0 0 10px var(--map-label-halo); }
.be-city__label small { display: block; font-family: var(--font-sans); font-size: 10px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; margin-top: 3px; }
.be-city--left .be-city__label { left: auto; right: 14px; text-align: right; }
.be-city--top .be-city__label { left: 50%; top: auto; bottom: 12px; transform: translateX(-50%); text-align: center; }
.be-city--bottom .be-city__label { left: 50%; top: 12px; transform: translateX(-50%); text-align: center; }
.be-city--major .be-city__dot { width: 11px; height: 11px; border-width: 2.5px; border-color: var(--ink); }
.be-city--major .be-city__label { font-size: 18px; }
.be-city--minor .be-city__dot { width: 7px; height: 7px; border-width: 1.5px; }
.be-city--minor .be-city__label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.be-city--visited .be-city__dot { background: var(--accent); border-color: #fff; box-shadow: 0 0 0 1.5px var(--accent); }
.be-city--past { opacity: .5; }
.be-city--future .be-city__dot { background: var(--surface); border: 2px dashed var(--accent); }
.be-city--future .be-city__label { color: var(--ink-3); font-weight: 500; }
.be-city--dest .be-city__dot { background: var(--gold); border-color: #fff; box-shadow: 0 0 0 1.5px var(--gold); }
.be-city--current .be-city__dot { width: 14px; height: 14px; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--accent), 0 2px 6px rgba(0,0,0,.25); }
.be-city--current::before { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.be-city--current .be-city__label { font-size: 20px; color: var(--ink); }
.be-city--uncertain .be-city__dot { background: transparent; border: 2px dashed var(--zone); }

/* Etiquetas de región, mar y país */
.be-maplabel { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; text-align: center; line-height: 1.1; }
.be-maplabel--region { font-family: var(--font-serif); font-size: 15px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--map-region); opacity: .85;
  text-shadow: 0 0 3px var(--map-label-halo), 0 0 8px var(--map-label-halo); }
.be-maplabel--province { font-family: var(--font-serif); font-style: italic; font-size: 16px; color: var(--map-region); letter-spacing: .06em; text-shadow: 0 0 3px var(--map-label-halo), 0 0 8px var(--map-label-halo); }
.be-maplabel--sea { font-family: var(--font-serif); font-style: italic; font-size: 17px; letter-spacing: .14em; color: var(--map-sea-label); opacity: .9; }
.be-maplabel--country { font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #6d6280; text-shadow: 0 0 3px rgba(255,255,255,.9), 0 0 6px rgba(255,255,255,.8); }
.be-maplabel--empire { font-family: var(--font-serif); font-size: 22px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: rgba(90, 60, 40, .55); }

/* Rutas (SVG). geo.js asigna estas clases a los <path> */
.be-route { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.be-route--casing { stroke: rgba(255, 252, 244, .85); stroke-width: 7; }
.be-route--done { stroke: var(--route-done); stroke-width: 3.5; }
.be-route--todo { stroke: var(--route-todo); stroke-width: 2.5; stroke-dasharray: 2 7; opacity: .75; }
.be-route--sea { stroke: var(--route-sea); stroke-width: 3; stroke-dasharray: 9 6; }
.be-route--sea-todo { stroke: var(--route-sea); stroke-width: 2.2; stroke-dasharray: 2 7; opacity: .7; }
.be-route--approx { stroke: var(--zone); stroke-width: 3; stroke-dasharray: 10 6; opacity: .85; } /* ruta hecha pero sin trazado seguro: color de incertidumbre */
.be-route--letter { stroke: var(--route-letter); stroke-width: 2.5; stroke-dasharray: 6 5; }
.be-route--ghost { stroke: var(--ink-3); stroke-width: 2; opacity: .35; }
.be-route-arrow { fill: var(--route-done); }
.be-route-arrow--sea { fill: var(--route-sea); }
.be-route-arrow--letter { fill: var(--route-letter); }
.be-route-arrow--approx { fill: var(--zone); }

/* Zona de incertidumbre: área rayada con candidatos, nunca un punto falso */
.be-zone { fill: url(#be-hatch); stroke: var(--zone); stroke-width: 1.6; stroke-dasharray: 5 4; }
.be-zone--soft { fill: rgba(122, 92, 142, .10); }
.be-zone-candidate { fill: var(--surface); stroke: var(--zone); stroke-width: 2; }
.be-zone-label { position: absolute; transform: translate(-50%, -50%); font-size: var(--fs-2xs); font-weight: 700; color: #5d4674; background: rgba(255, 253, 248, .92); border: 1px solid #d5c8e1; border-radius: var(--r-pill); padding: 3px 9px; white-space: nowrap; letter-spacing: .02em; text-align: center; line-height: 1.3; box-shadow: var(--shadow-1); }

/* Globo de información anclado a un punto del mapa */
.be-pop { position: absolute; width: 300px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); border: 1px solid var(--line); pointer-events: auto; }
.be-pop::after { content: ""; position: absolute; width: 14px; height: 14px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); left: 24px; bottom: -8px; }
.be-pop--below::after { bottom: auto; top: -8px; transform: rotate(225deg); }

/* Controles flotantes del mapa */
.be-mapctl { position: absolute; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.be-mapctl--tr { top: 14px; right: 14px; }
.be-mapctl--tl { top: 14px; left: 14px; }
.be-mapctl--bl { bottom: 14px; left: 14px; }
.be-mapctl--br { bottom: 22px; right: 14px; }
.be-attrib { position: absolute; right: 0; bottom: 0; z-index: 2; padding: 2px 8px; font-size: 9.5px; line-height: 1.4; color: var(--ink-3); background: rgba(255, 252, 245, .72); border-top-left-radius: 6px; pointer-events: none; }
.be-float { background: rgba(255, 253, 248, .94); backdrop-filter: var(--blur-glass); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.be-zoombtns { display: flex; flex-direction: column; overflow: hidden; }
.be-zoombtns > * { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-2); }
.be-zoombtns > * + * { border-top: 1px solid var(--line); }
.be-legend { padding: 10px 12px; font-size: var(--fs-xs); color: var(--ink-2); display: grid; gap: 6px; }
.be-legend__row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.be-legend__line { width: 26px; height: 0; border-top: 3px solid var(--accent); }
.be-legend__line--sea { border-top: 3px dashed var(--sea); }
.be-legend__line--todo { border-top: 3px dotted var(--accent); opacity: .7; }
.be-legend__line--letter { border-top: 2.5px dashed var(--gold); }
.be-legend__line--approx { border-top: 3px dashed var(--zone); opacity: .85; }
.be-legend__zone { width: 22px; height: 14px; border: 1.5px dashed var(--zone); border-radius: 7px; background: repeating-linear-gradient(45deg, rgba(122,92,142,.25) 0 2px, transparent 2px 6px); }
.be-scalebar { padding: 6px 10px 8px; font-size: var(--fs-2xs); color: var(--ink-2); font-weight: 600; }
.be-scalebar__bar { height: 6px; border: 1.5px solid var(--ink-2); border-top: 0; margin-top: 3px; }

/* Cortina: mapa antiguo y actual superpuestos, con asa para deslizar */
.be-curtain { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); z-index: 2; }
.be-curtain__handle { position: absolute; top: 50%; left: -19px; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-2); display: grid; place-items: center; color: var(--ink-2); }
.be-curtain__tag { position: absolute; top: 14px; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(31, 26, 20, .78); color: #fff; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }

/* ---------- Línea de tiempo ---------- */
.be-timeline { position: relative; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: 168px 1fr; grid-template-rows: 44px 1fr; overflow: hidden; }
.be-timeline--nobar { grid-template-rows: 1fr; }
.be-timeline__bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.be-timeline__labels { border-right: 1px solid var(--line); background: var(--surface-2); }
.be-timeline__track { position: relative; overflow: hidden; }
.be-lane-label { height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.be-lane-label .be-chip__dot { width: 9px; height: 9px; }
.be-axis { position: absolute; left: 0; right: 0; top: 0; height: 26px; border-bottom: 1px solid var(--line); }
.be-tick { position: absolute; top: 0; bottom: 0; }
.be-tick span { position: absolute; top: 6px; left: 6px; font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.be-tick::before { content: ""; position: absolute; left: 0; top: 0; height: 26px; border-left: 1px solid var(--line-2); }
.be-tick--minor::before { height: 7px; top: 19px; border-color: var(--line); }
.be-gridline { position: absolute; top: 26px; bottom: 0; border-left: 1px solid var(--rejilla); }
.be-lanes { position: absolute; left: 0; right: 0; top: 26px; bottom: 0; }
.be-lane { position: relative; height: 30px; border-bottom: 1px solid rgba(228, 219, 203, .7); }
.be-lane:nth-child(even) { background: rgba(246, 241, 231, .5); }
.be-span { position: absolute; top: 5px; height: 20px; border-radius: 5px; background: var(--ink-3); color: #fff; font-size: var(--fs-2xs); font-weight: 600; line-height: 20px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.be-span--fuzzy-start { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px); mask-image: linear-gradient(90deg, transparent 0, #000 36px); padding-left: 30px; }
.be-span--fuzzy-end { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent 100%); }
.be-span--fuzzy-start.be-span--fuzzy-end { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%); }
.be-span--soft { background: transparent !important; color: var(--ink-2); border: 1.5px solid currentColor; line-height: 17px; }
.be-span--active { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold); }
.be-point { position: absolute; top: 8px; width: 14px; height: 14px; margin-left: -7px; border-radius: 3px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 0 2px #fff; }
.be-point-label { position: absolute; top: 6px; font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-2); white-space: nowrap; margin-left: 12px; }
.be-point-label--left { margin-left: -12px; transform: translateX(-100%); }
.be-span--clipped { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.be-cursor { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--gold); z-index: 4; }
.be-cursor::before { content: ""; position: absolute; top: 26px; bottom: 0; left: -9px; width: 16px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 10%, transparent), transparent); }
.be-cursor__flag { position: absolute; top: 2px; left: -1px; transform: translateX(-50%); background: var(--gold); color: #fff; font-size: var(--fs-2xs); font-weight: 700; padding: 3px 8px; border-radius: 5px; white-space: nowrap; box-shadow: var(--shadow-1); }
.be-uncertain-band { position: absolute; top: 26px; bottom: 0; background: repeating-linear-gradient(135deg, rgba(122, 92, 142, .07) 0 6px, transparent 6px 12px); border-left: 1px dashed rgba(122, 92, 142, .4); border-right: 1px dashed rgba(122, 92, 142, .4); }

/* Controles de reproducción y zoom temporal */
.be-play { display: flex; align-items: center; gap: 4px; }
.be-play__main { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; }
.be-play__btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); }
.be-speed { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); padding: 4px 10px; border-radius: var(--r-pill); background: var(--paper-2); border: 1px solid var(--line); white-space: nowrap; }
.be-zoomscale { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; background: var(--paper-2); }
.be-zoomscale > span { padding: 4px 10px; font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.be-zoomscale > span + span { border-left: 1px solid var(--line); }
.be-zoomscale > .on { background: var(--ink); color: #fff; }
.be-minimap { position: relative; height: 18px; flex: 1; max-width: 420px; border-radius: 5px; background: linear-gradient(90deg, var(--emp-egipto) 0 18%, var(--emp-asiria) 18% 34%, var(--emp-babilonia) 34% 44%, var(--emp-persia) 44% 60%, var(--emp-grecia) 60% 72%, var(--emp-roma) 72% 100%); opacity: .55; }
.be-minimap__win { position: absolute; top: -3px; bottom: -3px; border: 2px solid var(--ink); border-radius: 5px; background: rgba(255,255,255,.35); }

/* ---------- Hoja inferior (móvil) ---------- */
.be-phone { width: 100vw; height: 100vh; position: relative; overflow: hidden; background: var(--paper); }
.be-phone > .be-map { position: absolute; inset: 0; }
.be-statusbar { position: absolute; top: 0; left: 0; right: 0; height: 47px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px 0 34px; font: 600 16px/1 var(--font-sans); color: var(--ink); z-index: 6; }
.be-mtop { position: absolute; top: 54px; left: 12px; right: 12px; display: flex; gap: 8px; z-index: 5; }
.be-mtop .be-search { height: 46px; max-width: none; background: rgba(255, 253, 248, .96); box-shadow: var(--shadow-2); border-radius: 14px; }
.be-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -6px 30px rgba(40, 28, 10, .18); z-index: 5; padding: 8px 16px 28px; }
.be-sheet__grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 10px; }
.be-mtimeline { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow-2); }
.be-homebar { position: absolute; bottom: 8px; left: 50%; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: var(--ink); z-index: 7; }

/* ---------- Grafo (lienzo de nodos y aristas) ---------- */
.be-graph { position: relative; }
.be-graph svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.be-edge { fill: none; stroke: var(--line-2); stroke-width: 1.6; }
.be-edge--strong { stroke: var(--ink-3); stroke-width: 2; }
.be-edge--new { stroke: var(--gold); stroke-dasharray: 4 4; }
.be-gnode { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.be-gnode__label { font-size: var(--fs-sm); font-weight: 600; background: rgba(255, 253, 248, .92); padding: 1px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.be-gnode__meta { font-size: var(--fs-2xs); color: var(--ink-3); margin-top: -4px; white-space: nowrap; }
.be-gnode--dim { opacity: .35; }
.be-gnode--center .be-node { box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--gold), var(--shadow-2); }
