/* CSS exacto del mock aprobado — cargado despues de app.css para ganar en cascade */

    /* ══════════════════════════════════
       DESIGN SYSTEM TOKENS & VARIABLES
    ══════════════════════════════════ */
    :root {
      --bg-1: #07142f;
      --bg-2: #0b4fc8;

      --blue:    #1268f3;
      --blue-2:  #1ea7ff;
      --cyan:    #27d7ff;
      --green:   #14b884;
      --orange:  #ff8c42;
      --purple:  #6d5dfc;
      --red:     #ff4d6a;

      --card-dark: rgba(4, 22, 61, 0.96);
      --card-soft: rgba(255, 255, 255, 0.04);
      --stroke:    rgba(255,255,255,0.22);
      --stroke-w:  rgba(255,255,255,0.36);

      --text-dark: #07152f;
      --text-soft: #4a6082;
      --text-w:    #eef6ff;
      --text-mid:  rgba(230, 240, 255, 0.72);

      --shadow-card: 0 18px 45px rgba(4,20,56,0.28);
      --shadow-ex:   0 20px 45px rgba(0, 0, 0, 0.26);

      --r-xl: 24px;
      --r-lg: 20px;
      --r-md: 15px;
      --r-sm: 10px;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      color: var(--text-w);
      background:
        radial-gradient(circle at 76% 12%, rgba(39,215,255,0.95) 0, rgba(39,215,255,0.18) 25%, transparent 46%),
        radial-gradient(circle at 15% 38%, rgba(21,88,230,0.65) 0, transparent 36%),
        linear-gradient(155deg, var(--bg-1) 0%, #062263 38%, var(--bg-2) 72%, #04286f 100%);
      background-attachment: fixed;
      min-height: 100dvh;
      overflow-x: hidden;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background:
        linear-gradient(135deg, transparent 0 35%, rgba(255, 255, 255, 0.05) 36%, transparent 62%),
        radial-gradient(circle at 90% 85%, rgba(61,130,255,0.22), transparent 34%);
      z-index: 0;
    }

    /* ══════════════════════════════════════════════
       ETAPA 1: PLAN DE HOY — ALL VIEWPORTS
       (Specificity: #tab-plan .meal-card = 0,1,1,0
        beats app.css .meal-card = 0,0,1,0)
    ══════════════════════════════════════════════ */
    #tab-plan .meal-card,
    #tab-plan .macro-card,
    #tab-plan .plan-card,
    #tab-plan .ex-card,
    #tab-plan .meals-total,
    #tab-plan .workout-header-card {
      background: rgba(4, 22, 61, 0.96) !important;
      color: #eef6ff;
      border: 1px solid rgba(255, 255, 255, 0.18);
      box-shadow: 0 18px 45px rgba(4, 20, 56, 0.28);
      border-radius: 20px;
    }
    #tab-plan .meal-stack {
      background: transparent;
      border-color: transparent;
      box-shadow: none;
    }
    #tab-plan .meal-name,
    #tab-plan .workout-title,
    #tab-plan .meals-total-val,
    #tab-plan .ex-name {
      color: #ffffff;
    }
    #tab-plan .meal-desc,
    #tab-plan .meal-desc-text,
    #tab-plan .meal-hora,
    #tab-plan .workout-meta,
    #tab-plan .plan-section-label,
    #tab-plan .meals-total-lbl,
    #tab-plan .ex-set-item,
    #tab-plan .ex-num {
      color: rgba(230, 240, 255, 0.72);
    }
    #tab-plan .meal-macro,
    #tab-plan .macro-chip {
      background: rgba(255, 255, 255, 0.08);
      color: rgba(230, 240, 255, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.12);
    }
    #tab-plan .meal-macro span,
    #tab-plan .macro-chip span {
      color: #ffffff;
    }
    #tab-plan .meal-add-btn {
      background: rgba(255, 255, 255, 0.06);
      color: #46d7ff;
      border-top: 1px solid rgba(255, 255, 255, 0.12);
    }
    #tab-plan .day-summary-bar {
      background: rgba(4, 22, 61, 0.96);
      color: #eef6ff;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 20px;
    }

    /* ══════════════════════════════════════════════
       RYAN — IDENTIDAD VISUAL
    ══════════════════════════════════════════════ */
    .brand-icon.logo {
      display: none;
    }
    
    .ryan-presentation-card {
      background: rgba(4, 22, 61, 0.96);
      border: 1px solid rgba(18, 104, 243, 0.3);
      border-radius: 20px;
      padding: 20px;
      display: flex;
      gap: 18px;
      align-items: flex-start;
      box-shadow: 0 18px 45px rgba(4, 20, 56, 0.28);
      margin-bottom: 16px;
    }
    .ryan-presentation-card .ryan-avatar-large {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid rgba(39, 215, 255, 0.5);
      box-shadow: 0 0 20px rgba(39, 215, 255, 0.2);
      flex-shrink: 0;
    }
    .ryan-presentation-card .ryan-info {
      flex: 1;
    }
    .ryan-presentation-card .ryan-name {
      font-size: 1.15rem;
      font-weight: 800;
      color: #ffffff;
      margin-bottom: 2px;
    }
    .ryan-presentation-card .ryan-role {
      font-size: 0.75rem;
      font-weight: 700;
      color: #27d7ff;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 8px;
    }
    .ryan-presentation-card .ryan-text {
      font-size: 0.85rem;
      line-height: 1.6;
      color: rgba(230, 240, 255, 0.88);
    }
    .ryan-presentation-card .ryan-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 10px;
    }
    .ryan-presentation-card .ryan-tag {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: rgba(230, 240, 255, 0.8);
      padding: 3px 10px;
      border-radius: 99px;
      font-size: 0.7rem;
      font-weight: 600;
    }

    /* ══════════════════════════════════════════════
       MI ENTRENADOR — TAB COMPLETO (Ryan)
    ══════════════════════════════════════════════ */
    #tab-entrenador {
      padding: 24px;
    }
    .pt-intro-container {
      display: flex;
      justify-content: center;
      margin-top: 20px;
      width: 100%;
    }
    .pt-intro-card {
      background: rgba(4, 22, 61, 0.96);
      border: 1px solid rgba(18, 104, 243, 0.3);
      border-radius: 20px;
      padding: 24px;
      max-width: 600px;
      width: 100%;
      box-shadow: 0 18px 45px rgba(4, 20, 56, 0.28);
      display: flex;
      flex-direction: row;
      gap: 24px;
      align-items: flex-start;
    }
    .pt-intro-img-wrap {
      width: 160px;
      height: 160px;
      min-width: 160px;
      max-width: 160px;
      min-height: 160px;
      max-height: 160px;
      border-radius: 16px;
      overflow: hidden;
      flex-shrink: 0;
      border: 2px solid rgba(255, 255, 255, 0.1);
    }
    .pt-intro-img {
      width: 160px;
      height: 160px;
      min-width: 160px;
      max-width: 160px;
      min-height: 160px;
      max-height: 160px;
      object-fit: cover;
      object-position: center top;
      display: block;
    }
    .pt-intro-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .pt-intro-title-wrap {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .pt-intro-name {
      font-size: 1.4rem;
      font-weight: 900;
      color: #ffffff;
      margin: 0;
    }
    .pt-intro-role {
      font-size: 0.8rem;
      font-weight: 700;
      color: #27d7ff;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .pt-intro-text {
      font-size: 0.9rem;
      line-height: 1.6;
      color: rgba(230, 240, 255, 0.9);
      margin: 0;
    }
    .pt-intro-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 8px;
    }
    .pt-intro-tag {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: rgba(230, 240, 255, 0.8);
      font-size: 0.72rem;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 99px;
    }
    .pt-intro-btn {
      align-self: flex-start;
      background: #6d5dfc;
      color: #ffffff;
      border: none;
      border-radius: 12px;
      padding: 10px 20px;
      font-size: 0.88rem;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(109, 93, 252, 0.3);
      transition: all 0.2s ease;
      font-family: inherit;
      margin-top: 12px;
    }
    .pt-intro-btn:hover {
      box-shadow: 0 6px 20px rgba(109, 93, 252, 0.45);
      transform: translateY(-1px);
    }
    .pt-intro-btn:active {
      transform: scale(0.98);
      opacity: 0.95;
    }
    .pt-intro-back-btn {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: var(--text-mid);
      font-size: 0.74rem;
      font-weight: 600;
      padding: 5px 12px;
      border-radius: 8px;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.2s ease;
    }
    .pt-intro-back-btn:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    /* Mobile: stack photo above content */
    @media (max-width: 600px) {
      .pt-intro-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
      }
      .pt-intro-content {
        align-items: center;
      }
      .pt-intro-btn {
        align-self: center;
      }
    }

    /* ══════════════════════════════════════════════
       ETAPA 2: MI OBJETIVO — ALL VIEWPORTS
    ══════════════════════════════════════════════ */
    #tab-objetivo .objetivo-card,
    #tab-objetivo .macro-card,
    #tab-objetivo .motivational-visualizer-card,
    #tab-objetivo .mv-details-card {
      background: rgba(4, 22, 61, 0.96);
      color: #eef6ff;
      border: 1px solid rgba(255, 255, 255, 0.18);
      box-shadow: 0 18px 45px rgba(4, 20, 56, 0.28);
      border-radius: 20px;
    }
    #tab-objetivo .objetivo-label,
    #tab-objetivo .objetivo-meta,
    #tab-objetivo .peso-val,
    #tab-objetivo .macro-val,
    #tab-objetivo .mv-title,
    #tab-objetivo .mv-details-title {
      color: #ffffff;
    }
    #tab-objetivo .peso-lbl,
    #tab-objetivo .peso-unit,
    #tab-objetivo .peso-arrow,
    #tab-objetivo .macro-lbl,
    #tab-objetivo .macro-sub,
    #tab-objetivo .progress-detail,
    #tab-objetivo .mv-disclaimer,
    #tab-objetivo .mv-details-desc,
    #tab-objetivo .mv-label,
    #tab-objetivo .week-legend .wl {
      color: rgba(230, 240, 255, 0.72);
    }
    #tab-objetivo .objetivo-label {
      color: rgba(230, 240, 255, 0.72);
    }
    #tab-objetivo .peso-box {
      background: rgba(255, 255, 255, 0.04);
      border-color: rgba(255, 255, 255, 0.18);
    }
    #tab-objetivo .peso-box.activo {
      border-color: var(--violet);
      background: rgba(124, 92, 252, 0.15);
    }
    #tab-objetivo .peso-box.meta {
      border-color: var(--teal);
      background: rgba(0, 212, 170, 0.12);
    }
    #tab-objetivo .progress-pct {
      color: var(--teal);
    }
    #tab-objetivo .macro-check {
      background: rgba(34, 197, 94, 0.1);
      border: 1px solid rgba(34, 197, 94, 0.25);
      color: #22c55e;
      border-radius: 12px;
    }
    /* Macro cards with accent colors */
    #tab-objetivo .macro-card.kcal {
      border-left: 3px solid #ff8c42;
    }
    #tab-objetivo .macro-card.prot {
      border-left: 3px solid #1ea7ff;
    }
    #tab-objetivo .macro-card.grasa {
      border-left: 3px solid #fbbf24;
    }
    #tab-objetivo .macro-card.carb {
      border-left: 3px solid #14b884;
    }
    /* Week cells */
    #tab-objetivo .week-cell {
      background: rgba(4, 22, 61, 0.96);
      border: 1px solid rgba(255, 255, 255, 0.18);
      color: #eef6ff;
    }
    #tab-objetivo .week-cell.done {
      border-color: rgba(34, 197, 94, 0.5);
      background: rgba(34, 197, 94, 0.1);
    }
    #tab-objetivo .week-cell.today {
      border-color: var(--violet);
      background: rgba(124, 92, 252, 0.15);
    }
    #tab-objetivo .week-cell .wc-day {
      color: #eef6ff;
    }
    /* Motivational visualizer items */
    #tab-objetivo .mv-item {
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.04);
    }
    #tab-objetivo .mv-item.active {
      border-color: rgba(39, 215, 255, 0.5);
      background: rgba(39, 215, 255, 0.08);
    }
    /* Section titles */
    #tab-objetivo .section-title {
      color: #eef6ff;
    }
    /* Adjust button */
    #tab-objetivo .btn-adjust-profile {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.18);
      color: #46d7ff;
      border-radius: 99px;
    }

    /* ══════════════════════════════════════════════
       ETAPA 2: MI PROGRESO — ALL VIEWPORTS
    ══════════════════════════════════════════════ */
    #tab-progreso .progress-log-card,
    #tab-progreso .progress-photos-card {
      background: rgba(4, 22, 61, 0.96);
      color: #eef6ff;
      border: 1px solid rgba(255, 255, 255, 0.18);
      box-shadow: 0 18px 45px rgba(4, 20, 56, 0.28);
      border-radius: 20px;
      padding: 16px;
    }
    #tab-progreso .progress-log-header,
    #tab-progreso .wt-peso,
    #tab-progreso .chart-val,
    #tab-progreso .photo-side-title {
      color: #ffffff;
    }
    #tab-progreso .wt-fecha,
    #tab-progreso .wt-cintura,
    #tab-progreso .chart-label,
    #tab-progreso .section-title {
      color: rgba(230, 240, 255, 0.72);
    }
    #tab-progreso .section-title {
      color: #eef6ff;
    }
    #tab-progreso .wt-row {
      border-bottom-color: rgba(255, 255, 255, 0.08);
    }
    /* Photo angle tabs */
    #tab-progreso .pp-angle-tabs {
      display: flex;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      gap: 6px;
      padding: 4px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 8px;
    }
    #tab-progreso .angle-btn {
      flex: 1 1 0;
      min-width: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 8px 4px;
      font-size: 0.82rem;
      font-weight: 600;
      color: rgba(230, 240, 255, 0.72);
      background: transparent;
      border: none;
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: all var(--t, 0.2s);
    }
    #tab-progreso .angle-btn.active {
      background: var(--violet);
      color: #ffffff;
      border-radius: 6px;
    }
    /* Record dropdown: keep light for legibility */
    #tab-progreso .record-dropdown {
      background: rgba(255, 255, 255, 0.1);
      color: #eef6ff;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 8px;
    }
    /* Photos disclaimer */
    #tab-progreso .photos-disclaimer {
      background: rgba(251, 191, 36, 0.08);
      border: 1px solid rgba(251, 191, 36, 0.2);
      color: #fbbf24;
    }
    /* Photo side boxes */
    #tab-progreso .photo-side-box {
      background: rgba(4, 22, 61, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 16px;
      padding: 12px;
    }

    /* ══════════════════════════════════════════════
       ETAPA 2: CHAT LATERAL — ALL VIEWPORTS
    ══════════════════════════════════════════════ */
    .chat-bubble.pt {
      background: rgba(18, 104, 243, 0.18);
      color: #eef6ff;
      border: 1px solid rgba(39, 215, 255, 0.32);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    .chat-bubble.pt .cb-time {
      color: rgba(230, 240, 255, 0.5);
    }
    .chat-bubble.user {
      background: linear-gradient(135deg, var(--violet), #8b5cf6);
      color: #ffffff;
      box-shadow: 0 4px 12px rgba(109, 93, 252, 0.3);
    }
    /* Chat input area */
    .chat-input-row {
      background: rgba(4, 22, 61, 0.8);
      border-top: 1px solid rgba(255, 255, 255, 0.12);
    }
    .chat-input {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.18);
      color: #eef6ff;
    }
    .chat-input::placeholder {
      color: rgba(230, 240, 255, 0.4);
    }
    /* Suggestion chips */
    .cs-chip {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #46d7ff;
    }
    .cs-chip:hover {
      background: rgba(39, 215, 255, 0.12);
      border-color: rgba(39, 215, 255, 0.35);
    }
    .cs-label {
      color: rgba(230, 240, 255, 0.5);
    }
    .chat-suggestions {
      background: rgba(4, 22, 61, 0.6);
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    /* Chat send button */
    .chat-send {
      background: linear-gradient(135deg, #1268f3, #27d7ff);
      border: none;
      color: #ffffff;
      box-shadow: 0 4px 14px rgba(18, 104, 243, 0.35);
    }

    /* Also apply to onboarding PT bubbles */
    .ob-msg.pt {
      background: rgba(18, 104, 243, 0.18);
      color: #eef6ff;
      border: 1px solid rgba(39, 215, 255, 0.32);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* ══════════════════════════════════
       APP SHELL & PAGE TRANSITIONS
    ══════════════════════════════════ */
    @media (max-width: 1023px) {
      .app {
        width: min(100%, 460px);
        min-height: 100dvh;
        margin: 0 auto;
        position: relative;
        z-index: 1;
      }

      .tab-panel:not(#tab-chat) {
        /* Let app.js .hidden control visibility natively */
        padding: 20px 18px 110px !important;
        animation: fadein 0.25s ease;
      }
      .tab-panel:not(.hidden) { display: flex !important; }
      
      #tab-chat {
        position: fixed !important;
        top: var(--header-h, 64px) !important;
        bottom: calc(72px + max(14px, env(safe-area-inset-bottom)) + 8px) !important;
        left: 0 !important;
        right: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        z-index: 50 !important;
      }
      #tab-chat.hidden {
        display: none !important;
      }
      .chat-wrap {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        width: 100% !important;
        overflow: hidden !important;
        flex: 1 1 0% !important;
      }
      .chat-messages {
        flex: 1 1 0% !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 14px 18px 16px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        scroll-behavior: smooth !important;
      }
      .chat-input-row {
        flex-shrink: 0 !important;
      }
      .chat-suggestions {
        flex-shrink: 0 !important;
      }
    }

    @keyframes fadein {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* Header */
    .topbar {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 24px;
    }
    .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
    
    /* LOGO REAL DE MY ASSISTANT */
    .logo {
      width: 46px; height: 46px;
      display: grid; place-items: center;
      border-radius: 16px;
      background: linear-gradient(145deg, #0fe0ff, #1559ff);
      box-shadow: 0 12px 28px rgba(0,189,255,0.34);
      font-size: 1.45rem; flex-shrink: 0;
      font-weight: 900; color: white;
    }
    .brand-text h1 {
      font-size: 1.25rem; line-height: 1.05;
      letter-spacing: -0.04em; font-weight: 900;
      color: #ffffff;
    }
    .brand-text h1 span { color: #39d7ff; }
    .brand-text p { font-size: 0.82rem; color: var(--text-mid); margin-top: 3px; }
    .brand-text p strong { color: #46d7ff; }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .settings-btn {
      width: 38px; height: 38px;
      border-radius: 50%;
      background: rgba(255,255,255,0.13);
      border: 1px solid rgba(255,255,255,0.22);
      color: white; font-size: 1.1rem;
      display: grid; place-items: center;
      cursor: pointer;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
    }
    .settings-btn:active { background: rgba(255,255,255,0.25); }

    .date-chip {
      border: 1px solid rgba(255,255,255,0.3);
      background: rgba(255,255,255,0.13);
      backdrop-filter: blur(12px);
      border-radius: 999px;
      padding: 9px 13px;
      font-size: 0.76rem; font-weight: 800;
      white-space: nowrap;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
      color: #ffffff;
    }

    /* ══════════════════════════════════
       SHARED COMPONENTS & UI BASES
    ══════════════════════════════════ */
    .hero { margin-bottom: 22px; }
    .hero h2 {
      font-size: clamp(2rem, 12vw, 3.4rem);
      letter-spacing: -0.07em; line-height: 0.94; font-weight: 900;
      text-shadow: 0 12px 30px rgba(0,0,0,0.22);
      color: #ffffff;
    }
    .hero p { margin-top: 10px; color: var(--text-mid); font-size: 0.95rem; }

    .section-head {
      display: flex; align-items: center; justify-content: space-between;
      margin: 20px 0 11px; gap: 10px;
    }
    .section-title {
      display: flex; align-items: center; gap: 9px; min-width: 0;
      font-size: 0.95rem; font-weight: 900; letter-spacing: 0.03em; text-transform: uppercase;
      color: var(--text-w);
    }
    .section-icon {
      width: 32px; height: 32px;
      display: grid; place-items: center; border-radius: 11px;
      background: rgba(255,255,255,0.15);
      border: 1px solid rgba(255,255,255,0.18);
      font-size: 0.95rem; flex-shrink: 0;
    }
    .ghost-btn {
      flex-shrink: 0;
      border: 1px solid rgba(255,255,255,0.35);
      background: rgba(255,255,255,0.09);
      color: var(--text-w); border-radius: 999px;
      padding: 8px 13px; font-size: 0.74rem; font-weight: 800;
      white-space: nowrap; cursor: pointer; font-family: inherit;
    }

    .white-card {
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,248,255,0.98));
      border-radius: var(--r-xl);
      box-shadow: var(--shadow-card);
      border: 1px solid rgba(255,255,255,0.4);
      color: var(--text-dark);
    }

    .dark-card {
      background:
        radial-gradient(circle at 18% 18%, rgba(32,213,255,0.16), transparent 42%),
        linear-gradient(145deg, rgba(4,22,61,0.96), rgba(9,47,105,0.97));
      border-radius: var(--r-xl);
      box-shadow: var(--shadow-ex);
      border: 1px solid rgba(39,215,255,0.38);
      color: var(--text-w);
    }

    /* Bottom Navigation Bar */
    .bottom-nav {
      position: fixed; z-index: 10;
      left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
      transform: translateX(-50%);
      width: min(calc(100% - 28px), 430px);
      height: 72px; border-radius: 24px;
      background: rgba(3,16,45,0.84);
      border: 1px solid rgba(255,255,255,0.15);
      backdrop-filter: blur(20px);
      display: flex;
      align-items: center;
      justify-content: space-around;
    }
    .nav-btn {
      flex: 1;
    }
    .nav-item {
      text-align: center; color: var(--text-mid);
      font-size: 0.63rem; font-weight: 800; cursor: pointer;
      transition: color 0.2s;
      -webkit-tap-highlight-color: transparent;
    }
    .nav-item b {
      display: grid; place-items: center;
      width: 40px; height: 32px;
      margin: 0 auto 2px;
      border-radius: 13px; font-size: 1.1rem;
      transition: all 0.2s;
    }
    .nav-item.active { color: #46d7ff; }
    .nav-item.active b {
      background: linear-gradient(145deg, rgba(18,104,243,0.6), rgba(24,211,255,0.22));
      border: 1px solid rgba(39, 215, 255, 0.32);
      box-shadow: 0 8px 20px rgba(18,104,243,0.28);
    }

    /* ══════════════════════════════════
       TAB: PLAN
    ══════════════════════════════════ */
    .meal-stack {
      overflow: hidden;
      border-radius: var(--r-xl);
      box-shadow: var(--shadow-card);
      border: 1px solid rgba(255,255,255,0.36);
      background: rgba(255,255,255,0.22);
    }
    .meal-card {
      display: grid;
      grid-template-columns: 76px 1fr 42px;
      gap: 11px; align-items: center;
      min-height: 120px; padding: 12px;
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,248,255,0.98));
      color: var(--text-dark);
      border-bottom: 1px solid rgba(30,103,204,0.1);
    }
    .meal-card:last-of-type { border-bottom: 0; }
    .meal-img {
      width: 76px; height: 76px; border-radius: 17px;
      display: grid; place-items: center; font-size: 2.6rem;
      background: radial-gradient(circle at 35% 30%, white 0, #f4fbff 36%, #d9ecff 100%);
      box-shadow: inset 0 1px 0 white, 0 8px 16px rgba(18,104,243,0.1);
    }
    .meal-info { min-width: 0; }
    .meal-title-row { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
    .meal-name { font-size: 0.95rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; }
    .time-badge {
      flex-shrink: 0; padding: 3px 7px; border-radius: 999px;
      color: #446487; background: #e7f2ff; border: 1px solid #cce5ff;
      font-size: 0.64rem; font-weight: 800;
    }
    .meal-desc-text { margin: 5px 0 7px; color: #536684; font-size: 0.78rem; line-height: 1.25; }
    .macro-row { display: flex; gap: 4px; flex-wrap: wrap; }
    .macro-chip {
      display: inline-flex; align-items: center; gap: 3px;
      padding: 4px 6px; border-radius: 9px;
      background: #edf6ff; color: #183256; border: 1px solid #d5e9ff;
      font-size: 0.66rem; font-weight: 800;
    }

    .action-circle {
      width: 36px; height: 36px; border-radius: 50%; border: 0;
      background: linear-gradient(145deg, #1ea7ff, #155cff);
      color: white; font-size: 1.1rem; font-weight: 900;
      box-shadow: 0 8px 18px rgba(18,104,243,0.32);
      cursor: pointer; display: grid; place-items: center; flex-shrink: 0;
    }
    .meal-add-btn {
      width: 100%; border: 0; font-family: inherit; cursor: pointer;
      background: rgba(255,255,255,0.72); color: var(--blue);
      font-weight: 900; font-size: 0.85rem;
      padding: 12px; border-top: 1px solid rgba(30,103,204,0.12);
    }

    /* Exercise cards */
    .ex-card {
      display: grid; grid-template-columns: 44% 1fr;
      gap: 13px; padding: 13px;
      margin-bottom: 10px;
    }
    .ex-card-warmup,
    .ex-card-cooldown {
      display: block !important;
    }
    .ex-card-special-inner {
      width: 100%;
      box-sizing: border-box;
    }
    .ex-preview {
      min-height: 150px; border-radius: 17px;
      position: relative; overflow: hidden;
      background:
        radial-gradient(circle at 50% 60%, rgba(39,215,255,0.26), transparent 38%),
        linear-gradient(145deg, #102443, #07162f);
      display: grid; place-items: center;
      border: 1px solid rgba(255,255,255,0.1);
    }
    .mock-body {
      width: 80px; height: 104px; border-radius: 48% 48% 42% 42%;
      background:
        radial-gradient(circle at 45% 20%, rgba(255,255,255,0.36), transparent 16%),
        linear-gradient(165deg, #8db2d9, #1e6ab8 48%, #08234b);
      filter: drop-shadow(0 0 20px rgba(36,198,255,0.52));
      position: relative; transform: rotate(-10deg);
    }
    .mock-body::before, .mock-body::after {
      content: ""; position: absolute;
      background: linear-gradient(180deg, #8db2d9, #0c56a8);
      border-radius: 999px; box-shadow: 0 0 14px rgba(39,215,255,0.3);
    }
    .mock-body::before { width: 94px; height: 12px; left: -42px; top: 30px; transform: rotate(-12deg); }
    .mock-body::after  { width: 105px; height: 12px; left: -14px; bottom: 8px; transform: rotate(18deg); }
    .play-btn {
      position: absolute; left: 10px; bottom: 10px;
      width: 40px; height: 40px; border-radius: 50%; border: 0;
      background: rgba(255,255,255,0.17); color: white;
      backdrop-filter: blur(8px); font-size: 1rem;
      cursor: pointer; display: grid; place-items: center;
    }
    .ex-info { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
    .ex-header-row { display: flex; justify-content: space-between; align-items: flex-start; }
    .ex-tag {
      display: inline-block; background: var(--blue);
      padding: 4px 8px; border-radius: 8px;
      font-size: 0.65rem; font-weight: 900; margin-bottom: 6px;
      color: #ffffff;
    }
    .ex-options-btn {
      background: none; border: none; color: var(--text-mid);
      font-size: 1.25rem; font-weight: 900; padding: 0 6px; cursor: pointer;
    }
    .ex-name { font-size: 1rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1.12; color: #ffffff; }
    .ex-sub  { margin: 4px 0 9px; font-size: 0.72rem; color: var(--text-mid); }
    .ex-metrics {
      display: grid; grid-template-columns: repeat(3,1fr);
      gap: 1px; border-radius: 12px; overflow: hidden;
      background: rgba(255,255,255,0.1); margin-bottom: 9px;
    }
    .ex-metric { padding: 7px 4px; text-align: center; background: rgba(255,255,255,0.05); }
    .ex-metric strong { display: block; font-size: 1rem; }
    .ex-metric small { display: block; font-size: 0.5rem; opacity: 0.65; text-transform: uppercase; font-weight: 800; margin-top: 1px; }
    
    .tech-btn {
      width: 100%; border: 1px solid rgba(39,215,255,0.5);
      border-radius: 12px; color: #65ddff;
      background: rgba(14,99,195,0.16);
      padding: 9px; font-size: 0.8rem; font-weight: 900;
      cursor: pointer; font-family: inherit;
    }

    .ex-add-btn {
      margin-top: 13px; width: 100%; border-radius: 17px;
      background: rgba(255,255,255,0.1); color: #76e2ff;
      border: 1px solid rgba(255,255,255,0.17);
      font-family: inherit; font-weight: 900; font-size: 0.85rem;
      padding: 12px; cursor: pointer;
    }

    .day-summary-bar {
      margin-top: 14px; padding: 13px;
      border-radius: var(--r-lg);
      background: rgba(6,20,52,0.56);
      border: 1px solid rgba(255,255,255,0.17);
      backdrop-filter: blur(12px);
      display: grid; grid-template-columns: repeat(4,1fr);
      gap: 6px; text-align: center;
    }
    .day-summary-bar strong { display: block; font-size: 1rem; font-weight: 900; color: #ffffff; }
    .day-summary-bar span  { display: block; margin-top: 2px; font-size: 0.62rem; color: var(--text-mid); }

    /* ══════════════════════════════════
       TAB: OBJETIVO
    ══════════════════════════════════ */
    .goal-meta-card {
      padding: 18px;
      margin-bottom: 14px;
    }
    .goal-meta-header { display: flex; justify-content: space-between; align-items: flex-start; }
    .goal-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-soft); }
    .goal-value { font-size: 1.1rem; font-weight: 900; color: var(--text-dark); margin-top: 2px; }
    .goal-avatar { font-size: 2.2rem; }

    .weight-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
    .weight-box {
      flex: 1; text-align: center; padding: 10px 6px;
      border-radius: var(--r-md);
      background: #f4f8ff; border: 1px solid #ddeeff;
    }
    .weight-box.current { background: #dbeafe; border-color: rgba(26,86,219,0.2); }
    .weight-box.goal    { background: #d1fae5; border-color: rgba(16,185,129,0.25); }
    .weight-val { font-size: 1.3rem; font-weight: 900; color: var(--text-dark); }
    .weight-val span { font-size: 0.7rem; color: var(--text-soft); font-weight: 600; }
    .weight-lbl { font-size: 0.58rem; font-weight: 800; text-transform: uppercase; color: var(--text-soft); margin-top: 3px; }
    .weight-arrow { color: #93c5fd; font-size: 1.1rem; flex-shrink: 0; }

    .progress-section { margin-top: 14px; }
    .progress-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
    .progress-lbl { font-size: 0.72rem; font-weight: 800; color: var(--text-soft); }
    .progress-pct { font-size: 0.72rem; font-weight: 900; color: var(--blue); }
    .progress-track { height: 9px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
    .progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--blue-2)); transition: width 0.4s ease; }
    .progress-detail { margin-top: 6px; font-size: 0.65rem; color: var(--text-soft); }

    .macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
    .macro-card {
      padding: 13px; border-radius: var(--r-lg);
      box-shadow: var(--shadow-card);
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,248,255,0.98));
      border: 1px solid rgba(255,255,255,0.4);
    }
    .macro-val { font-size: 1.3rem; font-weight: 900; color: var(--text-dark); }
    .macro-lbl { font-size: 0.62rem; font-weight: 800; color: var(--text-soft); margin-top: 2px; }
    .macro-sub { font-size: 0.55rem; color: #94a3b8; margin-top: 3px; }
    .macro-card.kcal  { border-top: 3px solid #f97316; }
    .macro-card.prot  { border-top: 3px solid #3b82f6; }
    .macro-card.grasa { border-top: 3px solid #eab308; }
    .macro-card.carb  { border-top: 3px solid #10b981; }

    /* CARDS DE REFERENCIA CON IMÁGENES/DIBUJOS REALES */
    .ref-grid {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px;
    }
    .ref-card {
      background: white; border: 1px solid rgba(18,104,243,0.15);
      border-radius: var(--r-md); padding: 6px 4px; text-align: center;
      cursor: pointer; color: var(--text-dark); transition: all 0.2s ease;
      box-shadow: 0 4px 10px rgba(0,0,0,0.03);
      display: flex; flex-direction: column; align-items: center;
    }
    .ref-card.active {
      background: linear-gradient(145deg, #1ea7ff, #1268f3);
      color: white; border-color: transparent;
      box-shadow: 0 8px 18px rgba(18,104,243,0.25);
      transform: scale(1.03);
    }
    .ref-img-container {
      width: 100%; aspect-ratio: 4/5; border-radius: 8px;
      overflow: hidden; margin-bottom: 5px; background: #e0f2fe;
      display: grid; place-items: center;
    }
    .ref-img {
      width: 100%; height: 100%; object-fit: cover;
    }
    .ref-name { font-size: 0.6rem; font-weight: 900; display: block; text-transform: uppercase; }

    .pt-context-card {
      background: rgba(255,255,255,0.11); border: 1px dashed rgba(255,255,255,0.25);
      border-radius: var(--r-lg); padding: 12px 14px; margin-top: 14px;
      font-size: 0.74rem; line-height: 1.45; color: var(--text-mid);
    }

    /* SELECCIÓN DE DÍAS DE ENTRENAMIENTO MÓVIL */
    .days-select-card {
      padding: 16px; margin-top: 14px;
    }
    .days-row {
      display: flex; gap: 4px; justify-content: space-between; margin: 10px 0;
    }
    .day-selector-btn {
      flex: 1; text-align: center; padding: 10px 2px;
      border-radius: var(--r-sm); border: 1px solid var(--stroke);
      background: rgba(255,255,255,0.1); color: white;
      font-size: 0.72rem; font-weight: 800; cursor: pointer;
      display: flex; flex-direction: column; align-items: center; gap: 2px;
      transition: all 0.2s;
    }
    .day-selector-btn.active {
      background: var(--blue); border-color: var(--blue-2);
      box-shadow: 0 4px 12px rgba(18,104,243,0.3);
    }
    .day-check-indicator { font-size: 0.55rem; color: #46d7ff; }

    .days-summary-text {
      font-size: 0.72rem; color: var(--text-mid); line-height: 1.4;
    }
    .days-summary-text strong { color: white; }

    /* ══════════════════════════════════
       TAB: MI PT (CHAT WITH CONTRAST CORRECTIONS)
    ══════════════════════════════════ */
    .chat-screen {
      display: flex; flex-direction: column;
      height: calc(100dvh - 110px);
      padding: 0;
    }
    .chat-header-bar {
      display: flex; align-items: center; gap: 12px;
      padding: 14px 18px 12px;
    }
    .chat-avatar {
      width: 44px; height: 44px; border-radius: 50%;
      background: linear-gradient(145deg, #0fe0ff, #1559ff);
      display: grid; place-items: center; font-size: 1.4rem;
      box-shadow: 0 8px 20px rgba(0,189,255,0.3); flex-shrink: 0;
    }
    .chat-pt-info h3 { font-size: 0.92rem; font-weight: 900; color: #ffffff; }
    .chat-pt-info p  { font-size: 0.68rem; color: var(--text-mid); margin-top: 2px; }
    .chat-online { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); display: inline-block; margin-right: 4px; }

    .chat-messages {
      flex: 1 1 0% !important;
      min-height: 0 !important;
      overflow-y: auto !important;
      overscroll-behavior: contain !important;
      -webkit-overflow-scrolling: touch !important;
      padding: 12px 18px 14px !important;
      display: flex !important;
      flex-direction: column !important;
      gap: 12px !important;
      scroll-behavior: smooth !important;
    }
    .chat-messages::-webkit-scrollbar {
      width: 6px !important;
    }
    .chat-messages::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.2) !important;
    }
    .chat-messages::-webkit-scrollbar-thumb {
      background: rgba(39, 215, 255, 0.4) !important;
      border-radius: 6px !important;
    }
    .chat-messages::-webkit-scrollbar-thumb:hover {
      background: rgba(39, 215, 255, 0.7) !important;
    }
    .bubble-wrap { display: flex; gap: 8px; }
    .bubble-wrap.user { flex-direction: row-reverse; }

    .bubble-avatar {
      width: 32px; height: 32px; border-radius: 50%;
      flex-shrink: 0; display: grid; place-items: center;
      font-size: 1rem; align-self: flex-end;
    }
    .bubble-avatar.pt-av {
      background: linear-gradient(145deg, #0fe0ff, #1559ff);
      box-shadow: 0 4px 12px rgba(0,189,255,0.25);
    }
    .bubble-avatar.user-av {
      background: rgba(255,255,255,0.15);
      border: 1px solid rgba(255,255,255,0.2);
      font-size: 0.85rem;
      color: white;
    }

    .bubble {
      max-width: 78%; padding: 11.5px 15px;
      border-radius: 20px; font-size: 0.85rem; line-height: 1.5;
    }

    .bubble.pt {
      background: #f0fdf4; /* Verde menta muy suave */
      color: #14532d;      /* Verde bosque profundo para legibilidad total */
      border: 1px solid #bbf7d0;
      border-bottom-left-radius: 6px;
      box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    }
    .bubble.pt.alt {
      background: #f0f9ff; /* Celeste claro suave */
      color: #0c4a6e;      /* Azul marino oscuro */
      border: 1px solid #bae6fd;
    }

    .bubble.user {
      background: #1268f3;
      color: #ffffff;
      border-bottom-right-radius: 6px;
      font-weight: 500;
      box-shadow: 0 8px 20px rgba(18,104,243,0.25);
    }
    .bubble-time { font-size: 0.58rem; opacity: 0.72; margin-top: 5px; color: var(--text-mid); }
    .bubble.user + .bubble-time { text-align: right; }

    .action-chip {
      display: inline-flex; align-items: center; gap: 5px;
      background: #1268f3; color: white; border-radius: 999px;
      padding: 5px 12px; font-size: 0.72rem; font-weight: 800;
      margin-top: 8px; text-decoration: none;
      box-shadow: 0 4px 10px rgba(18,104,243,0.22);
    }

    /* Redesigned Pop Quick Suggestion Buttons */
    .suggestions-row {
      padding: 8px 18px 10px;
      display: flex; gap: 8px; overflow-x: auto;
      scrollbar-width: none;
    }
    .suggestions-row::-webkit-scrollbar { display: none; }

    .sugg-chip {
      flex-shrink: 0; padding: 9px 15px;
      border-radius: 999px;
      border: 1.5px solid var(--blue);
      background: var(--card);
      color: var(--blue);
      font-size: 0.75rem; font-weight: 900;
      cursor: pointer; white-space: nowrap;
      box-shadow: 0 4px 12px rgba(18,104,243,0.14);
      transition: all 0.2s ease;
      font-family: inherit;
    }
    .sugg-chip:active {
      transform: scale(0.95);
      background: #edf5ff;
    }

    .chat-input-bar {
      padding: 10px 18px;
      border-top: 1px solid rgba(255,255,255,0.1);
      display: flex; gap: 9px; align-items: flex-end;
    }
    .chat-input {
      flex: 1; padding: 11px 14px;
      border-radius: 16px;
      background: rgba(255,255,255,0.12);
      border: 1px solid rgba(255,255,255,0.2);
      color: white; font-size: 0.88rem; font-family: inherit;
      outline: none; resize: none;
      max-height: 100px; min-height: 44px;
    }
    .chat-input::placeholder { color: rgba(255,255,255,0.4); }
    .chat-send {
      width: 44px; height: 44px; border-radius: 14px; border: 0;
      background: white; color: var(--blue);
      font-size: 1.1rem; cursor: pointer;
      display: grid; place-items: center;
      box-shadow: 0 6px 16px rgba(18,104,243,0.25);
      flex-shrink: 0;
    }

    /* ══════════════════════════════════
       TAB: PROGRESO
    ══════════════════════════════════ */
    .stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-bottom: 14px; }
    .stat-card { padding: 13px 10px; border-radius: var(--r-lg); text-align: center; box-shadow: var(--shadow-card); }
    .stat-icon { font-size: 1.4rem; margin-bottom: 5px; }
    .stat-val  { font-size: 1.15rem; font-weight: 900; color: var(--text-dark); }
    .stat-lbl  { font-size: 0.58rem; font-weight: 800; color: var(--text-soft); margin-top: 2px; text-transform: uppercase; }

    /* Progress Photos Section */
    .photos-card {
      padding: 16px; margin-bottom: 12px;
    }
    .photos-header {
      display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
    }
    .photos-title { font-size: 0.88rem; font-weight: 900; color: var(--text-dark); }
    .photos-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    }
    .photo-slot {
      border-radius: 14px; overflow: hidden; background: #e2e8f0; border: 1px solid #cbd5e1;
      aspect-ratio: 4/5; display: flex; flex-direction: column; justify-content: space-between;
      position: relative; cursor: pointer;
    }
    .photo-img-sim {
      flex: 1; display: grid; place-items: center; font-size: 2.2rem;
      background: linear-gradient(180deg, #f1f5f9, #cbd5e1);
      position: relative;
    }
    .photo-img-sim::before {
      content: "👤"; font-size: 3.5rem; opacity: 0.28;
    }
    .photo-img-sim.now::before {
      opacity: 0.45; filter: drop-shadow(0 0 10px rgba(18,104,243,0.3));
    }
    .photo-label {
      background: rgba(15,23,42,0.72); color: white; text-align: center;
      padding: 5px; font-size: 0.65rem; font-weight: 800;
    }

    .chart-card { padding: 16px; border-radius: var(--r-xl); box-shadow: var(--shadow-card); margin-bottom: 12px; }
    .chart-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
    .chart-title { font-size: 0.85rem; font-weight: 900; color: var(--text-dark); }
    .chart-sub   { font-size: 0.65rem; color: var(--text-soft); margin-top: 2px; }
    .chart-badge { padding: 4px 9px; border-radius: 999px; font-size: 0.65rem; font-weight: 800; }
    .chart-badge.green { background: #d1fae5; color: #065f46; }
    .chart-badge.blue  { background: #dbeafe; color: #1e40af; }

    /* Weight chart */
    .weight-chart {
      display: flex; align-items: flex-end; gap: 5px;
      height: 80px; padding: 4px 0;
      border-bottom: 1px solid #e2e8f0;
      margin-bottom: 8px;
    }
    .chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
    .chart-bar {
      width: 100%; border-radius: 5px 5px 0 0;
      background: linear-gradient(180deg, var(--blue-2), var(--blue));
      opacity: 0.85; transition: height 0.3s ease;
      min-height: 4px;
    }
    .chart-day { font-size: 0.52rem; font-weight: 800; color: var(--text-soft); text-align: center; }
    .chart-day.today { color: var(--blue); }

    /* ══════════════════════════════════
       BOTTOM SHEET (MOBILE OPTION DRAWER)
    ══════════════════════════════════ */
    .sheet-overlay {
      position: fixed; inset: 0; z-index: 100;
      background: rgba(3,16,45,0.6);
      backdrop-filter: blur(4px);
      opacity: 0; pointer-events: none;
      transition: opacity 0.28s ease;
    }
    .sheet-overlay.active { opacity: 1; pointer-events: auto; }

    .bottom-sheet {
      position: fixed; z-index: 101;
      left: 50%; bottom: 0;
      transform: translate(-50%, 100%);
      width: min(100%, 460px);
      background: white; color: var(--text-dark);
      border-radius: var(--r-xl) var(--r-xl) 0 0;
      padding: 24px 18px max(24px, env(safe-area-inset-bottom));
      box-shadow: 0 -12px 36px rgba(0,0,0,0.22);
      transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .bottom-sheet.active { transform: translate(-50%, 0); }

    .sheet-handle {
      width: 44px; height: 5px; background: #cbd5e1; border-radius: 999px;
      margin: -12px auto 16px;
    }
    .sheet-title { font-size: 1.05rem; font-weight: 900; margin-bottom: 12px; }
    .sheet-option-list { display: flex; flex-direction: column; gap: 8px; }
    .sheet-btn {
      width: 100%; padding: 14px; border-radius: 14px; border: 0;
      background: #f1f5f9; color: var(--text-dark); font-family: inherit;
      font-size: 0.85rem; font-weight: 700; text-align: left;
      cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    }
    .sheet-btn.danger { background: #fee2e2; color: #b91c1c; }
    .sheet-btn:active { background: #e2e8f0; }

    /* ══════════════════════════════════
       BOTTOM SHEET: AJUSTAR MIS DATOS (NUEVO)
    ══════════════════════════════════ */
    .sheet-form-group {
      margin-bottom: 12px;
    }
    .sheet-form-label {
      display: block; font-size: 0.72rem; font-weight: 800; color: var(--text-soft);
      text-transform: uppercase; margin-bottom: 5px;
    }
    .sheet-input {
      width: 100%; padding: 11px; border: 1px solid #cbd5e1;
      border-radius: 10px; font-family: inherit; font-size: 0.85rem;
      outline: none; color: var(--text-dark);
    }
    .sheet-row-2col {
      display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    }
    .sheet-select {
      width: 100%; padding: 11px; border: 1px solid #cbd5e1;
      border-radius: 10px; font-family: inherit; font-size: 0.85rem;
      background: white; color: var(--text-dark); outline: none;
    }
    .sheet-checkbox-label {
      display: flex; align-items: center; gap: 8px; font-size: 0.8rem;
      color: var(--text-dark); margin-bottom: 6px; cursor: pointer;
    }

    /* ══════════════════════════════════
       VIDEO LIGHTBOX MODAL
    ══════════════════════════════════ */
    .video-modal-overlay {
      position: fixed; inset: 0; z-index: 200;
      background: rgba(0,0,0,0.96);
      backdrop-filter: blur(12px);
      display: flex; flex-direction: column;
      justify-content: center; align-items: center;
      opacity: 0; pointer-events: none;
      transition: opacity 0.3s ease;
      padding: 16px;
    }
    .video-modal-overlay.active { opacity: 1; pointer-events: auto; }

    .video-modal-container {
      width: 100%;
      height: 85vh;
      max-height: 720px;
      max-width: 420px;
      background: #09132e;
      border-radius: var(--r-xl);
      border: 1px solid rgba(255,255,255,0.18);
      overflow: hidden;
      box-shadow: 0 30px 60px rgba(0,0,0,0.6);
      display: flex;
      flex-direction: column;
      animation: zoomin 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes zoomin {
      from { opacity: 0; transform: scale(0.95); }
      to   { opacity: 1; transform: scale(1); }
    }

    .video-modal-header {
      padding: 16px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .video-modal-title { font-size: 1.1rem; font-weight: 900; color: #ffffff; }
    .video-modal-close {
      background: rgba(255,255,255,0.12);
      border: none;
      color: #ffffff;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      font-size: 1.1rem;
      font-weight: 700;
      cursor: pointer;
      display: grid;
      place-items: center;
    }

    .video-modal-player {
      flex: 1;
      background: #000;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: relative;
    }
    .simulated-video-preview {
      width: 100%;
      height: 100%;
      background: radial-gradient(circle at 50% 50%, #173263 0%, #03081a 100%);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-w);
      text-align: center;
      padding: 20px;
    }
    .simulated-video-preview span {
      font-size: 4rem;
      margin-bottom: 12px;
      display: block;
      animation: pulse-glow 2s infinite;
    }
    .video-modal-body {
      padding: 20px;
      background: rgba(255,255,255,0.03);
      border-top: 1px solid rgba(255,255,255,0.08);
      font-size: 0.85rem;
      line-height: 1.5;
      color: var(--text-mid);
    }
    .video-modal-body strong { color: var(--cyan); }

    /* ══════════════════════════════════════════════
       ETAPA 1 PILOTO: PLAN DE HOY (TARJETAS OSCURAS DE 3046)
    ══════════════════════════════════════════════ */
    #tab-plan .meal-card,
    #tab-plan .macro-card,
    #tab-plan .plan-card,
    #tab-plan .ex-card,
    #tab-plan .meals-total,
    #tab-plan .workout-header-card {
      background: rgba(4, 22, 61, 0.96) !important;
      color: #eef6ff;
      border: 1px solid rgba(255, 255, 255, 0.18);
      box-shadow: 0 18px 45px rgba(4, 20, 56, 0.28);
      border-radius: 20px;
    }

    #tab-plan .meal-stack {
      background: transparent;
      border: none;
      box-shadow: none;
    }

    #tab-plan .meal-name,
    #tab-plan .workout-title,
    #tab-plan .meals-total-val,
    #tab-plan .ex-name {
      color: #ffffff;
    }

    #tab-plan .meal-desc,
    #tab-plan .meal-desc-text,
    #tab-plan .meal-hora,
    #tab-plan .workout-meta,
    #tab-plan .plan-section-label,
    #tab-plan .meals-total-lbl,
    #tab-plan .ex-set-item,
    #tab-plan .ex-num,
    #tab-plan .time-badge {
      color: rgba(230, 240, 255, 0.72);
    }
    #tab-plan .time-badge {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.18);
    }

    #tab-plan .meal-macro,
    #tab-plan .macro-chip {
      background: rgba(255, 255, 255, 0.08);
      color: rgba(230, 240, 255, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.12);
    }
    #tab-plan .meal-macro span,
    #tab-plan .macro-chip span {
      color: #ffffff;
    }

    /* Badges de Macros con colores distintivos de 3046 */
    #tab-plan .macro-chip.kcal,
    #tab-plan .macro-badge.kcal {
      background: rgba(255, 140, 66, 0.18);
      color: #ff8c42;
      border: 1px solid rgba(255, 140, 66, 0.35);
    }
    #tab-plan .macro-chip.prot,
    #tab-plan .macro-badge.prot {
      background: rgba(30, 167, 255, 0.18);
      color: #1ea7ff;
      border: 1px solid rgba(30, 167, 255, 0.35);
    }
    #tab-plan .macro-chip.fat,
    #tab-plan .macro-badge.fat {
      background: rgba(251, 191, 36, 0.18);
      color: #fbbf24;
      border: 1px solid rgba(251, 191, 36, 0.35);
    }
    #tab-plan .macro-chip.carb,
    #tab-plan .macro-badge.carb {
      background: rgba(20, 184, 132, 0.18);
      color: #14b884;
      border: 1px solid rgba(20, 184, 132, 0.35);
    }

    /* Subtabs de Plan (Comidas / Ejercicios)
       Nota: !important necesario porque app.css línea 2353 usa
       .plan-subtab.active { background: #ffffff !important; } */
    #tab-plan .plan-subtabs {
      background: rgba(255, 255, 255, 0.08) !important;
      border: 1px solid rgba(255, 255, 255, 0.15) !important;
      border-radius: 99px !important;
      padding: 3px !important;
    }
    body {
      grid-template-rows: auto 1fr auto !important;
    }
    
    .app-header.topbar {
      position: sticky !important;
      top: 0 !important;
      z-index: 100 !important;
      background: rgba(7, 20, 47, 0.7) !important;
      backdrop-filter: blur(20px) !important;
      border-bottom: 1px solid rgba(255,255,255,0.05) !important;
      height: auto !important;
      min-height: 64px !important;
    }
    #tab-plan .plan-subtab {
      color: rgba(230, 240, 255, 0.72) !important;
      background: rgba(4, 22, 61, 0.6) !important;
      border-radius: 99px !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    #tab-plan .plan-subtab.active {
      background: linear-gradient(135deg, #1268f3, #27d7ff) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 14px rgba(18, 104, 243, 0.35) !important;
      border-color: transparent !important;
    }

    @media (min-width: 769px) {
      #tab-plan .plan-subtabs,
      .plan-subtabs {
        display: none !important;
      }
      #plan-section-comidas,
      #plan-section-ejercicios {
        display: block !important;
      }
    }

    /* meal-add-btn y day-summary-bar */
    #tab-plan .meal-add-btn {
      background: rgba(255, 255, 255, 0.06);
      color: #46d7ff;
      border-top: 1px solid rgba(255, 255, 255, 0.12);
    }
    #tab-plan .day-summary-bar {
      background: rgba(4, 22, 61, 0.96);
      color: #eef6ff;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 20px;
    }
    #tab-plan .day-summary-bar .meals-total-lbl {
      color: rgba(230, 240, 255, 0.72);
    }
    #tab-plan .day-summary-bar .meals-total-val {
      color: #ffffff;
    }

  
/* FIXES PARA PANELES DE ALTERNATIVAS E INLINE EDITORS */
.meal-inline-editor, .ex-inline-editor {
  background: rgba(4, 22, 61, 0.96) !important;
  border: 1px solid rgba(18, 104, 243, 0.3) !important;
}
.inline-label {
  color: rgba(230, 240, 255, 0.8) !important;
  font-weight: 600 !important;
}
.inline-input-sm, .inline-input {
  background: #ffffff !important;
  color: #121212 !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
}
.alt-card-quick {
  background: rgba(4, 22, 61, 0.96) !important;
  border: 1px solid rgba(39, 215, 255, 0.3) !important;
}
.acq-name {
  color: #ffffff !important;
}
.acq-macros {
  color: rgba(230, 240, 255, 0.8) !important;
}
.acq-diff {
  color: #27d7ff !important;
}
.acq-reason {
  color: rgba(230, 240, 255, 0.7) !important;
}
.acq-use-btn, .isi-use-btn, .inline-submit-btn {
  background: #1268f3 !important;
  color: #ffffff !important;
  border: 1px solid #27d7ff !important;
  border-radius: 8px !important;
}
.acq-use-btn:hover, .isi-use-btn:hover, .inline-submit-btn:hover {
  background: #27d7ff !important;
  color: #04163d !important;
}
.inline-save-btn {
  background: #1268f3 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}
.inline-cancel-btn {
  background: rgba(255,255,255,0.1) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}

/* =========================================================================
   CONTRASTE DE BOTONES EN PLAN (Aprobado)
   ========================================================================= */

/* 1. Botones de Navegación de Semanas y Resumen Diario (Estilo Lista de Compras) */
.week-nav-btn,
.week-nav-active,
#btn-ver-resumen {
  background: linear-gradient(135deg, #27d7ff, #7b61ff) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(39, 215, 255, 0.25) !important;
  transition: all 0.2s ease !important;
}
.week-nav-btn:hover,
.week-nav-btn:active,
#btn-ver-resumen:hover,
#btn-ver-resumen:active {
  box-shadow: 0 6px 16px rgba(39, 215, 255, 0.4) !important;
  transform: translateY(-1px) !important;
}

/* 2. Botones de Días (Lunes a Domingo) en Plan (wm-days-bar) - Tono Rosado */
.wm-day-btn {
  background: rgba(255, 182, 193, 0.35) !important;
  border: 1px solid rgba(255, 182, 193, 0.7) !important;
  transition: all 0.2s ease !important;
}
.wm-day-btn .wm-day-label {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}
.wm-day-btn .wm-day-badge {
  font-size: 0.65rem !important;
  margin-top: 2px !important;
  color: #ffffff !important;
}
.wm-day-btn:hover,
.wm-day-btn:active {
  background: rgba(255, 140, 170, 0.50) !important;
  border-color: #ff8caa !important;
}
.wm-day-active {
  background: rgba(255, 140, 170, 0.65) !important;
  border-color: #ff8caa !important;
  box-shadow: 0 0 10px rgba(255, 140, 170, 0.4) !important;
}
.wm-day-active .wm-day-label,
.wm-day-active .wm-day-badge {
  color: #ffffff !important;
}

/* 3. Botones grandes de Añadir (Comida y Ejercicio) - Tono Coral */
#tab-plan .meal-add-btn,
#tab-plan .ex-add-btn {
  background: rgba(239, 100, 82, 0.18) !important;
  border: 1px solid rgba(239, 100, 82, 0.45) !important;
  color: #ffd8d2 !important;
  transition: all 0.2s ease !important;
}
#tab-plan .meal-add-btn:hover,
#tab-plan .meal-add-btn:active,
#tab-plan .ex-add-btn:hover,
#tab-plan .ex-add-btn:active {
  background: rgba(239, 100, 82, 0.38) !important;
  border-color: #ef6452 !important;
  color: #ffffff !important;
}


/* Burbujas del Chat */
#tab-chat .chat-bubble.pt {
  background: linear-gradient(135deg, rgba(4, 22, 61, 0.9), rgba(18, 104, 243, 0.2)) !important;
  border: 1px solid rgba(39, 215, 255, 0.25) !important;
  color: #eef6ff !important;
}
#tab-chat .chat-bubble.usuario {
  background: rgba(124, 92, 252, 0.25) !important;
  border: 1px solid rgba(124, 92, 252, 0.5) !important;
  color: #ffffff !important;
}

/* =========================================================================



/* =========================================================================
   ADAPTACIONES VISUALES DEL PLAN Y CABECERA (Aprobado)
   ========================================================================= */

/* Cabecera / Foto de Ryan */


@media (max-width: 600px) {
  
}

/* Ocultar el saludo "Hola Gerardo" en móvil si ocupa mucho espacio, o dejarlo. 
   El usuario pidió que quede así:
   [ Ryan grande ]  My Assistant PT
                    Hola, Testing 👋
                    Toca la foto para conocer a Ryan
*/

/* Tarjetas del Plan (Alta legibilidad) */
.meal-card-title,
.meal-name {
  color: #ffffff !important;
  font-weight: 800 !important;
}

.meal-desc {
  color: rgba(255, 255, 255, 0.88) !important;
}

.meal-hora {
  color: #ffffff !important;
  font-weight: 800 !important;
}

.meal-macro {
  color: #eaf4ff !important;
  background: rgba(23, 103, 190, 0.18) !important;
  border: 1px solid rgba(39, 215, 255, 0.32) !important;
}

/* Botones de acción normales */
.meal-action-btn {
  color: #ffffff !important;
  background: rgba(4, 22, 61, 0.65) !important;
  border: 1px solid rgba(39, 150, 255, 0.55) !important;
  transition: all 0.2s ease;
}

/* Variantes específicas usando selectores de atributo (ya que app.js inyecta el onclick) */
/* Eliminar */
.meal-action-btn[onclick*="deleteMeal"] {
  color: #ffffff !important;
  background: rgba(190, 30, 55, 0.82) !important;
  border-color: #ff4d67 !important;
}

/* No tengo ingrediente */
.meal-action-btn[onclick*="no_tengo_ingrediente"] {
  color: #ffffff !important;
  background: rgba(120, 15, 40, 0.28) !important;
  border-color: #ff4d67 !important;
}

/* Dame alternativa */
.meal-action-btn[onclick*="dame_alternativa"] {
  color: #ffffff !important;
  background: rgba(0, 125, 115, 0.55) !important;
  border-color: #00d7c0 !important;
}


.ryan-avatar-btn {
  width: 108px !important;
  height: 108px !important;
  min-width: 108px !important;
  flex-shrink: 0 !important;
}

.ryan-avatar-header {
  width: 108px !important;
  height: 108px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  border: 2px solid #27d7ff !important;
  box-shadow: 0 4px 12px rgba(39, 215, 255, 0.35) !important;
  flex-shrink: 0 !important;
}

/* Cabecera superior */
.app-header .app-header-brand.brand { gap: 24px !important; align-items: center !important; }

/* ── MODAL PLAN SEMANAL DE ENTRENAMIENTO (Opción A) ── */
.ww-day-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  box-sizing: border-box;
}
.ww-day-card:hover {
  border-color: rgba(39, 215, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}
.ww-day-card.active-day {
  border: 1.5px solid rgba(39, 215, 255, 0.7);
  background: rgba(39, 215, 255, 0.08);
  box-shadow: 0 4px 18px rgba(39, 215, 255, 0.14);
}
.ww-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  cursor: pointer;
  user-select: none;
  min-height: 32px;
}
.ww-day-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ww-day-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}
.ww-today-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(39, 215, 255, 0.22);
  color: #27d7ff;
  border: 1px solid rgba(39, 215, 255, 0.5);
  padding: 1px 7px;
  border-radius: 8px;
}
.ww-badges-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ww-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ww-badge-workout {
  background: rgba(39, 215, 255, 0.15);
  color: #27d7ff;
  border: 1px solid rgba(39, 215, 255, 0.35);
}
.ww-badge-rest {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.ww-badge-status-completed {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.ww-badge-status-pending {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.ww-badge-status-skipped {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.ww-badge-status-rest {
  background: rgba(129, 140, 248, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.3);
}
.ww-day-focus {
  font-size: 0.84rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
}
.ww-day-metrics {
  font-size: 0.74rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ww-accordion-trigger {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #27d7ff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  transition: all 0.2s ease;
}
.ww-accordion-trigger:hover {
  background: rgba(39, 215, 255, 0.14);
  border-color: rgba(39, 215, 255, 0.35);
}
.ww-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ww-exercise-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}
.ww-ex-thumb {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ww-ex-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ww-ex-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ww-ex-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.ww-go-day-btn {
  margin-top: 6px;
  background: rgba(39, 215, 255, 0.12);
  border: 1px solid rgba(39, 215, 255, 0.35);
  color: #27d7ff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  width: 100%;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.ww-go-day-btn:hover {
  background: rgba(39, 215, 255, 0.22);
  border-color: #27d7ff;
  color: #ffffff;
}

@media (max-width: 480px) {
  .workout-week-card {
    width: 100% !important;
    max-height: 90dvh !important;
    border-radius: 20px 20px 0 0 !important;
  }
  .ww-day-title {
    font-size: 0.88rem;
  }
  .ww-day-focus {
    font-size: 0.8rem;
  }
}