/* =========================================
   1. Google Fonts & Variables
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --primary-color: #0066c0;
  --primary-light: #e0f2fe;
  --primary-hover: #004d91;
  --accent-color: #00c7b7;

  --bg-body: #f4f6f9;
  --bg-card: #ffffff;
  --text-main: #334155;
  --text-sub: #64748b;
  --border-color: #e2e8f0;

  --header-height: 64px;
  --footer-height: 60px;
  --sidebar-width: 260px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.7;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

/* =========================================
   2. Header
   ========================================= */
.header {
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  justify-content: center;
}

.menu-toggle {
  display: none;
}

.header-search {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 500px;
  z-index: 101;
}

.header-search input {
  width: 100%;
  padding: 10px 48px 10px 20px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  background-color: #f1f5f9;
  font-size: 15px;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.header-search input:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 192, 0.15);
  outline: none;
}

.header-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.header-search button:hover {
  background: var(--primary-hover);
}

/* ヘッダー内 PDFボタン */
.header-pdf-btn {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fff;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  z-index: 102;
}

.header-pdf-btn:hover {
  background: #fef2f2;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%) scale(1.02);
}

.header-pdf-btn i {
  font-size: 16px;
}

.mobile-search-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}

.mobile-search-toggle:active {
  background-color: #f1f5f9;
}

.mobile-search-bar {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  width: 100%;
  background: #fff;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  z-index: 99;
}

.mobile-search-bar form {
  position: relative;
  width: 100%;
}

.mobile-search-bar input {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  font-size: 16px;
}

.mobile-search-bar button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 18px;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  padding: 8px 0;
}

.search-suggestions-item {
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  border-bottom: 1px solid #f1f5f9;
}

.search-suggestions-item:last-child {
  border-bottom: none;
}

.search-suggestions-item:hover {
  background-color: #f8fafc;
  color: var(--primary-color);
}

/* =========================================
   3. Container & Sidebar
   ========================================= */
.container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: #fff;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  height: 100%;
  flex-shrink: 0;
  padding-bottom: 40px;
  transition: transform var(--transition-smooth);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sidebar-brand:hover {
  background-color: #f8fafc;
}

.sidebar-brand-logo {
  height: 22px;
  width: auto;
}

.sidebar-brand-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
}

.menu {
  padding: 16px 12px;
  list-style: none;
}

/* リストの「・」や「○」を完全に消す設定 */
.sidebar ul,
.sidebar ol,
.sidebar li {
  list-style: none !important;
  list-style-type: none !important;
  padding-left: 0;
}

.sidebar li {
  margin-bottom: 4px;
  list-style: none;
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: all var(--transition-fast);
  margin-right: 8px;
}

.sidebar .menu-icon {
  width: 24px;
  margin-right: 12px;
  color: var(--text-sub);
  text-align: center;
  font-size: 16px;
  transition: color 0.2s;
}

.sidebar a:hover {
  background-color: #f8fafc;
  color: var(--primary-color);
}

.sidebar a:hover .menu-icon {
  color: var(--primary-color);
}

.sidebar a:hover .menu-label {
  text-decoration: underline;
}

.sidebar a.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 700;
  border-left-color: var(--primary-color);
}

.sidebar a.active .menu-icon {
  color: var(--primary-color);
}

.sidebar .submenu {
  display: none;
  padding-left: 0;
  margin-top: 4px;
  margin-bottom: 8px;
}

.sidebar li.subitem a {
  padding-left: 48px;
  font-size: 13.5px;
  color: var(--text-sub);
}

.sidebar li.subitem a:hover {
  background-color: transparent;
  color: var(--primary-color);
}

.sidebar li.subitem a:hover .menu-label {
  text-decoration: underline;
}

.sidebar li.subitem a.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 700;
  border-left-color: var(--primary-color);
  padding-left: 44px;
}

.expand-icon {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-sub);
  transition: transform 0.3s ease;
}

.rotated {
  transform: rotate(180deg);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100% - var(--header-height));
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 89;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* =========================================
   4. Main Content
   ========================================= */
.content {
  flex-grow: 1;
  padding: 40px 60px;
  padding-bottom: 80px;
  overflow-y: auto;
  background-color: var(--bg-body);
}

.section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 40px;
  margin-bottom: 40px;
  border: 1px solid var(--border-color);
  animation: fadeUp 0.4s ease-out;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 32px 0;
  padding-bottom: 16px;
  border-bottom: 2px solid #eef2f6;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section h2::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f02d";
  color: var(--primary-color);
  font-size: 24px;
}

.content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 40px 0 20px;
  padding-left: 16px;
  border-left: 4px solid var(--primary-color);
  line-height: 1.4;
}

.section h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text-main);
}

.section p {
  margin-bottom: 24px;
  color: var(--text-main);
  line-height: 1.8;
}

.section ul,
.section ol {
  margin-bottom: 24px;
  padding-left: 24px;
  color: var(--text-main);
}

.section li {
  margin-bottom: 8px;
}

/* =========================================
   5. Components & Images
   ========================================= */
