/* ===== Zafrán v83 ===== */
/* 1) Arreglo: la pantalla de Entreno se podía deslizar de lado (cabecera y tarjetas más anchas que el móvil) */
html, body { max-width: 100%; overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
#trainView, #trainView * , .sheet, .sheet * { min-width: 0; }
#trainView { overflow-x: clip; touch-action: pan-y pinch-zoom; }
.head { flex-wrap: wrap; }
.head > div:first-child { min-width: 0; flex: 1 1 160px; }
.head-btns { flex: 0 1 auto; max-width: 100%; }
.head-btns .pill { white-space: nowrap; }
.trmk, .tiles2, .rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.trmk-b, .tile2, .trmk-b b, .tile2 b, .trmk-b small, .tile2 small { overflow-wrap: anywhere; }
.rd-badge { white-space: normal; }
#trainView img, #trainView svg, #trainView canvas, #trainView table { max-width: 100%; }
@media (max-width: 360px) { .trmk, .tiles2 { gap: 8px; } }

/* 2) Menú: «Análisis» destacado en naranja */
.navmenu .nv-hot { background: linear-gradient(135deg, #FF7A1A, #FF9F1C) !important; color: #fff !important; border-radius: 16px; box-shadow: 0 6px 18px -6px rgba(255, 122, 26, .7); font-weight: 900; }
.navmenu .nv-hot svg { stroke: #fff; }
.navmenu .nv-hot span::after { content: " ★"; }
.navmenu .nv-new { box-shadow: inset 0 0 0 2px rgba(255, 122, 26, .55); border-radius: 16px; }

/* 3) Análisis */
.za-tabs { margin-top: 6px; }
.za-tabs button.is-on { background: #FF7A1A; color: #fff; }
.za-nav { margin: 10px 0; }
.za-bar { margin: 8px 0; }
.za-bar-h { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.za-bar i { display: block; height: 10px; border-radius: 6px; background: var(--track, var(--chip)); overflow: hidden; margin-top: 4px; }
.za-bar s { display: block; height: 100%; border-radius: 6px; background: #FF7A1A; text-decoration: none; }
.za-bar.p s { background: #2F9E5B; } .za-bar.c s { background: #E8A33D; } .za-bar.g s { background: #8E6CD9; } .za-bar.w s { background: #3A8FD9; }
.za-bar s.over { background: #C2304A; }
.za-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.za-kpis > div { background: var(--surface); border-radius: 16px; padding: 12px; text-align: center; border: 1px solid var(--line); }
.za-kpis b { display: block; font-size: 1.6rem; font-weight: 900; color: var(--ink); }
.za-kpis span { font-size: .8rem; color: var(--muted); }
.za-kpis small { font-size: .7rem; } .za-kpis .up { color: #2F9E5B; } .za-kpis .dn { color: #C2304A; }
.za-chart { width: 100%; height: auto; display: block; }
.za-chart rect.ok { fill: #2F9E5B; } .za-chart rect.hi { fill: #FF7A1A; } .za-chart rect.lo { fill: #E8A33D; } .za-chart rect.nil { fill: transparent; }
.za-chart text { font-size: 11px; fill: var(--muted, #777); }
.za-chart .goal { stroke: var(--ink, #222); stroke-dasharray: 4 4; stroke-width: 1.4; } .za-chart .gl { font-size: 9px; }
.za-ai { border: 2px solid #FF7A1A; }
.za-note { background: #FF7A1A; color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .85rem; margin-left: 6px; }
.za-tips li { margin: 6px 0; }
.za-list { padding-left: 18px; margin: 6px 0; } .za-list li { margin: 4px 0; }
.za-sw { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 8px 0; }
.za-sw input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: #FF7A1A; }
.za-sw span { display: flex; flex-direction: column; gap: 2px; } .za-sw small { color: var(--muted); }
.za-deload { border: 2px dashed #8E6CD9; } .za-deload.on { border-style: solid; }
.linkbtn { background: none; border: 0; color: #D9621A; font-weight: 800; padding: 4px 0; cursor: pointer; font: inherit; text-decoration: underline; }
.tiny { font-size: .75rem; color: var(--muted); margin: 6px 0 0; }

/* 4) Molestias */
.zr-disc { background: color-mix(in srgb, #E8A33D 14%, transparent); border-radius: 12px; padding: 8px 12px; }
.zr-wrap { display: flex; justify-content: center; }
.zr-body { width: min(260px, 72vw); height: auto; }
.zr-body .sil > * { fill: color-mix(in srgb, var(--ink, #222) 12%, transparent); stroke: color-mix(in srgb, var(--ink, #222) 35%, transparent); stroke-width: 1.2; }
.zr-body .spot circle { fill: color-mix(in srgb, #FF7A1A 18%, transparent); stroke: #FF7A1A; stroke-width: 1.6; cursor: pointer; transition: r .15s; }
.zr-body .spot.m1 circle { fill: #F2C76E; } .zr-body .spot.m2 circle { fill: #FF7A1A; } .zr-body .spot.m3 circle { fill: #C2304A; }
.zr-body .spot.sel circle { stroke: var(--ink, #000); stroke-width: 3; }
.zr-body .spot:focus { outline: none; } .zr-body .spot:focus circle { stroke-width: 3.4; }
.zr-body .lbl { font-size: 12px; fill: var(--muted, #777); }
.zr-int { display: block; margin: 10px 0; } .zr-int input { width: 100%; accent-color: #FF7A1A; }
.zr-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.zr-adv { border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.zr-adv.ok { background: color-mix(in srgb, #2F9E5B 14%, transparent); }
.zr-adv.amb { background: color-mix(in srgb, #E8A33D 18%, transparent); }
.zr-adv.red { background: color-mix(in srgb, #C2304A 16%, transparent); }

/* 5) Longevidad */
.zl-lv-h { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.zl-lv i { display: block; height: 12px; border-radius: 8px; background: var(--track, var(--chip)); overflow: hidden; margin: 8px 0; }
.zl-lv s { display: block; height: 100%; background: linear-gradient(90deg, #2F9E5B, #FF9F1C); text-decoration: none; }
.zl-mis { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.zl-m { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; font: inherit; color: var(--text); cursor: pointer; }
.zl-m span { grid-row: 1 / 3; font-size: 1.6rem; align-self: center; } .zl-m small { color: var(--muted); }
.zl-m.on { border-color: #2F9E5B; background: color-mix(in srgb, #2F9E5B 12%, var(--surface)); }
.zl-m.on b::before { content: "✓ "; color: #2F9E5B; }
.zl-m:disabled { cursor: default; opacity: 1; }
.zl-mf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 380px) { .zl-mf { grid-template-columns: minmax(0, 1fr); } }

/* 6) Reproductor guiado */
.zp-ov { position: fixed; inset: 0; z-index: 9000; background: #14110D; color: #F6EFE6; display: flex; align-items: center; justify-content: center; padding: 16px; }
.zp-in { width: min(420px, 100%); text-align: center; position: relative; }
.zp-x { position: absolute; right: 0; top: -8px; color: #F6EFE6; background: none; border: 0; font-size: 2rem; }
.zp-k { opacity: .7; font-size: .85rem; }
.zp-circ { width: 200px; height: 200px; margin: 18px auto; border-radius: 50%; border: 4px solid #FF9F1C; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.zp-circ b { font-size: 2.6rem; font-family: "JetBrains Mono", monospace; } .zp-circ span { font-weight: 800; color: #FF9F1C; }
.zp-circ.br { animation: zpBox 16s linear infinite; }
@keyframes zpBox { 0% { transform: scale(.82); } 25% { transform: scale(1); } 50% { transform: scale(1); } 75% { transform: scale(.82); } 100% { transform: scale(.82); } }
@media (prefers-reduced-motion: reduce) { .zp-circ.br { animation: none; } }
.zp-ctl { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.zp-in .small { color: #CBBFAF; }

/* 7) Compra y fotos */
.zx-shop { list-style: none; padding: 0; margin: 4px 0 10px; } .zx-shop li { margin: 4px 0; }
.zx-shop label { display: flex; gap: 10px; align-items: center; } .zx-shop input { width: 20px; height: 20px; accent-color: #2F9E5B; }
.zx-shop input:checked + span { text-decoration: line-through; opacity: .6; }
.zx-rec { margin: 6px 0; }
.zx-up { position: relative; display: block; text-align: center; margin: 8px 0; cursor: pointer; }
.zx-cmp { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: #000; margin: 10px 0; }
.zx-cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.zx-cmp input[type=range] { position: absolute; left: 0; right: 0; bottom: 10px; width: 92%; margin: 0 4%; accent-color: #FF9F1C; }
.zx-sel { display: flex; gap: 10px; flex-wrap: wrap; } .zx-sel label { flex: 1 1 120px; } .zx-sel select { width: 100%; }
