/* ══════════════════════════════════════════════════════════════
   Tatami Atlas · capa móvil (se carga la última)
   Tamaños legibles, objetivos táctiles de 44 px, campos de 16 px
   (evitan el zoom de iOS) y composición a una columna.
   ══════════════════════════════════════════════════════════════ */
@media (max-width:850px){
  html{scroll-padding-top:72px}
  body{font-size:15px;line-height:1.55;-webkit-tap-highlight-color:transparent}
  .topbar{padding-top:env(safe-area-inset-top);height:calc(60px + env(safe-area-inset-top))}
  .view{padding:16px 16px calc(104px + env(safe-area-inset-bottom))!important}

  /* Tipografía: nada por debajo de 11 px */
  .section-kicker{font-size:11px!important;letter-spacing:.1em}
  .page-intro h2,.pro-heading h2{font-size:34px!important;line-height:1}
  .page-intro p,.pro-heading p{font-size:15px}
  .journey-stats span,.personal-map-legend,.personal-map-legend span,.map-hint{font-size:12.5px!important}
  .tool-card p{font-size:13.5px!important}
  .tool-card em{font-size:12.5px!important}
  .results-line,.results-line b,.results-line span,.results-line em{font-size:13px!important}
  .play-chip,.soon-chip{font-size:11px!important}
  .type-chip{font-size:11px!important}
  .filter-button{font-size:13px!important}
  .filter-button span{font-size:11px!important}
  .score-grid span{font-size:12px!important}
  .score-grid b{font-size:30px!important}
  .journal-entry header span,.journal-entry footer,.journal-entry footer span,.plan-context label,.plan-context p{font-size:13px!important}
  .challenge-counter span,.success-rule span{font-size:12px!important}
  .tech-card-copy p,.tech-card-copy small,.tech-card-copy span{font-size:13px!important}
  .rules-row b,.rules-facts span{font-size:12.5px!important}
  .mobile-nav button{font-size:11px!important}
  small{font-size:max(12px,.85em)}

  /* Objetivos táctiles */
  .solid-button,.invite-btn,.ghost-ink-button,.pro-actions button,.survey-footer button,.journey-empty button{min-height:46px}
  .favorite{min-width:42px!important;min-height:42px!important;display:inline-grid;place-items:center}
  .text-button,.text-link{min-height:40px;display:inline-flex;align-items:center}
  .modal-close{width:42px!important;height:42px!important}

  /* Campos a 16 px: iOS no hace zoom al tocarlos */
  input,select,textarea{font-size:16px!important}
  .search-field input,#tech-search{min-height:44px}

  /* Cabeceras de sección apiladas */
  .page-intro,.pro-heading{flex-direction:column!important;align-items:stretch!important;gap:14px!important}
  .page-intro>button,.page-intro>.solid-button{align-self:flex-start}
  .pro-heading .pro-actions{display:flex;flex-wrap:wrap;gap:8px;width:100%}
  .pro-heading .pro-actions>*{flex:1 1 auto}

  /* Inicio */
  [data-view="Hoy"] .journey-heading .section-kicker{display:none}
  [data-view="Hoy"] .journey-heading{min-height:170px!important;padding:24px 20px!important}
  [data-view="Hoy"] .journey-heading h2{font-size:38px!important}
  .personal-map-head{flex-wrap:wrap!important;gap:10px!important}
  .personal-map-head>div:first-child{width:100%}
  .personal-map-head button{flex:1 1 calc(50% - 5px);justify-content:center;min-height:42px}
  .journey-shortcuts b{font-size:24px}

  /* Pestañas y filtros: scroll horizontal en vez de apilarse */
  .pro-tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;width:100%;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .pro-tabs::-webkit-scrollbar{display:none}
  .pro-tabs button{white-space:nowrap;flex:none}
  .filter-pills,.map-filters{flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;padding-bottom:4px}
  .filter-pills::-webkit-scrollbar,.map-filters::-webkit-scrollbar{display:none}
  .filter-pills button,.map-filters button{flex:none;white-space:nowrap;min-height:38px}

  /* Tablas anchas: se desplazan dentro de su tarjeta */
  .profile-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  .profile-table th,.profile-table td{white-space:nowrap}

  /* Tarjetas y listas a una columna */
  .system-cards,.template-cards,.technique-grid,.tools-grid,.journey-shortcuts,.rules-grid{grid-template-columns:1fr!important}
  .challenge-card,.goal-active,.pro-panel,.rules-card,.journal-entry{padding:18px!important}
  .challenge-card h3,.goal-active h3{font-size:30px!important}
  .library-toolbar{display:grid;gap:10px}
  .modality-toggle{overflow-x:auto}

  /* Encuesta */
  .survey-layout{display:block!important}
  .survey-steps{display:flex!important;overflow-x:auto;gap:6px;padding:6px!important;margin-bottom:12px;scrollbar-width:none}
  .survey-steps::-webkit-scrollbar{display:none}
  .survey-steps button{flex:none;white-space:nowrap}
  .survey-toolbar{flex-direction:column;align-items:stretch;gap:10px}
  .survey-toolbar .pro-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .survey-footer{flex-direction:column-reverse;align-items:stretch;gap:10px}
  .survey-footer .solid-button{width:100%}

  /* Modales como hojas inferiores */
  dialog.pro-modal{max-height:92dvh;overflow:auto;padding-bottom:calc(20px + env(safe-area-inset-bottom))!important}
  .pro-modal h2{font-size:28px!important}

  /* Tutorial */
  .tour-actions .solid-button{width:auto!important;flex:none;padding:11px 18px;min-height:44px}
  .tour-actions .invite-btn{min-height:44px}

  /* Barra de navegación inferior */
  .mobile-nav{padding-bottom:calc(6px + env(safe-area-inset-bottom))!important}
  .mobile-nav button{min-height:52px}

  /* Restos de tamaños pequeños */
  .rules-card p,.rules-card .rule-footnote,.rule-footnote{font-size:13px!important}
  .rules-status{font-size:11px!important}
  #rules-app .rules-controls label span{font-size:11.5px!important}
  .roadmap-step summary span,.roadmap-step small,.roadmap-step p{font-size:13px!important}
  .journal-entry footer button,.backup-card button{font-size:13px!important;min-height:40px}
  .media-credit{font-size:12px!important}
  .favorite{font-size:18px!important}
  .tech-media-placeholder small,.technique-card small{font-size:12px!important}
  .plot-point{min-width:38px!important;min-height:38px!important;font-size:12px!important}

  /* Biblioteca */
  .tech-image{min-height:170px}
  .tech-name{font-size:21px!important}
}
@media (max-width:380px){
  .page-intro h2,.pro-heading h2{font-size:30px!important}
  [data-view="Hoy"] .journey-heading h2{font-size:33px!important}
  .journey-stats b{font-size:34px!important}
  .goal-tally{gap:8px}
}
@media(max-width:850px){dialog.video-quick{max-width:100vw!important;width:100vw!important;margin:auto 0 0!important}}
