/* SportK — Sistema i18n
   Soporta 5 idiomas: es, en, it, de, fr.
   API: t("path.to.key", { params }), setLocale(loc), getLocale().
   Fallback automático al español si falta una clave.
*/

const LOCALES = {
  // ============================================================
  // ESPAÑOL
  // ============================================================
  es: {
    locale_name: "Español",
    common: {
      back: "Atrás", continue: "Continuar", next: "Siguiente", cancel: "Cancelar",
      save: "Guardar", close: "Cerrar", ok: "OK", yes: "Sí", no: "No", skip: "Saltar",
      start: "Empezar", repeat: "Repetir", pause: "Pausa", resume: "Reanudar",
      stop: "Detener", retry: "Reintentar", finish: "Finalizar",
      beginner: "Principiante", intermediate: "Intermedio", advanced: "Avanzado",
      male: "Hombre", female: "Mujer", all: "Ambos",
      loading: "Cargando…", error: "Error",
      seconds_short: "s", minutes_short: "min", reps: "reps",
      day_rest: "Descanso", today: "Hoy", yesterday: "Ayer",
      days_ago: "Hace {n} días",
      weekday_mon: "Lunes", weekday_tue: "Martes", weekday_wed: "Miércoles",
      weekday_thu: "Jueves", weekday_fri: "Viernes", weekday_sat: "Sábado", weekday_sun: "Domingo",
    },
    nav: { home: "Inicio", routines: "Rutinas", progress: "Progreso", profile: "Perfil" },
    onboarding: {
      lang_eyebrow: "Idioma / Language",
      lang_title: "Elige tu idioma",
      lang_desc: "Puedes cambiarlo después desde tu perfil.",
      welcome: "Bienvenida / Bienvenido",
      audience_title: "¿Para quién son las rutinas?",
      audience_desc: "Adaptamos la anatomía y los objetivos. No pedimos datos personales.",
      step2: "Paso 2 de 4",
      step3: "Paso 3 de 4",
      step4: "Paso 4 de 4 · Antes de empezar",
      goal_title: "¿Qué buscas mejorar?",
      goal_desc: "Elige tu objetivo principal. Ajustaremos tu plan a la evidencia clínica para ese caso.",
      test_title_guide: "Encuentra tu suelo pélvico",
      test_title_running: "Mide tu fuerza actual",
      test_desc: "Tres mini-pruebas. Sirven para asignarte el nivel exacto y ver tu progreso real con el tiempo.",
      guide_intro: "Antes del test, asegúrate de saber qué músculo aprietas. Es más fácil de lo que parece.",
      guide_what_h: "¿Qué es el suelo pélvico?",
      guide_what_female: "Una hamaca muscular que sostiene vejiga, útero e intestino. Hacer un Kegel = cerrar y elevar voluntariamente los músculos alrededor de la vagina y el ano.",
      guide_what_male: "Una capa muscular del periné que sostiene órganos pélvicos. Hacer un Kegel = cerrar el ano y elevar la base del pene.",
      guide_what_neutral: "Una hamaca muscular entre el pubis y el cóccix que sostiene los órganos pélvicos. Hacer un Kegel = cerrarla y elevarla voluntariamente.",
      guide_locate_h: "Cómo localizarlo",
      guide_locate_female_p1: "Imagina que **aguantas las ganas de orinar** y, a la vez, **aguantas un gas**. Esa contracción interna —cierre + elevación— es tu suelo pélvico.",
      guide_locate_female_tip: "💡 **Verificación táctil:** introduce un dedo en la vagina y aprieta. Debes sentir un **cierre suave alrededor del dedo**, no un empuje hacia afuera.",
      guide_locate_male_p1: "Imagina que **cortas el chorro al orinar** y, a la vez, **aguantas un gas**. Esa contracción es tu suelo pélvico.",
      guide_locate_male_tip: "💡 **Verificación visual:** frente al espejo, al apretar correctamente **la base del pene retrocede ligeramente y los testículos suben**. Esa es la pista correcta.",
      guide_locate_neutral: "Imagina que aguantas las ganas de orinar y, a la vez, aguantas un gas. Esa contracción interna —cierre y elevación— es el suelo pélvico.",
      guide_reverse_h: "Kegel inverso (relajación)",
      guide_reverse_p: "Aprender a **soltar** es tan importante como apretar. El Kegel inverso es el movimiento opuesto —abrir y empujar muy suavemente hacia abajo— y previene la **hipertonía**: tensión crónica que causa dolor, disfunción y bloquea el progreso.",
      guide_reverse_female_p1: "Imagina que **abres ligeramente la vagina y el ano** hacia afuera, como soltar un gas suave o iniciar un puje muy ligero. Movimiento mínimo, sin Valsalva ni apnea.",
      guide_reverse_female_tip: "💡 **Verificación táctil:** con un dedo en la vagina, al hacer Reverse el dedo siente una **apertura y descenso suaves**, no cierre.",
      guide_reverse_male_p1: "Imagina que **dejas salir un gas suave** sin esfuerzo abdominal. El perineo se ensancha y la base del pene **desciende ligeramente**.",
      guide_reverse_male_tip: "💡 **Verificación visual:** al hacerlo bien **la base del pene baja y los testículos NO se elevan** —al contrario de un Kegel.",
      guide_reverse_neutral: "Abre y empuja muy suavemente hacia abajo, como soltar un gas. Movimiento opuesto al Kegel, sin Valsalva.",
      guide_errors_h: "Errores frecuentes",
      guide_err_glutes: "Apretar glúteos, muslos o abdomen.",
      guide_err_breath: "Aguantar la respiración o pujar hacia abajo (Valsalva).",
      guide_err_pee: "Hacerlo durante la micción real (puede causar infecciones).",
      guide_ok_close: "Cierre + elevación interna, respirando con normalidad.",
      guide_ok_pos: "Mejor sentado, tumbado o de pie relajado para empezar.",
      guide_practice_h: "Practica antes del test",
      guide_practice_p: "Haz **3 contracciones suaves de 2 segundos** con descanso de 4 segundos entre cada una. Si sientes el cierre interno y nada más se mueve, estás listo.",
      guide_ready: "Lo tengo, empezar test",
      skip_test: "Saltar test (asigna principiante)",
      results: "Resultados",
      max_hold: "Max hold",
      flicks_per_10s: "Flicks/10s",
      mvc_short: "MVC",
      before_start_h: "Antes de empezar",
      before_no_glutes: "No aprietes glúteos ni muslos.",
      before_exhale: "Exhala al contraer.",
      before_release: "Soltar es tan importante como apretar.",
      before_rest: "Día de descanso semanal obligatorio.",
      level_suggested_hint: "Sugerido por tu test. Puedes cambiarlo si quieres ir más despacio o ya tienes experiencia.",
      level_chosen_hint: "Has elegido {chosen} (sugerido: {suggested}).",
    },
    test: {
      pill_hold: "1 / 3 · Aguanta",
      pill_flicks: "2 / 3 · Flicks",
      pill_mvc: "3 / 3 · Sensación",
      hold_h: "Aprieta y sostén",
      hold_desc: "Aprieta lo más fuerte que puedas. Suelta cuando empieces a temblar o pierdas calidad.",
      release: "Suelto",
      flicks_h: "Flicks en 10 segundos",
      flicks_desc: "Tap en el botón cada vez que aprietes y sueltes completo. Cuenta solo flicks limpios.",
      flicks_tap: "Tap aquí cada flick",
      flicks_remaining: "{s}s restantes",
      flicks_done: "Tiempo terminado",
      mvc_h: "¿Qué tan fuerte sientes la contracción?",
      mvc_desc: "1 = casi nada, 10 = máxima fuerza posible.",
      save_results: "Guardar resultados",
      next_flicks: "Siguiente: flicks",
      next: "Siguiente",
      title: "Test de fuerza",
      title_done: "Test completado",
      intro_title: "Mide tu fuerza actual",
      intro_desc: "Tres mini-pruebas de menos de 1 minuto en total. Sirven para asignarte el nivel correcto y para que veas tu progreso real con el tiempo.",
      intro_li1: "**Aguanta lo más posible** — mediremos hasta cuánto sostienes la contracción.",
      intro_li2: "**Flicks en 10 segundos** — cuántos pulsos completos haces.",
      intro_li3: "**Sensación de fuerza** — escala 1-10 subjetiva.",
      intro_start: "Empezar test",
      done_back: "Volver al inicio",
      level_suggested: "Nivel sugerido",
      mvc_subjective: "MVC subjetivo",
      max_hold: "Aguante máx.",
      flicks_per_10s: "Flicks/10s",
      mvc_short: "MVC",
    },
    home: {
      greeting: "Hola",
      rest_day_eyebrow: "Día de descanso",
      rest_day_title: "Tu suelo pélvico también descansa",
      rest_day_desc: "El descanso es parte del protocolo. Sin él aparece la hipertonía. Vuelve mañana.",
      view_catalog: "Ver catálogo",
      streak: "Racha",
      sessions: "Sesiones",
      this_week: "Esta sem.",
      days: "días",
      total: "total",
      measure_baseline: "Mide tu fuerza actual",
      retest_monthly: "Re-test mensual",
      mini_tests_short: "3 mini-pruebas, < 1 minuto",
      recommended: "Recomendadas del track",
      view_all: "Ver todas",
      progression_ready_h: "¡Listo para subir de nivel!",
      progression_ready_p: "Tus tests superan los umbrales del siguiente nivel.",
      progression_yes: "Subir a {level}",
      progression_later: "Más tarde",
      today_routine: "Rutina de hoy",
      start_now: "Empezar ahora",
      last_session: "Última sesión",
      history_link: "Historial",
      exercises_short: "ejercicios",
      repetitions: "repeticiones",
    },
    catalog: {
      title: "Catálogo",
      header: "Rutinas",
      available: "{n} disponibles",
      chip_all: "Todos",
      all_levels: "Todos los niveles",
      mine_badge: "Mía",
      confirm_delete: "¿Eliminar rutina?",
      delete_aria: "Eliminar",
      empty: "Sin rutinas con este filtro.",
      all_tracks: "Todos los tracks",
      includes_reverse: "Incluye reverse",
      no_results: "No hay rutinas para esta combinación.",
      create_routine: "Crear rutina",
    },
    detail: {
      header: "Detalle",
      duration: "Duración",
      exercises: "Ejercicios",
      reps: "Reps",
      concepts: "Conceptos",
      full_glossary: "Ver glosario completo de la rutina ({n})",
      start_routine: "Empezar rutina",
      not_found: "Rutina no encontrada.",
      type_hold: "Hold", type_flick: "Flicks", type_ladder: "Escalera",
      type_elevator: "Elevator", type_wave: "Onda", type_knack: "Knack",
      type_edging: "Edging", type_edge: "Edge sin hold", type_reverse: "Reverse",
      desc_standard: "{reps} reps · {hold}s aguante{reverse}",
      desc_flick: "{reps} pulsos rápidos",
      desc_ladder: "{reps} peldaños · {start}-{max}s",
      desc_elevator: "{reps} elevators · 4 pisos",
      desc_wave: "{reps} ondas anterior/posterior",
      desc_knack: "{reps} contracciones anticipatorias",
      desc_edging: "{reps} × {sec}s al ~50%",
      desc_edge: "{reps} squeezes breves · sin hold",
      desc_reverse: "{reps} Kegels inversos",
      desc_reverse_suffix: " · reverse cada {n}",
      arousal_toggle_label: "Hacerlo con estimulación",
      arousal_toggle_on_hint: "Ciclo Stop-Start: te estimulas hasta el punto de no retorno y pulsas para iniciar el Kegel @50%. Práctica solitaria.",
      arousal_toggle_off_hint: "Modo seco: el Kegel @50% se ejecuta por reloj, sin fase de excitación previa.",
    },
    active: {
      paused: "En pausa",
      tap_ponr: "Estoy cerca · iniciar Kegel",
      arousal_hint: "Sube hasta el PONR. Pulsa cuando estés cerca.",
      arousal_sub: "Tu cuerpo marca el ritmo. Cuanto antes pulses, más temprano el Kegel.",
      pause_h: "Recuerda",
      pause_no_glutes: "No aprietes glúteos, muslos ni abdomen.",
      pause_no_breath: "Exhala al contraer. Sin Valsalva.",
      pause_release: "Suelta del todo entre repeticiones.",
      pause_tip_valsalva: "· Sin Valsalva (no pujes hacia abajo)",
      pause_tip_no_glutes: "· No aprietes glúteos ni muslos",
      pause_tip_breath: "· Exhala al contraer · Inhala al relajar",
      resume: "Reanudar",
      skip_exercise: "Saltar ejercicio",
      exit: "Salir",
      exit_confirm: "¿Salir de la sesión?",
      eyes_closed: "Modo ojos cerrados",
      eyes_closed_exit: "Salir de modo ojos cerrados",
      eyes_closed_short: "Salir modo ciego",
      paused_tap_resume: "Pausado · toca para reanudar",
      rep_short: "Rep",
      rep_of: "Rep {n} de {total}",
      reverse_inserted: "intercalada",
      reverse_label: "Kegel inverso",
      intensity_push: "Empuje",
      intensity_aria: "Intensidad sugerida",
      intensity_caption: "Porcentaje de apriete del músculo",
      aria_back: "Atrás",
      aria_pause: "Pausar",
      aria_skip: "Saltar",
      session_complete: "¡Sesión completa!",
      summary_title: "Resumen",
      summary_back: "Volver al inicio",
      summary_again: "Repetir rutina",
      summary_repetitions: "Repeticiones",
      summary_exercises: "Ejercicios",
      summary_duration: "Duración",
      summary_achievement: "Logro",
      summary_streak_plus: "+1 día",
      summary_motivation: "La constancia gana al volumen. Mantén la racha mañana.",
      summary_save_close: "Guardar y cerrar",
    },
    phase: {
      ready: "Prepárate", inhale: "Inhala", exhale: "Exhala",
      contract: "Aprieta", hold: "Sostén", release: "Suelta",
      rest: "Descansa", reverse: "Empuja suave", peak: "Cima",
      plateau: "Meseta", "knack-trigger": "Tose sin soltar", "knack-hold": "Mantenlo sin toser",
      arousal: "Sube al PONR",
    },
    engine: {
      push_gently_down: "Empuja suave hacia abajo",
      relax_full: "Relaja completo",
      release_slow: "Suelta lento",
      descend_slow: "Baja despacio",
      ladder_step: "Peldaño {n}",
      ladder_hold: "Peldaño {n} · {sec}s",
      elevator_floor: "Piso {n} · {pct}%",
      elevator_up: "Sube",
      elevator_peak: "Cima · sostén",
      elevator_down: "Bajando · {pct}%",
      elevator_pause: "Pausa",
      elevator_release_full: "Suelta total",
      wave_front: "Anillo anterior",
      wave_back: "Anillo posterior",
      wave_front_short: "Anterior",
      wave_back_short: "Posterior",
      knack_ready: "Listo para anticipar",
      knack_squeeze: "¡Aprieta!",
      knack_cough: "Tose {sec}s sin soltar",
      knack_hold: "Mantenlo {sec}s sin toser",
      recover: "Recupera",
      squeeze_pct: "Aprieta al {pct}%",
      edge_hold: "Edge · {sec}s al {pct}%",
      edge_squeeze: "Aprieta firme · freno breve",
      flick_burst: "Flicks rápidos · {sec}s",
      flick_after: "Flicker · {sec}s mantén el arousal",
      arousal_cue: "Sube hasta el PONR. Pulsa cuando estés cerca. Estimúlate tú mismo o con un vibrador o juguete hasta 1 punto antes del clímax.",
    },
    stats: {
      title: "Progreso",
      subtitle: "Tu evolución",
      aria_tests: "Tests",
      tab_activity: "Actividad", tab_strength: "Fuerza", tab_sexual: "Salud sexual",
      no_tests_h: "Aún no has hecho tests",
      no_tests_p: "Mide tu fuerza actual en menos de 1 minuto. Te ayudará a ver progreso real con el tiempo.",
      take_test: "Hacer test",
      last_7d: "Últimos 7 días",
      history: "Historial",
      streak_current: "Racha actual",
      reps_per_day_h: "REPETICIONES POR DÍA",
      total_reps: "Total reps",
      average: "Promedio",
      empty_history: "Aún no has completado ninguna sesión.",
      hold_evolution: "Evolución de max hold",
      flicks_evolution: "Evolución de flicks/10s",
      ielt_log: "Registrar IELT",
      ehs_log: "Registrar EHS",
      cono_log: "Registrar peso de cono",
      ielt_title: "Latencia eyaculatoria",
      ehs_title: "Dureza de erección",
      cono_title: "Cono retenido",
      ielt_record_h: "Latencia eyaculatoria (IELT)",
      ehs_record_h: "Dureza erección (EHS)",
      cono_record_h: "Peso de cono retenible",
      ielt_subtitle: "Latencia eyaculatoria intravaginal en segundos. Tras un encuentro real.",
      ehs_subtitle: "Erection Hardness Score. 1=tumescencia · 2=duro pero no penetrable · 3=penetrable · 4=máxima rigidez.",
      cono_subtitle: "Peso máximo de cono vaginal retenible mientras caminas 15 min.",
      record_weight: "Registrar peso",
      latest_record: "último registro",
      latest_short: "último",
      no_data: "Sin datos aún",
      test_history: "Historial de tests",
      latest: "Último",
      new_test: "Hacer nuevo test",
    },
    profile: {
      header: "Perfil",
      edit: "Editar",
      audience: "Audiencia", level: "Nivel", track: "Track", goals: "Objetivos",
      language: "Idioma",
      preferences: "Preferencias",
      sound: "Sonido", haptic: "Vibración háptica", volume: "Volumen",
      tests_row: "Test de fuerza",
      take_test_now: "Hacer test ahora",
      last_test: "Último test",
      days_ago: "hace {n} días",
      design: "Diseño",
      design_sub: "Tema y color de acento",
      open_tweaks: "Abrir tweaks",
      reset: "Restablecer onboarding",
      reset_confirm: "¿Restablecer? Borrarás tu nivel y test inicial.",
      edit_title: "Editar perfil",
      save: "Guardar",
    },
    glossary: {
      title: "Glosario",
      header: "Glosario · {name}",
    },
    create: {
      title: "Nueva rutina",
      name: "Nombre",
      name_ph: "Ej. Mi rutina mañanera",
      track: "Track",
      level: "Nivel",
      exercises: "Ejercicios",
      reps: "Reps",
      min_short: "~ Min",
      save: "Guardar rutina",
      need_name: "Pon un nombre a tu rutina",
      need_exercises: "Añade al menos un ejercicio",
      type_label: "Tipo",
      hold_sec: "Hold (s)",
      rest_sec: "Rest (s)",
      description_default: "Rutina personalizada.",
      default_ex_name: "Contracción",
      default_ex_instruction: "Contrae y relaja con control.",
      default_new_ex: "Nuevo ejercicio",
      btn_holds: "Holds", btn_flicks: "Flicks", btn_ladder: "Escalera",
      btn_elevator: "Elevator", btn_knack: "Knack", btn_edge: "Edge", btn_edge_no_hold: "Edge sin hold", btn_reverse: "Reverse",
    },
    goals: {
      strength: "Fuerza general",
      erection: "Mejorar erección",
      ielt: "Durar más (control eyaculatorio)",
      edging: "Control sexual avanzado / edging",
      incontinence: "Incontinencia / escapes",
      postpartum: "Recuperación post-parto",
      orgasmic: "Función sexual femenina (orgasmo, Pompoir)",
    },
    tracks: {
      "general-strength": { name: "Fuerza general", blurb: "Tono base. Equilibrio fibras lentas (resistencia) + rápidas (reflejo)." },
      "male-sexual": { name: "Salud sexual masculina", blurb: "Erección, durabilidad, control eyaculatorio y edging. Basado en MTCK + PRM." },
      "incontinence-knack": { name: "Continencia · The Knack", blurb: "Reflejo anticipatorio antes de toser/estornudar. 8× cura sintomática vs control." },
      "female-postpartum-sexual": { name: "Post-parto y función sexual", blurb: "Reactivación, conos vaginales, ondas Pompoir y reverse Kegels obligatorios." },
    },
  },

  // ============================================================
  // ENGLISH
  // ============================================================
  en: {
    locale_name: "English",
    common: {
      back: "Back", continue: "Continue", next: "Next", cancel: "Cancel",
      save: "Save", close: "Close", ok: "OK", yes: "Yes", no: "No", skip: "Skip",
      start: "Start", repeat: "Repeat", pause: "Pause", resume: "Resume",
      stop: "Stop", retry: "Retry", finish: "Finish",
      beginner: "Beginner", intermediate: "Intermediate", advanced: "Advanced",
      male: "Male", female: "Female", all: "Both",
      loading: "Loading…", error: "Error",
      seconds_short: "s", minutes_short: "min", reps: "reps",
      day_rest: "Rest", today: "Today", yesterday: "Yesterday",
      days_ago: "{n} days ago",
      weekday_mon: "Monday", weekday_tue: "Tuesday", weekday_wed: "Wednesday",
      weekday_thu: "Thursday", weekday_fri: "Friday", weekday_sat: "Saturday", weekday_sun: "Sunday",
    },
    nav: { home: "Home", routines: "Routines", progress: "Progress", profile: "Profile" },
    onboarding: {
      lang_eyebrow: "Language / Idioma",
      lang_title: "Choose your language",
      lang_desc: "You can change it later from your profile.",
      welcome: "Welcome",
      audience_title: "Who are the routines for?",
      audience_desc: "We adapt the anatomy and goals. We don't ask for personal data.",
      step2: "Step 2 of 4",
      step3: "Step 3 of 4",
      step4: "Step 4 of 4 · Before we start",
      goal_title: "What do you want to improve?",
      goal_desc: "Pick your main goal. We'll tailor your plan to clinical evidence for that case.",
      test_title_guide: "Find your pelvic floor",
      test_title_running: "Measure your current strength",
      test_desc: "Three mini-tests. They set your exact level and let you see real progress over time.",
      guide_intro: "Before the test, make sure you know which muscle to squeeze. It's easier than it looks.",
      guide_what_h: "What is the pelvic floor?",
      guide_what_female: "A muscular hammock that supports the bladder, uterus and intestine. A Kegel = voluntarily closing and lifting the muscles around the vagina and anus.",
      guide_what_male: "A muscular layer of the perineum that supports the pelvic organs. A Kegel = closing the anus and lifting the base of the penis.",
      guide_what_neutral: "A muscular hammock between the pubis and coccyx supporting the pelvic organs. A Kegel = voluntarily closing and lifting it.",
      guide_locate_h: "How to find it",
      guide_locate_female_p1: "Imagine you're **holding back the urge to pee** and at the same time **holding back gas**. That internal contraction —close + lift— is your pelvic floor.",
      guide_locate_female_tip: "💡 **Touch check:** insert a finger into the vagina and squeeze. You should feel a **gentle close around the finger**, not a push outwards.",
      guide_locate_male_p1: "Imagine you're **stopping the flow while peeing** and at the same time **holding back gas**. That contraction is your pelvic floor.",
      guide_locate_male_tip: "💡 **Visual check:** in front of a mirror, when contracting correctly **the base of the penis pulls back slightly and the testicles rise**. That's the right cue.",
      guide_locate_neutral: "Imagine holding back the urge to pee while also holding back gas. That internal contraction —close and lift— is the pelvic floor.",
      guide_reverse_h: "Reverse Kegel (relaxation)",
      guide_reverse_p: "Learning to **release** matters as much as squeezing. The reverse Kegel is the opposite motion —open and push very gently downward— and prevents **hypertonia**: chronic tension that causes pain, dysfunction and blocks progress.",
      guide_reverse_female_p1: "Imagine **slightly opening the vagina and anus outward**, like releasing soft gas or starting a very light push. Minimal movement, no Valsalva, no breath holding.",
      guide_reverse_female_tip: "💡 **Touch check:** with a finger inside the vagina, on a reverse you should feel a **gentle opening and descent**, not closing.",
      guide_reverse_male_p1: "Imagine **letting out a soft gas** without abdominal effort. The perineum widens and the base of the penis **drops slightly**.",
      guide_reverse_male_tip: "💡 **Visual check:** done correctly, **the base of the penis lowers and the testicles do NOT rise** —the opposite of a Kegel.",
      guide_reverse_neutral: "Open and push very gently downward, like releasing gas. Opposite of a Kegel, no Valsalva.",
      guide_errors_h: "Common mistakes",
      guide_err_glutes: "Squeezing glutes, thighs or abdomen.",
      guide_err_breath: "Holding your breath or bearing down (Valsalva).",
      guide_err_pee: "Doing it while actually peeing (can cause infections).",
      guide_ok_close: "Close + internal lift, breathing normally.",
      guide_ok_pos: "Best sitting, lying down or relaxed standing to start.",
      guide_practice_h: "Practice before the test",
      guide_practice_p: "Do **3 gentle 2-second contractions** with 4 seconds of rest between each. If you feel the internal close and nothing else moves, you're ready.",
      guide_ready: "Got it, start the test",
      skip_test: "Skip test (assigns beginner)",
      results: "Results",
      max_hold: "Max hold",
      flicks_per_10s: "Flicks/10s",
      mvc_short: "MVC",
      before_start_h: "Before you start",
      before_no_glutes: "Don't squeeze glutes or thighs.",
      before_exhale: "Exhale while contracting.",
      before_release: "Releasing matters as much as squeezing.",
      before_rest: "Mandatory weekly rest day.",
      level_suggested_hint: "Suggested by your test. You can change it if you want to go slower or already have experience.",
      level_chosen_hint: "You picked {chosen} (suggested: {suggested}).",
    },
    test: {
      pill_hold: "1 / 3 · Hold",
      pill_flicks: "2 / 3 · Flicks",
      pill_mvc: "3 / 3 · Feel",
      hold_h: "Squeeze and hold",
      hold_desc: "Squeeze as hard as you can. Release when you start to shake or lose quality.",
      release: "Released",
      flicks_h: "Flicks in 10 seconds",
      flicks_desc: "Tap the button each time you fully squeeze and release. Only count clean flicks.",
      flicks_tap: "Tap here per flick",
      flicks_remaining: "{s}s left",
      flicks_done: "Time's up",
      mvc_h: "How strong does the contraction feel?",
      mvc_desc: "1 = barely anything, 10 = maximum possible.",
      save_results: "Save results",
      next_flicks: "Next: flicks",
      next: "Next",
      title: "Strength test",
      title_done: "Test complete",
      intro_title: "Measure your current strength",
      intro_desc: "Three mini-tests under 1 minute total. They set your correct level and let you see real progress over time.",
      intro_li1: "**Hold as long as possible** — we'll measure how long you sustain the contraction.",
      intro_li2: "**Flicks in 10 seconds** — how many full pulses you do.",
      intro_li3: "**Strength feel** — subjective 1-10 scale.",
      intro_start: "Start test",
      done_back: "Back to home",
      level_suggested: "Suggested level",
      mvc_subjective: "Subjective MVC",
      max_hold: "Max hold",
      flicks_per_10s: "Flicks/10s",
      mvc_short: "MVC",
    },
    home: {
      greeting: "Hi",
      rest_day_eyebrow: "Rest day",
      rest_day_title: "Your pelvic floor rests too",
      rest_day_desc: "Rest is part of the protocol. Without it, hypertonia appears. Come back tomorrow.",
      view_catalog: "View catalog",
      streak: "Streak",
      sessions: "Sessions",
      this_week: "This week",
      days: "days",
      total: "total",
      measure_baseline: "Measure your current strength",
      retest_monthly: "Monthly re-test",
      mini_tests_short: "3 mini-tests, < 1 minute",
      recommended: "Recommended for your track",
      view_all: "View all",
      progression_ready_h: "Ready to level up!",
      progression_ready_p: "Your tests beat the next level's thresholds.",
      progression_yes: "Move to {level}",
      progression_later: "Later",
      today_routine: "Today's routine",
      start_now: "Start now",
      last_session: "Last session",
      history_link: "History",
      exercises_short: "exercises",
      repetitions: "repetitions",
    },
    catalog: {
      title: "Catalog",
      header: "Routines",
      available: "{n} available",
      chip_all: "All",
      all_levels: "All levels",
      mine_badge: "Mine",
      confirm_delete: "Delete routine?",
      delete_aria: "Delete",
      empty: "No routines with this filter.",
      all_tracks: "All tracks",
      includes_reverse: "Includes reverse",
      no_results: "No routines for this combination.",
      create_routine: "Create routine",
    },
    detail: {
      header: "Detail",
      duration: "Duration",
      exercises: "Exercises",
      reps: "Reps",
      concepts: "Concepts",
      full_glossary: "View full routine glossary ({n})",
      start_routine: "Start routine",
      not_found: "Routine not found.",
      type_hold: "Hold", type_flick: "Flicks", type_ladder: "Ladder",
      type_elevator: "Elevator", type_wave: "Wave", type_knack: "Knack",
      type_edging: "Edging", type_edge: "Edge no-hold", type_reverse: "Reverse",
      desc_standard: "{reps} reps · {hold}s hold{reverse}",
      desc_flick: "{reps} quick pulses",
      desc_ladder: "{reps} steps · {start}-{max}s",
      desc_elevator: "{reps} elevators · 4 floors",
      desc_wave: "{reps} anterior/posterior waves",
      desc_knack: "{reps} anticipatory contractions",
      desc_edging: "{reps} × {sec}s at ~50%",
      desc_edge: "{reps} brief squeezes · no hold",
      desc_reverse: "{reps} reverse Kegels",
      desc_reverse_suffix: " · reverse every {n}",
      arousal_toggle_label: "Do it with stimulation",
      arousal_toggle_on_hint: "Stop-Start cycle: stimulate yourself to the point of no return, then tap to start the Kegel @50%. Solo practice.",
      arousal_toggle_off_hint: "Dry mode: Kegel @50% runs on a timer, no arousal phase before it.",
    },
    active: {
      paused: "Paused",
      tap_ponr: "I'm close · start Kegel",
      arousal_hint: "Build up to the PONR. Tap when close.",
      arousal_sub: "Your body sets the pace. The sooner you tap, the earlier the Kegel.",
      pause_h: "Remember",
      pause_no_glutes: "Don't squeeze glutes, thighs or abdomen.",
      pause_no_breath: "Exhale while contracting. No Valsalva.",
      pause_release: "Fully release between reps.",
      pause_tip_valsalva: "· No Valsalva (don't bear down)",
      pause_tip_no_glutes: "· Don't squeeze glutes or thighs",
      pause_tip_breath: "· Exhale on contraction · Inhale on release",
      resume: "Resume",
      skip_exercise: "Skip exercise",
      exit: "Exit",
      exit_confirm: "Exit the session?",
      eyes_closed: "Eyes-closed mode",
      eyes_closed_exit: "Exit eyes-closed mode",
      eyes_closed_short: "Exit blind mode",
      paused_tap_resume: "Paused · tap to resume",
      rep_short: "Rep",
      rep_of: "Rep {n} of {total}",
      reverse_inserted: "interspersed",
      reverse_label: "Reverse Kegel",
      intensity_push: "Push",
      intensity_aria: "Suggested intensity",
      intensity_caption: "Muscle squeeze percentage",
      aria_back: "Back",
      aria_pause: "Pause",
      aria_skip: "Skip",
      session_complete: "Session complete!",
      summary_title: "Summary",
      summary_back: "Back to home",
      summary_again: "Repeat routine",
      summary_repetitions: "Repetitions",
      summary_exercises: "Exercises",
      summary_duration: "Duration",
      summary_achievement: "Achievement",
      summary_streak_plus: "+1 day",
      summary_motivation: "Consistency beats volume. Keep the streak tomorrow.",
      summary_save_close: "Save and close",
    },
    phase: {
      ready: "Get ready", inhale: "Inhale", exhale: "Exhale",
      contract: "Squeeze", hold: "Hold", release: "Release",
      rest: "Rest", reverse: "Push gently", peak: "Peak",
      plateau: "Plateau", "knack-trigger": "Cough without releasing", "knack-hold": "Hold without coughing",
      arousal: "Build up to PONR",
    },
    engine: {
      push_gently_down: "Push gently down",
      relax_full: "Fully relax",
      release_slow: "Release slowly",
      descend_slow: "Lower slowly",
      ladder_step: "Step {n}",
      ladder_hold: "Step {n} · {sec}s",
      elevator_floor: "Floor {n} · {pct}%",
      elevator_up: "Up",
      elevator_peak: "Peak · hold",
      elevator_down: "Down · {pct}%",
      elevator_pause: "Pause",
      elevator_release_full: "Full release",
      wave_front: "Front ring",
      wave_back: "Back ring",
      wave_front_short: "Front",
      wave_back_short: "Back",
      knack_ready: "Ready to anticipate",
      knack_squeeze: "Squeeze!",
      knack_cough: "Cough {sec}s without releasing",
      knack_hold: "Hold {sec}s without coughing",
      recover: "Recover",
      squeeze_pct: "Squeeze at {pct}%",
      edge_hold: "Edge · {sec}s at {pct}%",
      edge_squeeze: "Squeeze firm · brief brake",
      flick_burst: "Fast flicks · {sec}s",
      flick_after: "Flicker · {sec}s keep arousal up",
      arousal_cue: "Build up to the PONR. Tap when close. Stimulate yourself or use a vibrator or toy up to 1 point before climax.",
    },
    stats: {
      title: "Progress",
      subtitle: "Your evolution",
      aria_tests: "Tests",
      tab_activity: "Activity", tab_strength: "Strength", tab_sexual: "Sexual health",
      no_tests_h: "No tests yet",
      no_tests_p: "Measure your current strength in under a minute. Helps you see real progress over time.",
      take_test: "Take test",
      last_7d: "Last 7 days",
      history: "History",
      streak_current: "Current streak",
      reps_per_day_h: "REPS PER DAY",
      total_reps: "Total reps",
      average: "Average",
      empty_history: "You haven't completed any session yet.",
      hold_evolution: "Max hold evolution",
      flicks_evolution: "Flicks/10s evolution",
      ielt_log: "Log IELT",
      ehs_log: "Log EHS",
      cono_log: "Log cone weight",
      ielt_title: "Ejaculatory latency",
      ehs_title: "Erection hardness",
      cono_title: "Cone retained",
      ielt_record_h: "Ejaculatory latency (IELT)",
      ehs_record_h: "Erection hardness (EHS)",
      cono_record_h: "Retainable cone weight",
      ielt_subtitle: "Intravaginal ejaculatory latency in seconds. After a real encounter.",
      ehs_subtitle: "Erection Hardness Score. 1=tumescence · 2=hard but not penetrable · 3=penetrable · 4=maximum rigidity.",
      cono_subtitle: "Maximum vaginal cone weight you can hold while walking 15 min.",
      record_weight: "Log weight",
      latest_record: "latest record",
      latest_short: "latest",
      no_data: "No data yet",
      test_history: "Test history",
      latest: "Latest",
      new_test: "Take new test",
    },
    profile: {
      header: "Profile",
      edit: "Edit",
      audience: "Audience", level: "Level", track: "Track", goals: "Goals",
      language: "Language",
      preferences: "Preferences",
      sound: "Sound", haptic: "Haptic vibration", volume: "Volume",
      tests_row: "Strength test",
      take_test_now: "Take test now",
      last_test: "Last test",
      days_ago: "{n} days ago",
      design: "Design",
      design_sub: "Theme and accent color",
      open_tweaks: "Open tweaks",
      reset: "Reset onboarding",
      reset_confirm: "Reset? You'll lose your level and initial test.",
      edit_title: "Edit profile",
      save: "Save",
    },
    glossary: {
      title: "Glossary",
      header: "Glossary · {name}",
    },
    create: {
      title: "New routine",
      name: "Name",
      name_ph: "e.g. My morning routine",
      track: "Track",
      level: "Level",
      exercises: "Exercises",
      reps: "Reps",
      min_short: "~ Min",
      save: "Save routine",
      need_name: "Give your routine a name",
      need_exercises: "Add at least one exercise",
      type_label: "Type",
      hold_sec: "Hold (s)",
      rest_sec: "Rest (s)",
      description_default: "Custom routine.",
      default_ex_name: "Contraction",
      default_ex_instruction: "Contract and release with control.",
      default_new_ex: "New exercise",
      btn_holds: "Holds", btn_flicks: "Flicks", btn_ladder: "Ladder",
      btn_elevator: "Elevator", btn_knack: "Knack", btn_edge: "Edge", btn_edge_no_hold: "Edge no-hold", btn_reverse: "Reverse",
    },
    goals: {
      strength: "General strength",
      erection: "Improve erection",
      ielt: "Last longer (ejaculatory control)",
      edging: "Advanced sexual control / edging",
      incontinence: "Incontinence / leaks",
      postpartum: "Postpartum recovery",
      orgasmic: "Female sexual function (orgasm, Pompoir)",
    },
    tracks: {
      "general-strength": { name: "General strength", blurb: "Base tone. Balance of slow fibers (endurance) + fast (reflex)." },
      "male-sexual": { name: "Male sexual health", blurb: "Erection, stamina, ejaculatory control and edging. Based on MTCK + PRM." },
      "incontinence-knack": { name: "Continence · The Knack", blurb: "Anticipatory reflex before coughing/sneezing. 8× symptomatic cure vs control." },
      "female-postpartum-sexual": { name: "Postpartum and sexual function", blurb: "Reactivation, vaginal cones, Pompoir waves and mandatory reverse Kegels." },
    },
  },

  // ============================================================
  // ITALIANO
  // ============================================================
  it: {
    locale_name: "Italiano",
    common: {
      back: "Indietro", continue: "Continua", next: "Avanti", cancel: "Annulla",
      save: "Salva", close: "Chiudi", ok: "OK", yes: "Sì", no: "No", skip: "Salta",
      start: "Inizia", repeat: "Ripeti", pause: "Pausa", resume: "Riprendi",
      stop: "Ferma", retry: "Riprova", finish: "Fine",
      beginner: "Principiante", intermediate: "Intermedio", advanced: "Avanzato",
      male: "Uomo", female: "Donna", all: "Entrambi",
      loading: "Caricamento…", error: "Errore",
      seconds_short: "s", minutes_short: "min", reps: "rip",
      day_rest: "Riposo", today: "Oggi", yesterday: "Ieri",
      days_ago: "{n} giorni fa",
      weekday_mon: "Lunedì", weekday_tue: "Martedì", weekday_wed: "Mercoledì",
      weekday_thu: "Giovedì", weekday_fri: "Venerdì", weekday_sat: "Sabato", weekday_sun: "Domenica",
    },
    nav: { home: "Home", routines: "Routine", progress: "Progresso", profile: "Profilo" },
    onboarding: {
      lang_eyebrow: "Lingua / Language",
      lang_title: "Scegli la tua lingua",
      lang_desc: "Puoi cambiarla in seguito dal profilo.",
      welcome: "Benvenuta / Benvenuto",
      audience_title: "Per chi sono le routine?",
      audience_desc: "Adattiamo l'anatomia e gli obiettivi. Non chiediamo dati personali.",
      step2: "Passo 2 di 4",
      step3: "Passo 3 di 4",
      step4: "Passo 4 di 4 · Prima di iniziare",
      goal_title: "Cosa vuoi migliorare?",
      goal_desc: "Scegli l'obiettivo principale. Adatteremo il piano all'evidenza clinica del caso.",
      test_title_guide: "Trova il tuo pavimento pelvico",
      test_title_running: "Misura la tua forza attuale",
      test_desc: "Tre mini-prove. Servono ad assegnarti il livello esatto e a vedere il tuo progresso reale nel tempo.",
      guide_intro: "Prima del test, assicurati di sapere quale muscolo stringere. È più facile di quanto sembri.",
      guide_what_h: "Cos'è il pavimento pelvico?",
      guide_what_female: "Un'amaca muscolare che sostiene vescica, utero e intestino. Fare un Kegel = chiudere e sollevare volontariamente i muscoli intorno alla vagina e all'ano.",
      guide_what_male: "Uno strato muscolare del perineo che sostiene gli organi pelvici. Fare un Kegel = chiudere l'ano e sollevare la base del pene.",
      guide_what_neutral: "Un'amaca muscolare tra pube e coccige che sostiene gli organi pelvici. Fare un Kegel = chiuderla e sollevarla volontariamente.",
      guide_locate_h: "Come localizzarlo",
      guide_locate_female_p1: "Immagina di **trattenere la pipì** e allo stesso tempo **trattenere un gas**. Quella contrazione interna —chiusura + sollevamento— è il tuo pavimento pelvico.",
      guide_locate_female_tip: "💡 **Verifica tattile:** inserisci un dito in vagina e stringi. Devi sentire una **chiusura delicata intorno al dito**, non una spinta verso fuori.",
      guide_locate_male_p1: "Immagina di **interrompere il getto della pipì** e allo stesso tempo **trattenere un gas**. Quella contrazione è il tuo pavimento pelvico.",
      guide_locate_male_tip: "💡 **Verifica visiva:** davanti allo specchio, contraendo bene **la base del pene si ritrae leggermente e i testicoli salgono**. È l'indicatore corretto.",
      guide_locate_neutral: "Immagina di trattenere la pipì e allo stesso tempo un gas. Quella contrazione interna —chiusura e sollevamento— è il pavimento pelvico.",
      guide_reverse_h: "Kegel inverso (rilassamento)",
      guide_reverse_p: "Imparare a **lasciar andare** è importante quanto stringere. Il Kegel inverso è il movimento opposto —aprire e spingere molto delicatamente verso il basso— e previene l'**ipertonia**: tensione cronica che causa dolore, disfunzione e blocca i progressi.",
      guide_reverse_female_p1: "Immagina di **aprire leggermente la vagina e l'ano** verso fuori, come lasciar uscire un gas leggero o avviare una piccola spinta. Movimento minimo, senza Valsalva né apnea.",
      guide_reverse_female_tip: "💡 **Verifica tattile:** con un dito in vagina, in un reverse senti una **apertura e discesa delicate**, non chiusura.",
      guide_reverse_male_p1: "Immagina di **lasciar uscire un gas leggero** senza sforzo addominale. Il perineo si allarga e la base del pene **scende leggermente**.",
      guide_reverse_male_tip: "💡 **Verifica visiva:** fatto bene **la base del pene scende e i testicoli NON si sollevano** —l'opposto di un Kegel.",
      guide_reverse_neutral: "Apri e spingi molto delicatamente verso il basso, come lasciar uscire un gas. Opposto del Kegel, senza Valsalva.",
      guide_errors_h: "Errori frequenti",
      guide_err_glutes: "Stringere glutei, cosce o addome.",
      guide_err_breath: "Trattenere il respiro o spingere in giù (Valsalva).",
      guide_err_pee: "Farlo durante la minzione reale (può causare infezioni).",
      guide_ok_close: "Chiusura + sollevamento interno, respirando normalmente.",
      guide_ok_pos: "Meglio seduto, sdraiato o in piedi rilassato per iniziare.",
      guide_practice_h: "Pratica prima del test",
      guide_practice_p: "Fai **3 contrazioni dolci di 2 secondi** con 4 secondi di pausa tra una e l'altra. Se senti la chiusura interna e nient'altro si muove, sei pronto.",
      guide_ready: "Capito, inizia il test",
      skip_test: "Salta test (assegna principiante)",
      results: "Risultati",
      max_hold: "Hold max",
      flicks_per_10s: "Flick/10s",
      mvc_short: "MVC",
      before_start_h: "Prima di iniziare",
      before_no_glutes: "Non stringere glutei né cosce.",
      before_exhale: "Espira mentre contrai.",
      before_release: "Rilasciare conta quanto stringere.",
      before_rest: "Giorno di riposo settimanale obbligatorio.",
      level_suggested_hint: "Suggerito dal test. Puoi cambiarlo se vuoi andare più piano o hai già esperienza.",
      level_chosen_hint: "Hai scelto {chosen} (suggerito: {suggested}).",
    },
    test: {
      pill_hold: "1 / 3 · Tieni",
      pill_flicks: "2 / 3 · Flick",
      pill_mvc: "3 / 3 · Sensazione",
      hold_h: "Stringi e tieni",
      hold_desc: "Stringi più forte che puoi. Rilascia quando inizi a tremare o perdi qualità.",
      release: "Rilasciato",
      flicks_h: "Flick in 10 secondi",
      flicks_desc: "Tocca il pulsante ogni volta che stringi e rilasci completamente. Conta solo flick puliti.",
      flicks_tap: "Tocca qui ogni flick",
      flicks_remaining: "{s}s rimasti",
      flicks_done: "Tempo scaduto",
      mvc_h: "Quanto forte senti la contrazione?",
      mvc_desc: "1 = quasi niente, 10 = forza massima.",
      save_results: "Salva risultati",
      next_flicks: "Avanti: flick",
      next: "Avanti",
      title: "Test di forza",
      title_done: "Test completato",
      intro_title: "Misura la tua forza attuale",
      intro_desc: "Tre mini-prove in meno di 1 minuto. Servono ad assegnarti il livello giusto e a vedere il tuo progresso reale nel tempo.",
      intro_li1: "**Tieni il più a lungo possibile** — misureremo la durata della contrazione.",
      intro_li2: "**Flick in 10 secondi** — quanti impulsi completi fai.",
      intro_li3: "**Sensazione di forza** — scala soggettiva 1-10.",
      intro_start: "Inizia test",
      done_back: "Torna alla home",
      level_suggested: "Livello suggerito",
      mvc_subjective: "MVC soggettivo",
      max_hold: "Tenuta max",
      flicks_per_10s: "Flick/10s",
      mvc_short: "MVC",
    },
    home: {
      greeting: "Ciao",
      rest_day_eyebrow: "Giorno di riposo",
      rest_day_title: "Anche il pavimento pelvico riposa",
      rest_day_desc: "Il riposo fa parte del protocollo. Senza, compare l'ipertonia. Torna domani.",
      view_catalog: "Vedi catalogo",
      streak: "Serie",
      sessions: "Sessioni",
      this_week: "Questa sett.",
      days: "giorni",
      total: "totale",
      measure_baseline: "Misura la tua forza attuale",
      retest_monthly: "Re-test mensile",
      mini_tests_short: "3 mini-prove, < 1 minuto",
      recommended: "Consigliate per il tuo track",
      view_all: "Vedi tutte",
      progression_ready_h: "Pronto a salire di livello!",
      progression_ready_p: "I tuoi test superano le soglie del livello successivo.",
      progression_yes: "Passa a {level}",
      progression_later: "Più tardi",
      today_routine: "Routine di oggi",
      start_now: "Inizia ora",
      last_session: "Ultima sessione",
      history_link: "Cronologia",
      exercises_short: "esercizi",
      repetitions: "ripetizioni",
    },
    catalog: {
      title: "Catalogo",
      header: "Routine",
      available: "{n} disponibili",
      chip_all: "Tutti",
      all_levels: "Tutti i livelli",
      mine_badge: "Mia",
      confirm_delete: "Eliminare la routine?",
      delete_aria: "Elimina",
      empty: "Nessuna routine con questo filtro.",
      all_tracks: "Tutti i track",
      includes_reverse: "Include reverse",
      no_results: "Nessuna routine per questa combinazione.",
      create_routine: "Crea routine",
    },
    detail: {
      header: "Dettaglio",
      duration: "Durata",
      exercises: "Esercizi",
      reps: "Rip",
      concepts: "Concetti",
      full_glossary: "Vedi glossario completo della routine ({n})",
      start_routine: "Inizia routine",
      not_found: "Routine non trovata.",
      type_hold: "Hold", type_flick: "Flick", type_ladder: "Scala",
      type_elevator: "Elevator", type_wave: "Onda", type_knack: "Knack",
      type_edging: "Edging", type_edge: "Edge senza hold", type_reverse: "Reverse",
      desc_standard: "{reps} rip · {hold}s tenuta{reverse}",
      desc_flick: "{reps} impulsi rapidi",
      desc_ladder: "{reps} gradini · {start}-{max}s",
      desc_elevator: "{reps} elevator · 4 piani",
      desc_wave: "{reps} onde anteriore/posteriore",
      desc_knack: "{reps} contrazioni anticipatorie",
      desc_edging: "{reps} × {sec}s al ~50%",
      desc_edge: "{reps} squeeze brevi · senza hold",
      desc_reverse: "{reps} Kegel inversi",
      desc_reverse_suffix: " · reverse ogni {n}",
      arousal_toggle_label: "Farlo con stimolazione",
      arousal_toggle_on_hint: "Ciclo Stop-Start: ti stimoli fino al punto di non ritorno e tocchi per avviare il Kegel @50%. Pratica solitaria.",
      arousal_toggle_off_hint: "Modalità asciutta: il Kegel @50% va a tempo, senza fase di eccitazione prima.",
    },
    active: {
      paused: "In pausa",
      tap_ponr: "Sono vicino · avvia Kegel",
      arousal_hint: "Sali fino al PONR. Tocca quando sei vicino.",
      arousal_sub: "Il tuo corpo detta il ritmo. Prima tocchi, prima parte il Kegel.",
      pause_h: "Ricorda",
      pause_no_glutes: "Non stringere glutei, cosce o addome.",
      pause_no_breath: "Espira mentre contrai. Niente Valsalva.",
      pause_release: "Rilascia completamente tra le ripetizioni.",
      pause_tip_valsalva: "· Niente Valsalva (non spingere in giù)",
      pause_tip_no_glutes: "· Non stringere glutei né cosce",
      pause_tip_breath: "· Espira contraendo · Inspira rilassando",
      resume: "Riprendi",
      skip_exercise: "Salta esercizio",
      exit: "Esci",
      exit_confirm: "Uscire dalla sessione?",
      eyes_closed: "Modalità occhi chiusi",
      eyes_closed_exit: "Esci dalla modalità occhi chiusi",
      eyes_closed_short: "Esci modalità cieca",
      paused_tap_resume: "In pausa · tocca per riprendere",
      rep_short: "Rip",
      rep_of: "Rip {n} di {total}",
      reverse_inserted: "intercalata",
      reverse_label: "Kegel inverso",
      intensity_push: "Spinta",
      intensity_aria: "Intensità suggerita",
      intensity_caption: "Percentuale di stretta del muscolo",
      aria_back: "Indietro",
      aria_pause: "Pausa",
      aria_skip: "Salta",
      session_complete: "Sessione completata!",
      summary_title: "Riepilogo",
      summary_back: "Torna alla home",
      summary_again: "Ripeti routine",
      summary_repetitions: "Ripetizioni",
      summary_exercises: "Esercizi",
      summary_duration: "Durata",
      summary_achievement: "Traguardo",
      summary_streak_plus: "+1 giorno",
      summary_motivation: "La costanza batte il volume. Mantieni la serie domani.",
      summary_save_close: "Salva e chiudi",
    },
    phase: {
      ready: "Preparati", inhale: "Inspira", exhale: "Espira",
      contract: "Stringi", hold: "Tieni", release: "Rilascia",
      rest: "Riposa", reverse: "Spingi piano", peak: "Picco",
      plateau: "Plateau", "knack-trigger": "Tossisci senza mollare", "knack-hold": "Tieni senza tossire",
      arousal: "Sali al PONR",
    },
    engine: {
      push_gently_down: "Spingi piano verso il basso",
      relax_full: "Rilassa completamente",
      release_slow: "Rilascia lento",
      descend_slow: "Scendi piano",
      ladder_step: "Gradino {n}",
      ladder_hold: "Gradino {n} · {sec}s",
      elevator_floor: "Piano {n} · {pct}%",
      elevator_up: "Sali",
      elevator_peak: "Picco · tieni",
      elevator_down: "Scendi · {pct}%",
      elevator_pause: "Pausa",
      elevator_release_full: "Rilascio totale",
      wave_front: "Anello anteriore",
      wave_back: "Anello posteriore",
      wave_front_short: "Anteriore",
      wave_back_short: "Posteriore",
      knack_ready: "Pronto ad anticipare",
      knack_squeeze: "Stringi!",
      knack_cough: "Tossisci {sec}s senza mollare",
      knack_hold: "Tienilo {sec}s senza tossire",
      recover: "Recupera",
      squeeze_pct: "Stringi al {pct}%",
      edge_hold: "Edge · {sec}s al {pct}%",
      edge_squeeze: "Stringi forte · freno breve",
      flick_burst: "Flick rapidi · {sec}s",
      flick_after: "Flicker · {sec}s mantieni l'arousal",
      arousal_cue: "Sali fino al PONR. Tocca quando sei vicino. Stimolati da solo/a o con un vibratore o sex toy fino a 1 punto prima del climax.",
    },
    stats: {
      title: "Progresso",
      subtitle: "La tua evoluzione",
      aria_tests: "Test",
      tab_activity: "Attività", tab_strength: "Forza", tab_sexual: "Salute sessuale",
      no_tests_h: "Nessun test ancora",
      no_tests_p: "Misura la tua forza attuale in meno di un minuto. Ti aiuta a vedere progresso reale nel tempo.",
      take_test: "Fai il test",
      last_7d: "Ultimi 7 giorni",
      history: "Cronologia",
      streak_current: "Serie attuale",
      reps_per_day_h: "RIPETIZIONI AL GIORNO",
      total_reps: "Totale rip",
      average: "Media",
      empty_history: "Non hai ancora completato alcuna sessione.",
      hold_evolution: "Evoluzione hold max",
      flicks_evolution: "Evoluzione flick/10s",
      ielt_log: "Registra IELT",
      ehs_log: "Registra EHS",
      cono_log: "Registra peso del cono",
      ielt_title: "Latenza eiaculatoria",
      ehs_title: "Durezza dell'erezione",
      cono_title: "Cono trattenuto",
      ielt_record_h: "Latenza eiaculatoria (IELT)",
      ehs_record_h: "Durezza erezione (EHS)",
      cono_record_h: "Peso cono trattenibile",
      ielt_subtitle: "Latenza eiaculatoria intravaginale in secondi. Dopo un incontro reale.",
      ehs_subtitle: "Erection Hardness Score. 1=tumescenza · 2=duro ma non penetrabile · 3=penetrabile · 4=massima rigidità.",
      cono_subtitle: "Peso massimo del cono vaginale trattenibile camminando 15 min.",
      record_weight: "Registra peso",
      latest_record: "ultimo registro",
      latest_short: "ultimo",
      no_data: "Nessun dato",
      test_history: "Cronologia test",
      latest: "Ultimo",
      new_test: "Nuovo test",
    },
    profile: {
      header: "Profilo",
      edit: "Modifica",
      audience: "Pubblico", level: "Livello", track: "Track", goals: "Obiettivi",
      language: "Lingua",
      preferences: "Preferenze",
      sound: "Suono", haptic: "Vibrazione aptica", volume: "Volume",
      tests_row: "Test di forza",
      take_test_now: "Fai test ora",
      last_test: "Ultimo test",
      days_ago: "{n} giorni fa",
      design: "Design",
      design_sub: "Tema e colore d'accento",
      open_tweaks: "Apri tweak",
      reset: "Ripristina onboarding",
      reset_confirm: "Ripristinare? Perderai livello e test iniziale.",
      edit_title: "Modifica profilo",
      save: "Salva",
    },
    glossary: {
      title: "Glossario",
      header: "Glossario · {name}",
    },
    create: {
      title: "Nuova routine",
      name: "Nome",
      name_ph: "Es. La mia routine mattutina",
      track: "Track",
      level: "Livello",
      exercises: "Esercizi",
      reps: "Rip",
      min_short: "~ Min",
      save: "Salva routine",
      need_name: "Dai un nome alla tua routine",
      need_exercises: "Aggiungi almeno un esercizio",
      type_label: "Tipo",
      hold_sec: "Hold (s)",
      rest_sec: "Rest (s)",
      description_default: "Routine personalizzata.",
      default_ex_name: "Contrazione",
      default_ex_instruction: "Contrai e rilascia con controllo.",
      default_new_ex: "Nuovo esercizio",
      btn_holds: "Hold", btn_flicks: "Flick", btn_ladder: "Scala",
      btn_elevator: "Elevator", btn_knack: "Knack", btn_edge: "Edge", btn_edge_no_hold: "Edge senza hold", btn_reverse: "Reverse",
    },
    goals: {
      strength: "Forza generale",
      erection: "Migliorare l'erezione",
      ielt: "Durare di più (controllo eiaculatorio)",
      edging: "Controllo sessuale avanzato / edging",
      incontinence: "Incontinenza / perdite",
      postpartum: "Recupero post-parto",
      orgasmic: "Funzione sessuale femminile (orgasmo, Pompoir)",
    },
    tracks: {
      "general-strength": { name: "Forza generale", blurb: "Tono di base. Equilibrio fibre lente (resistenza) + veloci (riflesso)." },
      "male-sexual": { name: "Salute sessuale maschile", blurb: "Erezione, durata, controllo eiaculatorio ed edging. Basato su MTCK + PRM." },
      "incontinence-knack": { name: "Continenza · The Knack", blurb: "Riflesso anticipatorio prima di tossire/starnutire. 8× cura sintomatica vs controllo." },
      "female-postpartum-sexual": { name: "Post-parto e funzione sessuale", blurb: "Riattivazione, coni vaginali, onde Pompoir e reverse Kegel obbligatori." },
    },
  },

  // ============================================================
  // DEUTSCH
  // ============================================================
  de: {
    locale_name: "Deutsch",
    common: {
      back: "Zurück", continue: "Weiter", next: "Weiter", cancel: "Abbrechen",
      save: "Speichern", close: "Schließen", ok: "OK", yes: "Ja", no: "Nein", skip: "Überspringen",
      start: "Start", repeat: "Wiederholen", pause: "Pause", resume: "Fortsetzen",
      stop: "Stopp", retry: "Erneut", finish: "Fertig",
      beginner: "Anfänger", intermediate: "Mittel", advanced: "Fortgeschritten",
      male: "Mann", female: "Frau", all: "Beide",
      loading: "Lädt…", error: "Fehler",
      seconds_short: "s", minutes_short: "Min", reps: "Wdh",
      day_rest: "Pause", today: "Heute", yesterday: "Gestern",
      days_ago: "vor {n} Tagen",
      weekday_mon: "Montag", weekday_tue: "Dienstag", weekday_wed: "Mittwoch",
      weekday_thu: "Donnerstag", weekday_fri: "Freitag", weekday_sat: "Samstag", weekday_sun: "Sonntag",
    },
    nav: { home: "Start", routines: "Routinen", progress: "Fortschritt", profile: "Profil" },
    onboarding: {
      lang_eyebrow: "Sprache / Language",
      lang_title: "Wähle deine Sprache",
      lang_desc: "Du kannst sie später im Profil ändern.",
      welcome: "Willkommen",
      audience_title: "Für wen sind die Routinen?",
      audience_desc: "Wir passen Anatomie und Ziele an. Wir fragen keine persönlichen Daten ab.",
      step2: "Schritt 2 von 4",
      step3: "Schritt 3 von 4",
      step4: "Schritt 4 von 4 · Vor dem Start",
      goal_title: "Was möchtest du verbessern?",
      goal_desc: "Wähle dein Hauptziel. Wir passen den Plan an die klinische Evidenz an.",
      test_title_guide: "Finde deinen Beckenboden",
      test_title_running: "Miss deine aktuelle Kraft",
      test_desc: "Drei Mini-Tests. Sie bestimmen dein genaues Niveau und zeigen echten Fortschritt über die Zeit.",
      guide_intro: "Stelle vor dem Test sicher, welchen Muskel du anspannst. Es ist einfacher als es aussieht.",
      guide_what_h: "Was ist der Beckenboden?",
      guide_what_female: "Eine Muskelhängematte, die Blase, Gebärmutter und Darm trägt. Ein Kegel = bewusst die Muskeln um Vagina und Anus schließen und heben.",
      guide_what_male: "Eine Muskelschicht des Damms, die die Beckenorgane trägt. Ein Kegel = den Anus schließen und die Penisbasis heben.",
      guide_what_neutral: "Eine Muskelhängematte zwischen Schambein und Steißbein, die die Beckenorgane trägt. Ein Kegel = sie bewusst schließen und heben.",
      guide_locate_h: "So findest du ihn",
      guide_locate_female_p1: "Stell dir vor, du **hältst den Harndrang zurück** und gleichzeitig **einen Furz**. Diese innere Kontraktion —Schließen + Heben— ist dein Beckenboden.",
      guide_locate_female_tip: "💡 **Tastprüfung:** führe einen Finger in die Vagina ein und drücke. Du solltest ein **sanftes Schließen um den Finger** spüren, kein Drücken nach außen.",
      guide_locate_male_p1: "Stell dir vor, du **stoppst den Harnstrahl** und gleichzeitig **hältst einen Furz zurück**. Diese Kontraktion ist dein Beckenboden.",
      guide_locate_male_tip: "💡 **Sichtprüfung:** vor dem Spiegel zieht sich beim korrekten Anspannen **die Penisbasis leicht zurück und die Hoden heben sich**. Das ist der richtige Hinweis.",
      guide_locate_neutral: "Stell dir vor, du hältst den Harndrang und gleichzeitig einen Furz zurück. Diese innere Kontraktion —Schließen und Heben— ist der Beckenboden.",
      guide_reverse_h: "Reverse Kegel (Entspannung)",
      guide_reverse_p: "**Loslassen** ist genauso wichtig wie Anspannen. Der Reverse Kegel ist die Gegenbewegung —öffnen und sehr sanft nach unten drücken— und verhindert **Hypertonie**: chronische Spannung, die Schmerzen, Dysfunktion und Fortschrittsblockaden verursacht.",
      guide_reverse_female_p1: "Stell dir vor, du **öffnest Vagina und Anus leicht nach außen**, als ließest du sanft Luft entweichen oder beginnst mit einem ganz leichten Drücken. Minimale Bewegung, ohne Valsalva, ohne Luftanhalten.",
      guide_reverse_female_tip: "💡 **Tastprüfung:** mit einem Finger in der Vagina spürst du beim Reverse ein **sanftes Öffnen und Absinken**, kein Schließen.",
      guide_reverse_male_p1: "Stell dir vor, du **lässt einen sanften Furz ab** ohne Bauchanspannung. Der Damm weitet sich und die Penisbasis **senkt sich leicht ab**.",
      guide_reverse_male_tip: "💡 **Sichtprüfung:** richtig gemacht **senkt sich die Penisbasis und die Hoden heben sich NICHT** —Gegenteil eines Kegels.",
      guide_reverse_neutral: "Öffne und drücke sehr sanft nach unten, als ließest du Luft entweichen. Gegenteil des Kegels, ohne Valsalva.",
      guide_errors_h: "Häufige Fehler",
      guide_err_glutes: "Gesäß, Oberschenkel oder Bauch anspannen.",
      guide_err_breath: "Luft anhalten oder nach unten pressen (Valsalva).",
      guide_err_pee: "Beim echten Wasserlassen üben (kann Infektionen verursachen).",
      guide_ok_close: "Schließen + inneres Heben, normal atmen.",
      guide_ok_pos: "Am besten sitzend, liegend oder entspannt stehend zum Start.",
      guide_practice_h: "Vor dem Test üben",
      guide_practice_p: "Mache **3 sanfte 2-Sekunden-Kontraktionen** mit 4 Sekunden Pause dazwischen. Wenn du das innere Schließen spürst und sonst nichts, bist du bereit.",
      guide_ready: "Verstanden, Test starten",
      skip_test: "Test überspringen (Anfänger)",
      results: "Ergebnisse",
      max_hold: "Max Hold",
      flicks_per_10s: "Flicks/10s",
      mvc_short: "MVC",
      before_start_h: "Bevor du startest",
      before_no_glutes: "Spanne kein Gesäß oder Oberschenkel an.",
      before_exhale: "Beim Anspannen ausatmen.",
      before_release: "Entspannen ist genauso wichtig wie anspannen.",
      before_rest: "Verpflichtender wöchentlicher Ruhetag.",
      level_suggested_hint: "Vom Test vorgeschlagen. Du kannst es ändern, wenn du langsamer machen willst oder schon Erfahrung hast.",
      level_chosen_hint: "Du hast {chosen} gewählt (vorgeschlagen: {suggested}).",
    },
    test: {
      pill_hold: "1 / 3 · Halten",
      pill_flicks: "2 / 3 · Flicks",
      pill_mvc: "3 / 3 · Gefühl",
      hold_h: "Anspannen und halten",
      hold_desc: "Spanne so stark wie möglich an. Lass los, wenn du anfängst zu zittern oder Qualität verlierst.",
      release: "Losgelassen",
      flicks_h: "Flicks in 10 Sekunden",
      flicks_desc: "Tippe bei jedem vollständigen Anspannen und Loslassen. Nur saubere Flicks zählen.",
      flicks_tap: "Hier pro Flick tippen",
      flicks_remaining: "{s}s übrig",
      flicks_done: "Zeit abgelaufen",
      mvc_h: "Wie stark fühlt sich die Kontraktion an?",
      mvc_desc: "1 = kaum etwas, 10 = maximale Kraft.",
      save_results: "Ergebnisse speichern",
      next_flicks: "Weiter: Flicks",
      next: "Weiter",
      title: "Krafttest",
      title_done: "Test abgeschlossen",
      intro_title: "Miss deine aktuelle Kraft",
      intro_desc: "Drei Mini-Tests in unter 1 Minute. Sie bestimmen dein korrektes Niveau und zeigen echten Fortschritt.",
      intro_li1: "**So lange wie möglich halten** — wir messen die Dauer der Kontraktion.",
      intro_li2: "**Flicks in 10 Sekunden** — wie viele vollständige Pulse du machst.",
      intro_li3: "**Kraftgefühl** — subjektive Skala 1-10.",
      intro_start: "Test starten",
      done_back: "Zurück zur Startseite",
      level_suggested: "Empfohlenes Niveau",
      mvc_subjective: "Subjektives MVC",
      max_hold: "Max. Halt",
      flicks_per_10s: "Flicks/10s",
      mvc_short: "MVC",
    },
    home: {
      greeting: "Hallo",
      rest_day_eyebrow: "Ruhetag",
      rest_day_title: "Auch dein Beckenboden ruht",
      rest_day_desc: "Ruhe gehört zum Protokoll. Ohne sie entsteht Hypertonie. Komm morgen wieder.",
      view_catalog: "Katalog ansehen",
      streak: "Serie",
      sessions: "Sitzungen",
      this_week: "Diese Wo.",
      days: "Tage",
      total: "gesamt",
      measure_baseline: "Miss deine aktuelle Kraft",
      retest_monthly: "Monatlicher Re-Test",
      mini_tests_short: "3 Mini-Tests, < 1 Minute",
      recommended: "Empfohlen für deinen Track",
      view_all: "Alle ansehen",
      progression_ready_h: "Bereit für das nächste Niveau!",
      progression_ready_p: "Deine Tests übertreffen die Schwellen des nächsten Niveaus.",
      progression_yes: "Auf {level} wechseln",
      progression_later: "Später",
      today_routine: "Heutige Routine",
      start_now: "Jetzt starten",
      last_session: "Letzte Sitzung",
      history_link: "Verlauf",
      exercises_short: "Übungen",
      repetitions: "Wiederholungen",
    },
    catalog: {
      title: "Katalog",
      header: "Routinen",
      available: "{n} verfügbar",
      chip_all: "Alle",
      all_levels: "Alle Niveaus",
      mine_badge: "Eigene",
      confirm_delete: "Routine löschen?",
      delete_aria: "Löschen",
      empty: "Keine Routinen mit diesem Filter.",
      all_tracks: "Alle Tracks",
      includes_reverse: "Mit Reverse",
      no_results: "Keine Routinen für diese Kombination.",
      create_routine: "Routine erstellen",
    },
    detail: {
      header: "Detail",
      duration: "Dauer",
      exercises: "Übungen",
      reps: "Wdh",
      concepts: "Konzepte",
      full_glossary: "Vollständiges Routine-Glossar ansehen ({n})",
      start_routine: "Routine starten",
      not_found: "Routine nicht gefunden.",
      type_hold: "Hold", type_flick: "Flicks", type_ladder: "Leiter",
      type_elevator: "Elevator", type_wave: "Welle", type_knack: "Knack",
      type_edging: "Edging", type_edge: "Edge ohne Halten", type_reverse: "Reverse",
      desc_standard: "{reps} Wdh. · {hold}s Halten{reverse}",
      desc_flick: "{reps} schnelle Pulse",
      desc_ladder: "{reps} Stufen · {start}-{max}s",
      desc_elevator: "{reps} Elevator · 4 Stockwerke",
      desc_wave: "{reps} Wellen vorne/hinten",
      desc_knack: "{reps} antizipatorische Kontraktionen",
      desc_edging: "{reps} × {sec}s bei ~50%",
      desc_edge: "{reps} kurze Squeezes · ohne Halten",
      desc_reverse: "{reps} Reverse-Kegels",
      desc_reverse_suffix: " · Reverse alle {n}",
      arousal_toggle_label: "Mit Stimulation durchführen",
      arousal_toggle_on_hint: "Stop-Start-Zyklus: stimuliere dich bis zum Point of no Return und tippe, um den Kegel @50% zu starten. Solo-Praxis.",
      arousal_toggle_off_hint: "Trockenmodus: der Kegel @50% läuft nach Uhr, ohne vorherige Erregungsphase.",
    },
    active: {
      paused: "Pausiert",
      tap_ponr: "Bin nahe · Kegel starten",
      arousal_hint: "Steigere bis zum PONR. Tippe, wenn du nahe bist.",
      arousal_sub: "Dein Körper gibt das Tempo vor. Je früher du tippst, desto früher der Kegel.",
      pause_h: "Denk dran",
      pause_no_glutes: "Spanne weder Gesäß, Oberschenkel noch Bauch an.",
      pause_no_breath: "Beim Anspannen ausatmen. Kein Valsalva.",
      pause_release: "Zwischen den Wiederholungen vollständig entspannen.",
      pause_tip_valsalva: "· Kein Valsalva (nicht nach unten drücken)",
      pause_tip_no_glutes: "· Weder Gesäß noch Oberschenkel anspannen",
      pause_tip_breath: "· Beim Anspannen ausatmen · Beim Loslassen einatmen",
      resume: "Fortsetzen",
      skip_exercise: "Übung überspringen",
      exit: "Beenden",
      exit_confirm: "Sitzung verlassen?",
      eyes_closed: "Augen-zu-Modus",
      eyes_closed_exit: "Augen-zu-Modus verlassen",
      eyes_closed_short: "Blindmodus verlassen",
      paused_tap_resume: "Pausiert · tippe zum Fortsetzen",
      rep_short: "Wdh",
      rep_of: "Wdh {n} von {total}",
      reverse_inserted: "eingeschoben",
      reverse_label: "Reverse Kegel",
      intensity_push: "Druck",
      intensity_aria: "Empfohlene Intensität",
      intensity_caption: "Anspannungsprozent des Muskels",
      aria_back: "Zurück",
      aria_pause: "Pause",
      aria_skip: "Überspringen",
      session_complete: "Sitzung abgeschlossen!",
      summary_title: "Zusammenfassung",
      summary_back: "Zurück zur Startseite",
      summary_again: "Routine wiederholen",
      summary_repetitions: "Wiederholungen",
      summary_exercises: "Übungen",
      summary_duration: "Dauer",
      summary_achievement: "Erfolg",
      summary_streak_plus: "+1 Tag",
      summary_motivation: "Beständigkeit schlägt Volumen. Halte morgen die Serie.",
      summary_save_close: "Speichern und schließen",
    },
    phase: {
      ready: "Bereit", inhale: "Einatmen", exhale: "Ausatmen",
      contract: "Anspannen", hold: "Halten", release: "Loslassen",
      rest: "Ruhe", reverse: "Sanft drücken", peak: "Spitze",
      plateau: "Plateau", "knack-trigger": "Husten ohne loszulassen", "knack-hold": "Halten ohne husten",
      arousal: "Bis zum PONR steigern",
    },
    engine: {
      push_gently_down: "Sanft nach unten drücken",
      relax_full: "Vollständig entspannen",
      release_slow: "Langsam loslassen",
      descend_slow: "Langsam absenken",
      ladder_step: "Stufe {n}",
      ladder_hold: "Stufe {n} · {sec}s",
      elevator_floor: "Etage {n} · {pct}%",
      elevator_up: "Aufwärts",
      elevator_peak: "Spitze · halten",
      elevator_down: "Abwärts · {pct}%",
      elevator_pause: "Pause",
      elevator_release_full: "Vollständig loslassen",
      wave_front: "Vorderer Ring",
      wave_back: "Hinterer Ring",
      wave_front_short: "Vorne",
      wave_back_short: "Hinten",
      knack_ready: "Bereit zum Antizipieren",
      knack_squeeze: "Anspannen!",
      knack_cough: "{sec}s husten ohne loszulassen",
      knack_hold: "{sec}s halten ohne husten",
      recover: "Erholen",
      squeeze_pct: "Bei {pct}% anspannen",
      edge_hold: "Edge · {sec}s bei {pct}%",
      edge_squeeze: "Fest anspannen · kurze Bremse",
      flick_burst: "Schnelle Flicks · {sec}s",
      flick_after: "Flicker · {sec}s Erregung halten",
      arousal_cue: "Steigere bis zum PONR. Tippe, wenn du nahe bist. Stimuliere dich selbst oder mit einem Vibrator oder Sextoy bis 1 Punkt vor dem Höhepunkt.",
    },
    stats: {
      title: "Fortschritt",
      subtitle: "Deine Entwicklung",
      aria_tests: "Tests",
      tab_activity: "Aktivität", tab_strength: "Kraft", tab_sexual: "Sexuelle Gesundheit",
      no_tests_h: "Noch keine Tests",
      no_tests_p: "Miss deine aktuelle Kraft in unter einer Minute. Hilft dir, echten Fortschritt zu sehen.",
      take_test: "Test machen",
      last_7d: "Letzte 7 Tage",
      history: "Verlauf",
      streak_current: "Aktuelle Serie",
      reps_per_day_h: "WIEDERHOLUNGEN PRO TAG",
      total_reps: "Wdh. gesamt",
      average: "Durchschnitt",
      empty_history: "Du hast noch keine Sitzung abgeschlossen.",
      hold_evolution: "Max-Hold-Verlauf",
      flicks_evolution: "Flicks/10s-Verlauf",
      ielt_log: "IELT eintragen",
      ehs_log: "EHS eintragen",
      cono_log: "Kegelgewicht eintragen",
      ielt_title: "Ejakulationslatenz",
      ehs_title: "Erektionshärte",
      cono_title: "Gehaltener Kegel",
      ielt_record_h: "Ejakulationslatenz (IELT)",
      ehs_record_h: "Erektionshärte (EHS)",
      cono_record_h: "Haltbares Kegel-Gewicht",
      ielt_subtitle: "Intravaginale Ejakulationslatenz in Sekunden. Nach echtem Geschlechtsverkehr.",
      ehs_subtitle: "Erection Hardness Score. 1=Schwellung · 2=hart, nicht penetrierbar · 3=penetrierbar · 4=maximale Steifheit.",
      cono_subtitle: "Maximales Vaginalkegel-Gewicht, das du beim 15-min-Gehen halten kannst.",
      record_weight: "Gewicht eintragen",
      latest_record: "letzter Eintrag",
      latest_short: "zuletzt",
      no_data: "Noch keine Daten",
      test_history: "Testverlauf",
      latest: "Neuester",
      new_test: "Neuer Test",
    },
    profile: {
      header: "Profil",
      edit: "Bearbeiten",
      audience: "Zielgruppe", level: "Niveau", track: "Track", goals: "Ziele",
      language: "Sprache",
      preferences: "Einstellungen",
      sound: "Ton", haptic: "Haptische Vibration", volume: "Lautstärke",
      tests_row: "Krafttest",
      take_test_now: "Jetzt Test machen",
      last_test: "Letzter Test",
      days_ago: "vor {n} Tagen",
      design: "Design",
      design_sub: "Theme und Akzentfarbe",
      open_tweaks: "Tweaks öffnen",
      reset: "Onboarding zurücksetzen",
      reset_confirm: "Zurücksetzen? Du verlierst Niveau und Eingangstest.",
      edit_title: "Profil bearbeiten",
      save: "Speichern",
    },
    glossary: {
      title: "Glossar",
      header: "Glossar · {name}",
    },
    create: {
      title: "Neue Routine",
      name: "Name",
      name_ph: "z.B. Meine Morgenroutine",
      track: "Track",
      level: "Niveau",
      exercises: "Übungen",
      reps: "Wdh",
      min_short: "~ Min",
      save: "Routine speichern",
      need_name: "Gib deiner Routine einen Namen",
      need_exercises: "Füge mindestens eine Übung hinzu",
      type_label: "Typ",
      hold_sec: "Halten (s)",
      rest_sec: "Pause (s)",
      description_default: "Eigene Routine.",
      default_ex_name: "Kontraktion",
      default_ex_instruction: "Anspannen und kontrolliert loslassen.",
      default_new_ex: "Neue Übung",
      btn_holds: "Holds", btn_flicks: "Flicks", btn_ladder: "Leiter",
      btn_elevator: "Elevator", btn_knack: "Knack", btn_edge: "Edge", btn_edge_no_hold: "Edge ohne Halten", btn_reverse: "Reverse",
    },
    goals: {
      strength: "Allgemeine Kraft",
      erection: "Erektion verbessern",
      ielt: "Länger durchhalten (Ejakulationskontrolle)",
      edging: "Fortgeschrittene sexuelle Kontrolle / Edging",
      incontinence: "Inkontinenz / Tröpfeln",
      postpartum: "Postpartum-Erholung",
      orgasmic: "Weibliche sexuelle Funktion (Orgasmus, Pompoir)",
    },
    tracks: {
      "general-strength": { name: "Allgemeine Kraft", blurb: "Grundton. Balance langsame Fasern (Ausdauer) + schnelle (Reflex)." },
      "male-sexual": { name: "Männliche sexuelle Gesundheit", blurb: "Erektion, Ausdauer, Ejakulationskontrolle und Edging. Basiert auf MTCK + PRM." },
      "incontinence-knack": { name: "Kontinenz · The Knack", blurb: "Antizipationsreflex vor Husten/Niesen. 8× symptomatische Heilung vs Kontrolle." },
      "female-postpartum-sexual": { name: "Postpartum und sexuelle Funktion", blurb: "Reaktivierung, Vaginalkegel, Pompoir-Wellen und obligatorische Reverse Kegels." },
    },
  },

  // ============================================================
  // FRANÇAIS
  // ============================================================
  fr: {
    locale_name: "Français",
    common: {
      back: "Retour", continue: "Continuer", next: "Suivant", cancel: "Annuler",
      save: "Enregistrer", close: "Fermer", ok: "OK", yes: "Oui", no: "Non", skip: "Passer",
      start: "Commencer", repeat: "Répéter", pause: "Pause", resume: "Reprendre",
      stop: "Stop", retry: "Réessayer", finish: "Terminer",
      beginner: "Débutant", intermediate: "Intermédiaire", advanced: "Avancé",
      male: "Homme", female: "Femme", all: "Les deux",
      loading: "Chargement…", error: "Erreur",
      seconds_short: "s", minutes_short: "min", reps: "rép",
      day_rest: "Repos", today: "Aujourd'hui", yesterday: "Hier",
      days_ago: "il y a {n} jours",
      weekday_mon: "Lundi", weekday_tue: "Mardi", weekday_wed: "Mercredi",
      weekday_thu: "Jeudi", weekday_fri: "Vendredi", weekday_sat: "Samedi", weekday_sun: "Dimanche",
    },
    nav: { home: "Accueil", routines: "Routines", progress: "Progrès", profile: "Profil" },
    onboarding: {
      lang_eyebrow: "Langue / Language",
      lang_title: "Choisis ta langue",
      lang_desc: "Tu peux la changer plus tard depuis ton profil.",
      welcome: "Bienvenue",
      audience_title: "Pour qui sont les routines ?",
      audience_desc: "Nous adaptons l'anatomie et les objectifs. Pas de données personnelles.",
      step2: "Étape 2 sur 4",
      step3: "Étape 3 sur 4",
      step4: "Étape 4 sur 4 · Avant de commencer",
      goal_title: "Que veux-tu améliorer ?",
      goal_desc: "Choisis ton objectif principal. Nous adapterons ton plan à l'évidence clinique.",
      test_title_guide: "Trouve ton plancher pelvien",
      test_title_running: "Mesure ta force actuelle",
      test_desc: "Trois mini-tests. Ils déterminent ton niveau exact et te font voir ton vrai progrès dans le temps.",
      guide_intro: "Avant le test, assure-toi de savoir quel muscle serrer. C'est plus simple qu'il n'y paraît.",
      guide_what_h: "Qu'est-ce que le plancher pelvien ?",
      guide_what_female: "Un hamac musculaire qui soutient vessie, utérus et intestin. Faire un Kegel = fermer et soulever volontairement les muscles autour du vagin et de l'anus.",
      guide_what_male: "Une couche musculaire du périnée qui soutient les organes pelviens. Faire un Kegel = fermer l'anus et soulever la base du pénis.",
      guide_what_neutral: "Un hamac musculaire entre le pubis et le coccyx soutenant les organes pelviens. Faire un Kegel = le fermer et le soulever volontairement.",
      guide_locate_h: "Comment le localiser",
      guide_locate_female_p1: "Imagine que tu **retiens l'envie d'uriner** et en même temps **un gaz**. Cette contraction interne —fermer + soulever— c'est ton plancher pelvien.",
      guide_locate_female_tip: "💡 **Vérification tactile :** insère un doigt dans le vagin et serre. Tu dois sentir une **fermeture douce autour du doigt**, pas une poussée vers l'extérieur.",
      guide_locate_male_p1: "Imagine que tu **coupes le jet en urinant** et en même temps **retiens un gaz**. Cette contraction est ton plancher pelvien.",
      guide_locate_male_tip: "💡 **Vérification visuelle :** face au miroir, en contractant correctement **la base du pénis recule légèrement et les testicules remontent**. C'est le bon repère.",
      guide_locate_neutral: "Imagine retenir l'envie d'uriner et un gaz en même temps. Cette contraction interne —fermer et soulever— c'est le plancher pelvien.",
      guide_reverse_h: "Kegel inverse (relâchement)",
      guide_reverse_p: "Apprendre à **relâcher** compte autant que serrer. Le Kegel inverse est le mouvement opposé —ouvrir et pousser très doucement vers le bas— et prévient l'**hypertonie** : tension chronique qui provoque douleur, dysfonction et bloque le progrès.",
      guide_reverse_female_p1: "Imagine **ouvrir légèrement le vagin et l'anus** vers l'extérieur, comme laisser sortir un gaz doux ou amorcer une très légère poussée. Mouvement minimal, sans Valsalva ni apnée.",
      guide_reverse_female_tip: "💡 **Vérification tactile :** avec un doigt dans le vagin, en reverse tu sens une **ouverture et descente douces**, pas une fermeture.",
      guide_reverse_male_p1: "Imagine **laisser sortir un gaz doux** sans effort abdominal. Le périnée s'élargit et la base du pénis **descend légèrement**.",
      guide_reverse_male_tip: "💡 **Vérification visuelle :** bien fait **la base du pénis descend et les testicules ne montent PAS** —l'inverse d'un Kegel.",
      guide_reverse_neutral: "Ouvre et pousse très doucement vers le bas, comme laisser sortir un gaz. Inverse du Kegel, sans Valsalva.",
      guide_errors_h: "Erreurs fréquentes",
      guide_err_glutes: "Serrer fessiers, cuisses ou abdomen.",
      guide_err_breath: "Bloquer la respiration ou pousser vers le bas (Valsalva).",
      guide_err_pee: "Le faire pendant la miction réelle (peut causer des infections).",
      guide_ok_close: "Fermer + soulever en interne, en respirant normalement.",
      guide_ok_pos: "Mieux assis, allongé ou debout détendu pour commencer.",
      guide_practice_h: "Pratique avant le test",
      guide_practice_p: "Fais **3 contractions douces de 2 secondes** avec 4 secondes de repos entre chacune. Si tu sens la fermeture interne et rien d'autre ne bouge, tu es prêt.",
      guide_ready: "Compris, commencer le test",
      skip_test: "Passer le test (assigne débutant)",
      results: "Résultats",
      max_hold: "Hold max",
      flicks_per_10s: "Flicks/10s",
      mvc_short: "MVC",
      before_start_h: "Avant de commencer",
      before_no_glutes: "Ne serre pas fessiers ni cuisses.",
      before_exhale: "Expire en contractant.",
      before_release: "Relâcher est aussi important que serrer.",
      before_rest: "Jour de repos hebdomadaire obligatoire.",
      level_suggested_hint: "Suggéré par ton test. Tu peux le changer si tu veux aller plus lentement ou si tu as déjà de l'expérience.",
      level_chosen_hint: "Tu as choisi {chosen} (suggéré : {suggested}).",
    },
    test: {
      pill_hold: "1 / 3 · Tiens",
      pill_flicks: "2 / 3 · Flicks",
      pill_mvc: "3 / 3 · Sensation",
      hold_h: "Serre et tiens",
      hold_desc: "Serre aussi fort que possible. Relâche quand tu commences à trembler ou perdre la qualité.",
      release: "Relâché",
      flicks_h: "Flicks en 10 secondes",
      flicks_desc: "Tape le bouton à chaque fois que tu serres et relâches complètement. Compte uniquement les flicks propres.",
      flicks_tap: "Tape ici à chaque flick",
      flicks_remaining: "{s}s restantes",
      flicks_done: "Temps écoulé",
      mvc_h: "À quel point ressens-tu la contraction ?",
      mvc_desc: "1 = presque rien, 10 = force maximale.",
      save_results: "Enregistrer les résultats",
      next_flicks: "Suivant : flicks",
      next: "Suivant",
      title: "Test de force",
      title_done: "Test terminé",
      intro_title: "Mesure ta force actuelle",
      intro_desc: "Trois mini-tests en moins d'une minute. Ils déterminent ton niveau correct et te font voir ton vrai progrès.",
      intro_li1: "**Tiens le plus longtemps possible** — on mesure la durée de la contraction.",
      intro_li2: "**Flicks en 10 secondes** — combien de pulsations complètes tu fais.",
      intro_li3: "**Sensation de force** — échelle subjective 1-10.",
      intro_start: "Commencer le test",
      done_back: "Retour à l'accueil",
      level_suggested: "Niveau suggéré",
      mvc_subjective: "MVC subjectif",
      max_hold: "Tenue max",
      flicks_per_10s: "Flicks/10s",
      mvc_short: "MVC",
    },
    home: {
      greeting: "Salut",
      rest_day_eyebrow: "Jour de repos",
      rest_day_title: "Ton plancher pelvien aussi se repose",
      rest_day_desc: "Le repos fait partie du protocole. Sans lui, l'hypertonie apparaît. Reviens demain.",
      view_catalog: "Voir le catalogue",
      streak: "Série",
      sessions: "Sessions",
      this_week: "Cette sem.",
      days: "jours",
      total: "total",
      measure_baseline: "Mesure ta force actuelle",
      retest_monthly: "Re-test mensuel",
      mini_tests_short: "3 mini-tests, < 1 minute",
      recommended: "Recommandées pour ton track",
      view_all: "Voir tout",
      progression_ready_h: "Prêt à monter de niveau !",
      progression_ready_p: "Tes tests dépassent les seuils du niveau suivant.",
      progression_yes: "Passer à {level}",
      progression_later: "Plus tard",
      today_routine: "Routine du jour",
      start_now: "Commencer maintenant",
      last_session: "Dernière séance",
      history_link: "Historique",
      exercises_short: "exercices",
      repetitions: "répétitions",
    },
    catalog: {
      title: "Catalogue",
      header: "Routines",
      available: "{n} disponibles",
      chip_all: "Toutes",
      all_levels: "Tous les niveaux",
      mine_badge: "À moi",
      confirm_delete: "Supprimer la routine ?",
      delete_aria: "Supprimer",
      empty: "Aucune routine avec ce filtre.",
      all_tracks: "Tous les tracks",
      includes_reverse: "Inclut reverse",
      no_results: "Aucune routine pour cette combinaison.",
      create_routine: "Créer une routine",
    },
    detail: {
      header: "Détail",
      duration: "Durée",
      exercises: "Exercices",
      reps: "Rép",
      concepts: "Concepts",
      full_glossary: "Voir le glossaire complet de la routine ({n})",
      start_routine: "Commencer la routine",
      not_found: "Routine introuvable.",
      type_hold: "Hold", type_flick: "Flicks", type_ladder: "Échelle",
      type_elevator: "Elevator", type_wave: "Vague", type_knack: "Knack",
      type_edging: "Edging", type_edge: "Edge sans tenue", type_reverse: "Reverse",
      desc_standard: "{reps} reps · {hold}s tenue{reverse}",
      desc_flick: "{reps} impulsions rapides",
      desc_ladder: "{reps} échelons · {start}-{max}s",
      desc_elevator: "{reps} elevators · 4 étages",
      desc_wave: "{reps} vagues antérieur/postérieur",
      desc_knack: "{reps} contractions anticipatoires",
      desc_edging: "{reps} × {sec}s à ~50%",
      desc_edge: "{reps} squeezes brefs · sans tenue",
      desc_reverse: "{reps} Kegels inversés",
      desc_reverse_suffix: " · reverse tous les {n}",
      arousal_toggle_label: "Le faire avec stimulation",
      arousal_toggle_on_hint: "Cycle Stop-Start : stimule-toi jusqu'au point de non-retour et tape pour démarrer le Kegel @50%. Pratique solo.",
      arousal_toggle_off_hint: "Mode sec : le Kegel @50% s'enchaîne au chrono, sans phase d'excitation préalable.",
    },
    active: {
      paused: "En pause",
      tap_ponr: "Je suis proche · démarrer Kegel",
      arousal_hint: "Monte jusqu'au PONR. Tape quand tu es proche.",
      arousal_sub: "Ton corps donne le rythme. Plus tôt tu tapes, plus tôt le Kegel démarre.",
      pause_h: "Souviens-toi",
      pause_no_glutes: "Ne serre pas fessiers, cuisses ni abdomen.",
      pause_no_breath: "Expire en contractant. Pas de Valsalva.",
      pause_release: "Relâche complètement entre les répétitions.",
      pause_tip_valsalva: "· Pas de Valsalva (ne pousse pas vers le bas)",
      pause_tip_no_glutes: "· Ne serre pas fessiers ni cuisses",
      pause_tip_breath: "· Expire en contractant · Inspire en relâchant",
      resume: "Reprendre",
      skip_exercise: "Passer l'exercice",
      exit: "Quitter",
      exit_confirm: "Quitter la séance ?",
      eyes_closed: "Mode yeux fermés",
      eyes_closed_exit: "Quitter le mode yeux fermés",
      eyes_closed_short: "Quitter mode aveugle",
      paused_tap_resume: "En pause · tape pour reprendre",
      rep_short: "Rép",
      rep_of: "Rép {n} sur {total}",
      reverse_inserted: "intercalée",
      reverse_label: "Kegel inversé",
      intensity_push: "Poussée",
      intensity_aria: "Intensité suggérée",
      intensity_caption: "Pourcentage de serrage du muscle",
      aria_back: "Retour",
      aria_pause: "Pause",
      aria_skip: "Passer",
      session_complete: "Session terminée !",
      summary_title: "Résumé",
      summary_back: "Retour à l'accueil",
      summary_again: "Refaire la routine",
      summary_repetitions: "Répétitions",
      summary_exercises: "Exercices",
      summary_duration: "Durée",
      summary_achievement: "Réussite",
      summary_streak_plus: "+1 jour",
      summary_motivation: "La constance bat le volume. Maintiens la série demain.",
      summary_save_close: "Enregistrer et fermer",
    },
    phase: {
      ready: "Prêt", inhale: "Inspire", exhale: "Expire",
      contract: "Serre", hold: "Tiens", release: "Relâche",
      rest: "Repos", reverse: "Pousse doucement", peak: "Sommet",
      plateau: "Plateau", "knack-trigger": "Tousse sans relâcher", "knack-hold": "Tiens sans tousser",
      arousal: "Monte au PONR",
    },
    engine: {
      push_gently_down: "Pousse doucement vers le bas",
      relax_full: "Relâche complètement",
      release_slow: "Relâche lentement",
      descend_slow: "Descends doucement",
      ladder_step: "Échelon {n}",
      ladder_hold: "Échelon {n} · {sec}s",
      elevator_floor: "Étage {n} · {pct}%",
      elevator_up: "Monte",
      elevator_peak: "Sommet · tiens",
      elevator_down: "Descente · {pct}%",
      elevator_pause: "Pause",
      elevator_release_full: "Relâche total",
      wave_front: "Anneau antérieur",
      wave_back: "Anneau postérieur",
      wave_front_short: "Antérieur",
      wave_back_short: "Postérieur",
      knack_ready: "Prêt à anticiper",
      knack_squeeze: "Serre !",
      knack_cough: "Tousse {sec}s sans relâcher",
      knack_hold: "Tiens {sec}s sans tousser",
      recover: "Récupère",
      squeeze_pct: "Serre à {pct}%",
      edge_hold: "Edge · {sec}s à {pct}%",
      edge_squeeze: "Serre ferme · frein bref",
      flick_burst: "Flicks rapides · {sec}s",
      flick_after: "Flicker · {sec}s maintiens l'excitation",
      arousal_cue: "Monte jusqu'au PONR. Tape quand tu es proche. Stimule-toi seul·e ou avec un vibromasseur ou sex toy jusqu'à 1 point avant l'orgasme.",
    },
    stats: {
      title: "Progrès",
      subtitle: "Ton évolution",
      aria_tests: "Tests",
      tab_activity: "Activité", tab_strength: "Force", tab_sexual: "Santé sexuelle",
      no_tests_h: "Aucun test pour le moment",
      no_tests_p: "Mesure ta force actuelle en moins d'une minute. Aide à voir ton vrai progrès.",
      take_test: "Faire le test",
      last_7d: "7 derniers jours",
      history: "Historique",
      streak_current: "Série actuelle",
      reps_per_day_h: "RÉPÉTITIONS PAR JOUR",
      total_reps: "Total reps",
      average: "Moyenne",
      empty_history: "Tu n'as encore complété aucune séance.",
      hold_evolution: "Évolution hold max",
      flicks_evolution: "Évolution flicks/10s",
      ielt_log: "Enregistrer IELT",
      ehs_log: "Enregistrer EHS",
      cono_log: "Enregistrer poids du cône",
      ielt_title: "Latence éjaculatoire",
      ehs_title: "Dureté de l'érection",
      cono_title: "Cône retenu",
      ielt_record_h: "Latence éjaculatoire (IELT)",
      ehs_record_h: "Dureté érection (EHS)",
      cono_record_h: "Poids de cône retenable",
      ielt_subtitle: "Latence éjaculatoire intravaginale en secondes. Après un rapport réel.",
      ehs_subtitle: "Erection Hardness Score. 1=tumescence · 2=dur mais non pénétrable · 3=pénétrable · 4=rigidité maximale.",
      cono_subtitle: "Poids maximal du cône vaginal retenu pendant 15 min de marche.",
      record_weight: "Enregistrer poids",
      latest_record: "dernier enregistrement",
      latest_short: "dernier",
      no_data: "Aucune donnée",
      test_history: "Historique des tests",
      latest: "Dernier",
      new_test: "Nouveau test",
    },
    profile: {
      header: "Profil",
      edit: "Modifier",
      audience: "Public", level: "Niveau", track: "Track", goals: "Objectifs",
      language: "Langue",
      preferences: "Préférences",
      sound: "Son", haptic: "Vibration haptique", volume: "Volume",
      tests_row: "Test de force",
      take_test_now: "Faire le test",
      last_test: "Dernier test",
      days_ago: "il y a {n} jours",
      design: "Design",
      design_sub: "Thème et couleur d'accent",
      open_tweaks: "Ouvrir tweaks",
      reset: "Réinitialiser l'onboarding",
      reset_confirm: "Réinitialiser ? Tu perdras niveau et test initial.",
      edit_title: "Modifier le profil",
      save: "Enregistrer",
    },
    glossary: {
      title: "Glossaire",
      header: "Glossaire · {name}",
    },
    create: {
      type_label: "Type",
      hold_sec: "Hold (s)",
      rest_sec: "Rest (s)",
      description_default: "Routine personnalisée.",
      default_ex_name: "Contraction",
      default_ex_instruction: "Contracte et relâche avec contrôle.",
      default_new_ex: "Nouvel exercice",
      btn_holds: "Holds", btn_flicks: "Flicks", btn_ladder: "Échelle",
      btn_elevator: "Elevator", btn_knack: "Knack", btn_edge: "Edge", btn_edge_no_hold: "Edge sans tenue", btn_reverse: "Reverse",
      title: "Nouvelle routine",
      name: "Nom",
      name_ph: "ex. Ma routine du matin",
      track: "Track",
      level: "Niveau",
      exercises: "Exercices",
      reps: "Rép",
      min_short: "~ Min",
      save: "Enregistrer la routine",
      need_name: "Donne un nom à ta routine",
      need_exercises: "Ajoute au moins un exercice",
    },
    goals: {
      strength: "Force générale",
      erection: "Améliorer l'érection",
      ielt: "Durer plus longtemps (contrôle éjaculatoire)",
      edging: "Contrôle sexuel avancé / edging",
      incontinence: "Incontinence / fuites",
      postpartum: "Récupération post-partum",
      orgasmic: "Fonction sexuelle féminine (orgasme, Pompoir)",
    },
    tracks: {
      "general-strength": { name: "Force générale", blurb: "Tonus de base. Équilibre fibres lentes (endurance) + rapides (réflexe)." },
      "male-sexual": { name: "Santé sexuelle masculine", blurb: "Érection, endurance, contrôle éjaculatoire et edging. Basé sur MTCK + PRM." },
      "incontinence-knack": { name: "Continence · The Knack", blurb: "Réflexe anticipatoire avant tousser/éternuer. 8× guérison symptomatique vs contrôle." },
      "female-postpartum-sexual": { name: "Post-partum et fonction sexuelle", blurb: "Réactivation, cônes vaginaux, vagues Pompoir et reverse Kegels obligatoires." },
    },
  },
};

