/* Adapt the learning hierarchy for tablets and narrow student phones. */
@media (max-width: 1080px) {
  .today-grid, .progress-grid { grid-template-columns: 1fr; }
  .week-goal-panel { grid-template-columns: 1fr 1fr; }
  .week-goal-panel .section-heading, .week-goal-panel .week-range { grid-column: 1 / -1; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  :root { --topbar: 68px; }
  body { padding-bottom: 66px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 330px; padding: 28px 24px; }
  .auth-message h1 { font-size: 31px; }
  .auth-preview { display: none; }
  .auth-form-panel { min-height: auto; padding: 34px 22px 46px; }
  .auth-form-wrap h2 { font-size: 28px; }
  .app-shell { display: block; min-height: calc(100vh - 66px); }
  .sidebar { display: none; }
  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 15; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); height: 66px; padding: 5px 6px; background: var(--surface); border-top: 1px solid var(--border); }
  .mobile-nav-link { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; color: var(--ink-soft); border-radius: var(--radius); font-size: 9px; }
  .mobile-nav-link.is-active { color: #6d50c8; background: var(--brand-pale); font-weight: 800; }
  .mobile-nav-link.is-disabled { opacity: .48; }
  .mobile-nav-link svg { width: 18px; height: 18px; }
  .topbar { padding: 0 16px; }
  .topbar { gap: 10px; }
  .topbar > div:first-child { min-width: 0; }
  .topbar h1 { font-size: 20px; }
  .topbar p { font-size: 10px; }
  .today-topbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; min-height: auto; padding-top: 12px; padding-bottom: 12px; }
  .today-topbar .today-date-navigation { justify-content: space-between; }
  .today-date-navigation { gap: 4px; }
  .day-nav-button { width: 30px; height: 30px; }
  .day-nav-button svg { width: 16px; height: 16px; }
  .date-badge { padding: 8px 10px; font-size: 10px; }
  .date-badge svg { display: none; }
  .page-content { gap: 16px; padding: 18px 16px 24px; }
  .daily-summary { grid-template-columns: minmax(0, 1fr) 92px; min-height: 84px; }
  .daily-summary > div { display: none; }
  .daily-summary .summary-lead, .daily-summary > div:nth-child(2) { display: grid; padding: 12px 16px; }
  .daily-summary strong { font-size: 19px; }
  .summary-lead strong { font-size: 17px; }
  .daily-study-progress-copy em { display: none; }
  .daily-math { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; min-height: 68px; padding: 10px; }
  .daily-math-icon { width: 36px; height: 36px; }
  .daily-math-copy span, .daily-math-progress { display: none; }
  .daily-math-action { min-height: 34px; padding: 0 10px; font-size: 10px; }
  .section-heading h2 { font-size: 18px; }
  .task-list { gap: 8px; }
  .task-row { grid-template-columns: 22px 34px minmax(0, 1fr) 16px; gap: 10px; min-height: 62px; padding: 8px 11px; }
  .task-icon { width: 34px; height: 34px; }
  .task-icon svg { width: 17px; }
  .task-copy strong { font-size: 12px; }
  .task-copy span { display: none; }
  .task-duration { width: 16px; overflow: hidden; color: transparent; }
  .task-duration::after { content: "›"; color: var(--ink-muted); font-size: 20px; }
  .week-goal-panel { display: none; }
  .week-goal-strip { gap: 13px; padding: 13px 14px; }
  .week-day { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .week-day-heading { flex-direction: row; align-items: end; }
  .compact-task { grid-template-columns: 20px 48px minmax(0, 1fr); }
  .compact-task em { display: none; }
  .week-math-row em { display: inline-flex; }
  .compact-task small { white-space: normal; }
  .metric-row { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .metric-row article { min-height: 86px; padding: 12px; }
  .metric-row article > span { width: 34px; height: 34px; }
  .metric-row strong { font-size: 20px; }
  .progress-panel { padding: 16px; }
  .progress-line { grid-template-columns: 100px minmax(0, 1fr) 34px; gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
