:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel2: #f1f3ef;
  --line: #e2e6e1;
  --text: #17211c;
  --text2: #3d4a44;
  --mut: #6b7772;
  --accent: #ff6a13;
  --amber: #e39a17;
  --good: #1f9d61;
  --warn: #b7791f;
  --bad: #d64533;
  --aid: #2b7bd6;
  --ink: 23, 33, 28;
  --fade: 255, 255, 255;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mut { color: var(--mut); }
.small { font-size: 12px; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
a { color: #1d5fae; }

/* ---------- Cabecera ---------- */
.top { height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: none; max-width: 340px; }
.title { min-width: 0; }
.title p { overflow: hidden; text-overflow: ellipsis; }
.title h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.title h1 em { font-style: normal; font-weight: 500; color: var(--mut); }
.title p { margin: 0; font-size: 12px; color: var(--mut); white-space: nowrap; }
.head-stats { display: flex; gap: 20px; margin-left: 8px; overflow: hidden; flex: 1; min-width: 0; }
.hs { display: flex; flex-direction: column; white-space: nowrap; }
.hs span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mut); }
.hs b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wx { margin-left: auto; font-size: 13px; color: var(--mut); white-space: nowrap; }
.wx b { color: var(--text); }
.proto { font-size: 11px; color: var(--mut); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: calc(100% - 64px); }
.stage { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) 212px; min-width: 0; }
#map { position: relative; min-height: 0; }
.side { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }

/* ---------- Herramientas de mapa ---------- */
.map-tools { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; align-items: center; z-index: 2; }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; backdrop-filter: blur(6px); }
.seg button { background: none; border: 0; padding: 5px 10px; border-radius: 6px; color: var(--mut); font-size: 12px; font-weight: 600; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.small button { padding: 4px 8px; }
.exag { background: rgba(14, 18, 21, 0.85); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; color: var(--mut); display: flex; gap: 6px; align-items: center; }
.exag select { background: transparent; border: 0; color: var(--text); font-weight: 600; }
.exag select option { background: var(--panel); }

/* ---------- Rótulo del sobrevuelo ---------- */
.lower { position: absolute; left: 16px; bottom: 228px; z-index: 2; background: rgba(12, 16, 19, 0.88); border: 1px solid rgba(255, 255, 255, 0.08); border-left: 3px solid var(--accent); border-radius: 8px; padding: 12px 16px; min-width: 300px; max-width: min(460px, calc(100% - 32px)); backdrop-filter: blur(8px); }
.lt-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; }
.lt-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin: 2px 0 6px; }
.lt-row { display: flex; gap: 14px; font-size: 13px; color: #cfd6db; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.lt-crono { margin-top: 8px; font-size: 12px; color: var(--amber); font-weight: 600; }
.lt-sponsor, .sponsor-slot { margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--mut); }
.lt-sponsor em, .sponsor-slot em { font-style: normal; border: 1px dashed var(--mut); border-radius: 6px; padding: 6px 12px; color: var(--mut); font-weight: 600; letter-spacing: 0.02em; }
.sponsor-slot.sm em { padding: 3px 9px; }

