/* Responsive polish — Class / Tutor / hub (móvil + tablet) */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* —— Hub —— */
@media (max-width: 900px) {
  .hub-app {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

@media (max-width: 640px) {
  .hub-brand h1 {
    font-size: 1.45rem;
  }

  .hub-header-actions {
    width: 100%;
  }

  .hub-header-actions .session-identity {
    width: 100%;
    max-width: none;
  }

  .hub-card {
    min-height: 0;
    padding: 1rem 1.05rem;
  }

  .hub-tip::after,
  .tv-tip::after {
    left: 0;
    transform: none;
    width: min(16.5rem, calc(100vw - 2.5rem));
  }
}

/* —— Tutor vocacional —— */
@media (max-width: 900px) {
  .tv-app {
    padding: 1rem max(0.85rem, env(safe-area-inset-right)) 2.5rem max(0.85rem, env(safe-area-inset-left));
  }

  .tv-header-side {
    width: 100%;
    align-items: stretch;
  }

  .tv-header-side .lang-switcher {
    align-self: flex-start;
  }

  .tv-nav {
    width: 100%;
    gap: 0.45rem 0.75rem;
  }

  .tv-nav a {
    font-size: 0.85rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
  }

  .tv-activity-grid {
    grid-template-columns: 1fr;
  }

  .tv-actions {
    flex-wrap: wrap;
  }

  .tv-actions .tv-btn,
  .tv-actions .tv-btn-ghost,
  .tv-chat-form .tv-btn {
    min-height: 2.75rem;
  }

  .tv-chat-form {
    flex-wrap: wrap;
  }

  .tv-chat-form input {
    min-width: 0;
    flex: 1 1 100%;
  }

  .admin-pre {
    font-size: 0.72rem;
    max-height: 50vh;
  }
}

@media (max-width: 560px) {
  .tv-panel {
    padding: 1rem;
    border-radius: 12px;
  }

  .tv-header h1 {
    font-size: 1.35rem;
  }

  .tv-brand {
    font-size: 0.78rem;
  }

  .hitl-layout {
    gap: 0.75rem;
  }
}

/* —— Panel docente / reporte —— */
@media (max-width: 900px) {
  .class-prep .workspace-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }

  .class-prep .workspace-tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .dashboard .session-identity,
  .class-prep .session-identity {
    max-width: none;
    width: 100%;
  }

  .form-footer-actions .btn-primary,
  .form-footer-actions .btn-secondary,
  .match-actions .btn-primary,
  .match-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .mission-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Tablet sweet spot */
@media (min-width: 641px) and (max-width: 1024px) {
  .hub-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tv-layout {
    grid-template-columns: 1fr;
  }

  .app.dashboard,
  .hub-app {
    max-width: 920px;
  }
}