.preview-img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: inline-block;
  vertical-align: top;
  max-width: 48%;
  width: auto;
  height: auto;
  margin: 10px 1% 20px 0;
  cursor: zoom-in;
  transition: transform var(--transition-fast);
}

.preview-img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.top-button-area {
  text-align: center;
  margin: 40px 0 60px;
}

a.top-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #0078D4;
  font-size: 18px;
  font-weight: 700;
  padding: 16px 50px;
  border-radius: 99px;
  border: 2px solid #0078D4;
  box-shadow: 0 4px 15px rgba(0, 120, 212, 0.15);
  transition: all 0.2s ease;
  text-decoration: none;
}

a.top-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 120, 212, 0.25);
  background-color: #f0f9ff;
  text-decoration: none;
}

.btn-logo {
  height: 28px;
  width: auto;
  margin: 0 !important;
  display: inline-block !important;
  vertical-align: middle;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* --- トップページメニューカード --- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.menu-item {
  display: block;
  text-decoration: none;
  height: 100%;
}

.menu-wrapper {
  display: flex;
  flex-direction: row;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  height: 100%;
  position: relative;
  align-items: stretch;
}

.menu-item:hover .menu-wrapper {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #bfdbfe;
}

.menu-img {
  flex: 0 0 35%;
  width: 35%;
  height: auto;
  object-fit: contain;
  background: #f8fafc;
  border-right: 1px solid #f1f5f9;
  padding: 16px;
  pointer-events: none;
}

.menu-description {
  flex: 1;
  padding: 24px;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.menu-description strong {
  display: block;
  font-size: 18px;
  color: var(--text-main);
  margin-bottom: 8px;
  font-weight: 700;
}

.menu-description strong::after {
  /* 文字化け修正: Unicodeエスケープ */
  content: "\2192";
  font-family: sans-serif;
  margin-left: 8px;
  opacity: 0;
  transition: all 0.2s;
  color: var(--primary-color);
}

.menu-item:hover .menu-description strong {
  color: var(--primary-color);
}

.menu-item:hover .menu-description strong::after {
  opacity: 1;
  margin-left: 12px;
}

@media (max-width: 900px) {

  /* スマホ表示修正: flex-direction (記法修正) */
  .menu-wrapper {
    flex-direction: column;
  }

  .menu-img {
    flex: 0 0 140px;
    width: 100%;
    height: 140px;
    border-right: none;
    border-bottom: 1px solid #f1f5f9;
  }
}

.prev-next-nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 60px;
  gap: 20px;
}

.prev-next-nav .next-btn {
  margin-left: auto;
}

.prev-next-nav .prev-btn {
  margin-right: auto;
}

.prev-next-nav button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.prev-next-nav button:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.scroll-top-btn {
  position: fixed;
  bottom: 80px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 102, 192, 0.4);
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transform: translateY(20px);
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background-color: var(--primary-hover);
}

#image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
}

.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
}

.search-context {
  font-size: 0.9em;
  color: #666;
  margin-top: 4px;
  background: #f9f9f9;
  padding: 8px;
  border-radius: 4px;
}

.result-item {
  margin-bottom: 20px;
}

.result-item a {
  font-weight: bold;
  font-size: 1.1em;
}

.footer {
  height: var(--footer-height);
  background-color: #fff;
  border-top: 1px solid var(--border-color);
  color: var(--text-sub);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
  z-index: 100;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 40px;
}

.footer-left img.footer-logo {
  height: 30px;
  width: auto;
  max-width: 100%;
  display: block;
}

.footer-right p {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 24px;
}

.new-badge {
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-decoration: none !important;
  display: inline-block;
}

.note,
.info,
.caution {
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 30px 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-size: 15px;
}