/* ---------- Perfil ---------- */
.profile-panel { border-top: 1px solid var(--line); background: var(--panel); display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; }
.pp-head { display: flex; align-items: center; gap: 12px; padding: 8px 14px 0; flex-wrap: wrap; }
.play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); display: grid; place-items: center; flex: none; }
.play svg { width: 16px; height: 16px; fill: #fff; }
.play .i-pause { display: none; }
.play.on .i-play { display: none; }
.play.on .i-pause { display: block; }
.pp-label { display: flex; flex-direction: column; line-height: 1.2; }
.pp-label b { font-size: 13px; }
.pp-label span { font-size: 11px; color: var(--mut); }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; }
.ghost:hover { border-color: #b9c2bd; }
.legend { margin-left: auto; display: flex; gap: 8px; font-size: 10px; color: var(--mut); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
#profile { width: 100%; height: 100%; display: block; cursor: crosshair; }

/* ---------- Pestañas ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 8px; flex: none; }
.tabs button { background: none; border: 0; padding: 14px 12px 12px; color: var(--mut); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tab { overflow: auto; padding: 14px 16px 24px; flex: 1; min-height: 0; }
.intro { color: var(--mut); font-size: 13px; margin: 0 0 12px; }

/* ---------- Capítulos ---------- */
.chap { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--panel2); transition: border-color 0.2s, background 0.2s; }
.chap.on { border-color: var(--accent); background: #fff7f1; }
.chap-head { display: grid; grid-template-columns: auto minmax(0, 1fr) 120px; gap: 10px; align-items: center; }
.chap-n { font-size: 12px; font-weight: 800; color: var(--mut); font-variant-numeric: tabular-nums; }
.chap-t h3 { margin: 0; font-size: 14px; font-weight: 700; }
.chap-t p { margin: 0; font-size: 11px; color: var(--mut); }
.spark { width: 120px; height: 28px; }
.chap-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 10px 0 0; }
.chap-stats div { min-width: 0; }
.chap-stats dt { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mut); }
.chap-stats dd { margin: 0; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--text2); }
.tag.aid { background: rgba(43, 123, 214, 0.12); color: #1d5fae; }
.tag.cut { background: rgba(214, 69, 51, 0.1); color: #b0352a; }
.tag.crono { background: rgba(227, 154, 23, 0.16); color: #8a5a00; }
.tag.poi { background: var(--panel2); }
.chap-actions { display: flex; gap: 14px; margin-top: 10px; }
.link { background: none; border: 0; padding: 0; color: #d9530a; font-size: 12px; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---------- Plan ---------- */
.block { margin-bottom: 20px; }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mut); font-weight: 600; margin-bottom: 8px; display: block; }
.lbl .mut { text-transform: none; letter-spacing: 0; font-weight: 400; }
.target-row { display: flex; align-items: center; gap: 16px; }
#targetOut { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.eq { font-size: 12px; color: var(--mut); }
.eq b { color: var(--text); }
input[type='range'] { width: 100%; accent-color: var(--accent); margin: 8px 0 2px; }
.range-lbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--mut); }
.stops { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stops label { font-size: 12px; color: var(--mut); display: flex; flex-direction: column; gap: 4px; }
.stops select { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.cutoff .big { font-size: 24px; font-weight: 800; }
.cutoff p { margin: 4px 0 0; font-size: 12px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 12px; }
.ptable th { text-align: left; font-weight: 600; color: var(--mut); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ptable td small { display: block; color: var(--mut); font-size: 11px; }
.ptable .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptable .wx { white-space: nowrap; color: var(--text2); }
.ptable tr.k-aid td:nth-child(2) { color: #1d5fae; }
.ptable tr.k-crono td:nth-child(2) { color: #8a5a00; }
.ptable tr.k-finish td, .ptable tr.k-start td { font-weight: 700; }
.cutlbl { color: var(--bad) !important; font-style: normal; }
.gap { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 6px; background: var(--panel2); margin-bottom: 5px; font-size: 12px; overflow: hidden; }
.gap-bar { position: absolute; inset: 0 auto 0 0; background: rgba(0, 0, 0, 0.04); }
.gap.max .gap-bar { background: rgba(255, 106, 19, 0.14); }
.gap span { position: relative; }
.gap-r { color: var(--mut); white-space: nowrap; }
.gap-r b { color: var(--text); }
.note { font-size: 12px; color: var(--text2); margin: 8px 0 0; }
.export { display: flex; gap: 8px; }
.primary { background: var(--accent); border: 0; border-radius: 8px; padding: 9px 14px; font-weight: 700; color: #fff; }
.method { border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- Info ---------- */
.aidlist, .list { list-style: none; padding: 0; margin: 0; }
.aidlist li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.aidlist small { display: block; color: var(--mut); }
.aidn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; border: 2px solid var(--aid); flex: none; }
.aidn.food { background: var(--aid); }
.list li { padding: 6px 0 6px 14px; position: relative; border-bottom: 1px solid var(--line); font-size: 13px; }
.list li::before { content: ''; position: absolute; left: 0; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ---------- Patrocinio ---------- */
.sp-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--panel2); }
.sp-k { font-weight: 700; margin-bottom: 4px; }
.sp-card p { margin: 0; font-size: 13px; color: var(--text2); }

/* ---------- Marcadores ---------- */
.mk { cursor: default; }
.mk-start span, .mk-crono span { display: block; background: #0e1215; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; border: 1px solid #fff; white-space: nowrap; position: relative; }
.mk-start span::after, .mk-crono span::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #fff; border-bottom: 0; }
.mk-crono span { background: var(--amber); color: #1a1406; border-color: var(--amber); }
.mk-crono span::after { border-top-color: var(--amber); }
.mk-aid { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); cursor: pointer; }
.mk-aid.food { background: var(--aid); }
.mk-aid.water { background: #0e1215; border-color: var(--aid); }
.mk-aid.cut { outline: 2px solid var(--bad); outline-offset: 2px; }
.mk-poi { display: flex; align-items: flex-end; gap: 4px; pointer-events: none; }
.mk-poi i { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.mk-poi i.chapel { border: 0; width: 10px; height: 10px; background: #fff; border-radius: 2px; }
.mk-poi span { color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.6); white-space: nowrap; }
.mk-poi small { display: block; font-weight: 500; font-size: 10px; opacity: 0.85; }
.mk-runner i { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(255, 122, 26, 0.3); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px rgba(255, 122, 26, 0.08); } }
.pop .maplibregl-popup-content { background: #0e1215; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12px/1.4 Inter, system-ui, sans-serif; }
.pop .maplibregl-popup-tip { border-top-color: #0e1215 !important; border-bottom-color: #0e1215 !important; }
.pop h4 { margin: 0 0 4px; font-size: 13px; }
.pop p { margin: 2px 0; }
.pop .cut { color: var(--bad); }
.pop .mut { color: var(--mut); }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1600px) { .head-stats .hs:nth-child(n + 5) { display: none; } }
@media (max-width: 1440px) { .head-stats .hs:nth-child(n + 4) { display: none; } }
@media (max-width: 1200px) { .head-stats .hs:nth-child(n + 3) { display: none; } }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 62vh auto; height: auto; }
  .stage { height: 62vh; grid-template-rows: minmax(0, 1fr) 180px; }
  .lower { bottom: 192px; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .head-stats, .proto { display: none; }
  .legend { display: none; }
}
@media (max-width: 600px) {
  .top { padding: 8px 12px; gap: 2px 10px; height: auto; flex-wrap: wrap; }
  .layout { height: auto; }
  .wx { font-size: 11px; margin-left: 0; width: 100%; }
  .stage { grid-template-rows: minmax(0, 1fr) 250px; }
  .pp-label span { display: none; }
  .lower { min-width: 0; left: 8px; right: 8px; padding: 8px 12px; }
  .lt-title { font-size: 16px; }
  .chap-head { grid-template-columns: auto minmax(0, 1fr); }
  .spark { display: none; }
  .chap-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.mk-poi.below { align-items: flex-start; }
.mk-poi.below i { margin-top: 2px; }

/* ---------- Cabecera: idioma y modo organizador ---------- */
.head-tools { display: flex; align-items: center; gap: 8px; }
.lang { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; font-weight: 600; }
.org-toggle { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--mut); white-space: nowrap; }
.org-toggle.on { border-color: var(--amber); color: #1a1406; background: var(--amber); }
.tabs .org-tab { color: var(--amber); }

/* ---------- Capítulos: contenido del organizador ---------- */
.chap-desc { margin: 10px 0 0; font-size: 13px; color: var(--text2); line-height: 1.5; }
.chap-photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.chap-photos button { padding: 0; border: 0; border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 3; background: #000; }
.chap-photos img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.chap-photos button:hover img { transform: scale(1.05); }
.sp-card-chap { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); }
.sp-card-chap img { height: 30px; max-width: 70px; object-fit: contain; }
.sp-card-chap div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sp-card-chap span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mut); }
.sp-card-chap small { color: var(--text2); font-size: 12px; }
.sp-card-chap a { font-size: 12px; font-weight: 600; color: #d9530a; text-decoration: none; white-space: nowrap; }
.sp-inline { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--mut); }
.sp-inline img { height: 18px; max-width: 50px; object-fit: contain; }
.sp-inline b { color: var(--text); }
.lt-sponsor.real img { height: 26px; max-width: 80px; object-fit: contain; }
.lt-sponsor.real b { color: var(--text); font-size: 13px; }

/* ---------- Sobrevuelo: foto, cabecera de patrocinador ---------- */
.fly-photo { position: absolute; right: 16px; bottom: 228px; z-index: 3; width: 300px; max-width: 45%; border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); opacity: 0; transform: translateY(12px); transition: 0.35s; pointer-events: none; }
.fly-photo.show { opacity: 1; transform: none; }
.fly-photo img { width: 100%; display: block; }
.fly-photo span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 12px; font-weight: 600; background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); }
.fly-photo span:empty { display: none; }
.fly-badge { position: absolute; top: 56px; left: 12px; z-index: 2; background: rgba(14, 18, 21, 0.85); border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px 6px; }
.title-card { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; background: rgba(8, 11, 14, 0.82); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity 0.5s; bottom: 212px; }
.title-card.show { opacity: 1; }
.title-card img { max-height: 90px; max-width: 260px; object-fit: contain; }
.tc-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--mut); }
.tc-n { font-size: 26px; font-weight: 800; }
.title-card p { margin: 0; color: #cfd6db; max-width: 420px; }

/* ---------- Visor de fotos ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(4, 6, 8, 0.92); display: grid; place-items: center; padding: 24px; }
.lb-inner { position: relative; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.lb-inner img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 8px; }
.lb-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lb-cap { flex: 1; display: flex; flex-direction: column; min-width: 200px; }
.lb-cap span { color: var(--mut); font-size: 12px; }
.lb-nav { position: absolute; top: 40%; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 26px; line-height: 1; }
.lb-nav.prev { left: 8px; }
.lb-nav.next { right: 8px; }
.mk-photo { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); cursor: pointer; transition: transform 0.15s; }
.mk-photo:hover { transform: scale(1.6); z-index: 5; }
.mk-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Carrera: subida de GPX y repetición ---------- */
.drop { display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line); border-radius: 10px; padding: 18px; cursor: pointer; background: var(--panel2); font-size: 13px; text-align: center; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop input { display: none; }
.race-actions { margin: 8px 0; }
.err { color: var(--warn); font-size: 12px; }
.runner { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.runner:hover { background: var(--panel2); }
.runner.on { border-color: var(--line); background: var(--panel2); }
.runner i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.rn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.rt { font-variant-numeric: tabular-nums; font-size: 13px; }
.icon { background: none; border: 0; color: var(--mut); font-size: 15px; padding: 0 4px; }
.icon:hover { color: var(--text); }
.replay { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rp-clock { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 96px; }
.rp-opt { display: flex; flex-direction: column; font-size: 10px; color: var(--mut); text-transform: uppercase; letter-spacing: 0.06em; }
.rp-opt select { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 12px; text-transform: none; letter-spacing: 0; }
#rpPlay .i-pause { display: none; }
#rpPlay.on .i-play { display: none; }
#rpPlay.on .i-pause { display: block; }
.ana-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.ana-head i { width: 12px; height: 12px; border-radius: 50%; }
.ana-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.ana-stats div { background: var(--panel2); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; min-width: 0; }
.ana-stats span { font-size: 10px; color: var(--mut); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ana-stats b { font-variant-numeric: tabular-nums; }
.ptable.ana td:first-child { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.board { position: absolute; top: 56px; left: 12px; z-index: 3; width: 250px; background: rgba(12, 16, 19, 0.88); border: 1px solid var(--line); border-radius: 10px; padding: 8px; backdrop-filter: blur(6px); max-height: calc(100% - 300px); overflow: auto; }
.b-h { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mut); padding: 0 4px 6px; }
.b-r { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.b-r:hover, .b-r.on { background: rgba(255, 255, 255, 0.08); }
.b-p { width: 16px; color: var(--mut); font-variant-numeric: tabular-nums; }
.b-r i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.b-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-v { font-variant-numeric: tabular-nums; color: #cfd6db; }
.mk-rr { display: flex; align-items: center; gap: 4px; pointer-events: none; }
.mk-rr i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.mk-rr span { font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
#rpSlider { width: 100%; accent-color: var(--accent); }

/* ---------- Organizador ---------- */
.org-lang { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); margin-bottom: 10px; }
.org-lang select, .place select, .oc-body select, .sp-form input { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.saved { position: fixed; right: 20px; bottom: 20px; z-index: 60; background: var(--good); color: #062; font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 999px; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.saved.show { opacity: 1; }
.lbl-row { display: flex; justify-content: space-between; align-items: baseline; }
.sp-form { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--panel2); }
.sp-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mut); }
.sp-form input[type='file'] { font-size: 11px; }
.sp-logo-prev img { max-height: 50px; max-width: 160px; background: #fff1; border-radius: 4px; padding: 4px; }
.sp-form-actions { display: flex; gap: 8px; }
.sp-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); }
.sp-logo { width: 54px; height: 36px; border-radius: 6px; background: #ffffff10; display: grid; place-items: center; overflow: hidden; flex: none; }
.sp-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sp-logo span { font-weight: 800; color: var(--mut); text-transform: uppercase; }
.sp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-txt small { font-size: 11px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-txt small.mut { color: var(--mut); }
.place { display: grid; gap: 8px; }
.place label, .place-aid label { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; font-size: 12px; }
.place-aid { display: grid; gap: 6px; }
.oc { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--panel2); }
.oc.open { border-color: var(--amber); }
.oc-h { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 9px 10px; text-align: left; }
.oc-t { flex: 1; font-weight: 600; font-size: 13px; }
.oc-b { font-size: 11px; color: var(--amber); }
.oc-body { padding: 0 10px 10px; display: grid; gap: 6px; }
.oc-body textarea { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: 13px/1.45 Inter, system-ui, sans-serif; color: var(--text); resize: vertical; }
.oc-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.oc-ph { position: relative; display: grid; gap: 4px; }
.oc-ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.oc-ph input { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font-size: 11px; width: 100%; }
.oc-ph .km { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--mut); }
.oc-ph .km input { width: 70px; }
.oc-ph .icon { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, 0.6); border-radius: 50%; width: 22px; height: 22px; color: #fff; }
.oc-add { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: 6px; font-size: 12px; color: var(--mut); cursor: pointer; text-align: center; padding: 6px; }
.oc-add:hover { border-color: var(--amber); color: var(--text); }
.oc-add input, .file-btn input { display: none; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sp-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); text-decoration: none; color: var(--text); text-align: center; }
.sp-tile img { max-height: 44px; max-width: 120px; object-fit: contain; }
.sp-tile small { color: var(--mut); font-size: 11px; }
.sp-ph { font-weight: 800; font-size: 18px; color: var(--mut); text-transform: uppercase; }
@media (max-width: 1400px) { .proto { display: none; } }
@media (max-width: 600px) {
  .head-tools { width: 100%; }
  .fly-photo { bottom: 260px; width: 180px; }
  .board { width: 190px; }
}

.ana-wrap { overflow-x: auto; }
.ptable.ana { font-size: 11px; }
.ptable.ana th { font-size: 9px; }


/* ---------- Paneles sobre el mapa: siguen oscuros para leerse sobre la ortofoto ---------- */
.lower, .board, .map-tools, .fly-badge, .title-card, .pop .maplibregl-popup-content, .lightbox, .fly-photo {
  --text: #eef2f0; --text2: #cfd6d2; --mut: #9eaaa5; --line: #34413b; --panel2: #1d2621; --panel: #141b17;
  color: var(--text);
}
.map-tools .seg, .map-tools .exag { background: rgba(14, 20, 17, 0.85); }
.map-tools .seg button.on { background: #2c3833; box-shadow: none; }
.pop .maplibregl-popup-content { background: #111814; }
.pop .maplibregl-popup-tip { border-top-color: #111814 !important; border-bottom-color: #111814 !important; }
.board .b-r:hover, .board .b-r.on { background: rgba(255, 255, 255, 0.08); }
.lightbox .ghost { color: var(--text); }
.profile-panel { --ink: 23, 33, 28; --fade: 255, 255, 255; }
.top { box-shadow: 0 1px 0 var(--line); }

.draft-pill { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; background: #23406e; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.25); pointer-events: none; }

/* Feed del recorrido durante el sobrevuelo */
.feed { position: absolute; top: 56px; right: 60px; z-index: 4; width: 300px; max-width: 42%; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.feed-card { pointer-events: auto; display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, 0.96); color: #17211c; border-radius: 12px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); opacity: 0; transform: translateX(24px); transition: opacity .35s, transform .35s; }
.feed-card.show { opacity: 1; transform: none; }
.feed-card.sponsor { border-left: 4px solid #ff6a13; cursor: pointer; }
.feed-card .fc-img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.feed-card .fc-logo { width: 72px; height: 44px; flex: none; display: grid; place-items: center; }
.feed-card .fc-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.feed-card .fc-logo b { font-size: 11px; text-align: center; }
.feed-card .fc-t { min-width: 0; display: grid; gap: 2px; }
.feed-card .fc-t b { font-size: 13px; }
.feed-card .fc-t p { margin: 0; font-size: 12px; color: #3d4a44; line-height: 1.35; }
.feed-card .fc-t small { font-size: 10px; color: #ff6a13; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pop-img { display: block; width: calc(100% + 20px); margin: -10px -10px 8px; max-height: 160px; object-fit: cover; border-radius: 8px 8px 0 0; }
.mk-board .bd { width: calc(70px * var(--s, 1)); height: calc(38px * var(--s, 1)); }
@media (max-width: 760px) { .feed { right: 8px; top: 48px; width: 220px; max-width: 60%; } }

.mk-board.link, .feed-card.link { cursor: pointer; }
.mk-board.link:hover .bd { outline: 2px solid #ff6a13; }
a.sp-inline, a.lt-sponsor { color: inherit; text-decoration: none; cursor: pointer; }
a.sp-inline:hover b, a.lt-sponsor:hover b { text-decoration: underline; }
.title-card.show.link { pointer-events: auto; cursor: pointer; }
.title-card .tc-in { display: grid; justify-items: center; gap: 8px; color: inherit; text-decoration: none; }