// Estado actual del idioma
let _currentLocale = "es";

// Detección automática del idioma del navegador
function detectBrowserLocale() {
  const supported = ["es", "en", "it", "de", "fr"];
  const navLang = (navigator.language || navigator.userLanguage || "es").toLowerCase().slice(0, 2);
  return supported.includes(navLang) ? navLang : "es";
}

function setLocale(loc) {
  if (LOCALES[loc]) {
    _currentLocale = loc;
    try { document.documentElement.lang = loc; } catch (e) {}
  }
}

function getLocale() {
  return _currentLocale;
}

function getSupportedLocales() {
  return Object.keys(LOCALES).map((id) => ({ id, name: LOCALES[id].locale_name }));
}

function t(path, params) {
  const parts = String(path).split(".");
  let v = LOCALES[_currentLocale];
  for (const p of parts) {
    if (v && typeof v === "object" && p in v) v = v[p];
    else { v = undefined; break; }
  }
  if (typeof v !== "string") {
    // fallback al español
    let fb = LOCALES.es;
    for (const p of parts) {
      if (fb && typeof fb === "object" && p in fb) fb = fb[p];
      else { fb = undefined; break; }
    }
    v = typeof fb === "string" ? fb : path;
  }
  if (params && typeof v === "string") {
    Object.entries(params).forEach(([k, val]) => {
      v = v.split(`{${k}}`).join(val);
    });
  }
  return v;
}

