:root {
  --bg: #0E1015;        /* panel, tipo carbono */
  --surface: #161A21;
  --surface-2: #1E232C;
  --line: #272D37;
  --text: #F3F5F8;
  --muted: #8C96A6;
  --volt: #FF7A1F;      /* acento naranja */
  --volt-ink: #0E1015;
  --route: #FF7A1F;     /* la ruta usa el mismo acento que la interfaz */
  --magenta: #E6007E;   /* toque de marca en la cabecera */
  --danger: #FF5C5C;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
#app { display: flex; height: 100%; }
aside {
  width: 380px; flex: none; overflow-y: auto; background: var(--bg);
  border-right: 1px solid var(--line); z-index: 2; scrollbar-color: var(--line) transparent;
}
#map { flex: 1; height: 100%; cursor: crosshair; background: #1E232C; font-family: "Barlow", sans-serif; }
#map[data-base="voyager"], #map[data-base="osm"] { background: #E8E6E1; }
.tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.35); }
.route-line { filter: drop-shadow(0 0 4px rgba(255,122,31,.45)); }
.leaflet-control-attribution {
  background: rgba(14,16,21,.75) !important; color: var(--muted); font-size: .66rem; padding: 2px 8px !important;
  border-radius: 6px 0 0 0; backdrop-filter: blur(4px);
}
.leaflet-control-attribution a { color: var(--text) !important; }
.leaflet-control-attribution a:hover { color: var(--volt) !important; }
.leaflet-control-attribution svg { display: none !important; }
button { font: inherit; color: var(--text); cursor: pointer; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- Cabecera ---- */
header { padding: 20px 20px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 3; }
header::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--volt), var(--magenta)); }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.logo { width: 34px; height: 34px; flex: none; }
h1 { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 1.9rem; line-height: 1; margin: 0; letter-spacing: .01em; text-transform: uppercase; }
h1 span { color: var(--volt); }
.tag { font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.stripes { margin-left: auto; align-self: flex-start; width: 42px; height: 14px; background: repeating-linear-gradient(-60deg, var(--volt) 0 4px, transparent 4px 9px); opacity: .9; }

.label { font-family: var(--cond); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.modes button {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: .88rem; font-weight: 600; padding: 8px 4px; border: 0; background: transparent; border-radius: 4px; color: var(--muted);
  transition: background .15s, color .15s;
}
.modes button:hover { color: var(--text); }
.modes button[aria-pressed="true"] { background: var(--volt); color: var(--volt-ink); }
.actions { display: grid; grid-template-columns: 42px 42px 42px 1fr; gap: 6px; }
.actions button {
  display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px;
  border-radius: 6px; border: 1px solid var(--line); background: var(--surface); transition: background .15s, border-color .15s;
}
.actions button:not(:disabled):hover { background: var(--surface-2); border-color: #39414E; }
.actions button.primary {
  background: var(--volt); border-color: var(--volt); color: var(--volt-ink);
  font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase;
}
.actions button.primary:not(:disabled):hover { background: #E2FF6B; border-color: #E2FF6B; }
.actions button:disabled { opacity: .35; cursor: default; }
.status { font-size: .8rem; color: var(--muted); margin-top: 10px; min-height: 1.1em; }
.status:not(:empty)::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--volt); margin-right: 7px; vertical-align: 1px; }
.status.err { color: var(--danger); }
.status.err::before { background: var(--danger); }

/* ---- Secciones ---- */
section { padding: 20px; border-bottom: 1px solid var(--line); }
h2 { font-family: var(--cond); font-style: italic; font-weight: 700; font-size: 1.15rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 14px; }
h2::before { content: "/"; color: var(--volt); margin-right: 7px; }

.start h2 { font-size: 1.5rem; margin-bottom: 6px; }
.start p { color: var(--muted); font-size: .92rem; line-height: 1.5; margin: 0 0 16px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); font-size: .9rem; line-height: 1.45; color: #C9CFD9; }
.steps li::before {
  content: counter(s, decimal-leading-zero); font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 1.35rem; line-height: 1;
  color: var(--volt); min-width: 26px;
}
.steps b, .tips b { color: var(--text); font-weight: 600; }
kbd { font-family: inherit; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

/* ---- Métricas tipo ciclocomputador ---- */
.metrics { padding-top: 18px; }
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; margin-bottom: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 12px 10px; position: relative; overflow: hidden; }
.stat .k { font-family: var(--cond); font-weight: 700; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat .v {
  font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 1.55rem; line-height: 1.05; margin-top: 3px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat .u { font-size: .62em; font-weight: 700; color: var(--volt); margin-left: 3px; }
.hero .stat { padding: 14px 14px 12px; }
.hero .stat .v { font-size: 2.7rem; }
.hero .stat:first-child { border-color: #5A2E10; background: linear-gradient(135deg, #24160D 0%, var(--surface) 70%); }
.hero .stat:first-child::after { content: ""; position: absolute; right: -8px; top: 0; bottom: 0; width: 34px; background: repeating-linear-gradient(-60deg, rgba(255,122,31,.14) 0 4px, transparent 4px 10px); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* ---- Perfil de elevación ---- */
#chart { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px 4px; }
#chart svg { width: 100%; height: auto; display: block; touch-action: none; overflow: visible; }
#chart .g { stroke: var(--line); stroke-width: 1; }
#chart .yl, #chart .xl { font-size: 9px; fill: var(--muted); font-family: var(--cond); font-weight: 600; letter-spacing: .03em; }
#chart .ln { fill: none; stroke: var(--volt); stroke-width: 2.2; stroke-linejoin: round; }
#chart .axis { stroke: #39414E; }
#chart .hv { stroke: var(--text); stroke-width: 1; stroke-dasharray: 2 2; }
#chart .ht { font-size: 11px; font-weight: 700; fill: var(--text); font-family: var(--cond); letter-spacing: .02em; }
.loading { color: var(--muted); font-size: .85rem; padding: 8px 4px; line-height: 1.45; }

/* ---- Tipo de vía ---- */
.bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: 14px; background: var(--surface); }
.bar div { height: 100%; }
ul.legend { list-style: none; margin: 0; padding: 0; }
ul.legend li { display: flex; align-items: center; gap: 10px; font-size: .9rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.legend li:last-child { border-bottom: 0; }
ul.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
ul.legend b { font-weight: 500; }
ul.legend .n { margin-left: auto; font-family: var(--cond); font-weight: 700; font-size: .98rem; letter-spacing: .02em; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.more { background: none; border: 0; font-family: var(--cond); font-weight: 700; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; padding: 8px 0 0; color: var(--volt); }
.show {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 10px;
  border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text); font-size: .88rem; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.show::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; }
.show:hover { background: var(--surface); }
.show[aria-pressed="true"] { border-color: var(--volt); color: var(--volt); background: rgba(255,122,31,.07); }
.show[aria-pressed="true"]::before { background: currentColor; }
.show:disabled { opacity: .45; cursor: default; background: transparent; }
.libtools .show::before { display: none; }
.slopeLegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); margin-top: 10px; }
.slopeLegend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

/* ---- Consejos ---- */
.tips { padding: 0 20px 24px; }
.tips summary { cursor: pointer; list-style: none; padding: 16px 0 4px; font-family: var(--cond); font-weight: 700; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tips summary::-webkit-details-marker { display: none; }
.tips summary::after { content: " +"; color: var(--volt); }
.tips[open] summary::after { content: " −"; }
.tips ul { margin: 8px 0 0; padding-left: 18px; color: #C9CFD9; font-size: .86rem; line-height: 1.55; }
.tips li::marker { color: var(--volt); }

/* ---- Controles del mapa ---- */
.basemap { position: relative; }
.bm-toggle {
  width: 68px; height: 68px; padding: 0; border: 2px solid var(--bg); border-radius: 10px; overflow: hidden;
  position: relative; background: var(--surface-2); box-shadow: 0 3px 12px rgba(0,0,0,.35); display: block;
}
.bm-toggle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bm-toggle span {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(14,16,21,.85); color: var(--text);
  font-family: var(--cond); font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 2px; text-align: center; white-space: nowrap; overflow: hidden;
}
.bm-panel {
  position: absolute; right: 78px; bottom: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.4); display: grid; grid-template-columns: repeat(3, 78px); gap: 10px 8px;
}
.bm-panel[hidden] { display: none; }
.bm-opt { border: 0; background: none; padding: 0; font-size: .76rem; font-weight: 500; text-align: center; color: var(--muted); line-height: 1.2; }
.bm-opt img {
  width: 78px; height: 58px; object-fit: cover; display: block; margin-bottom: 5px;
  border-radius: 7px; border: 2px solid transparent; background: var(--surface-2);
}
.bm-opt:hover { color: var(--text); }
.bm-opt:hover img { border-color: #39414E; }
.bm-opt[aria-checked="true"] { color: var(--volt); font-weight: 600; }
.bm-opt[aria-checked="true"] img { border-color: var(--volt); }
.search { position: relative; width: min(340px, calc(100vw - 28px)); margin: 14px 0 0 14px !important; }
.sbar {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 4px 0 12px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 12px rgba(0,0,0,.35);
}
.sbar:focus-within { border-color: var(--volt); }
.sbar input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: .92rem; outline: none; }
.sbar input::placeholder { color: var(--muted); }
.sbar .loc { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.sbar .loc:hover { background: var(--surface-2); color: var(--volt); }
.results {
  list-style: none; margin: 6px 0 0; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.4); max-height: 320px; overflow-y: auto;
}
.results li { padding: 8px 10px; border-radius: 5px; cursor: pointer; font-size: .86rem; line-height: 1.35; }
.results li b { display: block; font-weight: 600; color: var(--text); }
.results li span { color: var(--muted); font-size: .8rem; }
.results li[aria-selected="true"] { background: var(--surface-2); }
.results li.msg { cursor: default; color: var(--muted); }
.results li.msg.err { color: var(--danger); }
.leaflet-bar { border: 0 !important; box-shadow: 0 3px 12px rgba(0,0,0,.35) !important; border-radius: 8px !important; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover {
  width: 38px; height: 38px; line-height: 38px; font-size: 20px; color: var(--text); background: var(--bg); border-bottom-color: var(--line);
}
.leaflet-bar a:hover { background: var(--surface-2); color: var(--volt); }
.leaflet-bottom.leaflet-right .leaflet-control-zoom { margin-bottom: 8px; margin-right: 14px; }
.leaflet-bottom.leaflet-right .basemap { margin-bottom: 6px; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg); color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.leaflet-popup-content-wrapper { border-radius: 8px; border: 1px solid var(--line); }
.leaflet-popup-content { margin: 8px; }
.leaflet-tooltip { background: var(--bg); color: var(--text); border: 0; border-radius: 5px; font-family: "Barlow", sans-serif; font-weight: 600; font-size: .8rem; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.leaflet-tooltip-top::before { border-top-color: var(--bg); }

/* ---- Puntos de la ruta ---- */
.pt { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--route); box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.pt.first { background: var(--route); border-color: var(--bg); width: 18px; height: 18px; box-shadow: 0 0 0 2px var(--route), 0 1px 6px rgba(0,0,0,.45); }
.pt.last {
  width: 18px; height: 18px; border: 2px solid var(--bg); box-shadow: 0 0 0 2px var(--route), 0 1px 6px rgba(0,0,0,.45);
  background: repeating-conic-gradient(#fff 0 25%, var(--bg) 0 50%) 50% / 7px 7px; /* bandera de meta */
}
.pt.ghost { width: 14px; height: 14px; background: var(--bg); border-color: var(--route); opacity: .9; cursor: grab; }
.pt.loop { box-shadow: 0 0 0 2px var(--route), 0 0 0 4px var(--bg), 0 0 0 6px var(--route), 0 1px 6px rgba(0,0,0,.45); }
.popbtns { display: flex; gap: 6px; }
.popbtn, .delbtn { border: 0; border-radius: 5px; padding: 7px 11px; font-weight: 600; font-size: .85rem; }
.popbtn { background: var(--volt); color: var(--volt-ink); }
.delbtn { background: var(--danger); color: #fff; }

/* ---- Panel desplegable en móvil ---- */
.sheet-close, #sheetBtn { display: none; }
.sheet-close {
  align-items: center; justify-content: center; width: 36px; height: 36px; margin: -6px -6px 0 0; flex: none;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text);
}
#sheetBtn {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000;
  align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border: 0; border-radius: 22px;
  background: var(--volt); color: var(--volt-ink); box-shadow: 0 4px 16px rgba(0,0,0,.4);
  font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
#sheetBtn.alert::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--volt); }

@media (max-width: 700px) {
  #app { display: block; position: relative; }
  #map { height: 100%; }
  aside {
    position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 78vh; height: 78dvh; z-index: 1001;
    border-right: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.45);
    transform: translateY(100%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s;
  }
  body.sheet-open aside { transform: none; visibility: visible; transition: transform .25s ease; }
  body.sheet-open #sheetBtn { display: none; }
  #sheetBtn, .sheet-close { display: flex; }
  .stripes { display: none; }
  .brand .sheet-close { margin-left: auto; }
  header { padding: 16px 16px 12px; }
  .brand { margin-bottom: 12px; }
  section { padding: 16px; }
  .tips { padding: 0 16px 20px; }
  .hero .stat .v { font-size: 2.3rem; }
}

/* =====================================================================
   Ampliaciones: perfil de bici, menús, subidas, tiempo, servicios, rutas
   ===================================================================== */
.modes.four { grid-template-columns: repeat(4, 1fr); }
.modes.three { grid-template-columns: repeat(3, 1fr); }
#speed { width: 64px; }
.modes.four button { font-size: .84rem; padding: 8px 2px; }
.actions { grid-template-columns: 42px 42px 42px 42px 1fr; position: relative; }
.menuwrap { display: grid; }
/* los menús ocupan todo el ancho de la fila de acciones */
.menu {
  position: absolute; left: 0; right: 0; top: 46px; z-index: 20; padding: 5px; margin: 0; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
.menu[hidden] { display: none; }
.menu button {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: auto; padding: 9px 10px; border: 0; border-radius: 5px;
  background: none; text-align: left; font-size: .88rem; font-weight: 500;
}
.menu button:not(:disabled):hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button:disabled { opacity: .35; cursor: default; }
.menu small { display: block; color: var(--muted); font-size: .74rem; font-weight: 400; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }

/* Ajustes de la bici */
section.bike { padding-top: 16px; padding-bottom: 16px; }
.settings { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-size: .86rem; color: #C9CFD9; }
.settings label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.num {
  width: 58px; height: 32px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; text-align: center;
}
.num:focus, .txt:focus { outline: none; border-color: var(--volt); }
input[type="checkbox"] { accent-color: var(--volt); width: 16px; height: 16px; margin: 0; }
.txt {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  color: var(--text); font: inherit; font-size: .95rem; font-weight: 600;
}
/* Nombre de la ruta con el botón de guardar al lado */
.rnamerow { display: flex; align-items: stretch; gap: 8px; margin-bottom: 12px; }
.rnamerow .txt { flex: 1; min-width: 0; }
.ibtn.savebtn { width: 38px; height: auto; }  /* misma altura que el campo (.ibtn, más abajo, la fijaría en 34 px) */
.ibtn.savebtn.saved { color: var(--volt); border-color: #5A2E10; }
.hint { font-size: .78rem; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }

/* Perfil: subidas sombreadas */
#chart .cl { fill: rgba(230,0,126,.14); }
#chart .cln { font-size: 8.5px; fill: #FF4FAE; font-family: var(--cond); font-weight: 700; }
#chart .cls { fill: rgba(255,122,31,.2); }

/* Lista de subidas */
/* Parciales por km */
.splits { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.splits th { font-family: var(--cond); font-weight: 700; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 0 0 6px; }
.splits th:first-child, .splits td:first-child { text-align: left; }
.splits td { padding: 5px 0; border-top: 1px solid var(--line); text-align: right; color: #C9CFD9; }
.splits td.p { font-weight: 700; color: var(--text); }
.splits th:nth-child(1) { width: 14%; } .splits th:nth-child(2) { width: 17%; } .splits th:nth-child(4), .splits th:nth-child(5) { width: 13%; }
.splits td.kmbar { padding: 5px 12px; }
.splits td.kmbar i { display: block; height: 6px; border-radius: 3px; background: var(--volt); opacity: .75; }
.climbs { list-style: none; margin: 0; padding: 0; }
.climbs li { border-top: 1px solid var(--line); }
.climbs li:first-child { border-top: 0; }
.climbs button {
  display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; width: 100%;
  padding: 9px 4px; border: 0; background: none; text-align: left; border-radius: 6px;
}
.climbs button:hover { background: var(--surface); }
.climbs .cat {
  grid-row: span 2; min-width: 40px; padding: 4px 5px; border-radius: 5px; text-align: center;
  font-family: var(--cond); font-style: italic; font-weight: 800; font-size: .9rem; color: #fff; background: #4A5260;
}
.climbs .cat.c4 { background: #8A6A14; } .climbs .cat.c3 { background: #B86E00; } .climbs .cat.c2 { background: #D6322D; }
.climbs .cat.c1 { background: #A3156B; } .climbs .cat.hc { background: #5B0F7A; }
.climbs b { font-weight: 600; font-size: .9rem; }
.climbs .gain { grid-row: span 2; font-family: var(--cond); font-weight: 700; font-size: 1rem; color: var(--volt); white-space: nowrap; }
.climbs span.d { font-size: .8rem; color: var(--muted); }
.empty { color: var(--muted); font-size: .86rem; line-height: 1.45; }

/* Tiempo y viento */
.wxrow { display: flex; gap: 8px; align-items: center; }
.wxrow input { flex: 1; min-width: 0; color-scheme: dark; }
.wxgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.wxgrid .stat .v { font-size: 1.3rem; }
.windbar { margin-top: 14px; }

/* Puntos de interés */
.poi {
  display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); color: #fff;
}
.poi svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.poi.water { background: #1E88E5; } .poi.wc { background: #7B4FC9; } .poi.food { background: #E67E00; }
.pois { list-style: none; margin: 10px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.pois li { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: .86rem; cursor: pointer; }
.pois li:hover { background: var(--surface); }
.pois li .poi { width: 20px; height: 20px; flex: none; }
.pois li .poi svg { width: 11px; height: 11px; }
.pois li .n { margin-left: auto; font-family: var(--cond); font-weight: 700; color: var(--muted); white-space: nowrap; }
.poicount > span { display: inline-flex; align-items: center; gap: 6px; }
.poicount .poi { width: 18px; height: 18px; flex: none; }
.poicount .poi svg { width: 10px; height: 10px; }
.poicount { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: #C9CFD9; margin-top: 12px; }

/* Marcas de kilómetro */
.kmlbl {
  display: inline-block; transform: translate(-50%, -50%); padding: 1px 5px; border-radius: 9px; white-space: nowrap;
  background: var(--bg); color: var(--volt); border: 1px solid var(--volt);
  font-family: var(--cond); font-weight: 700; font-size: .72rem; line-height: 1.3; pointer-events: none;
}
.pt.mini { width: 10px; height: 10px; border-width: 2px; }

/* Mis rutas */
.libsearch { margin: 12px 0 4px; }
.lib { list-style: none; margin: 0; padding: 0; }
.lib li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lib li:last-child { border-bottom: 0; }
.lib li.cur b { color: var(--volt); }
.lib .meta { flex: 1; min-width: 0; cursor: pointer; border-radius: 4px; }
.lib .meta:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
.lib b { display: block; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib .meta span { color: var(--muted); font-size: .78rem; }  /* solo la línea de km y fecha, no el menú de descarga */
.ibtn {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}
.ibtn:hover { background: var(--surface-2); color: var(--volt); }
.ibtn.del:hover { color: var(--danger); }
/* Exportar desde Mis rutas: el menú se abre hacia la izquierda, alineado con el botón */
.libexp { position: relative; }
.libexp .menu { left: auto; right: 0; top: 40px; width: 240px; }
details.box { padding: 0 20px; border-bottom: 1px solid var(--line); }
details.box > summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-family: var(--cond); font-style: italic; font-weight: 700;
  font-size: 1.15rem; letter-spacing: .06em; text-transform: uppercase;
}
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::before { content: "/"; color: var(--volt); margin-right: 7px; }
details.box > summary::after { content: " +"; color: var(--volt); }
details.box[open] > summary::after { content: " −"; }
details.box > div { padding-bottom: 18px; }

/* Buscador: añadir a la ruta */
.results li { display: flex; align-items: center; gap: 8px; }
.results li .rt { flex: 1; min-width: 0; }
.results li .add {
  flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--volt);
}
.results li .add:hover { border-color: var(--volt); }

/* Pie del panel */
.foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 16px 20px 28px; font-size: .78rem; }
.foot a, .foot button { color: var(--muted); background: none; border: 0; padding: 0; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover, .foot button:hover { color: var(--volt); }

/* Cuenta (en Mis rutas) */
.acct { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.acct-txt { font-size: .84rem; line-height: 1.45; color: #C9CFD9; margin: 0 0 10px; }
.acct-txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.acct-txt span { color: var(--muted); font-size: .78rem; }
.acct-txt span.err { color: var(--danger); }
.acct-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; }
.acct-links button { background: none; border: 0; padding: 0; font-size: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.acct-links button:hover { color: var(--volt); }

/* Sin cuenta: presentación con los botones de entrar y registrarse */
.gate { padding: 20px; border-bottom: 1px solid var(--line); }
.gate p { color: #C9CFD9; font-size: .92rem; line-height: 1.5; margin: 0 0 14px; }
.gate p.hint { font-size: .78rem; color: var(--muted); margin: 0; }
.gate-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.gate-btns button { flex: 1 1 140px; justify-content: center; margin: 0; min-height: 44px; padding: 10px 16px; }
.gate .cta { padding: 10px 16px; border-radius: 6px; border: 1px solid var(--volt); background: var(--volt); color: var(--volt-ink); font-weight: 600; font-size: .92rem; }
.gate .cta:hover { filter: brightness(1.08); }
.gate .show::before { display: none; }
/* Bloqueada: solo la marca, los avisos, la presentación y el pie */
body.locked aside > :not(header):not(#gate):not(.foot) { display: none; }
body.locked aside > header > :not(.brand):not(.status) { display: none; }
body.locked .brand { margin-bottom: 4px; }
body.locked #map { cursor: default; }
body.locked #sheetClose { display: none; }
/* Ruta compartida sin cuenta: se ve con todos sus datos, pero sin herramientas de edición */
body.viewonly #undo, body.viewonly #redo, body.viewonly #clear,
body.viewonly #loopBox, body.viewonly #libBox, body.viewonly #emptyBox { display: none; }
body.viewonly #map { cursor: grab; }
/* El buscador de lugares del mapa (con el botón de mi ubicación) solo con sesión */
body.locked .leaflet-control-container form.search, body.viewonly .leaflet-control-container form.search { display: none; }

/* Cuadro de diálogo de la cuenta */
.dlg {
  width: min(400px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg h2 { margin-top: 0; }
.dlg .intro { font-size: .86rem; line-height: 1.45; color: #C9CFD9; margin: 0 0 14px; }
.dlg .intro a { color: var(--volt); }
.fld { display: block; margin-bottom: 12px; }
.fld span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.fld + .hint { margin: -6px 0 12px; }
.pwd { position: relative; }
.pwd .txt { padding-right: 44px; }
.pwd-eye {
  position: absolute; top: 3px; right: 3px; bottom: 3px; width: 36px; display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted);
}
.pwd-eye:hover { color: var(--text); }
.pwd-eye[aria-pressed="true"] { color: var(--volt); }
.dlg .err { color: var(--danger); font-size: .84rem; margin: 0 0 10px; min-height: 1em; }
.dlg .err:empty { display: none; }
.dlg .row { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 14px; }
.dlg .row button { border-radius: 6px; padding: 8px 14px; font-weight: 600; font-size: .86rem; border: 1px solid var(--line); background: var(--surface); }
.dlg .row button.ok { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); }
.dlg .row button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.dlg .row button:disabled { opacity: .5; cursor: default; }
.dlg form > :last-child { margin-bottom: 0; }

/* Aviso de cookies */
#consent {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2000;
  width: min(520px, calc(100vw - 24px)); padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); box-shadow: 0 8px 28px rgba(0,0,0,.5); font-size: .86rem; line-height: 1.45; color: #C9CFD9;
}
#consent[hidden] { display: none; }
#consent a { color: var(--volt); }
#consent .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
#consent button { border-radius: 6px; padding: 8px 14px; font-weight: 600; font-size: .86rem; border: 1px solid var(--line); background: var(--surface); }
#consent button.ok { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); }
@media (min-width: 701px) { #consent { left: calc(190px + 50vw); bottom: 24px; width: min(520px, calc(100vw - 420px)); } }

/* Soltar un GPX sobre el mapa */
#drop {
  position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center;
  background: rgba(14,16,21,.75); border: 3px dashed var(--volt); color: var(--volt);
  font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 2rem; text-transform: uppercase; pointer-events: none;
}
#drop[hidden] { display: none; }

@media (max-width: 700px) {
  section.bike { padding-top: 14px; padding-bottom: 14px; }
  details.box { padding: 0 16px; }
  .foot { padding: 14px 16px 24px; }
}

/* Por dónde pasa: avisos según la bici */
.alerts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.al {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); font-size: .88rem; line-height: 1.35; color: var(--text);
}
.al svg { margin-top: 1px; }
.al small { display: block; color: var(--muted); font-size: .76rem; margin-top: 1px; }
.al.warn svg { color: #FFB020; }
.al.info svg { color: #7CC4F8; }
.al.ok svg { color: var(--volt); }
.al.warn { border-color: #4A3A12; }
button.al:hover { background: var(--surface-2); }
button.al[aria-pressed="true"] { border-color: #E6007E; background: rgba(230,0,126,.1); }
.detail { margin-top: 12px; }
.detail summary {
  cursor: pointer; list-style: none; padding: 6px 0; font-family: var(--cond); font-weight: 700; font-size: .85rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--volt);
}
.detail summary::-webkit-details-marker { display: none; }
.detail summary::after { content: " +"; }
.detail[open] summary::after { content: " −"; }
.detail .label { margin: 12px 0 8px; }
.showpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.showpair .show { margin-top: 14px; font-size: .84rem; padding: 10px 6px; }

/* Ruta circular automática */
.loopset { flex-wrap: nowrap; }
.num.sel { flex: 1; min-width: 0; width: auto; padding: 0 8px; text-align: left; font-weight: 500; color-scheme: dark; }
#loopBtn { border-color: var(--volt); color: var(--volt); }
#loopBtn::before { display: none; }
#loopBtn:not(:disabled):hover { background: rgba(255,122,31,.07); }
#loopBtn:disabled { cursor: progress; }
/* Buscando la ruta circular: rayas en movimiento en el botón (como las de la cabecera) y la propuesta
   en curso dibujada en el mapa con la línea discontinua avanzando */
#loopBtn.busy {
  opacity: 1;
  background-image: linear-gradient(-45deg, rgba(255,122,31,.16) 25%, transparent 25%, transparent 50%, rgba(255,122,31,.16) 50%, rgba(255,122,31,.16) 75%, transparent 75%);
  background-size: 16px 16px; animation: busy-stripes .6s linear infinite;
}
@keyframes busy-stripes { to { background-position: 16px 0; } }
.loop-preview { animation: loop-dash 1s linear infinite; filter: drop-shadow(0 0 4px rgba(255,122,31,.45)); }
@keyframes loop-dash { to { stroke-dashoffset: -28; } }
@media (prefers-reduced-motion: reduce) { #loopBtn.busy, .loop-preview { animation: none; } }
.start p.hint { font-size: .82rem; margin: 14px 0 0; }
.start .hint b { color: var(--text); font-weight: 600; }
.start .hint a { color: var(--volt); }
.startrow { display: flex; align-items: center; gap: 8px; min-height: 34px; margin-bottom: 2px; }
#loopStartName { flex: 1; min-width: 0; font-size: .9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#loopStartName.set { color: var(--text); font-weight: 600; }
.loopwhere .show { margin: 6px 0 14px; }
.loopwhere .show::before { display: none; }
#loopPick[aria-pressed="true"] { border-color: var(--volt); color: var(--volt); background: rgba(255,122,31,.07); }
.pt.home {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: grab;
  background: var(--magenta); border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.pt.home svg { width: 14px; height: 14px; fill: #fff; }

/* ---- Portada pública (/ y /en/, animada por js/landing.js) ---- */
/* El mapa va fijo de fondo; la portada se desplaza por encima. Arriba es transparente a la derecha para ver la
   ruta de ejemplo, y cada sección siguiente tiene fondo propio y va tapando el mapa. */
body.landing { height: auto; min-height: 100%; overflow-x: hidden; }
#ld-map { position: fixed; inset: 0; z-index: 0; background: #1E232C; }
#ld-map { overflow: hidden; }
#ld-map svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ld-map .bg { fill: #10131A; }
#ld-map path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#ld-map .track { stroke: #181C24; stroke-width: .7; vector-effect: non-scaling-stroke; }
#ld-map .minor { stroke: #1E232C; stroke-width: 1; vector-effect: non-scaling-stroke; }
#ld-map .mid { stroke: #29303B; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
#ld-map .major { stroke: #343C49; stroke-width: 2.4; vector-effect: non-scaling-stroke; }
#ld-map .water { stroke: #1B2D42; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
#ld-map .water-a { fill: #16212E; stroke: none; }
#ld-map .lbls text { fill: #4C5666; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; text-anchor: middle; }
#ld-map .lbls .big { fill: #6E7889; font-size: 1.4em; }
#ld-map .r-case { stroke: #0E1015; opacity: .8; }
#ld-map .r-rest { stroke: #FF7A1F; opacity: .18; }
#ld-map .r-done { stroke: #FF7A1F; }
#ld-map .ld-start, #ld-map .ld-rider { position: absolute; left: -9px; top: -9px; }
#ld-map .ld-rider { left: -8px; top: -8px; }
#landing { position: relative; z-index: 1; color: var(--text); font-family: "Barlow", system-ui, sans-serif; }
#landing a { text-decoration: none; }
a.ld-btn, a.ld-link { display: inline-flex; align-items: center; justify-content: center; }
a.ld-brand { color: var(--text); }
#landing h2, #landing h3 { font-family: inherit; }
.ld-top {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 72px; padding: 0 40px; background: linear-gradient(180deg, rgba(14,16,21,.95) 30%, rgba(14,16,21,0));
}
.ld-top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--volt), var(--magenta)); }
.ld-top { transition: background-color .25s, border-color .25s; border-bottom: 1px solid transparent; }
.ld-top.solid { background: rgba(14,16,21,.94); border-bottom-color: var(--line); backdrop-filter: blur(8px); }
.ld-brand { display: flex; align-items: center; gap: 10px; font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 1.7rem; text-transform: uppercase; letter-spacing: .01em; }
.ld-brand b { color: var(--volt); font-weight: 800; }
.ld-logo { width: 32px; height: 32px; flex: none; }
.ld-top-btns { display: flex; align-items: center; gap: 20px; }
.ld-link { background: none; border: 0; padding: 6px 2px; color: var(--text); font-weight: 600; font-size: .95rem; }
.ld-link:hover { color: var(--volt); }
.ld-btn {
  border-radius: 8px; padding: 14px 26px; border: 1px solid #39414E; background: rgba(14,16,21,.55); color: var(--text);
  font-weight: 700; font-size: 1.02rem; transition: transform .15s, filter .15s, border-color .15s, box-shadow .15s;
}
.ld-btn.primary { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); box-shadow: 0 10px 34px rgba(255,122,31,.22); }
.ld-btn:hover { transform: translateY(-2px); }
.ld-btn.primary:hover { filter: brightness(1.06); box-shadow: 0 14px 40px rgba(255,122,31,.32); }
.ld-btn.ghost:hover { border-color: var(--volt); }
.ld-btn.small { padding: 9px 16px; font-size: .9rem; box-shadow: none; }
.ld-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.ld-ctas.center { justify-content: center; }

.ld-hero {
  position: relative; display: flex; align-items: center; min-height: 100vh; min-height: 100dvh; margin-top: -72px; padding: 72px 40px 100px;
  background:
    linear-gradient(90deg, rgba(14,16,21,.97) 0%, rgba(14,16,21,.92) 30%, rgba(14,16,21,.45) 41%, rgba(14,16,21,0) 50%),
    linear-gradient(0deg, var(--bg) 0%, rgba(14,16,21,0) 18%);
}
.ld-map-gap { display: none; }
.ld-hero-copy { position: relative; z-index: 1; max-width: 560px; }
.ld-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px; font-family: var(--cond); font-weight: 700; font-size: .88rem; letter-spacing: .16em; text-transform: uppercase; color: var(--volt); }
.ld-eyebrow::before { content: ""; width: 28px; height: 10px; background: repeating-linear-gradient(-60deg, var(--volt) 0 3px, transparent 3px 7px); }
.ld-title { margin: 0 0 22px; font-family: var(--cond) !important; font-style: italic; font-weight: 800; text-transform: uppercase; font-size: clamp(2.7rem, 5.6vw, 4.8rem); line-height: .94; letter-spacing: .005em; }
.ld-title span { display: block; }
.ld-title .v { color: var(--volt); }
.ld-lead { max-width: 520px; margin: 0 0 32px; font-size: 1.15rem; line-height: 1.55; color: #C9CFD9; }
.ld-free { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: .92rem; color: var(--muted); }
.ld-free .i { color: var(--volt); }

/* Tarjeta "calculando en directo" junto a la ruta de ejemplo */
.ld-live {
  position: absolute; right: 40px; top: 50%; transform: translateY(-50%); z-index: 1; width: 340px; padding: 18px;
  background: rgba(14,16,21,.9); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 22px 54px rgba(0,0,0,.55); backdrop-filter: blur(8px);
}
.ld-live-head { display: flex; align-items: center; gap: 8px; font-family: var(--cond); font-weight: 700; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--volt); }
.ld-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--volt); animation: ld-pulse 1.6s infinite; }
@keyframes ld-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,122,31,.6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(255,122,31,0); } }
.ld-live-name { display: block; margin: 6px 0 14px; font-size: .92rem; font-weight: 600; }
.ld-live-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.ld-live-stats .k { display: block; font-family: var(--cond); font-weight: 700; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ld-live-stats .v { display: block; font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ld-live-stats .u { font-size: .6em; font-weight: 700; color: var(--volt); margin-left: 2px; }
.ld-prof { display: block; width: 100%; height: 70px; margin-bottom: 12px; overflow: visible; }
.ld-cur { stroke: var(--text); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.ld-surf .bar { height: 8px; margin-bottom: 8px; }
.ld-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; color: var(--muted); }
.ld-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ld-rider { width: 16px; height: 16px; border-radius: 50%; background: var(--volt); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--volt), 0 0 20px 6px rgba(255,122,31,.65); }
.ld-scroll { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .86rem; color: var(--muted); text-decoration: none; }
.ld-scroll:hover { color: var(--volt); }
.ld-scroll .i { animation: ld-bob 1.8s ease-in-out infinite; }
@keyframes ld-bob { 50% { transform: translateY(5px); } }

/* Cifras */
.ld-figs { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ld-fig { padding: 36px 20px; text-align: center; border-right: 1px solid var(--line); }
.ld-fig:last-child { border-right: 0; }
.ld-fig .n { display: block; font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 3.6rem; line-height: 1; color: var(--volt); font-variant-numeric: tabular-nums; }
.ld-fig .t { display: block; margin-top: 8px; font-family: var(--cond); font-weight: 700; font-size: .86rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Secciones */
.ld-sec { padding: 96px 40px; background: var(--bg); }
.ld-sec + .ld-sec { padding-top: 24px; }
.ld-sec > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.ld-h2 { margin: 0 auto 44px; text-align: center; font-family: var(--cond) !important; font-style: italic; font-weight: 800; text-transform: uppercase; font-size: clamp(1.9rem, 3.4vw, 2.8rem); line-height: 1.02; }
.ld-sub { margin: -28px auto 44px; text-align: center; font-size: 1.05rem; color: var(--muted); }
.ld-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ld-card { padding: 18px 22px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: transform .2s, border-color .2s; }
.ld-card:hover, .ld-feat:hover, .ld-bike:hover { transform: translateY(-4px); border-color: #6E3714; }
.ld-num { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 2.2rem; line-height: 1; color: var(--volt); }
.ld-card h3 { margin: 8px 0; font-size: 1.15rem; }
.ld-card p, .ld-feat p, .ld-bike p { margin: 0; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.ld-ill { display: flex; align-items: center; justify-content: center; height: 124px; margin-bottom: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.ld-ill svg { width: 86%; height: 104px; overflow: visible; }
.ld-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ld-feat { padding: 26px 24px; background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%); border: 1px solid var(--line); border-radius: 12px; transition: transform .2s, border-color .2s; }
.ld-feat .i { width: 30px; height: 30px; margin-bottom: 14px; color: var(--volt); }
.ld-feat h3, .ld-bike h3 { margin: 0 0 6px; font-size: 1.08rem; }
.ld-bikes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ld-bike { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: transform .2s, border-color .2s; }
.ld-bike .i { width: 40px; height: 40px; color: var(--volt); }
.ld-bike h3 { margin-top: 10px; font-family: var(--cond) !important; font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 1.5rem; }
.ld-end { padding: 104px 40px; text-align: center; border-top: 1px solid var(--line);
  background: repeating-linear-gradient(-60deg, rgba(255,122,31,.05) 0 14px, transparent 14px 30px), var(--bg); }
.ld-end .ld-h2 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
.ld-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 40px 40px; background: var(--bg); border-top: 1px solid var(--line); }
.ld-brand.small { font-size: 1.2rem; }
.ld-brand.small .ld-logo { width: 24px; height: 24px; }
.ld-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
#landing .ld-foot a:not(.ld-brand):not(.kofi), .ld-foot button { padding: 0; background: none; border: 0; font-size: .88rem; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
#landing .ld-foot a:not(.ld-brand):not(.kofi):hover, .ld-foot button:hover { color: var(--volt); }

/* Aparición al hacer scroll */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }

/* Ilustraciones de "Cómo funciona" (se animan al aparecer) */
.ill1 .road { fill: none; stroke: #272D37; stroke-width: 12; stroke-linecap: round; }
.ill1 .trace { fill: none; stroke: var(--volt); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 4px rgba(255,122,31,.5)); }
.ill1 .p { fill: var(--bg); stroke: var(--volt); stroke-width: 3; transform-box: fill-box; transform-origin: center; transform: scale(0); }
.in .ill1 .trace { animation: ld-trace 3.6s ease-in-out infinite; }
.in .ill1 .p { animation: ld-pop 3.6s ease-out infinite; }
.in .ill1 .p2 { animation-delay: .25s; }
.in .ill1 .p3 { animation-delay: .5s; }
@keyframes ld-trace { 0%, 12% { stroke-dashoffset: 100; opacity: 1; } 60%, 88% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ld-pop { 0% { transform: scale(0); } 8%, 88% { transform: scale(1); } 100% { transform: scale(0); } }
.ill2 rect { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); }
.in .ill2 rect { animation: ld-grow 3.6s cubic-bezier(.2,.7,.2,1) infinite; animation-delay: calc(var(--i) * 55ms); }
@keyframes ld-grow { 0% { transform: scaleY(0); } 28%, 86% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
.ill3 .dev { fill: var(--surface-2); stroke: #39414E; stroke-width: 2; }
.ill3 .scr { fill: #0B0D11; }
.ill3 .ok { fill: none; stroke: var(--volt); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.ill3 .file rect { fill: var(--volt); }
.ill3 .file text { font-family: var(--cond); font-weight: 800; font-size: 13px; text-anchor: middle; fill: var(--volt-ink); }
.in .ill3 .file { animation: ld-drop 3.2s ease-in infinite; }
.in .ill3 .ok { animation: ld-ok 3.2s ease-out infinite; }
@keyframes ld-drop { 0% { transform: translateY(0); opacity: 1; } 42% { transform: translateY(48px); opacity: 1; } 52%, 100% { transform: translateY(48px); opacity: 0; } }
@keyframes ld-ok { 0%, 48% { stroke-dashoffset: 100; } 64%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 100; } }

@media (max-width: 1100px) {
  .ld-live { width: 300px; }
  .ld-hero-copy { max-width: 470px; }
  .ld-bikes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .ld-top { height: 60px; padding: 0 16px; }
  .ld-brand { font-size: 1.35rem; }
  .ld-logo { width: 26px; height: 26px; }
  .ld-top-btns .ld-btn { display: none; }
  .ld-hero { display: block; min-height: 0; margin-top: -60px; padding: 0 16px 64px;
    background: linear-gradient(180deg, rgba(14,16,21,0) 0, rgba(14,16,21,0) 44vh, var(--bg) 49vh); }
  .ld-map-gap { display: block; height: 48vh; }
  .ld-live { position: absolute; left: 16px; right: 16px; top: calc(48vh - 74px); transform: none; width: auto; padding: 12px 14px; }
  .ld-live .ld-live-name, .ld-live .ld-prof, .ld-live .ld-surf { display: none; }
  .ld-live-head { margin-bottom: 6px; }
  .ld-live-stats { margin: 0; }
  .ld-hero-copy { padding-top: 40px; }
  .ld-lead { font-size: 1.05rem; }
  .ld-ctas .ld-btn { flex: 1 1 100%; }
  .ld-scroll { display: none; }
  .ld-figs { grid-template-columns: repeat(2, 1fr); }
  .ld-fig { padding: 26px 12px; }
  .ld-fig:nth-child(2) { border-right: 0; }
  .ld-fig:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ld-fig .n { font-size: 2.8rem; }
  .ld-sec { padding: 64px 16px; }
  .ld-how, .ld-feats { grid-template-columns: 1fr; }
  .ld-bikes { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ld-bike { padding: 18px; }
  .ld-end { padding: 72px 16px; }
  .ld-foot { padding: 24px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  #landing *, #landing *::before { animation: none !important; transition: none !important; }
  .ill1 .trace, .ill3 .ok { stroke-dashoffset: 0; }
  .ill1 .p, .ill2 rect { transform: none; }
  .ill3 .file { opacity: 0; }
}
.ld-attr { position: absolute; right: 12px; bottom: 8px; z-index: 1; max-width: 60%; text-align: right; font-size: .66rem; color: var(--muted); }
.ld-attr a { color: var(--muted); }
.ld-attr svg { display: none; }
@media (max-width: 760px) { .ld-attr { position: static; max-width: none; margin-top: 28px; text-align: left; } }
@media (min-width: 701px) { body.landing #consent { left: 50%; bottom: 24px; width: min(520px, calc(100vw - 24px)); } }

/* Invítame a un café (Ko-fi): enlace propio con el color de su botón, sin cargar su script */
a.kofi, .foot a.kofi, #landing .ld-foot a.kofi {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px;
  background: #72a4f2; color: #fff; font-weight: 600; text-decoration: none; transition: filter .15s, transform .15s;
}
a.kofi .i { width: 16px; height: 16px; }
a.kofi:hover, .foot a.kofi:hover, #landing .ld-foot a.kofi:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
.foot a.kofi { margin-top: 4px; }
#landing .ld-foot nav { align-items: center; }
