/* CSS Custom Properties */
:root {
  /* ブランドカラー */
  --primary-color: #00878d;
  --primary-light: #e8f8f5;
  --primary-lighter: #d1f2eb;
  /* テキスト色 */
  --color-text: #333;
  --color-text-muted: #666;
  --color-text-muted-alt: #555; /* バナー内メッセージ用のやや濃いミュートカラー */
  --color-text-inverse: #fff;
  --color-text-secondary: #64748b;
  --color-text-tertiary: #94a3b8;
  --color-gray-500: #6b7280;
  --color-gray-400: #9ca3af;
  /* 背景色 */
  --color-bg: #fff;
  --color-bg-subtle: #f8f9fa;
  --color-bg-hover: #f0f0f0;
  /* ボーダー色 */
  --color-border: #e5e5e5;
  --color-border-light: #ddd;
  --color-border-alt: #dee2e6;
  --color-border-revision: #e5e7eb;
  --color-border-header: #d7d7da;
  --color-border-footer: #e2e8f0;
  --color-separator: #cbd5e0;
  /* バナー */
  --banner-height: 0px;
  --banner-bg: #fff8f3;
  --banner-accent: #f98938;
  /* レイアウト */
  --sidebar-top: 110px; /* サイドバーの上端位置（ヘッダー + パンくず + 余白） */
  /* スクロールバー */
  --color-scrollbar-track: #f1f1f1;
  --color-scrollbar-thumb: #c1c1c1;
  --color-scrollbar-thumb-hover: #a8a8a8;
  /* 警告色（PDFエラーメッセージ） */
  --color-warning-bg: #fef7e0;
  --color-warning-border: #f5c842;
  --color-warning-text: #8a6914;
  --color-warning-text-detail: #a5751a;
  /* 警告色（カードコンテキスト: 基本警告色とは異なるトーン） */
  --color-warning-card-bg: #fff3cd;
  --color-warning-card-border: #ffeaa7;
  --color-warning-card-text: #856404;
}

/* ========================================
   z-index 階層構造
   ----------------------------------------
   ヘッダー:              100
   リダイレクトバナー:     998
   フローティングボタン:   999
   オーバーレイ:          1000
   サイドバー（ドロワー）: 1001
   ======================================== */

/* ========================================
   リダイレクトバナー
   旧サイトからの移転通知用バナー
   ======================================== */
.redirect-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 998;
  background: var(--banner-bg);
  border-bottom: 2px solid var(--banner-accent);
  color: var(--color-text);
  transform: translateY(-100%);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease;
}

.redirect-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

.redirect-banner.hiding {
  transform: translateY(-100%);
  opacity: 0;
}

.redirect-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
}

.redirect-banner-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.redirect-banner-icon svg {
  width: 24px;
  height: 24px;
  color: var(--banner-accent);
}

.redirect-banner-text {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.redirect-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--banner-accent);
}

.redirect-banner-message {
  font-size: 14px;
  color: var(--color-text-muted-alt);
  line-height: 1.5;
}

.redirect-banner-link {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.redirect-banner-link:hover {
  color: var(--banner-accent);
}

/* バナー表示時のボディのpadding-top調整（JSで高さを設定） */
body.has-banner {
  padding-top: var(--banner-height);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Noto Sans JP",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
.site-header {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border-header);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* バナー表示時のヘッダー位置調整 */
body.has-banner .site-header {
  top: var(--banner-height);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  max-width: none;
  margin: 0;
  padding: 0 30px;
  width: 100%;
  position: relative; /* モバイルメニューの絶対配置用 */
}

.logo-link {
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-svg {
  height: 31px;
  width: auto;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.header-nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-nav-link:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

/* モバイルメニューボタン（デフォルト非表示） */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--color-text);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
  position: relative;
  overflow: hidden;
  padding: 80px 0;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
}

.hero-description {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Terms Section */
.terms-section {
  padding: 80px 0;
  background: var(--color-bg);
}

/* Section Group (横棒で区切り) */
.section-group {
  padding: 40px 20px;
  background: var(--color-bg);
}

/* Section Header (控えめな見出し) */
.section-header {
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px 0;
  letter-spacing: 0.3px;
}

.section-description {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.terms-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.terms-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  max-width: 500px;
  width: 100%;
}

.terms-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-color);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
}

.card-description {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.card-links-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
}

.card-links-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.card-link {
  color: var(--color-text-inverse);
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  font-weight: 500;
  transition: filter 0.2s;
  flex: 1;
  text-align: center;
}

.card-link:hover {
  filter: brightness(0.85);
}

.pdf-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  border: 1px solid var(--color-border-light);
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.2s;
}

