/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .session-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-word {
    min-width: 160px;
    padding: 21px 21px;
  }
}

@media (max-width: 1100px) {
  .hero-words {
    gap: 8px;
  }

  .hero-word {
    min-width: 146px;
    padding: 19px 19px;
  }
}

@media (max-width: 1080px) {
  .sheets {
    grid-template-columns: 1fr;
  }

  .sheet {
    min-height: 280px;
  }

  .sheet textarea {
    min-height: 210px;
  }

  .split {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .notepad-view {
    padding: 24px;
  }
}

@media (max-width: 960px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100%;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }

  body.nav-open .sidebar {
    transform: none;
  }

  body.nav-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 12, 10, 0.45);
    z-index: 45;
    animation: fade 0.18s ease both;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .topbar {
    display: flex;
  }

  .page {
    padding: 26px 22px 80px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .session-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notepad-list {
    position: static;
    max-height: none;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
  }

  .notepad-item {
    min-width: 210px;
    border: 1px solid var(--line);
  }

  .auth {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-mobile-tagline {
    display: block;
  }

  .auth-panel {
    min-height: 100vh;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 16px 70px;
  }

  .session-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 32px;
  }

  .word-row-term {
    min-width: 120px;
  }

  .word-row-meaning {
    display: none;
  }

  .inline-form {
    width: 100%;
  }

  .inline-form .input {
    width: 100%;
    flex: 1;
  }

  .notepad-view {
    padding: 20px 18px 24px;
  }

  .modal {
    padding: 20px;
  }

  .toast-host {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  .search-input {
    padding-right: 16px;
  }

  .search-meta {
    display: none;
  }
}

@media print {
  .sidebar,
  .topbar,
  .toast-host,
  .head-actions,
  .search-wrap,
  .results-toolbar,
  .back-link,
  .save-status,
  .autosave-note {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  body {
    background: #fff;
  }

  .student-group {
    break-inside: avoid;
    box-shadow: none;
  }
}
