// ─── VYB i18n ─────────────────────────────────────────────────
// Lightweight local translation system. No external libs, no AI.
// Usage:
//   t('nav.habits')                  → string in current language
//   const t = useT()                 → re-renders on language change
//   setLang('es')                    → persists + broadcasts change
const LANG_KEY = 'vyb-language';
const SUPPORTED = ['en','es'];

const TRANSLATIONS = {
  en: {
    common: {
      edit: 'Edit', done: 'Done', cancel: 'Cancel', save: 'Save',
      delete: 'Delete', archive: 'Archive', back: 'Back', close: 'Close',
      add: 'Add', remove: 'Remove', confirm: 'Confirm',
      yes: 'Yes', no: 'No', open: 'Open',
      all: 'All', none: 'None',
    },
    greeting: {
      morning: 'Good morning', afternoon: 'Good afternoon',
      evening: 'Good evening', night: 'Good night', restWell: 'Rest well',
    },
    nav: {
      overview: 'Overview',
      habits:   'Habits',
      tasks:    'Tasks',
      ideas:    'Ideas',
      reading:  'Reading',
      momentum: 'Momentum',
      backToOverview: 'Back to Overview',
      viewProfile: 'View Profile',
      settings: 'Settings',
    },
    section: {
      overview: 'Overview',
      habits:   'Habits',
      tasks:    'Tasks',
      ideas:    'Ideas',
      reading:  'Reading',
      momentum: 'Momentum',
    },
    home: {
      title: 'What do you want to focus on today?',
      subtitle: 'Choose where to begin.',
      dashboardCta: 'Go to Dashboard',
      actions: {
        habits:  'Build habits',
        tasks:   'Handle tasks',
        ideas:   'Brainstorm ideas',
        reading: 'Continue reading',
      },
      actionsShort: {
        habits:  'Habits',
        tasks:   'Tasks',
        ideas:   'Ideas',
        reading: 'Reading',
      },
    },
    auth: {
      welcomeBack:         'Welcome back',
      createAccountKicker: 'Create account',
      createYourReality:   'Create your reality.',
    },
    profile: {
      title:        'Profile & Settings',
      subtitle:     'Personalize your workspace.',
      appearance:   'Appearance',
      appearanceHint:'Choose how VYB looks on this device.',
      themeDark:    'Dark',
      themeLight:   'Light',
      themeSystem:  'System',
      language:     'Language',
      languageHint: 'Choose the language for the app interface.',
      langEn:       'English',
      langEs:       'Español',
      signOut:      'Sign Out',
      email:        'Email',
      memberSince:  'Member since',
      provider:     'Provider',
      developerTools: 'Developer Tools',
    },
    settings: {
      title:    'Settings',
      subtitle: 'Customize your app experience.',
      appearance: 'Appearance',
      language:   'Language',
      socialPrivacy: 'Social privacy',
      socialPrivacyHint: 'Off by default. You decide what (if anything) is ever shared.',
      developer:  'Developer tools',
      developerHint: 'Local utilities for testing and resetting account data.',
    },
    dev: {
      reset:                 'Reset account data',
      chooseWhatToReset:     'Choose what to reset',
      resetSelected:         'Reset selected data',
      typeResetToConfirm:    'Type RESET to confirm',
      selectedReset:         'Selected data reset.',
      selectAtLeastOne:      'Select at least one area to reset.',
      categoryHabits:        'Habits',
      categoryTasks:         'Tasks',
      categoryIdeas:         'Ideas',
      categoryReading:       'Reading',
      categoryMood:          'Mood',
      categoryFocus:         'Focus',
      categoryWorkouts:      'Workouts',
      categoryNotes:         'Notes',
      categoryLocal:         'Local preferences',
      localDesc:             'UI-only state (sidebar, flags). Does not touch the database.',
      selectAllOn:           '✓ All app data selected',
      selectAllOff:          'Select all (All app data)',
      resetting:             'Resetting…',
      resetComplete:         'Reset complete',
    },
    overview: {
      kicker:        'Dashboard',
      thisWeek:      'This Week',
      weeklyOverview:'Weekly Overview',
      todayMomentum: "Today's Momentum",
      activity:      'Activity',
      activityToday: 'Activity Today',
      systemInProgress: "Today's system in progress",
      systemComplete:   "Today's system complete",
      currentMission:'Current Mission',
      nextAction:    'Next Action',
      completeNextHabit: 'Complete your next habit',
      goToHabits:    'Go to Habits',
      goToTasks:     'Go to Tasks',
      goToIdeas:     'Go to Ideas',
      goToReading:   'Go to Reading',
      openMomentum:  'Open Momentum',
      openHabits:    'Open Habits',
      openTasks:     'Open Tasks',
      openReading:   'Open Reading',
      ofHabitsComplete: 'of {total} habits complete',
      habitsToday:   'Habits today',
      tasksDone:     'Tasks done',
      workouts:      'Workouts',
      mood:          'Mood',
      focus:         'Focus',
      topPriorities: 'Top Priorities',
      noPriorities:  'No priorities yet',
      addUrgent:     'Add urgent tasks to surface them here.',
      urgent:        'Urgent',
      checkin:       'Check-in',
      moodEnergy:    'Mood & Energy',
      howAreYou:     'How are you today?',
      today:         'Today',
      dailyHabits:   'Daily Habits',
      smallActions:  'Small actions today.',
      doneOfTotal:   '{done} of {total} done',
      noHabitsYet:   'No habits yet.',
      buildDailySys: 'Build your daily system in Habits.',
      training:      'Training',
      sessions:      'sessions',
      restDay:       'Rest day',
      currentRead:   'Current Read',
      reading:       'Reading',
      keepPageMoving:'Keep the page moving.',
      noBook:        'No current book.',
      startReading:  'Start reading from your library.',
      untitled:      'Untitled',
      progress:      'Progress',
      pageOf:        'p. {x} of {y}',
      continueReading:'Continue reading',
      latestEntry:   'Latest entry',
      capture:       'Capture',
      contentIdeas:  'Content Ideas',
      noIdeasYet:    'No ideas yet',
      captureSlip:   'Capture what comes to mind before it slips away.',
      tasks:         'Tasks',
      done:          'done',
      noTasksYet:    'No tasks yet',
      openTasksHint: 'Open Tasks to capture what needs doing this week.',
      noneDash:      '— none',
      reflectionsReminders:'Reflections & Reminders',
      quickNotes:    'Quick Notes',
      notesPlaceholder:'Thoughts, reminders, reflections...',
      momentum:      'Momentum',
      streak:        'Streak',
      currentStreak: 'Current Streak',
      day:           'day', days: 'days',
      streakHint:    "Days you completed what was scheduled. Rest days don't break your rhythm.",
      week:          'Week',
      weeklyMomentum:'Weekly Momentum',
      completeDays:  'complete days',
      noRhythm:      'No rhythm yet. Build your daily system in Habits.',
      perfectWeek:   'Perfect week. Momentum locked.',
      smallWins:     'Small wins. Real momentum.',
      momentumLocked:'Momentum Locked',
      almostThere:   'Almost there.',
      keepGoing:     'Keep going.',
      startTheDay:   'Start the day.',
      dailySysComplete:'Daily system complete',
      habitsLower:   'habits',
      comeBackTomorrow:'Come back tomorrow.',
      todayIncluded: 'Today included.',
      todayInProgress:'Today in progress.',
      complete:      'complete', incomplete: 'incomplete',
      // Overview v3 — quick actions + timeline
      qaGoToHabits:        'Go to Habits',
      qaAddTask:           'Add Task',
      qaCaptureIdea:       'Capture Idea',
      qaOpenReading:       'Open Reading',
      qaShortHabits:       'Habits',
      qaShortTask:         'Task',
      qaShortIdea:         'Idea',
      qaShortRead:         'Read',
      qaOpenMomentum:      'Open Momentum',
      todayHabits:         'Today Habits',
      todayHabitsSub:      'Track today inside your week.',
      habitColLabel:       'Habit',
      streakColLabel:      'Streak',
      viewAllHabits:       'View all habits',
      noPlannedHabitsToday:'No planned habits today.',
      adjustSystemHint:    'Go to Habits to adjust your system.',
      noHabitsYet:         'No habits yet.',
      startBuildingSystem: 'Start building your system.',
      noHabitsToday:       'No habits planned for today.',
      nextHabitsHint:      'Your next scheduled habits will appear here.',
      areaOther:           'Other',
      viewAll:             'View all',
      // Quick Notes (multi-note Overview widget — separate from legacy notes string)
      quickNotesPlaceholder:'Reflection, reminder, or quick thought...',
      quickNotesHint:      'Enter to save · Shift+Enter for new line',
      addNote:             'Add Note',
      noQuickNotes:        'No quick notes yet.',
      deleteNote:          'Delete note',
      customize: {
        button:       'Customize Dashboard',
        title:        'Customize Dashboard',
        subtitle:     'Choose what appears in your Overview.',
        sectionActive:'Currently on your dashboard',
        sectionAvail: 'Available widgets',
        show:         'Show',
        hide:         'Hide',
        visible:      'Visible',
        hidden:       'Hidden',
        showWidget:   'Show widget',
        hideWidget:   'Hide widget',
        save:         'Save changes',
        cancel:       'Cancel',
        reset:        'Reset to default',
        widgets: {
          dailyCatchup:  { title: 'Daily Catch-up',  description: 'Review yesterday and prepare today.' },
          todayHabits:   { title: 'Today Habits',    description: 'Check your planned habits from the dashboard.' },
          topPriorities: { title: 'Top Priorities',  description: 'See your most important tasks.' },
          deepWork:      { title: 'Deep Work',       description: 'Start a focus timer.' },
          quickNotes:    { title: 'Quick Notes',     description: 'Capture reflections and reminders.' },
          contentIdeas:  { title: 'Content Ideas',   description: 'Review your latest content ideas.' },
          todayMomentum: { title: 'Today Momentum',  description: 'See a compact progress summary.' },
          currentReading:{ title: 'Current Reading', description: 'See your current book and reading progress.' },
          moodEnergy:    { title: 'Mood & Energy',   description: 'Track your mood and energy.' },
        },
      },
      catchup: {
        title:        'Daily Catch-up',
        subtitle:     'Review yesterday. Prepare today.',
        cta:          'Start Catch-up',
        doneTitle:    'Daily Catch-up complete',
        doneSubtitle: 'Today is ready.',
        ctaAgain:     'Review again',
        step1Title:   'How did yesterday go?',
        step2Title:   'Complete missing info',
        step3Title:   'Carry over tasks',
        step4Title:   'What should move today?',
        step5Title:   'Today is ready',
        habitsCompleted: 'Habits completed',
        tasksCompleted:  'Tasks completed',
        ideasCaptured:   'Ideas captured',
        moodEnergy:      'Mood & energy',
        readingSession:  'Reading',
        noDataYet:       'No data yet',
        noUnfinished:    'No unfinished tasks',
        keepForToday:    'Keep for today',
        moveToLater:     'Move to Later',
        markDone:        'Mark done',
        skip:            'Skip',
        back:            'Back',
        next:            'Next',
        finish:          'Finish',
        goToOverview:    'Go to Overview',
        openTasks:       'Open Tasks',
        goToHabits:      'Go to Habits',
        startUrgent:     'Start with your top urgent task.',
        startTop:        'Start with your top priority.',
        startWith:       'Start with:',
        readOnePage:     'Read one page.',
        chooseOneMove:   'Choose one small move.',
        todaysFocus:     'Today\u2019s focus',
        todayLoadLabel:  'Today\u2019s load',
        plannedHabits:   'Habits today',
        promptMoodMissing:'How was your energy yesterday?',
        promptReadAsk:    'Did you read yesterday?',
        promptHabitsNote: 'Want to leave a quick note about yesterday?',
        notePlaceholder:  'A line about yesterday\u2026',
        yes:             'Yes',
        no:              'No',
        save:            'Save',
        stepOf:          'Step {n} of {total}',
      },
    },
    focus: {
      deepWork:      'Deep Work',
      setTimer:      'Set a timer. Protect your attention.',
      mute:          'Mute completion chime',
      unmute:        'Unmute completion chime',
      minBlock:      'min block',
      min:           'min',
      start:         'Start Focus',
      pause:         'Pause',
      end:           'End',
      resume:        'Resume',
      reset:         'Reset',
      newSession:    'New Session',
      idle:          'Choose your focus block.',
      running:       'Stay with it.',
      paused:        'Paused. Ready when you are.',
      complete:      'Focus session complete.',
    },
    mood: {
      kicker:        'Daily Check-in',
      title:         'Mood & Energy',
      subtitle:      'A record of how you actually feel — small signal, real over time.',
      mood:          'Mood',
      energyLevel:   'Energy level',
      avgMood:       'Avg Mood',
      avgEnergy:     'Avg Energy',
      acrossDays:    'across {n} day',
      acrossDaysPlural:'across {n} days',
      trend14:       '14-Day Trend',
      energy:        'Energy',
      low:'Low', meh:'Meh', okay:'Okay', good:'Good', high:'High',
    },
    onboarding: {
      welcome:       'Welcome',
      buildLife:     'Build the life\nyou meant to live.',
      personalOS:    'Your personal operating system for habits, workouts, reading, ideas, and the quiet work of becoming.',
      yourName:      'Your name',
      namePlaceholder:'What should we call you?',
      enterBegin:    'Enter · Begin',
      dataLocal:     'Your data is stored locally on this device.',
    },
    tweaks: {
      title:         'Tweaks',
      accentColor:   'Accent Color',
      yourName:      'Your Name',
      yourNamePlaceholder:'Your name',
      signOut:       'Sign Out',
    },
    dictation: {
      listening:     'Listening…',
      dictate:       'Dictate',
      notSupported:  'Dictation not supported',
      stop:          'Stop dictation',
      start:         'Start dictation',
    },
    habits: {
      label:     'Create your reality',
      title:     'Daily Habits',
      subtitle:  'Small actions today. A better version tomorrow.',
      todayProgress:        "Today's Progress",
      todayHelper:          'Complete what matters today.',
      todayHelperDone:      "Today's system complete.",
      percentComplete:      'complete',
      weeklyProgress:       'Weekly Progress',
      checkInsThisWeek_one: 'check-in this week',
      checkInsThisWeek:     'check-ins this week',
      extraTodayTitle:      'Extra today',
      extraTodayHelper:     'Optional habits that count toward your weekly goals.',
      extraTodayEmpty:      'No extra habits available.',
      completedExtras:      'Completed extras',
      completedExtrasHelper:'Extra effort logged. These count toward your weekly goals.',
      extraDone_one:        '+1 extra done',
      extraDone:            '+{n} extras done',
      extraLogged:          'Extra effort logged.',
      extraBadge:           'Extra',
      doneBadge:            'Done',
      formNewHabit:         'New Habit',
      formEditHabit:        'Edit Habit',
      formIntroNew:         'Create a habit and choose when it should happen.',
      formIntroEdit:        'Adjust with intention. Your system works through repetition.',
      formName:             'Name',
      formNamePlaceholder:  'e.g. Read 20 minutes',
      formArea:             'Area',
      formSelectArea:       'Select area',
      formAreaSuggested:    '(suggested)',
      formFrequency:        'Frequency',
      formEveryDay:         'Every day',
      formCustomDays:       'Custom days',
      formHelperDaily:      'Every day is the default. Use custom days for a more realistic system.',
      formHelperCustom:     'Choose realistic days. Momentum will track this habit around your schedule. Rest days don’t count against you.',
      formErrName:          'Add a habit name.',
      formErrArea:          'Choose an area for this habit.',
      formErrDays:          'Pick at least one day.',
      formCreate:           'Create',
      addHabits:            'Add Habits',
    },
    weekday: {
      shortMon:'Mon', shortTue:'Tue', shortWed:'Wed', shortThu:'Thu',
      shortFri:'Fri', shortSat:'Sat', shortSun:'Sun',
    },
    tasks: {
      label:     'This Week',
      title:     'Tasks',
      empty:     'Capture. Sort. Execute.',
      placeholder:'What needs doing?',
      errAddTitle:'Add a task title.',
      errAddProject:'Add a project',
      errAddFailed:'Could not add task. Try again.',
      capturedNeedsDoing:'Capture what needs doing.',
      useComposerBelow:'Use the composer below — keep it small, specific, and true to your priorities.',
      addProjectContext:'Add project / context',
      completedToday:'Completed today',
      undo:'Undo',
      addTask:'Add task',
      nothingHere:'Nothing here.',
      generalProject:'Inbox',
      keepShort:    'Keep tasks short and specific so they\u2019re easier to finish.',
      writeItNowHint:'Write it now. Organize it later.',
      filterAll:    'All',
      viewLabel:    'View',
      ofTotalComplete:'{done} of {total} complete · {open} remaining',
      open:'open',
      projectLabel:'Project',
      priorityLabel:'Priority',
      mobilePlaceholder:'What needs to get done?',
      sheetDone:'Done',
      tapToChange:'Tap to change',
      addProjectShort:'+ Project',
      organizeHelper:'Organize tasks by project or context.',
      noProject:'No project',
      chooseProject:'Choose project',
      choosePriority:'Choose priority',
      createProject:'Create project',
      projectNamePlaceholder:'Project name',
      addProject:'+ Add project',
      newShort:'+ New',
      addAction:'Add',
      cancelAction:'Cancel',
      load: {
        title:'Today\u2019s Load',
        activeTasks:'active tasks',
        empty:        'Empty day',
        light:        'Light day',
        focused:      'Focused day',
        active:       'Active day',
        heavy:        'Heavy day',
        overloaded:   'Overloaded day',
        emptyMsg:     'Add 1\u20133 meaningful tasks to give your day direction.',
        lightMsg:     'Good for recovery or deep focus.',
        focusedMsg:   'Perfect range. Clear and achievable.',
        activeMsg:    'Productive, but protect your focus.',
        heavyMsg:     'Prioritize. Pick your top 3.',
        overloadedMsg:'Move some tasks to another day or backlog.',
        urgent:       'Urgent',
        important:    'Important',
        later:        'Later',
        urgentWarn:   'Too many urgent tasks. Pick the real top 3.',
        urgentWarnHi: 'This is overloaded. Move what can wait.',
        top3Title:    'Top 3 to protect your focus',
      },
      boardWarn: {
        urgent5:      'You have several urgent tasks. Try to keep this list to 5 or fewer.',
        urgent8:      'Urgent is overloaded. Pick the real top 3 and move what can wait.',
        important10:  'Important is getting heavy. Choose what truly moves things forward.',
      },
    },
    ideas: {
      label:     'Capture',
      title:     'Ideas',
      subtitle:  'Catch what crosses your mind. Return to it with a clearer head.',
      placeholder:'Capture an idea…',
      emptyError:'Write an idea first.',
      inbox:'Inbox',
      filterAll:'All',
      filterActive:'Active',
      filterArchived:'Archived',
      noArchived:'No archived ideas',
      noIdeasYet:'No ideas yet',
      captureBelow:'Capture one below — no idea is too small to note.',
      addIdea:'Add idea',
      restore:'Restore',
      convertToTask:'Convert to task',
      convertEditTitle:'Edit task title',
      convertCreate:'Create task',
      convertSuccess:'Task created from idea.',
      convertViewTask:'View task',
      categoryShort:'Category',
      addCategoryShort:'+ Category',
      addCategoryContext:'Add category or context',
      defaultCategories:['Business','Content','Personal','Learning','VYB'],
      addCategory:'+ Add category',
      newCategory:'+ New',
      categoryNamePlaceholder:'Category name',
      composerPlaceholder:'What idea do you want to save?',
      noCategory:'No category',
      presetBusiness:'Business',
      presetContent:'Content',
      presetGeneral:'General',
      presetWebApp:'Web/App',
      presetLearning:'Learning',
      presetPersonal:'Personal',
    },
    overviewMini: {
      habitsTodayTitle:'Habits today',
      habitsTodayCompleted:'{completed} / {total} completed',
      habitsTodayNone:'No habits planned',
      pendingTasksTitle:'Pending tasks',
      pendingTasksOpen:'{count} open',
      pendingTasksOpenShort:'open',
      pendingTasksHelper:'Check your next task.',
    },
    reading: {
      label:     'Personal Library',
      title:     'Reading',
      subtitle:  'A record of what moves you. Progress, insight, and the quiet work of thinking.',
      addBook:   'Add Book',
      startLibrary:'Start your personal library',
      addBookPlaceholder:'Add the book you\'re reading…',
      readingGoals:'Reading Goals',
      editGoals:'Edit Goals',
      thisYear:'This year',
      thisMonth:'This month',
      myLibrary:'My Library',
      tabAll:'All',
      tabReading:'Reading',
      tabFinished:'Finished',
      tabWishlist:'Wishlist',
      currentlyReading:'Currently Reading',
      bookDetail:'Book Detail',
      progress:'Progress',
      doneForToday:'Done for today',
      markFinished:'Mark as finished',
      addEntry:'Add entry',
      saveEntry:'Save entry',
      insight:'Insight',
      quote:'Quote',
      note:'Note',
      bookTitle:'Title',
      author:'Author',
      pages:'Pages',
      coverUrl:'Cover URL (optional)',
      status:'Status',
      currentPage:'Current Page',
      totalPages:'Total Pages',
      pageNotFound:'Page count not found. You can leave this blank.',
      autofilledFrom:'Autofilled from {src}',
      whenFinish:'When did you finish it?',
      optionalToday:'Optional — defaults to today.',
      editBook:'Edit Book',
      addManually:'Add Manually',
      confirmBook:'Confirm Book',
      searchByTitleAuthor:'Search by Title or Author',
      search:'Search',
      noResults:'No results. Try a different query, or add manually.',
      searchUnavailable:'Search unavailable. You can add manually.',
      cantFind:"Can't find it? Add manually",
      cancel:'Cancel',
      chooseDifferent:'Choose a different book',
      backToSearch:'← Back to search',
      coverAttached:'Cover attached',
      noCover:'No cover — placeholder will show.',
      removeCover:'Remove cover',
      delete:'Delete',
      saveBookChanges:'Save Book Changes',
      ofPages:'p. {shown} of {total}',
      minusPage:'-1 page',
      plusPage:'+1 page',
      pageOptional:'Page (optional)',
      entriesCount:'Entries · {n}',
      noEntriesYet:'No entries yet.',
      captureInsightHint:'Capture an insight, quote, or note above.',
      readingDetail:'Reading · Detail',
      close:'Close',
      untitled:'Untitled',
      finishedOn:'Finished {date}',
      updatedOn:'Updated {date}',
      save:'Save',
      yearlyGoalBooks:'Yearly Goal · books',
      monthlyGoalBooks:'Monthly Goal · books',
      libraryCount:'My Library · {n}',
      wishlistCount:'Wishlist · {n}',
      captureIdeasWorth:'Capture the ideas worth keeping.',
      nothingHereYet:'Nothing here yet.',
      addBooksReading:"Add books you're reading or have finished.",
      tryDifferentFilter:'Try a different filter or add a new book.',
      booksToReadLater:'Books to read later.',
      edit:'Edit',
      open:'Open',
      finished:'Finished',
      placeholderQuote:'Paste the quote.',
      placeholderInsight:'A thought worth keeping.',
      placeholderNote:'A note for later.',
      placeholderEntry:'Capture an idea, quote, or note\u2026',
      sessionsToday:'Sessions today',
      noSessionsLogged:'No sessions logged today.',
      deleteSession:'Delete session',
      confirmDeleteSession:'Tap again to delete',
      startReading:'Start Reading',
      saveSession:'Save Session',
      readingInProgress:'Reading session in progress',
      startedAtPage:'Started at page {n}.',
      endPage:'End page',
      cancelSession:'Cancel',
      sessionAnotherBook:'A session is active for another book. Finish or cancel it first.',
      monthLabel:'Month',
      yearLabel:'Year',
      todaysReading:"Today's Reading",
      addTodaysSession:"Add today's session",
      pagesReadToday:'Pages read today',
      pagesReadSuffix:'pages read',
      startPageLabel:'Start page',
      endPageLabel:'End page',
      addAtLeastOnePage:'Add at least 1 page to save a session.',
      continueReading:'Continue Reading',
      dictate:'Dictate',
      listening:'Listening…',
      dictateStop:'Stop dictation',
      dictationUnsupported:"Dictation isn't supported in this browser.",
      dictationPrivacyNote:'Voice is transcribed by your browser. Review before saving.',
      dictationPermissionDenied:'Microphone permission denied.',
      dictationNoSpeech:"No speech detected. Try again.",
      dictationGenericError:'Dictation stopped. Try again.',
      habitCompleteToday:'Perfect. Your reading habit is complete for today.',
      habitExtraToday:'Nice. Reading was added as an extra habit today.',
      sessionSavedSimple:'Reading session saved.',
    },
    momentum: {
      label:     'Progress',
      title:     'Momentum',
      subtitle:  'Measure what matters. Improve what moves.',
      guide: {
        button: 'How it works',
        header: 'How Momentum Works',
        close:  'Close',
        back:   'Back',
        next:   'Next',
        gotIt:  'Got it',
        slides: [
          { eyebrow:'Momentum',    title:'See your progress.',    body:'Momentum shows what you did today, this week, and this month.' },
          { eyebrow:'Today',       title:'Start with today.',     body:'Complete your planned habits and track what moved today.' },
          { eyebrow:'This Week',   title:'Build the week.',       body:'Weekly Progress shows how your habits are filling up day by day.' },
          { eyebrow:'Consistency', title:'See each habit.',       body:'Habit Consistency shows which habits you are keeping up with.' },
          { eyebrow:'Balance',     title:'See your areas.',       body:'Area Balance shows which parts of your life got attention this week.' },
          { eyebrow:'This Month',  title:'See the pattern.',      body:'The Monthly Map lights up the days where you made progress.' },
          { eyebrow:'Aura',        title:'Build Aura.',           body:'Aura grows when your real actions create visible progress.' },
        ],
      },
      whatYouTrack:'"What you track becomes easier to improve."',
      dailyHabits:'Daily Habits',
      habitsCompleteOf:'{done}/{total} habits complete',
      noHabitsYet:'No habits yet',
      noHabitsToday:'No habits planned for today',
      pctOfToday:"{pct}% of today's habits",
      createFewHabits:'Create a few habits to build your daily system.',
      restDoesntBreak:"Rest days don't break your rhythm.",
      createHabits:'Create habits',
      openHabits:'Open Habits',
      currentMission:'Current Mission',
      todaysProgress:"Today's Progress",
      completeTodaysHabits:"Complete today's habits.",
      yourHabitsBuilding:'Your habits are the system building your next version.',
      todaysSystem:"Today's System",
      addHabit:'Add a habit',
      todaysSystemComplete:"Today's system complete.",
      restDayPreserved:'A rest day. Streak is preserved.',
      dailySeal:'Daily Seal',
      todaysSystemInProgress:"Today's system in progress",
      buildSystemToSeal:'Build your daily system in Habits to start sealing days.',
      rhythm:'Rhythm',
      progressBreakdown:'Progress Breakdown',
      whereSystemShowing:'Where the system is showing up.',
      tasks:'Tasks', habits:'Habits', ideas:'Ideas', reading:'Reading', focusLabel:'Focus',
      create:'Create', addTask:'Add task', capture:'Capture', addBook:'Add book', start:'Start', open:'Open',
      proofOfProgress:'Proof of progress',
      proofMessage:'Proof that your system is becoming real.',
      milestoneUnlocked:'Milestone Unlocked',
      builtThroughRepetition:'Built through repetition. Each one is a sign your system is real.',
      filterAll:'All', filterUnlocked:'Unlocked', filterInProgress:'In progress',
      unlocked:'Unlocked', inProgress:'In progress', comingSoon:'Coming soon',
      premiumComingSoon:'Premium · Coming soon',
      aiReflection:'AI Reflection',
      aiHelp:'Soon, VYB will help you read your own signals — patterns, drift, what to adjust.',
      collectingProof:'Your system is collecting proof. AI reflection arrives later.',
      unlockLater:'Unlock later',
      thisWeek:'This week',
      weeklyConsistency:'Weekly consistency',
      dueToday:'due today',
      upcoming:'upcoming',
      missed:'missed',
      weeklyGoalComplete:'weekly goal complete',
      stillRecoverable:'still recoverable',
      allScheduledComplete:'all scheduled days complete',
      frictionSignal:'Friction signal',
      tasksCompleted:'Tasks completed',
      ideasCaptured:'Ideas captured',
      readingToday:'Reading today',
      focusSessions:'Focus sessions',
      yes:'Yes', no:'No',
      nothingLogged:'Nothing logged yet today.',
      tasksIdeasHint:'Tasks, ideas, reading, and focus appear here as you log them.',
      captureIdea:'Capture idea',
      loggedActivity:'Logged activity, not required goals.',
      startFocus:'Start Focus',
      openOverview:'Open Overview',
      goToHabits:'Go to Habits', goToTasks:'Go to Tasks', goToIdeas:'Go to Ideas', goToReading:'Go to Reading',
      howItWorks:'How it works',
      hide:'Hide', show:'Show',
      keyIdeas:'Key ideas',
      example:'Example',
      activityToday:'Activity Today',
      noActivityYet:'No activity yet today.',
      addTaskShort:'Add task',
      captureIdeaShort:'Capture idea',
      openReadingShort:'Open reading',
      yourHabitsBuildSystem:'Your habits build the system.',
      day:'day', days:'days',
      startToday:'Start today',
      streakHintLine:'Days you completed what was planned. Rest days don\u2019t break your rhythm.',
      // Analytics dashboard (Phase 1)
      todayOverview:'Today',
      todayHelp:'A glance at today\u2019s signal.',
      weeklyTrends:'Weekly trends',
      weeklyTrendsHelp:'How your week is moving.',
      momentumTrendChart:'Momentum trend',
      momentumTrendHelp:'Daily habit completion.',
      weeklyActivity:'Weekly activity',
      weeklyActivityHelp:'What you logged this week.',
      areaBalanceTitle:'Area balance',
      areaBalanceHelp:'Where your effort is showing up.',
      habitConsistencyTitle:'Habit consistency',
      readingSignalTitle:'Reading signal',
      readingSignalHelp:'Your reading is showing up.',
      noActiveBook:'No active book.',
      noReadingThisWeek:'No reading sessions logged this week.',
      sessionsThisWeek:'sessions this week',
      sessionThisWeek:'session this week',
      sessionsToday:'today',
      currentBook:'Current book',
      progressLabel:'Progress',
      pages:'pages',
      focus:'Focus',
      sessions:'sessions',
      session:'session',
      extra:'extra',
      noDataYet:'No data yet.',
      nextMove:'Next move',
      viewAll:'View all',
      areaNoData:'Add habits to areas to see balance.',
      consistencyEmpty:'Build habits to track weekly consistency.',
      todayEmpty:'Nothing logged yet today.',
      // Compact stat card titles (Today Overview)
      statHabits:'Habits',
      statTasks:'Tasks',
      statIdeas:'Ideas',
      statReading:'Reading',
      statFocus:'Focus',
      // ── v2 (Momentum redesign) ─────────────────────────────
      pageSubtitle:'Track your progress today, this week, and this month.',
      todayTitle:'Today', todaySubtitle:'Your progress today.',
      weekTitle:'This Week', weekSubtitle:'Your progress this week.',
      monthTitle:'This Month', monthSubtitle:'Your bigger pattern.',
      todayHabitsEyebrow:'Today Habits',
      noPlannedToday:'No planned habits today.',
      statusOpenDay:'Open Day', statusComplete:'Complete', statusInProgress:'In Progress',
      statusNotStarted:'Not Started',
      pageSingular:'page',
      subCompleted:'completed', subCaptured:'captured',
      extras:'extras', extraSingular:'extra', completedBeyondPlan:'completed beyond plan',
      todaySnapshotTitle:'Today Snapshot',
      weeklyProgressEyebrow:'Weekly Progress',
      checkInsThisWeek:'check-ins this week', checkInThisWeek:'check-in this week',
      legendComplete:'Complete', legendPartial:'Partial', legendNone:'None', legendRest:'Rest',
      habitConsistencyTitle:'Habit Consistency',
      habitConsistencySubtitle:'How each habit is filling up this week.',
      noHabitTargetsWeek:'No habit targets this week.',
      areaBalanceTitle:'Area Balance', areaBalanceSubtitle:'Your week by life area.',
      areaEmpty:'Add habits in different areas to see your balance.',
      areaFillHint:'Fill the shape by completing planned habits in each area.',
      monthlyMapTitle:'Monthly Momentum Map',
      dayOf:'Day {a} of {b}',
      legendNoHabits:'No Habits', legendLow:'Low', legendMedium:'Medium', legendStrong:'Strong',
      monthlyTotalsEyebrow:'Monthly Totals',
      kpiHabits:'Habits', kpiTasks:'Tasks', kpiIdeas:'Ideas', kpiReading:'Reading',
      pages:'pages',
      completeDays:'Complete Days', activeDays:'Active Days',
      completeDaysSub:'All scheduled habits done.',
      activeDaysSub:'Any habit, task, idea, or reading.',
      topPerformers:'Top Performers', needsSupport:'Needs Support',
      bestHabit:'Best Habit', strongestArea:'Strongest Area',
      duoHabit:'Habit', duoArea:'Area',
      notEnoughData:'Not enough data yet.',
      notEnoughHabitData:'Not enough habit data yet.',
      noHabitNeedsSupport:'No habit needs support right now.',
      notEnoughForSupport:'Not enough data yet for Needs Support.',
      readingThisMonth:'Reading This Month',
      readingSessionsLabel:'Sessions', readingPagesLabel:'Pages', readingBooksFinished:'Books Finished',
      notEnoughThisMonth:'Not enough data yet for this month.',
      micro: {
        today: {
          start:'Start with one habit.', started:'You started today.',
          moving:'Today is moving.', half:'Halfway through today.',
          strong:'Strong day so far.', almost:'Almost done for today.',
          done:'Today is complete.',
        },
        week: {
          start:'Start the week with one check-in.', started:'The week has started.',
          moving:'Your week is moving.', half:'Half the rhythm is built.',
          strong:'Strong week.', almost:'Almost a full week.',
          done:'Weekly rhythm complete.',
        },
        month: {
          start:'Start the month with one move.', started:'The month is starting to show.',
          moving:'Your pattern is forming.', half:'The month has real movement.',
          strong:'Strong monthly pattern.', almost:'Almost a complete pattern.',
          done:'Month fully built.',
        },
        habit: {
          start:'Not started yet.', started:'First check-in done.',
          moving:'Building consistency.', half:'Halfway this week.',
          strong:'Strong consistency.', almost:'Almost complete.',
          done:'Fully consistent.',
        },
        area: {
          start:'No signal yet.', started:'Small signal started.',
          moving:'Area is moving.', half:'Area is building.',
          strong:'Strong area.', almost:'Almost full.',
          done:'Area complete.',
        },
        default: {
          start:'Start with one small move.', started:"You started. Keep it moving.",
          moving:"You're building momentum.", half:'Halfway there.',
          strong:'Strong progress.', almost:'Almost locked.',
          done:'Complete. Protect the rhythm.',
        },
      },
    },
    momentumHIW: {
      plan:'Plan', planCopy:'Choose the days for each habit.',
      complete:'Complete', completeCopy:'Finish what was planned for today.',
      track:'Track', trackCopy:'Tasks, ideas, reading and focus show your activity.',
      improve:'Improve', improveCopy:'Use the signals to adjust your system.',
    },
    // Display labels for stored Supabase enum values. Keys are normalized
    // (lowercase, spaces→underscores). DB stores English; this only translates display.
    data: {
      ideaCat: {
        business:'Business', content:'Content', video:'Video', reel:'Reel',
        thread:'Thread', product:'Product', personal:'Personal',
        newsletter:'Newsletter', podcast:'Podcast', essay:'Essay',
        short:'Short', other:'Other',
      },
      priority: { urgent:'Urgent', important:'Important', later:'Later' },
      priorityDesc: {
        urgent:'Needs action now.',
        important:'High-leverage work.',
        later:'Backlog for later.',
      },
      bookStatus: {
        all:'All', reading:'Reading', finished:'Finished',
        wishlist:'Wishlist', currently_reading:'Currently Reading',
      },
      habitArea: {
        health:'Health', personal_growth:'Personal Growth', finance:'Finance',
        focus:'Focus', creativity:'Creativity', lifestyle:'Lifestyle',
        business:'Business', mind:'Mind', body:'Body', spirit:'Spirit',
        relationships:'Relationships', work:'Work',
      },
      entryKind: { insight:'Insight', quote:'Quote', note:'Note' },
    },
  },
  es: {
    common: {
      edit: 'Editar', done: 'Listo', cancel: 'Cancelar', save: 'Guardar',
      delete: 'Eliminar', archive: 'Archivar', back: 'Atrás', close: 'Cerrar',
      add: 'Agregar', remove: 'Quitar', confirm: 'Confirmar',
      yes: 'Sí', no: 'No', open: 'Abrir',
      all: 'Todas', none: 'Ninguna',
    },
    greeting: {
      morning: 'Buenos días', afternoon: 'Buenas tardes',
      evening: 'Buenas noches', night: 'Buenas noches', restWell: 'Descansa',
    },
    nav: {
      overview: 'Resumen',
      habits:   'Hábitos',
      tasks:    'Tareas',
      ideas:    'Ideas',
      reading:  'Lectura',
      momentum: 'Momentum',
      backToOverview: 'Volver al Overview',
      viewProfile: 'Ver perfil',
      settings: 'Configuración',
    },
    section: {
      overview: 'Resumen',
      habits:   'Hábitos',
      tasks:    'Tareas',
      ideas:    'Ideas',
      reading:  'Lectura',
      momentum: 'Momentum',
    },
    home: {
      title: '¿Qué quieres lograr hoy?',
      subtitle: 'Elige por dónde empezar.',
      dashboardCta: 'Ir al Dashboard',
      actions: {
        habits:  'Hábitos',
        tasks:   'Tareas',
        ideas:   'Ideas',
        reading: 'Lectura',
      },
      actionsShort: {
        habits:  'Hábitos',
        tasks:   'Tareas',
        ideas:   'Ideas',
        reading: 'Lectura',
      },
    },
    auth: {
      welcomeBack:         'Bienvenido de vuelta',
      createAccountKicker: 'Crear cuenta',
      createYourReality:   'Crea tu realidad.',
    },
    profile: {
      title:        'Perfil y ajustes',
      subtitle:     'Personaliza tu espacio.',
      appearance:   'Apariencia',
      appearanceHint:'Elige cómo se ve VYB en este dispositivo.',
      themeDark:    'Oscuro',
      themeLight:   'Claro',
      themeSystem:  'Sistema',
      language:     'Idioma',
      languageHint: 'Elige el idioma de la interfaz.',
      langEn:       'English',
      langEs:       'Español',
      signOut:      'Cerrar sesión',
      email:        'Correo',
      memberSince:  'Miembro desde',
      provider:     'Proveedor',
      developerTools: 'Herramientas de desarrollo',
    },
    settings: {
      title:    'Configuración',
      subtitle: 'Personaliza tu experiencia en la app.',
      appearance: 'Apariencia',
      language:   'Idioma',
      socialPrivacy: 'Privacidad social',
      socialPrivacyHint: 'Desactivado por defecto. Tú decides qué (si algo) se comparte.',
      developer:  'Herramientas de desarrollo',
      developerHint: 'Utilidades locales para probar y reiniciar datos de la cuenta.',
    },
    dev: {
      reset:                 'Reiniciar datos de la cuenta',
      chooseWhatToReset:     'Elige qué quieres reiniciar',
      resetSelected:         'Reiniciar datos seleccionados',
      typeResetToConfirm:    'Escribe RESET para confirmar',
      selectedReset:         'Datos seleccionados reiniciados.',
      selectAtLeastOne:      'Selecciona al menos un área para reiniciar.',
      categoryHabits:        'Hábitos',
      categoryTasks:         'Tareas',
      categoryIdeas:         'Ideas',
      categoryReading:       'Lectura',
      categoryMood:          'Ánimo',
      categoryFocus:         'Enfoque',
      categoryWorkouts:      'Entrenamientos',
      categoryNotes:         'Notas',
      categoryLocal:         'Preferencias locales',
      localDesc:             'Estado solo de UI (sidebar, flags). No toca la base de datos.',
      selectAllOn:           '✓ Todos los datos seleccionados',
      selectAllOff:          'Seleccionar todo (Todos los datos)',
      resetting:             'Reiniciando…',
      resetComplete:         'Reinicio completo',
    },
    overview: {
      kicker:        'Panel',
      thisWeek:      'Esta semana',
      weeklyOverview:'Resumen semanal',
      todayMomentum: 'Momentum de hoy',
      activity:      'Actividad',
      activityToday: 'Actividad de hoy',
      systemInProgress: 'Sistema de hoy en progreso',
      systemComplete:   'Sistema de hoy completo',
      currentMission:'Misión actual',
      nextAction:    'Próxima acción',
      completeNextHabit: 'Completa tu próximo hábito',
      goToHabits:    'Ir a Hábitos',
      goToTasks:     'Ir a Tareas',
      goToIdeas:     'Ir a Ideas',
      goToReading:   'Ir a Lectura',
      openMomentum:  'Abrir Momentum',
      openHabits:    'Abrir Hábitos',
      openTasks:     'Abrir Tareas',
      openReading:   'Abrir Lectura',
      ofHabitsComplete: 'de {total} hábitos completos',
      habitsToday:   'Hábitos hoy',
      tasksDone:     'Tareas hechas',
      workouts:      'Entrenamientos',
      mood:          'Ánimo',
      focus:         'Enfoque',
      topPriorities: 'Prioridades principales',
      noPriorities:  'Sin prioridades aún',
      addUrgent:     'Añade tareas urgentes para verlas aquí.',
      urgent:        'Urgente',
      checkin:       'Registro',
      moodEnergy:    'Ánimo y energía',
      howAreYou:     '¿Cómo estás hoy?',
      today:         'Hoy',
      dailyHabits:   'Hábitos diarios',
      smallActions:  'Pequeñas acciones hoy.',
      doneOfTotal:   '{done} de {total} hechos',
      noHabitsYet:   'Sin hábitos todavía.',
      buildDailySys: 'Construye tu sistema diario en Hábitos.',
      training:      'Entrenamiento',
      sessions:      'sesiones',
      restDay:       'Día de descanso',
      currentRead:   'Lectura actual',
      reading:       'Lectura',
      keepPageMoving:'Sigue avanzando páginas.',
      noBook:        'Sin libro actual.',
      startReading:  'Empieza a leer desde tu biblioteca.',
      untitled:      'Sin título',
      progress:      'Progreso',
      pageOf:        'p. {x} de {y}',
      continueReading:'Continuar lectura',
      latestEntry:   'Última entrada',
      capture:       'Captura',
      contentIdeas:  'Ideas de contenido',
      noIdeasYet:    'Sin ideas todavía',
      captureSlip:   'Captura lo que se te ocurra antes de que se vaya.',
      tasks:         'Tareas',
      done:          'hechas',
      noTasksYet:    'Sin tareas todavía',
      openTasksHint: 'Abre Tareas para capturar lo que hay que hacer esta semana.',
      noneDash:      '— ninguno',
      reflectionsReminders:'Reflexiones y recordatorios',
      quickNotes:    'Notas rápidas',
      notesPlaceholder:'Pensamientos, recordatorios, reflexiones...',
      momentum:      'Momentum',
      streak:        'Racha',
      currentStreak: 'Racha actual',
      day:           'día', days: 'días',
      streakHint:    'Días en que completaste lo planeado. Los días de descanso no rompen tu ritmo.',
      week:          'Semana',
      weeklyMomentum:'Momentum semanal',
      completeDays:  'días completos',
      noRhythm:      'Sin ritmo aún. Construye tu sistema diario en Hábitos.',
      perfectWeek:   'Semana perfecta. Momentum asegurado.',
      smallWins:     'Pequeñas victorias. Momentum real.',
      momentumLocked:'Momentum asegurado',
      almostThere:   'Ya casi.',
      keepGoing:     'Sigue.',
      startTheDay:   'Empieza el día.',
      dailySysComplete:'Sistema diario completo',
      habitsLower:   'hábitos',
      comeBackTomorrow:'Vuelve mañana.',
      todayIncluded: 'Hoy incluido.',
      todayInProgress:'Hoy en progreso.',
      complete:      'completo', incomplete: 'incompleto',
      // Overview v3 — acciones rápidas + cronograma
      qaGoToHabits:        'Ir a hábitos',
      qaAddTask:           'Agregar tarea',
      qaCaptureIdea:       'Capturar idea',
      qaOpenReading:       'Abrir lectura',
      qaShortHabits:       'Hábitos',
      qaShortTask:         'Tarea',
      qaShortIdea:         'Idea',
      qaShortRead:         'Leer',
      qaOpenMomentum:      'Abrir Momentum',
      todayHabits:         'Hábitos de hoy',
      todayHabitsSub:      'Mira el día de hoy dentro de tu semana.',
      habitColLabel:       'Hábito',
      streakColLabel:      'Racha',
      viewAllHabits:       'Ver todos los hábitos',
      noPlannedHabitsToday:'No hay hábitos planeados para hoy.',
      adjustSystemHint:    'Ve a Hábitos para ajustar tu sistema.',
      noHabitsYet:         'Aún no hay hábitos.',
      startBuildingSystem: 'Empieza a construir tu sistema.',
      noHabitsToday:       'No hay hábitos planeados para hoy.',
      nextHabitsHint:      'Aquí verás tus próximos hábitos programados.',
      areaOther:           'Otro',
      viewAll:             'Ver todo',
      // Notas rápidas
      quickNotesPlaceholder:'Reflexión, recordatorio o pensamiento rápido...',
      quickNotesHint:      'Enter para guardar · Shift+Enter para nueva línea',
      addNote:             'Agregar nota',
      noQuickNotes:        'Aún no hay notas rápidas.',
      deleteNote:          'Eliminar nota',
      customize: {
        button:       'Personalizar dashboard',
        title:        'Personalizar dashboard',
        subtitle:     'Elige qué aparece en tu Overview.',
        sectionActive:'Actualmente en tu dashboard',
        sectionAvail: 'Widgets disponibles',
        visible:      'Visible',
        hidden:       'Oculto',
        showWidget:   'Mostrar widget',
        hideWidget:   'Ocultar widget',
        show:         'Mostrar',
        hide:         'Ocultar',
        save:         'Guardar cambios',
        cancel:       'Cancelar',
        reset:        'Restablecer por defecto',
        widgets: {
          dailyCatchup:  { title: 'Resumen diario',         description: 'Revisa ayer y prepara hoy.' },
          todayHabits:   { title: 'Hábitos de hoy',         description: 'Marca tus hábitos planeados desde el dashboard.' },
          topPriorities: { title: 'Prioridades principales',description: 'Mira tus tareas más importantes.' },
          deepWork:      { title: 'Trabajo profundo',       description: 'Inicia un temporizador de enfoque.' },
          quickNotes:    { title: 'Notas rápidas',          description: 'Captura reflexiones y recordatorios.' },
          contentIdeas:  { title: 'Ideas de contenido',     description: 'Revisa tus ideas de contenido recientes.' },
          todayMomentum: { title: 'Momentum de hoy',        description: 'Mira un resumen compacto de tu progreso.' },
          currentReading:{ title: 'Lectura actual',         description: 'Mira tu libro actual y avance de lectura.' },
          moodEnergy:    { title: 'Ánimo y energía',        description: 'Registra tu ánimo y energía.' },
        },
      },
      catchup: {
        title:        'Resumen diario',
        subtitle:     'Revisa ayer. Prepara hoy.',
        cta:          'Empezar resumen',
        doneTitle:    'Resumen diario completo',
        doneSubtitle: 'Hoy está listo.',
        ctaAgain:     'Revisar otra vez',
        step1Title:   '¿Cómo estuvo ayer?',
        step2Title:   'Completa información pendiente',
        step3Title:   'Tareas pendientes',
        step4Title:   '¿Qué debería moverse hoy?',
        step5Title:   'Hoy está listo',
        habitsCompleted: 'Hábitos completados',
        tasksCompleted:  'Tareas completadas',
        ideasCaptured:   'Ideas capturadas',
        moodEnergy:      'Ánimo y energía',
        readingSession:  'Lectura',
        noDataYet:       'Aún no hay datos',
        noUnfinished:    'No hay tareas pendientes',
        keepForToday:    'Mantener para hoy',
        moveToLater:     'Mover a Después',
        markDone:        'Marcar como hecha',
        skip:            'Saltar',
        back:            'Atrás',
        next:            'Siguiente',
        finish:          'Finalizar',
        goToOverview:    'Ir al Overview',
        openTasks:       'Abrir tareas',
        goToHabits:      'Ir a hábitos',
        startUrgent:     'Empieza con tu tarea urgente principal.',
        startTop:        'Empieza con tu prioridad principal.',
        startWith:       'Empieza con:',
        readOnePage:     'Lee una página.',
        chooseOneMove:   'Elige un avance pequeño.',
        todaysFocus:     'Enfoque de hoy',
        todayLoadLabel:  'Carga de hoy',
        plannedHabits:   'Hábitos hoy',
        promptMoodMissing:'¿Cómo estuvo tu energía ayer?',
        promptReadAsk:    '¿Leíste ayer?',
        promptHabitsNote: '¿Quieres dejar una nota rápida sobre ayer?',
        notePlaceholder:  'Una línea sobre ayer\u2026',
        yes:             'Sí',
        no:              'No',
        save:            'Guardar',
        stepOf:          'Paso {n} de {total}',
      },
    },
    focus: {
      deepWork:      'Trabajo profundo',
      setTimer:      'Pon un temporizador. Protege tu atención.',
      mute:          'Silenciar campana de fin',
      unmute:        'Activar campana de fin',
      minBlock:      'min bloque',
      min:           'min',
      start:         'Iniciar enfoque',
      pause:         'Pausar',
      end:           'Terminar',
      resume:        'Reanudar',
      reset:         'Reiniciar',
      newSession:    'Nueva sesión',
      idle:          'Elige tu bloque de enfoque.',
      running:       'Mantente con ello.',
      paused:        'En pausa. Listo cuando quieras.',
      complete:      'Sesión de enfoque completa.',
    },
    mood: {
      kicker:        'Registro diario',
      title:         'Ánimo y energía',
      subtitle:      'Un registro de cómo te sientes — pequeña señal, real con el tiempo.',
      mood:          'Ánimo',
      energyLevel:   'Nivel de energía',
      avgMood:       'Ánimo prom.',
      avgEnergy:     'Energía prom.',
      acrossDays:    'en {n} día',
      acrossDaysPlural:'en {n} días',
      trend14:       'Tendencia 14 días',
      energy:        'Energía',
      low:'Bajo', meh:'Regular', okay:'Bien', good:'Muy bien', high:'Alto',
    },
    onboarding: {
      welcome:       'Bienvenido',
      buildLife:     'Construye la vida\nque debías vivir.',
      personalOS:    'Tu sistema operativo personal para hábitos, entrenamientos, lectura, ideas y el trabajo silencioso de convertirte.',
      yourName:      'Tu nombre',
      namePlaceholder:'¿Cómo te llamamos?',
      enterBegin:    'Entrar · Comenzar',
      dataLocal:     'Tus datos se guardan localmente en este dispositivo.',
    },
    tweaks: {
      title:         'Ajustes',
      accentColor:   'Color de acento',
      yourName:      'Tu nombre',
      yourNamePlaceholder:'Tu nombre',
      signOut:       'Cerrar sesión',
    },
    dictation: {
      listening:     'Escuchando…',
      dictate:       'Dictar',
      notSupported:  'Dictado no soportado',
      stop:          'Detener dictado',
      start:         'Iniciar dictado',
    },
    habits: {
      label:     'Crea tu realidad',
      title:     'Hábitos diarios',
      subtitle:  'Pequeñas acciones hoy. Una mejor versión mañana.',
      todayProgress:        'Progreso de hoy',
      todayHelper:          'Completa los hábitos planeados para hoy.',
      todayHelperDone:      'Sistema de hoy completo.',
      percentComplete:      'completo',
      weeklyProgress:       'Progreso semanal',
      checkInsThisWeek_one: 'registro esta semana',
      checkInsThisWeek:     'registros esta semana',
      extraTodayTitle:      'Extra hoy',
      extraTodayHelper:     'Hábitos opcionales que suman a tus metas semanales.',
      extraTodayEmpty:      'No hay extras disponibles.',
      completedExtras:      'Extras completados',
      completedExtrasHelper:'Esfuerzo extra registrado. Esto suma a tus metas semanales.',
      extraDone_one:        '+1 extra completado',
      extraDone:            '+{n} extras completados',
      extraLogged:          'Extra registrado.',
      extraBadge:           'Extra',
      doneBadge:            'Listo',
      formNewHabit:         'Nuevo hábito',
      formEditHabit:        'Editar hábito',
      formIntroNew:         'Crea un hábito y elige cuándo realizarlo.',
      formIntroEdit:        'Ajusta con intención. Tu sistema funciona por repetición.',
      formName:             'Nombre',
      formNamePlaceholder:  'p. ej. Leer 20 minutos',
      formArea:             'Área',
      formSelectArea:       'Selecciona un área',
      formAreaSuggested:    '(sugerida)',
      formFrequency:        'Frecuencia',
      formEveryDay:         'Todos los días',
      formCustomDays:       'Días personalizados',
      formHelperDaily:      'Todos los días es lo predeterminado. Usa días personalizados para un sistema más realista.',
      formHelperCustom:     'Elige días realistas. Momentum medirá este hábito según tu calendario. Los días de descanso no cuentan en contra.',
      formErrName:          'Añade un nombre al hábito.',
      formErrArea:          'Elige un área para este hábito.',
      formErrDays:          'Elige al menos un día.',
      formCreate:           'Crear',
      addHabits:            'Añadir hábitos',
    },
    weekday: {
      shortMon:'Lun', shortTue:'Mar', shortWed:'Mié', shortThu:'Jue',
      shortFri:'Vie', shortSat:'Sáb', shortSun:'Dom',
    },
    tasks: {
      label:     'Esta semana',
      title:     'Tareas',
      empty:     'Captura. Ordena. Ejecuta.',
      placeholder:'¿Qué hay que hacer?',
      errAddTitle:'Añade un título a la tarea.',
      errAddProject:'Añade un proyecto',
      errAddFailed:'No se pudo agregar la tarea. Intenta de nuevo.',
      capturedNeedsDoing:'Captura lo que hay que hacer.',
      useComposerBelow:'Usa el campo de abajo — pequeño, específico y fiel a tus prioridades.',
      addProjectContext:'Añadir proyecto / contexto',
      completedToday:'Completadas hoy',
      undo:'Deshacer',
      addTask:'Añadir tarea',
      nothingHere:'Nada por aquí.',
      generalProject:'Bandeja',
      keepShort:    'Mantén tus tareas cortas y específicas para que sean más fáciles de completar.',
      writeItNowHint:'Escríbela ahora. Organízala después.',
      filterAll:    'Todas',
      viewLabel:    'Vista',
      ofTotalComplete:'{done} de {total} completas · {open} restantes',
      open:'abiertas',
      projectLabel:'Proyecto',
      priorityLabel:'Prioridad',
      mobilePlaceholder:'¿Qué hay que hacer?',
      sheetDone:'Listo',
      tapToChange:'Toca para cambiar',
      addProjectShort:'+ Proyecto',
      organizeHelper:'Organiza tus tareas por proyecto o contexto.',
      noProject:'Sin proyecto',
      chooseProject:'Elegir proyecto',
      choosePriority:'Elegir prioridad',
      createProject:'Crear proyecto',
      projectNamePlaceholder:'Nombre del proyecto',
      addProject:'+ Añadir proyecto',
      newShort:'+ Nuevo',
      addAction:'Agregar',
      cancelAction:'Cancelar',
      load: {
        title:'Carga de hoy',
        activeTasks:'tareas activas',
        empty:        'Día vacío',
        light:        'Día ligero',
        focused:      'Día enfocado',
        active:       'Día activo',
        heavy:        'Día pesado',
        overloaded:   'Día saturado',
        emptyMsg:     'Agrega 1\u20133 tareas importantes para darle dirección a tu día.',
        lightMsg:     'Bueno para descansar o enfocarte profundo.',
        focusedMsg:   'Rango perfecto. Claro y alcanzable.',
        activeMsg:    'Productivo, pero protege tu enfoque.',
        heavyMsg:     'Prioriza. Elige tus 3 principales.',
        overloadedMsg:'Mueve algunas tareas a otro día o al backlog.',
        urgent:       'Urgentes',
        important:    'Importantes',
        later:        'Después',
        urgentWarn:   'Demasiadas tareas urgentes. Elige las 3 verdaderamente importantes.',
        urgentWarnHi: 'Esto está saturado. Mueve lo que pueda esperar.',
        top3Title:    'Top 3 para proteger tu enfoque',
      },
      boardWarn: {
        urgent5:      'Tienes varias tareas urgentes. Intenta mantener esta lista en 5 o menos.',
        urgent8:      'Urgente está saturado. Elige las 3 principales y mueve lo que pueda esperar.',
        important10:  'Importante se está cargando. Elige lo que realmente hace avanzar las cosas.',
      },
    },
    ideas: {
      label:     'Captura',
      title:     'Ideas',
      subtitle:  'Atrapa lo que pasa por tu mente. Vuelve a ello con la cabeza despejada.',
      placeholder:'Captura una idea…',
      emptyError:'Escribe una idea primero.',
      inbox:'Inbox',
      filterAll:'Todas',
      filterActive:'Activas',
      filterArchived:'Archivadas',
      noArchived:'Sin ideas archivadas',
      noIdeasYet:'Sin ideas todavía',
      captureBelow:'Captura una abajo — ninguna idea es demasiado pequeña.',
      addIdea:'Añadir idea',
      restore:'Restaurar',
      convertToTask:'Convertir en tarea',
      convertEditTitle:'Editar título de la tarea',
      convertCreate:'Crear tarea',
      convertSuccess:'Tarea creada desde idea.',
      convertViewTask:'Ver tarea',
      categoryShort:'Categoría',
      addCategoryShort:'+ Categoría',
      addCategoryContext:'Añadir categoría o contexto',
      defaultCategories:['Business','Contenido','Personal','Aprendizaje','VYB'],
      addCategory:'+ Añadir categoría',
      newCategory:'+ Nueva',
      categoryNamePlaceholder:'Nombre de categoría',
      composerPlaceholder:'¿Qué idea quieres guardar?',
      noCategory:'Sin categoría',
      presetBusiness:'Negocio',
      presetContent:'Contenido',
      presetGeneral:'General',
      presetWebApp:'Web/App',
      presetLearning:'Aprendizaje',
      presetPersonal:'Personal',
    },
    overviewMini: {
      habitsTodayTitle:'Hábitos de hoy',
      habitsTodayCompleted:'{completed} / {total} completados',
      habitsTodayNone:'Sin hábitos planeados',
      pendingTasksTitle:'Tareas pendientes',
      pendingTasksOpen:'{count} abiertas',
      pendingTasksOpenShort:'abiertas',
      pendingTasksHelper:'Revisa tu siguiente tarea.',
    },
    reading: {
      label:     'Biblioteca personal',
      title:     'Lectura',
      subtitle:  'Un registro de lo que te mueve. Progreso, ideas y el trabajo silencioso de pensar.',
      addBook:   'Añadir libro',
      startLibrary:'Empieza tu biblioteca personal',
      addBookPlaceholder:'Añade el libro que estás leyendo…',
      readingGoals:'Metas de lectura',
      editGoals:'Editar metas',
      thisYear:'Este año',
      thisMonth:'Este mes',
      myLibrary:'Mi biblioteca',
      tabAll:'Todos',
      tabReading:'Leyendo',
      tabFinished:'Terminados',
      tabWishlist:'Por leer',
      currentlyReading:'Leyendo actualmente',
      bookDetail:'Detalle del libro',
      progress:'Progreso',
      doneForToday:'Listo por hoy',
      markFinished:'Marcar como terminado',
      addEntry:'Añadir entrada',
      saveEntry:'Guardar entrada',
      insight:'Idea',
      quote:'Cita',
      note:'Nota',
      bookTitle:'Título',
      author:'Autor',
      pages:'Páginas',
      coverUrl:'URL de portada (opcional)',
      status:'Estado',
      currentPage:'Página actual',
      totalPages:'Páginas totales',
      pageNotFound:'No se encontró el conteo de páginas. Puedes dejarlo vacío.',
      autofilledFrom:'Autocompletado desde {src}',
      whenFinish:'¿Cuándo lo terminaste?',
      optionalToday:'Opcional — por defecto, hoy.',
      editBook:'Editar libro',
      addManually:'Añadir manualmente',
      confirmBook:'Confirmar libro',
      searchByTitleAuthor:'Buscar por título o autor',
      search:'Buscar',
      noResults:'Sin resultados. Prueba otra búsqueda o añade manualmente.',
      searchUnavailable:'Búsqueda no disponible. Puedes añadir manualmente.',
      cantFind:'¿No lo encuentras? Añade manualmente',
      cancel:'Cancelar',
      chooseDifferent:'Elegir otro libro',
      backToSearch:'← Volver a la búsqueda',
      coverAttached:'Portada adjunta',
      noCover:'Sin portada — se mostrará un marcador.',
      removeCover:'Quitar portada',
      delete:'Eliminar',
      saveBookChanges:'Guardar cambios del libro',
      ofPages:'p. {shown} de {total}',
      minusPage:'-1 página',
      plusPage:'+1 página',
      pageOptional:'Página (opcional)',
      entriesCount:'Entradas · {n}',
      noEntriesYet:'Sin entradas todavía.',
      captureInsightHint:'Captura una idea, cita o nota arriba.',
      readingDetail:'Lectura · Detalle',
      close:'Cerrar',
      untitled:'Sin título',
      finishedOn:'Terminado el {date}',
      updatedOn:'Actualizado el {date}',
      save:'Guardar',
      yearlyGoalBooks:'Meta anual · libros',
      monthlyGoalBooks:'Meta mensual · libros',
      libraryCount:'Mi biblioteca · {n}',
      wishlistCount:'Por leer · {n}',
      captureIdeasWorth:'Captura las ideas que vale la pena guardar.',
      nothingHereYet:'Nada aquí todavía.',
      addBooksReading:'Añade libros que estás leyendo o has terminado.',
      tryDifferentFilter:'Prueba otro filtro o añade un nuevo libro.',
      booksToReadLater:'Libros para leer más tarde.',
      edit:'Editar',
      open:'Abrir',
      finished:'Terminado',
      placeholderQuote:'Pega la cita.',
      placeholderInsight:'Un pensamiento que vale la pena guardar.',
      placeholderNote:'Una nota para después.',
      placeholderEntry:'Captura una idea, cita o nota\u2026',
      sessionsToday:'Sesiones de hoy',
      noSessionsLogged:'Sin sesiones hoy.',
      deleteSession:'Eliminar sesión',
      confirmDeleteSession:'Toca otra vez para eliminar',
      startReading:'Empezar a leer',
      saveSession:'Guardar sesión',
      readingInProgress:'Sesión de lectura en curso',
      startedAtPage:'Empezó en la página {n}.',
      endPage:'Página final',
      cancelSession:'Cancelar',
      sessionAnotherBook:'Hay una sesión activa para otro libro. Termínala o cancélala primero.',
      monthLabel:'Mes',
      yearLabel:'Año',
      todaysReading:'Lectura de hoy',
      addTodaysSession:'Añade tu sesión de hoy',
      pagesReadToday:'Páginas leídas hoy',
      pagesReadSuffix:'páginas leídas',
      startPageLabel:'Página inicial',
      endPageLabel:'Página final',
      addAtLeastOnePage:'Añade al menos 1 página para guardar una sesión.',
      continueReading:'Continuar lectura',
      dictate:'Dictar',
      listening:'Escuchando…',
      dictateStop:'Detener dictado',
      dictationUnsupported:'El dictado no está disponible en este navegador.',
      dictationPrivacyNote:'La voz se transcribe desde tu navegador. Revisa antes de guardar.',
      dictationPermissionDenied:'Permiso de micrófono denegado.',
      dictationNoSpeech:'No se detectó voz. Inténtalo de nuevo.',
      dictationGenericError:'El dictado se detuvo. Inténtalo de nuevo.',
      habitCompleteToday:'Perfecto. Completaste tu hábito de lectura de hoy.',
      habitExtraToday:'Bien. Lectura se agregó como hábito extra de hoy.',
      sessionSavedSimple:'Sesión de lectura guardada.',
    },
    momentum: {
      label:     'Progreso',
      title:     'Momentum',
      subtitle:  'Mide lo importante. Mejora lo que avanza.',
      guide: {
        button: 'Cómo funciona',
        header: 'Cómo funciona Momentum',
        close:  'Cerrar',
        back:   'Atrás',
        next:   'Siguiente',
        gotIt:  'Entendido',
        slides: [
          { eyebrow:'Momentum',     title:'Mira tu progreso.',     body:'Momentum muestra lo que hiciste hoy, esta semana y este mes.' },
          { eyebrow:'Hoy',          title:'Empieza con hoy.',      body:'Completa tus hábitos planeados y registra lo que se movió hoy.' },
          { eyebrow:'Esta semana',  title:'Construye la semana.',  body:'El progreso semanal muestra cómo avanzan tus hábitos día por día.' },
          { eyebrow:'Consistencia', title:'Mira cada hábito.',     body:'La consistencia muestra qué hábitos estás manteniendo.' },
          { eyebrow:'Balance',      title:'Mira tus áreas.',       body:'El balance muestra qué partes de tu vida recibieron atención esta semana.' },
          { eyebrow:'Este mes',     title:'Mira el patrón.',       body:'El mapa mensual ilumina los días en los que avanzaste.' },
          { eyebrow:'Aura',         title:'Construye Aura.',       body:'Tu Aura crece cuando tus acciones reales crean progreso visible.' },
        ],
      },
      whatYouTrack:'"Lo que mides se vuelve más fácil de mejorar."',
      dailyHabits:'Hábitos diarios',
      habitsCompleteOf:'{done}/{total} hábitos completos',
      noHabitsYet:'Sin hábitos todavía',
      noHabitsToday:'Sin hábitos planeados para hoy',
      pctOfToday:'{pct}% de los hábitos de hoy',
      createFewHabits:'Crea unos hábitos para construir tu sistema diario.',
      restDoesntBreak:'Los días de descanso no rompen tu ritmo.',
      createHabits:'Crear hábitos',
      openHabits:'Abrir Hábitos',
      currentMission:'Misión actual',
      todaysProgress:'Progreso de hoy',
      completeTodaysHabits:'Completa los hábitos de hoy.',
      yourHabitsBuilding:'Tus hábitos son el sistema que construye tu próxima versión.',
      todaysSystem:'Sistema de hoy',
      addHabit:'Añadir un hábito',
      todaysSystemComplete:'Sistema de hoy completo.',
      restDayPreserved:'Día de descanso. La racha se mantiene.',
      dailySeal:'Sello diario',
      todaysSystemInProgress:'Sistema de hoy en progreso',
      buildSystemToSeal:'Construye tu sistema diario en Hábitos para empezar a sellar días.',
      rhythm:'Ritmo',
      progressBreakdown:'Desglose del progreso',
      whereSystemShowing:'Dónde aparece el sistema.',
      tasks:'Tareas', habits:'Hábitos', ideas:'Ideas', reading:'Lectura', focusLabel:'Enfoque',
      create:'Crear', addTask:'Añadir tarea', capture:'Capturar', addBook:'Añadir libro', start:'Iniciar', open:'Abrir',
      proofOfProgress:'Prueba de progreso',
      proofMessage:'Prueba de que tu sistema se vuelve real.',
      milestoneUnlocked:'Logro desbloqueado',
      builtThroughRepetition:'Construido por repetición. Cada uno es señal de que tu sistema es real.',
      filterAll:'Todos', filterUnlocked:'Desbloqueados', filterInProgress:'En progreso',
      unlocked:'Desbloqueado', inProgress:'En progreso', comingSoon:'Próximamente',
      premiumComingSoon:'Premium · Próximamente',
      aiReflection:'Reflexión IA',
      aiHelp:'Pronto, VYB te ayudará a leer tus propias señales — patrones, deriva, qué ajustar.',
      collectingProof:'Tu sistema acumula pruebas. La reflexión IA llega después.',
      unlockLater:'Desbloquear después',
      thisWeek:'Esta semana',
      weeklyConsistency:'Consistencia semanal',
      dueToday:'para hoy',
      upcoming:'próximos',
      missed:'perdidos',
      weeklyGoalComplete:'meta semanal completa',
      stillRecoverable:'aún recuperable',
      allScheduledComplete:'todos los días planeados completos',
      frictionSignal:'Señal de fricción',
      tasksCompleted:'Tareas completadas',
      ideasCaptured:'Ideas capturadas',
      readingToday:'Lectura hoy',
      focusSessions:'Sesiones de enfoque',
      yes:'Sí', no:'No',
      nothingLogged:'Nada registrado hoy todavía.',
      tasksIdeasHint:'Tareas, ideas, lectura y enfoque aparecen aquí cuando los registras.',
      captureIdea:'Capturar idea',
      loggedActivity:'Actividad registrada, no metas obligatorias.',
      startFocus:'Iniciar enfoque',
      openOverview:'Abrir Resumen',
      goToHabits:'Ir a Hábitos', goToTasks:'Ir a Tareas', goToIdeas:'Ir a Ideas', goToReading:'Ir a Lectura',
      howItWorks:'Cómo funciona',
      hide:'Ocultar', show:'Mostrar',
      keyIdeas:'Ideas clave',
      example:'Ejemplo',
      activityToday:'Actividad de hoy',
      noActivityYet:'Aún no hay actividad hoy.',
      addTaskShort:'Agregar tarea',
      captureIdeaShort:'Capturar idea',
      openReadingShort:'Abrir lectura',
      yourHabitsBuildSystem:'Tus hábitos construyen el sistema.',
      day:'día', days:'días',
      startToday:'Empieza hoy',
      streakHintLine:'Días en los que completaste lo planeado. Los días de descanso no rompen tu ritmo.',
      // Panel analítico (Fase 1)
      todayOverview:'Hoy',
      todayHelp:'Tu señal de hoy de un vistazo.',
      weeklyTrends:'Tendencias de la semana',
      weeklyTrendsHelp:'Cómo se mueve tu semana.',
      momentumTrendChart:'Tendencia de momentum',
      momentumTrendHelp:'Cumplimiento diario de hábitos.',
      weeklyActivity:'Actividad semanal',
      weeklyActivityHelp:'Lo que registraste esta semana.',
      areaBalanceTitle:'Balance por área',
      areaBalanceHelp:'Dónde se nota tu esfuerzo.',
      habitConsistencyTitle:'Consistencia de hábitos',
      readingSignalTitle:'Señal de lectura',
      readingSignalHelp:'Tu lectura está apareciendo.',
      noActiveBook:'Sin libro activo.',
      noReadingThisWeek:'Sin sesiones de lectura esta semana.',
      sessionsThisWeek:'sesiones esta semana',
      sessionThisWeek:'sesión esta semana',
      sessionsToday:'hoy',
      currentBook:'Libro actual',
      progressLabel:'Progreso',
      pages:'páginas',
      focus:'Enfoque',
      sessions:'sesiones',
      session:'sesión',
      extra:'extra',
      noDataYet:'Sin datos todavía.',
      nextMove:'Siguiente paso',
      viewAll:'Ver todos',
      areaNoData:'Asigna hábitos a áreas para ver el balance.',
      consistencyEmpty:'Crea hábitos para registrar consistencia semanal.',
      todayEmpty:'Aún no registras nada hoy.',
      // Tarjetas compactas (Resumen de hoy)
      statHabits:'Hábitos',
      statTasks:'Tareas',
      statIdeas:'Ideas',
      statReading:'Lectura',
      statFocus:'Enfoque',
      // ── v2 (Momentum redesign) ─────────────────────────────
      pageSubtitle:'Registra lo que se mueve hoy, esta semana y este mes.',
      todayTitle:'Hoy', todaySubtitle:'Tu progreso de hoy.',
      weekTitle:'Esta semana', weekSubtitle:'Tus avances esta semana.',
      monthTitle:'Este mes', monthSubtitle:'Tu patrón del mes.',
      todayHabitsEyebrow:'Hábitos de hoy',
      noPlannedToday:'No hay hábitos planeados para hoy.',
      statusOpenDay:'Día abierto', statusComplete:'Completo', statusInProgress:'En progreso',
      statusNotStarted:'Sin empezar',
      pageSingular:'página',
      subCompleted:'completadas', subCaptured:'capturadas',
      extras:'extras', extraSingular:'extra', completedBeyondPlan:'completado más allá del plan',
      todaySnapshotTitle:'Resumen de hoy',
      weeklyProgressEyebrow:'Progreso semanal',
      checkInsThisWeek:'avances esta semana', checkInThisWeek:'avance esta semana',
      legendComplete:'Completo', legendPartial:'Parcial', legendNone:'Ninguno', legendRest:'Descanso',
      habitConsistencyTitle:'Consistencia de hábitos',
      habitConsistencySubtitle:'Cómo avanza cada hábito esta semana.',
      noHabitTargetsWeek:'Sin metas de hábitos esta semana.',
      areaBalanceTitle:'Balance por áreas', areaBalanceSubtitle:'Tu semana por área de vida.',
      areaEmpty:'Agrega hábitos en distintas áreas para ver tu balance.',
      areaFillHint:'Llena la forma completando los hábitos planeados de cada área.',
      monthlyMapTitle:'Mapa mensual de Momentum',
      dayOf:'Día {a} de {b}',
      legendNoHabits:'Sin hábitos', legendLow:'Bajo', legendMedium:'Medio', legendStrong:'Fuerte',
      monthlyTotalsEyebrow:'Totales del mes',
      kpiHabits:'Hábitos', kpiTasks:'Tareas', kpiIdeas:'Ideas', kpiReading:'Lectura',
      pages:'páginas',
      completeDays:'Días completos', activeDays:'Días activos',
      completeDaysSub:'Todos los hábitos planeados hechos.',
      activeDaysSub:'Cualquier hábito, tarea, idea o lectura.',
      topPerformers:'Mejores avances', needsSupport:'Necesita apoyo',
      bestHabit:'Mejor hábito', strongestArea:'Área más fuerte',
      duoHabit:'Hábito', duoArea:'Área',
      notEnoughData:'Aún no hay datos suficientes.',
      notEnoughHabitData:'Aún no hay datos suficientes de hábitos.',
      noHabitNeedsSupport:'Ningún hábito necesita apoyo ahora.',
      notEnoughForSupport:'Aún no hay datos para Necesita apoyo.',
      readingThisMonth:'Lectura este mes',
      readingSessionsLabel:'Sesiones', readingPagesLabel:'Páginas', readingBooksFinished:'Libros terminados',
      notEnoughThisMonth:'Aún no hay datos suficientes este mes.',
      micro: {
        today: {
          start:'Empieza con un hábito.', started:'Ya empezaste hoy.',
          moving:'Hoy ya se está moviendo.', half:'Vas a la mitad de hoy.',
          strong:'Buen avance hoy.', almost:'Casi terminas por hoy.',
          done:'Hoy está completo.',
        },
        week: {
          start:'Empieza la semana con un avance.', started:'La semana ya empezó.',
          moving:'Tu semana ya se está moviendo.', half:'Ya construiste la mitad del ritmo.',
          strong:'Semana fuerte.', almost:'Casi completas la semana.',
          done:'Ritmo semanal completo.',
        },
        month: {
          start:'Empieza el mes con un avance.', started:'El mes ya empieza a tomar forma.',
          moving:'Tu patrón se está formando.', half:'El mes ya tiene movimiento real.',
          strong:'Patrón mensual fuerte.', almost:'Casi completas el patrón.',
          done:'Mes completamente construido.',
        },
        habit: {
          start:'Aún no comienza.', started:'Primer avance hecho.',
          moving:'Construyendo consistencia.', half:'A la mitad de la semana.',
          strong:'Consistencia fuerte.', almost:'Casi completo.',
          done:'Totalmente consistente.',
        },
        area: {
          start:'Sin señal todavía.', started:'Primera señal iniciada.',
          moving:'El área se está moviendo.', half:'El área se está construyendo.',
          strong:'Área fuerte.', almost:'Casi llena.',
          done:'Área completa.',
        },
        default: {
          start:'Empieza con un pequeño avance.', started:'Empezaste. Sigue moviéndolo.',
          moving:'Estás construyendo momentum.', half:'A la mitad.',
          strong:'Buen avance.', almost:'Casi asegurado.',
          done:'Completo. Protege el ritmo.',
        },
      },
    },
    momentumHIW: {
      plan:'Planifica', planCopy:'Elige los días de cada hábito.',
      complete:'Completa', completeCopy:'Termina lo planeado para hoy.',
      track:'Registra', trackCopy:'Tareas, ideas, lectura y enfoque muestran tu actividad.',
      improve:'Mejora', improveCopy:'Usa las señales para ajustar tu sistema.',
    },
    data: {
      ideaCat: {
        business:'Negocio', content:'Contenido', video:'Video', reel:'Reel',
        thread:'Hilo', product:'Producto', personal:'Personal',
        newsletter:'Newsletter', podcast:'Podcast', essay:'Ensayo',
        short:'Corto', other:'Otro',
      },
      priority: { urgent:'Urgente', important:'Importante', later:'Después' },
      priorityDesc: {
        urgent:'Acción inmediata.',
        important:'Trabajo central.',
        later:'Para más tarde.',
      },
      bookStatus: {
        all:'Todos', reading:'Leyendo', finished:'Terminado',
        wishlist:'Por leer', currently_reading:'Leyendo actualmente',
      },
      habitArea: {
        health:'Salud', personal_growth:'Crecimiento personal', finance:'Finanzas',
        focus:'Enfoque', creativity:'Creatividad', lifestyle:'Estilo de vida',
        business:'Negocio', mind:'Mente', body:'Cuerpo', spirit:'Espíritu',
        relationships:'Relaciones', work:'Trabajo',
      },
      entryKind: { insight:'Idea', quote:'Cita', note:'Nota' },
    },
  },
};