.pdf-link:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Terms Page Layout (from default.css) */
.terms-page {
  padding: 40px 0 80px;
}

.terms-layout {
  display: flex;
  flex-direction: column;
}

.terms-content-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}

.terms-sidebar {
  position: sticky;
  top: var(--sidebar-top);
  background: var(--color-bg-subtle);
  border-radius: 12px;
  padding: 24px;
  max-height: calc(100vh - var(--sidebar-top) - 30px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* バナー表示時のサイドバー位置調整 */
body.has-banner .terms-sidebar {
  top: calc(var(--sidebar-top) + var(--banner-height));
  max-height: calc(100vh - var(--sidebar-top) - 30px - var(--banner-height));
}

/* フローティング目次ボタン、オーバーレイ、閉じるボタン（デフォルト非表示） */
.toc-floating-btn {
  display: none;
}

.drawer-overlay {
  display: none;
}

.drawer-close-btn {
  display: none;
}

/* SVGアイコンの共通スタイル */
.toc-floating-btn svg,
.drawer-close-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

.toc-nav ul {
  list-style: none;
}

.toc-nav li {
  margin-bottom: 8px;
}

.toc-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.toc-nav a:hover,
.toc-nav a.active {
  background: var(--primary-color);
  color: var(--color-text-inverse);
}

.toc-nav .toc-h3 {
  margin-left: 16px;
  font-size: 13px;
}

/* サイドバーのスクロールバーのスタイリング */
.terms-sidebar::-webkit-scrollbar {
  width: 6px;
}

.terms-sidebar::-webkit-scrollbar-track {
  background: var(--color-scrollbar-track);
  border-radius: 3px;
}

.terms-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-thumb);
  border-radius: 3px;
}

.terms-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-thumb-hover);
}

/* Firefox用のスクロールバーのスタイリング */
.terms-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar-track);
}

/* Terms Content */
.terms-content {
  background: var(--color-bg);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  min-width: 0; /* グリッドアイテムのオーバーフロー防止 */
  overflow-x: hidden;
}

.terms-header {
  padding: 40px 40px 32px;
  border-bottom: 1px solid var(--color-border);
}

.terms-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
}

.terms-service {
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 8px;
}

.terms-updated {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.terms-actions {
  margin-top: 24px;
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-subtle);
  color: var(--color-text);
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid var(--color-border-light);
  font-weight: 500;
  transition: all 0.2s;
}

.pdf-download-btn:hover {
  background: var(--primary-color);
  color: var(--color-text-inverse);
  border-color: var(--primary-color);
}

.pdf-icon {
  width: 18px;
  height: 18px;
}

.terms-body {
  padding: 40px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* 表だけ横スクロール（本文全体はスクロールしない） */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
}

.table-scroll-wrapper:last-child {
  margin-bottom: 0;
}

/* テーブル：サイトのモダンなトーンに合わせたスタイル */
.terms-body table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.terms-body th,
.terms-body td {
  padding: 14px 20px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: keep-all;
  line-break: strict;
  border-bottom: 1px solid var(--color-border);
}

.terms-body thead th {
  background: var(--primary-light);
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.terms-body tbody tr {
  transition: background 0.2s ease;
}

.terms-body tbody tr:hover {
  background: var(--primary-light);
}

.terms-body tbody tr:last-child td {
  border-bottom: none;
}

.terms-body pre,
.terms-body code {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.terms-body h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
  margin: 40px 0 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
}

.terms-body h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin: 32px 0 16px;
}

.terms-body h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 24px 0 12px;
}

.terms-body p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.terms-body ul,
.terms-body ol {
  margin: 16px 0 16px 24px;
}

.terms-body li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* 括弧形式リスト（1) 2) 3) スタイル) */
.terms-body ol.parenthesis-list {
  list-style: none;
  counter-reset: parenthesis-counter;
  margin-left: 0;
  padding-left: 0;
}

.terms-body ol.parenthesis-list > li {
  counter-increment: parenthesis-counter;
  position: relative;
  padding-left: 1.8em;
  margin-left: 0;
}

.terms-body ol.parenthesis-list > li::before {
  content: counter(parenthesis-counter) ") ";
  font-weight: inherit;
  position: absolute;
  left: 0;
}

/* Hide sidebar when no TOC */
.terms-content-wrapper.no-toc {
  grid-template-columns: 1fr;
}

.terms-content-wrapper.no-toc .terms-sidebar {
  display: none;
}

/* Footer */
.site-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-footer);
  padding: 40px 0 20px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 0;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo-img {
  height: 70px;
  width: auto;
  display: block;
  object-fit: contain;
}

.footer-certifications {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-divider {
  height: 1px;
  background: var(--color-border-footer);
  margin: 20px 0;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.footer-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--primary-color);
}

