@media (max-width: 768px) {
  /* 1. 全体・表示切り替え設定 */
  html {
    font-size: 95%;
  }
  .pc-only {
    display: none !important;
  }
  .sp-only {
    display: block !important;
  }

  /* 2. ヘッダーの調整 */
  .site-header {
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    color: #333;
    background-image: url('/library/img/common/header_bg_sp-80.jpg');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: contain;
  }

  .header-container {
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
  }

  .site-header .header-utilities {
    display: none !important;
  }

  .header-branding {
    display: flex;
    align-items: center;
    max-width: 80%;
  }

  .complex-logo {
    width: 3.5rem;
  }

  .library-title-area {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid #444;
  }

  .library-title {
    font-size: 0.95rem !important;
    white-space: nowrap;
    color: #7756A6;
    background-color: transparent;
  }

  /* 3. ハンバーガーメニューボタン */
  .menu-toggle {
    display: block !important;
    background: none;
    color: #333;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 1100;
  }

  .menu-toggle-icon {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--primary-blue);
    color: #333;
    transition: all 0.3s;
    position: relative;
  }

  .menu-toggle-icon::before,
  .menu-toggle-icon::after {
    content: '';
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--primary-blue);
    color: var(--primary-blue);
    position: absolute;
    left: 0;
    transition: all 0.3s;
  }

  .menu-toggle-icon::before { top: -8px; }
  .menu-toggle-icon::after { top: 8px; }

  /* 4. メニュー本体（ドロワー）レイアウト */
  .nav-wrapper {
    display: flex !important;
    position: fixed;
    top: 0;
    right: -100%; 
    width: 85%;
    max-width: 340px;
    height: 100vh;
    background: #fff;
    color: #333;
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    flex-direction: column; 
    padding: 15px 0;
    box-shadow: -10px 0 20px rgba(0,0,0,0.1);
    overflow-y: auto; 
  }

  body.menu-open .nav-wrapper {
    right: 0;
  }

  /* 閉じるボタン */
  .btn-close-menu {
    align-self: flex-end;
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #333;
    margin: 0 5% 0.8rem 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  /* ドロワー内：文字サイズ・アクセス */
  .nav-wrapper #mobile-utilities {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 5%;
    margin-bottom: 0.8rem;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid #eee;
  }

  .nav-wrapper .font-size-selector,
  .nav-wrapper .access-link {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  .nav-wrapper .nav-button,
  .nav-wrapper .sub-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 90% !important;  
    max-width: none !important;
    margin: 0.55rem auto !important; 
    height: 3.2rem !important; 
    background-color: #fff !important;
    border: 1.5px solid var(--primary-blue) !important;
    border-radius: 10px !important;
    color: #333 !important;
    text-decoration: none !important;
    font-weight: bold !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
    text-align: center !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
  }

  .nav-wrapper .sub-menu-btn br,
  .nav-wrapper .nav-button br {
    display: none !important;
  }

  .nav-wrapper .nav-item,
  .nav-wrapper .sub-menu-item {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  .nav-wrapper .nav-list,
  .nav-wrapper .sub-menu-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important; 
    padding: 0 !important;
    margin: 0 !important;
  }

  /* 6. セクション間の調整 */
  .nav-wrapper .global-nav {
    display: block !important;
    margin-bottom: 0.1rem;
  }

  .mobile-sub-menu {
    border-top: 2px dashed #ddd;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    width: 100%;
  }

  body > .global-nav {
    display: none !important;
  }

  .index-sub-menu {
    display: none !important;
  }

  /* 7. その他パーツのスマホ対応（微調整） */

  .quick-search-section {
    width: 100% !important;
    padding: 0 1rem;
    margin: 1rem auto;
    box-sizing: border-box;
  }
  .quick-search-card { padding: 2rem 1rem; }
  .search-form-area { padding: 1.25rem 1rem; margin-bottom: 1rem; }
  .search-checkbox-group { gap: 1rem; }
  .search-input-row { flex-direction: column; gap: 0.5rem; }
  .search-input-field, .search-submit-btn { width: 100% !important; height: 3.2rem; }
  .search-utility-group { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }

  .search-main-content {
    align-items: stretch !important;
  }
  .search-form-area {
    padding: 1.25rem !important;
  }

  .user-action-grid {
    display: block;
    width: 100% !important;
    padding: 0 1rem !important;
    margin: 0 !important;
  }

  .user-action-grid .quick-search-section {
    width: 100% !important;
    margin-bottom: 1rem !important; 
  }

  .user-action-grid .button-area-login {
    gap: 0.75rem;
  }
  
  .user-action-grid .btn-quick-search {
  max-width: none !important;
  width: 100% !important;
  }
  
  /* フッター */
.facility-list {
    flex-direction: column; 
    align-items: center;
    gap: 1rem; 
    width: 100%;
    padding: 0;
  }

  .facility-btn {
    width: 100% !important; 
    min-width: 10rem !important;
    height: auto !important;
    min-height: 4rem;
    padding: 0.8rem 1.8rem 0.8rem 2.3rem !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4 !important; 
    overflow: hidden;
    border: 1px solid #333 !important; 
    background-color: #fff !important;
    color: #333 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  }

  .facility-btn:hover::before {
    width: 10px !important;
    opacity: 1 !important;
  }

  .facility-btn span {
    white-space: normal !important;
    word-break: break-all;
    position: relative;
    z-index: 2;
  }

  .footer-contact-area {
    flex-direction: column;
    gap: 2rem;
  }
  .footer-contact-list {
    grid-template-columns: 1fr; 
  }
  .footer-inquiry {
    padding-left: 0;
    border-left: none;
    border-top: 1px dashed #ccc;
    padding-top: 1.5rem;
    width: 100%;
    justify-content: center;
  }
}

/* PC調整 */
@media (max-width: 900px) and (min-width: 769px) {
  .library-title { font-size: 1.2rem; }
  .search-utility-group { grid-template-columns: repeat(4, 1fr); }
}