const detectDefaultLang = () => {
  try {
    const nav = (typeof navigator !== 'undefined' && navigator.language) || 'en';
    return nav.toLowerCase().startsWith('es') ? 'es' : 'en';
  } catch { return 'en'; }
};

const getLang = () => {
  try {
    const stored = localStorage.getItem(LANG_KEY);
    if (stored && SUPPORTED.includes(stored)) return stored;
  } catch {}
  return detectDefaultLang();
};

const setLang = (lang) => {
  if (!SUPPORTED.includes(lang)) return;
  try { localStorage.setItem(LANG_KEY, lang); } catch {}
  try { document.documentElement.dataset.lang = lang; } catch {}
  try { document.documentElement.setAttribute('lang', lang); } catch {}
  try { window.dispatchEvent(new CustomEvent('vyb-lang-change', { detail: lang })); } catch {}
};

const t = (key, fallback) => {
  const lang = getLang();
  const parts = String(key || '').split('.');
  let cur = TRANSLATIONS[lang];
  for (const p of parts) {
    if (cur && typeof cur === 'object' && p in cur) cur = cur[p];
    else { cur = undefined; break; }
  }
  if (typeof cur === 'string') return cur;
  // Fallback to English
  let en = TRANSLATIONS.en;
  for (const p of parts) {
    if (en && typeof en === 'object' && p in en) en = en[p];
    else { en = undefined; break; }
  }
  if (typeof en === 'string') return en;
  return fallback != null ? fallback : key;
};

