/* Homepage enhancement only. The original desktop and textbook styles stay unchanged. */
@media (max-width: 680px) {
  .catalog-shell.catalog-mobile-ready { padding-top: 0; }
  .catalog-mobile-ready .catalog-heading,
  .catalog-mobile-ready .filter-subject > .filter-label,
  .catalog-mobile-ready .filter-edition,
  .catalog-mobile-ready .filter-grade,
  .catalog-mobile-ready .filter-semester,
  .catalog-mobile-ready .result-summary { display: none; }

  .catalog-mobile-ready .catalog-filters {
    position: sticky;
    top: 0;
    z-index: 30;
    overflow: visible;
    margin-bottom: 10px;
    padding: 10px 0 0;
    border: 0;
    border-radius: 0;
    background: var(--catalog-bg);
  }
  .catalog-mobile-ready .filter-subject { padding: 0 0 10px; border: 0; }
  .catalog-mobile-ready .filter-subject .filter-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 0;
  }
  .catalog-mobile-ready .filter-subject .filter-button { min-width: 0; padding-inline: 4px; }
  .catalog-mobile-ready .mobile-filter-summary {
    gap: 8px;
    min-height: 54px;
    padding: 4px 6px 4px 12px;
    border: 1px solid var(--catalog-line);
    border-radius: 6px;
    background: #fff;
  }
  .catalog-mobile-ready .mobile-filter-summary strong { min-width: 0; font-size: 14px; }
  .catalog-mobile-ready .mobile-filter-summary button {
    flex: 0 0 auto;
    min-width: 72px;
    padding-inline: 12px;
    border: 1px solid var(--catalog-green);
    background: #fff;
    color: var(--catalog-green);
  }

  .catalog-mobile-sheet[open] {
    position: fixed;
    inset: auto 0 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    box-sizing: border-box;
    width: 100%;
    max-width: 680px;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--catalog-line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: #fff;
    color: var(--catalog-text);
  }
  .catalog-mobile-sheet::backdrop { background: rgba(16, 27, 22, .42); }
  .catalog-mobile-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 6px;
  }
  .catalog-mobile-sheet-head h2 { margin: 0; font-size: 19px; line-height: 1.4; }
  .catalog-mobile-sheet button,
  .catalog-mobile-sheet select { font: inherit; font-size: 15px; }
  .catalog-mobile-sheet-close {
    min-height: 44px;
    min-width: 44px;
    padding: 0 2px;
    border: 0;
    border-radius: 4px;
    background: #fff;
    color: var(--catalog-muted);
    cursor: pointer;
  }
  .catalog-mobile-sheet-body {
    min-height: 0;
    padding: 0 16px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .catalog-mobile-field { min-width: 0; margin: 0; padding: 0; border: 0; }
  .catalog-mobile-field + .catalog-mobile-field { margin-top: 18px; }
  .catalog-mobile-field > label,
  .catalog-mobile-field > legend { display: block; margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 700; }
  .catalog-mobile-field .edition-select { box-sizing: border-box; min-height: 46px; font-size: 14px; }
  .catalog-mobile-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .catalog-mobile-options button { min-width: 0; min-height: 44px; padding-inline: 3px; }
  .catalog-mobile-options button:disabled { border-color: #e7eae8; background: #f1f3f2; color: #88918c; cursor: not-allowed; }
  .catalog-mobile-options button:disabled.is-active { border-color: #a7b5ac; }
  .catalog-mobile-semesters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-mobile-availability { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; margin-top: 4px; }
  .catalog-mobile-availability p { flex: 1 1 190px; margin: 0; color: var(--catalog-muted); font-size: 13px; line-height: 1.6; }
  .catalog-mobile-availability button {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: #fff;
    color: var(--catalog-green);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }
  .catalog-mobile-no-results { margin: 14px 0 0; color: #9b4728; font-size: 14px; line-height: 1.6; }
  .catalog-mobile-sheet-foot {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--catalog-line);
    background: #fff;
  }
  .catalog-mobile-sheet-foot button { min-height: 48px; padding: 8px; border: 1px solid var(--catalog-green); border-radius: 6px; cursor: pointer; }
  .catalog-mobile-reset { background: #fff; color: var(--catalog-green); }
  .catalog-mobile-apply { background: var(--catalog-green); color: #fff; font-weight: 700 !important; }
  .catalog-mobile-apply:disabled { border-color: #e2e7e4; background: #edf1ee; color: #87948d; cursor: not-allowed; }
  .catalog-mobile-sheet button:focus-visible,
  .catalog-mobile-ready #mobile-edition-toggle:focus-visible { outline: 2px solid var(--catalog-green); outline-offset: 2px; }
}