.note {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.info {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

.caution {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.icon-note::before {
  content: "\f0eb";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #f59e0b;
  font-size: 20px;
}

.icon-info::before {
  content: "\f05a";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #3b82f6;
  font-size: 20px;
}

.icon-warning::before {
  content: "\f071";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #ef4444;
  font-size: 20px;
}

/* ★ PDF出力用スタイル (文字重なり対策・width:680px) */
.pdf-export-mode {
  width: 680px !important;
  max-width: 680px !important;

  background-color: #ffffff !important;
  color: #333333 !important;

  /* システムフォントを強制し、文字重なり・ズレを軽減 */
  font-family: "MS Gothic", "Meiryo", sans-serif !important;
  font-kerning: none !important;
  letter-spacing: 0.02em !important;
  word-spacing: 0.05em !important;

  padding: 20px !important;

  /* 透明度・アニメーション強制解除 */
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  border: 1px solid #ddd !important;
  height: auto !important;
}

/* 不要な要素の非表示 */
.pdf-export-mode .prev-next-nav,
.pdf-export-mode .subitem-buttons,
.pdf-export-mode .scroll-top-btn,
.pdf-export-mode button,
.pdf-export-mode .new-badge,
.pdf-export-mode .menu-item,
.pdf-export-mode .top-button-area {
  display: none !important;
}

/* 改ページ制御 (Avoid Break) */
.pdf-export-mode h2,
.pdf-export-mode h3,
.pdf-export-mode p,
.pdf-export-mode li,
.pdf-export-mode .note,
.pdf-export-mode .info,
.pdf-export-mode .caution,
.pdf-export-mode table {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ★ PDF内画像: 48%幅で横並び可 */
.pdf-export-mode img {
  width: 48% !important;
  max-width: 48% !important;
  height: auto !important;
  display: inline-block !important;
  vertical-align: top !important;
  margin: 10px 1% !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

/* PDF内フッター調整 */
.pdf-export-mode .footer {
  margin-top: 40px !important;
  border-top: 1px solid #ccc !important;
  padding-top: 20px !important;
  background: #fff !important;
  width: 100% !important;
  display: block !important;
  text-align: center !important;
  height: auto !important;
}

.pdf-export-mode .footer-content {
  display: block !important;
  padding: 0 !important;
  text-align: center !important;
}

.pdf-export-mode .footer-left,
.pdf-export-mode .footer-right {
  display: block !important;
  text-align: center !important;
  margin-bottom: 10px !important;
}

.pdf-export-mode .footer-logo {
  height: 24px !important;
  display: inline-block !important;
}

.pdf-export-mode .footer-right p {
  text-align: center !important;
  font-size: 10px !important;
  color: #666 !important;
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
    justify-content: space-between;
  }

  .menu-toggle {
    display: inline-flex;
    order: 1;
    margin-left: 0;
    align-items: center;
    gap: 8px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  }

  .menu-toggle i {
    font-size: 18px;
    color: var(--primary-color);
  }

  .menu-toggle:active {
    background-color: #f1f5f9;
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  }

  .menu-toggle .label {
    display: inline-block;
  }

  .mobile-search-toggle {
    display: flex;
    order: 2;
    margin-left: auto;
  }

  .header-search {
    display: none;
  }

  .header-pdf-btn {
    position: static;
    transform: none;
    order: 2;
    margin-right: 8px;
    padding: 6px 12px;
    font-size: 12px;

    /* ★修正: iPhone SE等の狭い画面で押しつぶされない設定 */
    white-space: nowrap;
    /* 文字改行禁止 */
    flex-shrink: 0;
    /* 縮小禁止 */
    display: inline-flex;
    align-items: center;
  }

  /* ★修正: スマホのタップでボタンが上に飛ばないように制御 */
  .header-pdf-btn:hover,
  .header-pdf-btn:active {
    transform: none !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--header-height));
    background: #fff;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .content {
    padding: 24px 16px;
    width: 100%;
  }

  .preview-img {
    max-width: 100%;
    margin-right: 0;
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  /* スマホ表示修正: flex-direction等 (記法修正) */
  .menu-wrapper {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  .menu-img {
    flex: 0 0 auto;
    width: 100%;
    height: 140px;
    border-right: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px;
  }

  .prev-next-nav {
    flex-direction: column;
  }

  .prev-next-nav .next-btn,
  .prev-next-nav .prev-btn {
    margin: 0;
    width: 100%;
    justify-content: center;
  }

  .footer {
    padding: 0 16px;
    height: auto;
    padding: 12px 16px;
  }

  /* スマホ表示修正: flex-direction (記法修正) */
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
  }

  .footer-left img.footer-logo {
    height: 24px;
  }

  .footer-right p {
    font-size: 10px;
    text-align: right;
  }
}

/* ★ ブラウザ印刷用 (Ctrl+P) */
@media print {

  /* 不要なUIを非表示 */
  .header,
  .sidebar,
  .menu-toggle,
  .mobile-search-toggle,
  .scroll-top-btn,
  .header-pdf-btn,
  .prev-next-nav,
  .subitem-buttons,
  .top-button-area,
  .menu-grid {
    display: none !important;
  }

  /* レイアウト基本設定: 1ページ目の白紙を防ぐリセット */
  body,
  html,
  .container {
    height: auto !important;
    width: 100% !important;
    display: block !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #fff !important;
  }

  .content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  /* --- 画像調整 --- */

  /* 1. 本文内の画像だけ 50% 幅にする */
  .content img {
    width: 50% !important;
    max-width: 50% !important;
    height: auto !important;
    page-break-inside: avoid;
    display: block;
    margin: 10px 0;
  }

  /* 2. フッターの画像（ロゴ）は小さく保つ */
  .footer img,
  .footer-logo {
    width: auto !important;
    max-width: 120px !important;
    height: auto !important;
    display: inline-block !important;
  }

  /* フッターのレイアウト */
  .footer {
    display: block !important;
    border-top: 1px solid #ccc !important;
    padding-top: 10px !important;
    margin-top: 20px !important;
  }

  .footer-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* セクションの改ページ制御 */
  .section {
    box-shadow: none !important;
    border: none !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    page-break-inside: auto !important;
    /* 長文が次ページに勝手に飛ばないようにする */
    break-inside: auto !important;
  }
}