.footer-copyright {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin: 0;
}

/* PDF Error Message Styles */
.pdf-error-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: 6px;
  color: var(--color-warning-text);
  font-size: 14px;
  font-weight: 500;
}

.pdf-error-message .error-icon {
  font-size: 16px;
}

.pdf-error-message .error-detail {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-warning-text-detail);
  margin-top: 2px;
}

/* For cards context */
.terms-card .pdf-error-message {
  background-color: var(--color-warning-card-bg);
  border-color: var(--color-warning-card-border);
  color: var(--color-warning-card-text);
  padding: 8px 12px;
  font-size: 13px;
}

/* For individual page context */
.terms-actions .pdf-error-message {
  background-color: var(--color-bg-subtle);
  border-color: var(--color-border-alt);
  color: var(--color-gray-500);
  padding: 12px 20px;
}

/* Breadcrumb Navigation Styles */
.breadcrumb-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.breadcrumb-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: var(--primary-color);
}

.breadcrumb-separator {
  width: 16px;
  height: 16px;
  color: var(--color-separator);
}

.breadcrumb-current {
  color: var(--primary-color);
  font-weight: 400;
}

/* Back to List Button Styles - Common */
.back-to-list-btn,
.back-to-list-btn-bottom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-light);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.back-to-list-btn:hover,
.back-to-list-btn-bottom:hover {
  background-color: var(--primary-lighter);
}

.back-to-list-btn .back-icon,
.back-to-list-btn-bottom .back-icon {
  width: 16px;
  height: 16px;
}

/* Back to List Button - Specific Styles */
.back-to-list-btn {
  padding: 8px 16px;
  white-space: nowrap;
}

.back-to-list-btn-bottom {
  padding: 12px 24px;
}

/* Bottom Back Button Wrapper */
.bottom-back-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 48px;
  margin-bottom: 48px;
}

/* Focus visible（アクセシビリティ） */
.header-nav-link:focus-visible,
.footer-link:focus-visible,
.breadcrumb-link:focus-visible,
.card-link:focus-visible,
.pdf-link:focus-visible,
.back-to-list-btn:focus-visible,
.back-to-list-btn-bottom:focus-visible,
.pdf-download-btn:focus-visible,
.error-page-btn:focus-visible,
.toc-nav a:focus-visible,
.mobile-menu-btn:focus-visible,
.drawer-close-btn:focus-visible,
.toc-floating-btn:focus-visible,
.redirect-banner-link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Revision History Section */
.revision-history {
  margin-top: 50px;
  padding-top: 24px;
  padding-bottom: 24px;
  padding-left: 40px;
  padding-right: 40px;
  border-top: 1px solid var(--color-border-revision);
}

.revision-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-gray-500);
  margin-bottom: 12px;
}

.revision-list {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  gap: 16px 24px;
  list-style: none;
  font-size: 13px;
  color: var(--color-gray-400);
  line-height: 1.6;
}

.revision-item {
  white-space: nowrap;
  min-width: 120px;
}

/* ========================================
   404 Error Page Styles
   ======================================== */
.error-page-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 300px);
  padding: 80px 0;
  background: var(--color-bg);
}

.error-page-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.error-page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 24px;
  line-height: 1.4;
}

.error-page-description {
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 48px;
}

.error-page-actions {
  display: flex;
  justify-content: center;
}

.error-page-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
  padding: 20px 48px;
  border-radius: 50px;
  border: 1px solid var(--color-border);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.error-page-btn:hover {
  border-color: var(--color-text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.error-page-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-text);
  border-radius: 50%;
}

.error-page-btn-icon svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-inverse);
}