// React hook: re-renders the calling component on lang change.
const useT = () => {
  const [, force] = React.useReducer(x => x + 1, 0);
  React.useEffect(() => {
    const h = () => force();
    window.addEventListener('vyb-lang-change', h);
    return () => window.removeEventListener('vyb-lang-change', h);
  }, []);
  return t;
};

// Apply lang to <html> on first load so CSS / screen readers see it.
try { document.documentElement.dataset.lang = getLang(); } catch {}
try { document.documentElement.setAttribute('lang', getLang()); } catch {}

// Display-label helper for stored DB enum values.
// Never mutates the stored value; just looks up a translated label.
// Usage: dl('ideaCat', idea.category) → 'Negocio' (es) / 'Business' (en)
const dl = (cat, value, fallback) => {
  if (value == null) return fallback != null ? fallback : '';
  const norm = String(value).toLowerCase().trim().replace(/\s+/g, '_');
  const out = t('data.' + cat + '.' + norm, null);
  // If t() returned the key itself (no match in EN or ES), fall back to the
  // original raw value so unknown stored values still render readably.
  if (out === 'data.' + cat + '.' + norm || out == null) {
    return fallback != null ? fallback : String(value);
  }
  return out;
};

Object.assign(window, { vybI18n: { TRANSLATIONS, SUPPORTED }, t, useT, getLang, setLang, dl });