// Permite obtener nodo no-string del árbol (por ej. tracks.general-strength)
function tNode(path) {
  const parts = String(path).split(".");
  let v = LOCALES[_currentLocale];
  for (const p of parts) {
    if (v && typeof v === "object" && p in v) v = v[p];
    else { v = undefined; break; }
  }
  if (v == null) {
    let fb = LOCALES.es;
    for (const p of parts) {
      if (fb && typeof fb === "object" && p in fb) fb = fb[p];
      else { fb = undefined; break; }
    }
    return fb;
  }
  return v;
}

// Renderiza texto con **negritas** simples como spans <b>.
// Útil porque algunas claves contienen markdown ligero.
function tBold(s) {
  if (!s || s.indexOf("**") === -1) return s;
  const parts = s.split("**");
  return parts.map((seg, i) =>
    i % 2 === 1 ? React.createElement("b", { key: i }, seg) : seg
  );
}

// Resuelve un campo localizado de data.jsx: acepta string crudo o
// objeto { es, en, it, de, fr } y devuelve la versión del locale actual
// con fallback a español, luego inglés, y finalmente la primera disponible.
function pick(field) {
  if (field == null) return "";
  if (typeof field === "string") return field;
  if (typeof field !== "object") return String(field);
  if (field[_currentLocale]) return field[_currentLocale];
  if (field.es) return field.es;
  if (field.en) return field.en;
  const first = Object.values(field).find((v) => typeof v === "string");
  return first || "";
}

// Inicializa con detección automática (una sola vez al cargar el script).
setLocale(detectBrowserLocale());

window.LOCALES = LOCALES;
window.t = t;
window.tNode = tNode;
window.tBold = tBold;
window.pick = pick;
window.setLocale = setLocale;
window.getLocale = getLocale;
window.getSupportedLocales = getSupportedLocales;
window.detectBrowserLocale = detectBrowserLocale;