.error-page-btn-text {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ========================================
   Responsive（ブレークポイント別に集約）
   ======================================== */

/* 1024px 以下（タブレット） */
@media (max-width: 1024px) {
  .terms-content-wrapper {
    grid-template-columns: 240px 1fr;
    gap: 40px;
  }

  .terms-sidebar {
    padding: 20px;
  }
}

/* 768px 以下（モバイル） */
@media (max-width: 768px) {
  /* リダイレクトバナー */
  .redirect-banner-content {
    padding: 10px 16px;
    gap: 10px;
  }

  .redirect-banner-icon {
    width: 20px;
    height: 20px;
  }

  .redirect-banner-icon svg {
    width: 20px;
    height: 20px;
  }

  .redirect-banner-text {
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
  }

  .redirect-banner-title {
    font-size: 13px;
  }

  .redirect-banner-message {
    font-size: 12px;
  }

  /* コンテナ・ヘッダー */
  .container {
    padding: 0 16px;
  }

  .header-content {
    height: 60px;
    padding: 0 16px;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    padding: 16px;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .header-nav.active {
    display: flex;
  }

  .header-nav-link {
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    width: 100%;
  }

  .mobile-menu-btn {
    display: block;
  }

  .logo-svg {
    height: 24px;
  }

  /* ヒーロー・セクション */
  .hero-section {
    padding: 48px 0;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-description {
    font-size: 15px;
  }

  .terms-section {
    padding: 40px 0;
  }

  .section-group {
    padding: 24px 16px;
  }

  /* カードグリッド */
  .terms-cards {
    grid-template-columns: 1fr;
  }

  /* 利用規約レイアウト・サイドバー（ドロワー） */
  .terms-page {
    padding: 24px 0 60px;
  }

  .terms-content-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .terms-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: var(--color-bg);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
  }

  .terms-sidebar.drawer-open {
    transform: translateX(0);
  }

  .sidebar-content {
    max-height: none;
    overflow: visible;
    opacity: 1;
    padding: 20px;
    padding-top: 60px;
  }

  .sidebar-title {
    display: block;
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    background: var(--color-bg);
    padding: 12px 16px;
    z-index: 10;
    border-bottom: 1px solid var(--color-border);
  }

  .drawer-close-btn {
    display: flex;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: 8px;
  }

  .drawer-close-btn:hover {
    background: var(--color-bg-hover);
  }

  .drawer-close-btn svg {
    width: 24px;
    height: 24px;
  }

  .toc-floating-btn {
    display: flex;
    position: fixed;
    bottom: 24px;
    left: 16px;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: var(--color-text-inverse);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 135, 141, 0.4);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease;
  }

  .toc-floating-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 135, 141, 0.5);
  }

  .toc-floating-btn:active {
    transform: scale(0.95);
  }

  .toc-floating-btn svg {
    width: 24px;
    height: 24px;
  }

  .drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .drawer-overlay.active {
    display: block;
    opacity: 1;
  }

  .toc-nav a {
    padding: 12px 16px;
  }

  /* 利用規約コンテンツ・フッター・カード・改訂履歴 */
  .terms-header {
    padding: 20px 16px;
  }

  .terms-body {
    padding: 20px 16px;
  }

  .terms-body th,
  .terms-body td {
    padding: 12px 16px;
    font-size: 0.875rem;
  }

  .terms-title {
    font-size: 22px;
    line-height: 1.4;
  }

  .terms-body h2 {
    font-size: 20px;
  }

  .terms-body h3 {
    font-size: 18px;
  }

  .terms-body h4 {
    font-size: 16px;
  }

  .footer-top {
    flex-direction: column;
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }

  .footer-nav {
    flex-direction: column;
    gap: 12px;
  }

  .footer-copyright {
    align-self: flex-start;
  }

  .card-links-row {
    flex-direction: column;
    gap: 12px;
  }

  .card-link {
    text-align: center;
  }

  .pdf-link {
    text-align: center;
  }

  .revision-history {
    padding: 16px;
    margin-top: 32px;
  }

  /* ブレッドクラム・一覧に戻る */
  .breadcrumb-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
  }

  .breadcrumb-nav {
    font-size: 13px;
    flex-wrap: wrap;
  }

  .breadcrumb-current {
    overflow-wrap: break-word;
    max-width: 100%;
  }

  .back-to-list-btn {
    width: 100%;
    justify-content: center;
  }

  /* 404 ページ */
  .error-page-section {
    padding: 60px 0;
    min-height: calc(100vh - 250px);
  }

  .error-page-title {
    font-size: 24px;
  }

  .error-page-description {
    font-size: 14px;
    margin-bottom: 36px;
  }

  .error-page-btn {
    padding: 16px 32px;
    font-size: 14px;
  }

  .error-page-btn-icon {
    width: 28px;
    height: 28px;
  }

  .error-page-btn-icon svg {
    width: 14px;
    height: 14px;
  }
}

/* 640px 以下 */
@media (max-width: 640px) {
  .revision-list {
    gap: 8px 16px;
  }
}

/* 480px 以下（小さなモバイル） */
@media (max-width: 480px) {
  .hero-title {
    font-size: 24px;
  }

  .hero-description {
    font-size: 14px;
  }

  .terms-title {
    font-size: 20px;
  }

  .terms-card {
    padding: 20px;
  }

  .card-title {
    font-size: 18px;
  }

  .redirect-banner-content {
    padding: 8px 12px;
  }

  .redirect-banner-message {
    font-size: 11px;
    line-height: 1.4;
  }

  .error-page-title {
    font-size: 20px;
  }

  .error-page-description {
    font-size: 13px;
  }

  .error-page-btn {
    padding: 14px 24px;
    gap: 12px;
  }
}
