/* CSS Variables */
:root {
  --bg: #ffffff;
  --text: #000000;
  --muted: #333333;
  --brand: #0066cc;
  --accent: #ff9900;
  --border: #e0e0e0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.15);
  --sidebar-bg: #f8f8f8;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Typography */
h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

section {
  padding: min(10vh, 64px) 0;
}

/* Header */
header {
  position: sticky;
  top: 0;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: box-shadow 0.2s;
}

header.scrolled {
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background: url('../assets/icons/favicon.ico') center/contain no-repeat;
  flex-shrink: 0;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--brand);
}

/* ハンバーガー初期状態は非表示（モバイルのみ表示） */
.category-toggle {
  display: none !important;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2100;
  background: #004aad;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  font-size: 0.95rem;
  cursor: pointer;
}

/* カテゴリサイドバー（共通） */
/* categories sidebar (common) */
.category-sidebar {
  background: transparent;
  /* Changed from #fff */
  border: none;
  /* Removed border */
  border-radius: 0;
  /* Removed radius */
  padding: 0;
  /* Adjusted padding if needed, or keep top/bottom */
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: none;
  /* Removed shadow */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* モバイル用カテゴリサイドバーはデフォルトで非表示（PC版のスタイルを上書き） */
.category-sidebar--mobile {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  width: min(65vw, 380px) !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  border: none !important;
  z-index: 2000 !important;
  background: #fff !important;
}

/* カテゴリサイドバーのヘッダー */
.category-sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
  flex-shrink: 0;
}

.category-sidebar-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.category-item {
  border-bottom: 1px solid #e5e5e5;
  margin: 0;
}

.category-item:first-child {
  border-top: 1px solid #e5e5e5;
}

/* すべて表示の下の罫線は他と統一する */
.category-link--reset {
  /* Reset specific styles if needed */
}

/*
.category-item:has(.category-link--reset) {
  border-bottom: none !important;
}
*/

.category-item:last-child {
  border-bottom: 1px solid #e5e5e5;
}

.category-link {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 上下の隙間を調整 (ユーザー要望により全て0にする) */
  padding: 0 16px 0 0;
  text-decoration: none;
  color: #1a1a1a;
  transition: color 0.2s ease, background-color 0.2s ease;
  position: relative;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.category-link:hover {
  color: #004aad;
  background-color: #f8f9fa;
}

.category-link:active,
.category-link.active {
  color: #004aad;
  background-color: #f0f4ff;
}

/* Reset Link Style Specific */
.category-link--reset {
  /* 共通のpadding: 0 が適用されるため特記事項なし */
}

.category-icon-wrapper {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Icon color darker like the image */
  color: #333;
  /* Default icon color */
  transition: color 0.2s ease, background-color 0.2s ease;
  border-radius: 8px;
  background-color: transparent;
}

.category-link:hover .category-icon-wrapper,
.category-link.active .category-icon-wrapper {
  color: #004aad;
  background-color: rgba(0, 74, 173, 0.05);
}

.category-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: inherit;
}

.category-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  word-break: break-word;
}

/* 説明文を表示する設定に変更 */
.category-description {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  /* 1行に制限 */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-name {
  font-size: 1.0rem;
  /* 少し大きく */
  font-weight: 700;
  /* Bold */
  line-height: 1.4;
  color: #222;
  /* Black-ish */
  margin-bottom: 2px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.category-description {
  font-size: 0.8rem;
  /* 小さく */
  color: #888;
  /* Grey */
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Chevron Style */
.category-arrow {
  margin-left: auto;
  color: #ccc;
  display: flex;
  align-items: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.category-link:hover .category-arrow {
  color: #004aad;
  transform: translateX(2px);
}


/* 記事一覧レイアウト（PC版：2カラム） */
.article-list-layout {
  display: grid;
  /* grid-template-columns: 1fr 300px; -> 360pxに拡大 */
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* モバイルカテゴリ: ハンバーガー＋オフキャンバス */
@media (max-width: 768px) {

  /* 一覧レイアウトは縦積み */
  .article-list-layout {
    display: block !important;
  }

  /* PC版のカテゴリサイドバーは非表示 */
  .category-sidebar--desktop,
  .article-list-layout .category-sidebar,
  .article-list-layout aside.category-sidebar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* モバイル用カテゴリサイドバーはデフォルトで非表示 */
  .category-sidebar--mobile {
    display: none !important;
  }

  /* ハンバーガーメニューボタン */
  .category-toggle {
    display: inline-flex !important;
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 2100 !important;
    background: #004aad !important;
    color: #fff !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 10px 14px !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18) !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
  }

  /* メニューが開いたらボタンを非表示（JavaScriptで制御） */
  .category-toggle.menu-open {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .category-overlay {
    display: block !important;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1090;
    transition: opacity 0.2s ease;
  }

  .category-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  /* モバイル用カテゴリサイドバー（オフキャンバス） - 開いたときだけ表示 */
  .category-sidebar--mobile.is-open,
  .article-list-layout .category-sidebar.is-open,
  .article-list-layout aside.category-sidebar.is-open {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: min(65vw, 380px) !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease !important;
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 2000 !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #fff !important;
  }

  /* モバイル用カテゴリサイドバーのヘッダー */
  .category-sidebar--mobile .category-sidebar-header,
  .category-sidebar.is-open .category-sidebar-header {
    padding: 20px 24px !important;
    border-bottom: 1px solid #e5e5e5 !important;
    background: #fff !important;
    flex-shrink: 0 !important;
  }

  .category-sidebar--mobile .category-sidebar-header h3,
  .category-sidebar.is-open .category-sidebar-header h3 {
    margin: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
  }

  /* モバイル用カテゴリリスト */
  .category-sidebar--mobile .category-list,
  .category-sidebar.is-open .category-list {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* モバイル用カテゴリアイテム */
  .category-sidebar--mobile .category-item,
  .category-sidebar.is-open .category-item {
    border-bottom: 1px solid #e5e5e5 !important;
    margin: 0 !important;
  }

  .category-sidebar--mobile .category-item:first-child,
  .category-sidebar.is-open .category-item:first-child {
    border-top: 1px solid #e5e5e5 !important;
  }

  .category-sidebar--mobile .category-item:last-child,
  .category-sidebar.is-open .category-item:last-child {
    border-bottom: 1px solid #e5e5e5 !important;
  }

  /* モバイル用カテゴリリンク */
  .category-sidebar--mobile .category-link,
  .category-sidebar.is-open .category-link {
    display: flex !important;
    align-items: center !important;
    /* Center vertically specifically for mobile */
    gap: 12px !important;
    /* padding: 12px 24px !important; -> 0に統一、ただし右側は矢印用に16px確保 */
    padding: 0 16px 0 0 !important;
    text-decoration: none !important;
    color: #1a1a1a !important;
    transition: color 0.2s ease, background-color 0.2s ease !important;
    position: relative !important;
    line-height: 1.6 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* モバイル用：すべて表示の下の罫線も表示する（統一） */
  .category-sidebar--mobile .category-item:has(.category-link--reset),
  .category-sidebar.is-open .category-item:has(.category-link--reset) {
    /* border-bottom: none !important; 削除 */
  }



  .category-sidebar--mobile .category-link:hover,
  .category-sidebar.is-open .category-link:hover {
    color: #004aad !important;
    background-color: #f8f9fa !important;
  }

  .category-sidebar--mobile .category-link:active,
  .category-sidebar--mobile .category-link.active,
  .category-sidebar.is-open .category-link:active,
  .category-sidebar.is-open .category-link.active {
    color: #004aad !important;
    background-color: #f0f4ff !important;
  }

  /* モバイル用カテゴリアイコン */
  .category-sidebar--mobile .category-icon-wrapper,
  .category-sidebar.is-open .category-icon-wrapper {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
    color: #666 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .category-sidebar--mobile .category-link:hover .category-icon-wrapper,
  .category-sidebar.is-open .category-link:hover .category-icon-wrapper,
  .category-sidebar.is-open .category-link.active .category-icon-wrapper {
    color: #004aad !important;
  }

  .category-sidebar--mobile .category-icon,
  .category-sidebar.is-open .category-icon {
    width: 20px !important;
    height: 20px !important;
    color: inherit !important;
    margin: 0 !important;
  }

  /* モバイル用カテゴリコンテンツ */
  .category-sidebar--mobile .category-content,
  .category-sidebar.is-open .category-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
  }

  /* モバイル用カテゴリ名 */
  .category-sidebar--mobile .category-name,
  .category-sidebar.is-open .category-name {
    font-size: 1.0625rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    color: inherit !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* モバイル用カテゴリ説明 */
  .category-sidebar--mobile .category-description,
  .category-sidebar.is-open .category-description {
    font-size: 0.875rem !important;
    color: #666 !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
  }

  .category-sidebar--mobile .category-link:hover .category-description,
  .category-sidebar.is-open .category-link:hover .category-description {
    color: #555 !important;
  }

  /* Remove .category-button mobile styles as we now use .category-link */
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #f8fafb 0%, #ffffff 50%, #f5f7fa 100%);
  padding: min(10vh, 60px) 0 min(8vh, 50px);
  position: relative;
  overflow: hidden;
}

.hero-decoration-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, var(--brand) 20%, var(--brand) 60%, transparent 75%);
  transform: translateY(-50%);
  z-index: 0;
  opacity: 0.3;
}

.hero-decoration-dots {
  position: absolute;
  top: 0;
  right: 0;
  width: 30%;
  height: 100%;
  background-image: radial-gradient(circle, rgba(0, 102, 204, 0.15) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
  z-index: 0;
  opacity: 0.4;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.03) 0%, rgba(0, 82, 163, 0.02) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40%;
  height: 60%;
  background: linear-gradient(45deg, rgba(0, 102, 204, 0.02) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
}

.hero-vertical-catch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 2;
}

.hero-vertical-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  color: var(--brand);
  line-height: 2;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
  padding: 2rem 1.5rem;
  border-radius: 16px;
  border: 3px solid rgba(0, 102, 204, 0.25);
  box-shadow:
    0 8px 24px rgba(0, 102, 204, 0.15),
    0 0 0 8px rgba(255, 255, 255, 0.9),
    inset 0 2px 4px rgba(0, 102, 204, 0.05);
  backdrop-filter: blur(10px);
  position: relative;
}

.hero-vertical-text::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 82, 163, 0.05) 100%);
  border-radius: 18px;
  z-index: -1;
}

.hero-image-wrapper::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.08) 0%, rgba(0, 82, 163, 0.05) 50%, rgba(0, 102, 204, 0.08) 100%);
  border-radius: 32px;
  z-index: -1;
  opacity: 0.6;
  filter: blur(20px);
}

.hero-image-wrapper::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.8) 100%);
  border-radius: 26px;
  z-index: -1;
  opacity: 0.5;
  backdrop-filter: blur(10px);
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 0 60px rgba(0, 102, 204, 0.1);
  object-fit: cover;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #f0f4f8 0%, #ffffff 100%);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s;
}

.hero-image-wrapper:hover .hero-image {
  transform: translateY(-5px) scale(1.01);
  box-shadow:
    0 35px 60px -12px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset,
    0 0 80px rgba(0, 102, 204, 0.15);
}

.hero-text {
  text-align: left;
}

.hero-badge-top {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 82, 163, 0.1) 100%);
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.hero-catch {
  font-size: clamp(20px, 2.5vw, 28px);
  color: #666;
  margin-bottom: 2.5rem;
  line-height: 1.7;
  font-weight: 400;
  white-space: nowrap;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: rgba(0, 102, 204, 0.08);
  border: 1px solid rgba(0, 102, 204, 0.15);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--brand);
  transition: all 0.3s ease;
}

.hero-feature-item:hover {
  background: rgba(0, 102, 204, 0.12);
  border-color: rgba(0, 102, 204, 0.25);
  transform: translateY(-2px);
}

.hero-feature-item svg {
  flex-shrink: 0;
}

.btn-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 2.75rem;
  background: linear-gradient(135deg, var(--brand) 0%, #0052a3 100%);
  color: white;
  text-decoration: none;
  border-radius: 16px;
  font-size: 1.125rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 102, 204, 0.25), 0 4px 12px rgba(0, 102, 204, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

.btn-hero-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s;
}

.btn-hero-cta:hover::before {
  left: 100%;
}

.btn-hero-cta svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-hero-cta:hover {
  background: linear-gradient(135deg, #0052a3 0%, var(--brand) 100%);
  box-shadow: 0 12px 32px rgba(0, 102, 204, 0.35), 0 6px 16px rgba(0, 102, 204, 0.2);
  transform: translateY(-3px);
}

.btn-hero-cta:hover svg {
  transform: translateX(4px);
}

.btn-hero-cta:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.25);
}

@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
  }

  .hero-image-wrapper {
    max-width: 550px;
  }

  .hero-vertical-catch {
    display: none;
  }

  .hero-decoration-dots {
    width: 20%;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 3rem 0 2rem;
  }

  .hero-decoration-line {
    height: 3px;
    opacity: 0.2;
  }

  .hero-decoration-dots {
    width: 15%;
    opacity: 0.3;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero-text {
    text-align: center;
  }

  .hero-image-wrapper {
    max-width: 100%;
    order: -1;
  }

  .hero-image {
    transform: none;
    border-radius: 20px;
  }

  .hero-image-wrapper:hover .hero-image {
    transform: scale(1.01);
  }

  .hero-badge-top {
    margin-bottom: 1.25rem;
  }

  .hero-title {
    margin-bottom: 1.25rem;
    white-space: normal;
    font-size: clamp(28px, 6vw, 36px);
  }

  .hero-catch {
    margin-bottom: 2rem;
    font-size: clamp(18px, 4vw, 22px);
    white-space: normal;
  }

  .hero-features {
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  .hero-feature-item {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  .btn-hero-cta {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }
}

/* Ranking Section with Sidebar */
.ranking-section {
  padding: 2rem 0;
  background: var(--bg);
}

.ranking-section-header {
  text-align: center;
  margin-bottom: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

.ranking-section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .ranking-section-header h2 {
    font-size: 1.5rem;
  }
}

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

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  order: 2;
}

@media (max-width: 767px) {
  .sidebar {
    margin-bottom: 2rem;
  }
}

.sidebar-widget {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.sidebar-widget h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.sidebar-widget h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.sidebar-diagnosis {
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
  border: 2px solid var(--brand);
}

.sidebar-diagnosis h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.sidebar-diagnosis p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-group select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.filter-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: normal;
  cursor: pointer;
  color: var(--text);
}

.filter-checkboxes input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand);
}

.filter-checkboxes input[type="checkbox"]:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-block {
  width: 100%;
  display: block;
}

/* Ranking Main */
.ranking-main {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#ranking-list {
  width: 100%;
  max-width: 100%;
}

.ranking-header {
  margin-bottom: 2rem;
  text-align: center;
  width: 100%;
}

.ranking-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.ranking-notice {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Ranking Tabs */
.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  width: 100%;
  margin-bottom: 2rem;
}

.tab-button {
  display: none;
  /* 初期状態で非表示、JavaScriptで表示可能なタブのみ表示 */
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border: 1px solid #e0e0e0;
  background: white;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  min-height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-button.show {
  display: flex;
  /* 表示可能なタブはflexで表示 */
}

.tab-button:hover {
  color: var(--text);
  background: white;
  border-color: var(--brand);
  box-shadow: 0 4px 8px rgba(0, 102, 204, 0.15);
  transform: translateY(-2px);
}

.tab-button.active {
  color: white;
  background: linear-gradient(135deg, var(--brand) 0%, #0052a3 100%);
  border-color: var(--brand);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
  transform: translateY(-2px);
}

.tab-button.active:hover {
  background: linear-gradient(135deg, #0052a3 0%, var(--brand) 100%);
  box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

.tab-button.active .tab-icon svg {
  filter: brightness(0) invert(1);
}

.tab-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon svg {
  width: 100%;
  height: 100%;
}

.tab-button:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .ranking-tabs {
    gap: 0.5rem;
    padding: 0;
    margin-bottom: 1.5rem;
  }

  .tab-button {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-height: 44px;
    gap: 0.375rem;
  }

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

/* Filters (old, keeping for compatibility) */
.filters {
  display: none;
}

/* Cards */
#ranking-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  transition: box-shadow 0.2s;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .card {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-top: 3.25rem;
    /* バッジ分の余白を確保して重なり防止 */
  }
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-rank {
  width: 50px;
  height: 50px;
  background: var(--brand);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .card-rank {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    z-index: 1;
    /* テキストの背面に潜らないように */
  }
}

@media (max-width: 768px) {
  .card-service-name {
    padding-right: 3.5rem;
    /* 右上バッジと余白を確保 */
    word-break: break-word;
  }
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.card-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  align-self: center;
  width: 300px;
  height: 250px;
  overflow: hidden;
}

.card-image {
  width: 300px;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .card-header-with-image {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .card-image-wrapper {
    order: 0;
    width: 100%;
    height: auto;
    max-width: 300px;
    margin: 0 auto;
    flex-shrink: 0;
  }

  .card-header-text {
    order: 1;
    padding-left: 0 !important;
    width: 100%;
    flex-shrink: 0;
    text-align: center;
  }

  .card-service-name {
    font-size: 1.25rem;
    text-align: center;
  }

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

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

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

  .card-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 300 / 250;
  }
}

.card-image-size {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 0.25rem 0.5rem;
  background: #f8f8f8;
  border-radius: 4px;
}

.card-service-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0;
  line-height: 1.3;
  text-align: left;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.card-tag-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  white-space: nowrap;
}

.card-header-with-image {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 0.5rem;
  min-height: 250px;
}

.card-header-text {
  min-width: 0;
  padding-left: 1rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--brand);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand);
  display: inline-block;
}

.card-catch {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.card-catch-connector {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
  height: 20px;
  width: 336px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.card-catch-line {
  position: absolute;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, #0052a3 100%);
  border-radius: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.card-catch-arrow {
  position: absolute;
  z-index: 1;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid var(--brand);
  top: 11.5px;
  left: 50%;
  transform: translateX(-50%);
}

.card-features-text {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 0.5rem;
}

.feature-line {
  display: block;
  line-height: 1.8;
}

.card-features-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

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

.card-feature-icon svg {
  width: 100%;
  height: 100%;
}

.card-feature-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 768px) {
  .card-features-list {
    gap: 0.5rem;
  }

  .card-feature-item {
    padding: 0.75rem 0.875rem;
    gap: 0.625rem;
  }

  .card-feature-icon {
    width: 20px;
    height: 20px;
  }

  .card-feature-text {
    font-size: 0.9rem;
  }
}

.card-rating {
  margin-bottom: 1rem;
}

.stars {
  display: flex;
  gap: 2px;
  align-items: center;
}

.star {
  flex-shrink: 0;
}

.star-full {
  color: var(--accent);
}

.star-half {
  color: var(--accent);
}

.star-empty {
  color: var(--border);
}

.card-features {
  list-style: none;
  margin-bottom: 1.5rem;
  margin-top: 0;
}

.card-features li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.card-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.card-stats div {
  display: flex;
  flex-direction: column;
}

.card-stats dt {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.card-stats dd {
  font-weight: 600;
  font-size: 0.95rem;
}

.card-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: stretch;
  width: 100%;
}

.card-details {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-expand {
  margin-top: 0.75rem;
  margin-left: auto;
  margin-right: auto;
}

/* btn-cta-largeクラスが適用されている場合は、そのスタイルを優先 */
.btn-cta-large.btn-expand {
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-expand .cta-service-name {
  display: inline;
}

.btn-expand .btn-icon {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
  display: inline-block;
}

.btn-expand[aria-expanded="true"] .btn-icon {
  transform: rotate(180deg);
}

.feature-details-section {
  margin-top: 1rem;
}

.feature-details-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--brand);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--brand);
}

.feature-detail-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.feature-detail-item:last-child {
  margin-bottom: 0;
}

.feature-detail-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-detail-icon svg {
  width: 100%;
  height: 100%;
}

.feature-detail-content {
  flex: 1;
}

.feature-detail-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #FF6B35;
  display: inline-block;
  width: 100%;
}

.feature-detail-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-top: 0.5rem;
}

.feature-detail-text strong {
  color: #FF6B35;
  font-weight: 600;
}

/* 特徴詳細のレスポンシブ対応 */
@media (max-width: 768px) {
  .feature-details-heading {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .feature-detail-item {
    padding: 1.25rem;
    gap: 0.75rem;
  }

  .feature-detail-icon {
    width: 28px;
    height: 28px;
  }

  .feature-detail-title {
    font-size: 1.05rem;
  }

  .feature-detail-text {
    font-size: 0.95rem;
  }
}

.recommendation-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.company-info {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.company-info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.167rem;
  gap: 0.75rem;
}

.company-info-item:last-child {
  margin-bottom: 0;
}

.company-info-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
  min-width: 140px;
  flex-shrink: 0;
  line-height: 1.5;
}

.company-info-value {
  font-size: 0.875rem;
  color: #333;
  line-height: 1.5;
  flex: 1;
}

.recommendation-box {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.recommendation-header {
  background: var(--brand);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  text-align: center;
}

.recommendation-body {
  background: white;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem;
  text-align: center;
}

@media (max-width: 768px) {
  .recommendation-info {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .company-info {
    padding: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .company-info-item {
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.167rem;
  }

  .company-info-label {
    font-size: 0.8125rem;
    min-width: auto;
  }

  .company-info-value {
    font-size: 0.8125rem;
  }

  .recommendation-header {
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
  }

  .recommendation-body {
    font-size: 1rem;
    padding: 0.875rem;
  }
}

.card-details-cta {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  border: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--brand);
  color: white;
}

.btn-primary:hover {
  background-color: #0052a3;
  transform: translateY(-1px);
}

.cta-promo-section {
  margin-bottom: 1.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-promo-text {
  text-align: center;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.cta-connector {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
  height: 30px;
}

.cta-line {
  position: absolute;
  width: 100%;
  max-width: 200px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, #0052a3 100%);
  border-radius: 2px;
}

.btn-cta-large {
  display: block;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, var(--brand) 0%, #0052a3 100%);
  border-radius: 16px;
  text-decoration: none;
  color: white;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3), 0 2px 4px rgba(0, 102, 204, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

.btn-cta-large::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-cta-large:hover::before {
  left: 100%;
}

.btn-cta-large:hover {
  background: linear-gradient(135deg, #0052a3 0%, var(--brand) 100%);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4), 0 4px 8px rgba(0, 102, 204, 0.3);
  transform: translateY(-2px);
}

.btn-cta-large:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.cta-service-name {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.cta-link-text {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

.cta-external-icon {
  display: inline-block;
  vertical-align: middle;
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .btn-cta-large {
    max-width: 100%;
    padding: 1.15rem 1.5rem;
  }

  .cta-service-name {
    font-size: 1.35rem;
  }

  .cta-link-text {
    font-size: 0.95rem;
  }

  .cta-promo-text {
    font-size: 0.95rem;
  }
}

.btn-secondary {
  background-color: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn-secondary:hover {
  background-color: rgba(0, 102, 204, 0.1);
}

/* How to Choose Section */
#how-to-choose {
  margin-top: 6rem;
  padding-top: 4rem;
  border-top: 2px solid var(--border);
}

.how-to-choose-points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .how-to-choose-points {
    grid-template-columns: repeat(3, 1fr);
  }
}

.how-to-choose-point {
  padding: 1.5rem;
  background: #f8f8f8;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.how-to-choose-point h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--brand);
}

/* FAQ */
#faq {
  margin-top: 6rem;
  padding-top: 4rem;
  position: relative;
}

#faq::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 1200px);
  height: 2px;
  background: var(--border);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

details {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg);
}

summary {
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem;
  list-style: none;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s;
  color: var(--brand);
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

details p {
  margin-top: 1rem;
  padding-left: 1.5rem;
  color: var(--muted);
  line-height: 1.8;
}

/* Usage Flow Section */
.usage-flow-section {
  padding-top: min(10vh, 80px);
  padding-bottom: 40px;
  background: var(--bg);
  margin-top: 4rem;
  position: relative;
}

.usage-flow-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 1200px);
  height: 2px;
  background: var(--border);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 3rem;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Flow Diagram Styles */
.flow-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 3rem auto 1.5rem;
  padding: 2rem;
}

.flow-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 220px;
}

.flow-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 82, 163, 0.08) 100%);
  border: 3px solid var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  transition: all 0.3s ease;
}

.flow-item:hover .flow-icon {
  background: linear-gradient(135deg, var(--brand) 0%, #0052a3 100%);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 102, 204, 0.3);
}

.flow-number {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand) 0%, #0052a3 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
  border: 3px solid white;
}

.flow-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  width: 100%;
  transition: all 0.3s ease;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flow-item:hover .flow-card {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
  transform: translateY(-4px);
}

.flow-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.flow-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
  margin: 0 0.5rem;
}

.flow-arrow svg {
  width: 40px;
  height: 40px;
}

@media (max-width: 1024px) {
  .flow-diagram {
    gap: 1rem;
    padding: 1.5rem;
  }

  .flow-item {
    min-width: 180px;
    max-width: 200px;
  }

  .flow-icon {
    width: 90px;
    height: 90px;
  }

  .flow-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }

  .flow-arrow svg {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 768px) {
  .flow-diagram {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
  }

  .flow-item {
    min-width: 100%;
    max-width: 100%;
  }

  .flow-icon {
    width: 80px;
    height: 80px;
  }

  .flow-number {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }

  .flow-card {
    min-height: auto;
    padding: 1.25rem;
  }

  .flow-card h3 {
    font-size: 1.1rem;
  }

  .flow-card p {
    font-size: 0.9rem;
  }

  .flow-arrow {
    transform: rotate(90deg);
    margin: 0.25rem 0;
  }

  .flow-arrow svg {
    width: 28px;
    height: 28px;
  }
}

.flow-cta {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  max-width: 700px;
  margin: 0 auto;
}

.flow-cta-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.btn-large {
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
  min-height: 56px;
  font-weight: 600;
}

/* Company Info Page */
.company-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.company-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s ease;
}

.company-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.company-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.company-name-en {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.company-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.company-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.company-detail-item dt {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.company-detail-item dd {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  .company-card {
    padding: 1.5rem;
  }

  .company-card h2 {
    font-size: 1.5rem;
  }
}

/* Scroll to Top Button */
.scroll-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--brand) 0%, #0052a3 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3), 0 2px 4px rgba(0, 102, 204, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.scroll-to-top-btn[style*="display: flex"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-to-top-btn:hover {
  background: linear-gradient(135deg, #0052a3 0%, var(--brand) 100%);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4), 0 4px 8px rgba(0, 102, 204, 0.3);
  transform: translateY(-3px);
}

.scroll-to-top-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.scroll-to-top-btn svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .scroll-to-top-btn {
    width: 52px;
    height: 52px;
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .scroll-to-top-btn svg {
    width: 22px;
    height: 22px;
  }
}

/* Footer */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2rem 16px;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
  list-style: none;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-nav a:hover {
  color: var(--brand);
}

.footer-copyright {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Utilities */
.no-results,
.error {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.breadcrumb ol {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin-left: 0.5rem;
  color: var(--muted);
}

/* Scroll behavior for header shadow */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Comparison Table Section */
.comparison-section {
  margin-top: 4rem;
  padding-top: 4rem;
}

.comparison-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: clamp(24px, 3.5vw, 32px);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-weight: 700;
}

.comparison-section h2::before {
  content: '⚖️';
  font-size: 1.2em;
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin: 0 auto;
  max-width: 1400px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  font-size: 0.95rem;
  min-width: 800px;
}

.comparison-table thead {
  background: #e3f2fd;
  color: var(--text);
  border-bottom: 2px solid #b3d9ff;
}

.comparison-table th {
  padding: 1.5rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  border-bottom: none;
  position: relative;
}

.comparison-table th:first-child {
  border-top-left-radius: 12px;
  padding-left: 1.5rem;
}

.comparison-table th:last-child {
  border-top-right-radius: 12px;
  padding-right: 1.5rem;
}

.comparison-table tbody tr {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s ease;
}

.comparison-table tbody tr:hover {
  background-color: #f8f9fa;
}

.comparison-table tbody tr:last-child {
  border-bottom: none;
}

.comparison-table td {
  padding: 1.5rem 1.25rem;
  vertical-align: middle;
  color: #333;
}

.comparison-table td:first-child {
  padding-left: 1.5rem;
}

.comparison-table td:last-child {
  padding-right: 1.5rem;
}

.service-name-cell {
  min-width: 250px;
}

.service-name-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-catch {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.25rem;
}


.service-link {
  color: var(--brand);
  text-decoration: underline;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  font-weight: 500;
  align-self: flex-start;
}

.service-link:hover {
  color: #0052a3;
}

/* オンライン面談 */
.online-meeting-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  min-width: 70px;
}

.online-meeting-badge.available {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.online-meeting-badge.unavailable {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.comparison-table td:nth-child(2),
.comparison-table td:nth-child(3) {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
}

.btn-official-site {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #ff6b35;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.btn-official-site:hover {
  background: #ff8c42;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.btn-official-site:active {
  transform: translateY(0);
}

.btn-official-site svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 2.5;
}

.comparison-table .error {
  text-align: center;
  color: #c62828;
  padding: 2rem;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .comparison-table-wrapper {
    margin: 0 -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .comparison-table {
    font-size: 0.85rem;
    min-width: 700px;
  }

  .comparison-table th {
    padding: 1.25rem 1rem;
    font-size: 0.9rem;
  }

  .comparison-table th:first-child {
    padding-left: 1.25rem;
  }

  .comparison-table th:last-child {
    padding-right: 1.25rem;
  }

  .comparison-table td {
    padding: 1.25rem 1rem;
  }

  .comparison-table td:first-child {
    padding-left: 1.25rem;
  }

  .comparison-table td:last-child {
    padding-right: 1.25rem;
  }

  .service-name-cell {
    min-width: 200px;
  }

  .service-link {
    font-size: 0.85rem;
  }

  .btn-official-site {
    padding: 0.625rem 1.25rem;
    font-size: 0.85rem;
  }

  .online-meeting-badge {
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
    min-width: 60px;
  }
}

/* ご利用上の注意 */
.disclaimer {
  background: #f8f9fa;
  border-top: 1px solid #e5e5e5;
  padding: 60px 20px 60px 20px;
  padding-top: 60px;
  margin-top: 0;
}

.disclaimer .container {
  max-width: 1000px;
  margin: 0 auto;
}

.disclaimer-content {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e5e5;
}

.disclaimer h2 {
  color: #1a1a1a;
  font-size: 1.75rem;
  margin-bottom: 24px;
  font-weight: 700;
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2px solid #004aad;
  position: relative;
}

.disclaimer h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #004aad, #00a2d6);
}

.disclaimer-text {
  max-width: 100%;
  margin: 0;
  text-align: left;
}

.disclaimer-text p {
  font-size: 1.0625rem;
  margin-bottom: 24px;
  color: #2d2d2d;
  line-height: 1.8;
  font-weight: 500;
}

.disclaimer-text p strong {
  color: #1a1a1a;
  font-weight: 700;
}

.disclaimer-text ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.disclaimer-text li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 16px;
  color: #333;
  line-height: 1.8;
  font-size: 1rem;
}

.disclaimer-text li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #004aad;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .disclaimer {
    padding: 40px 16px;
    margin-top: 60px;
  }

  .disclaimer-content {
    padding: 24px 20px;
  }

  .disclaimer h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .disclaimer-text p {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .disclaimer-text li {
    font-size: 0.9375rem;
    margin-bottom: 12px;
    padding-left: 28px;
  }
}

/* アフィリエイトバナー - card-image-wrapper内で1つのflexアイテムとして扱う */
/* 重要: 既存のCSS（card-header-with-image、card-header-text、card-ctas）は一切変更しない */
.affiliate-banner-container {
  /* flexアイテムとして扱われるが、内部は通常のフロー */
  display: block;
  width: 300px;
  height: 250px;
  position: relative;
  flex-shrink: 0;
  /* インライン要素の余白を完全に削除 */
  line-height: 0;
  font-size: 0;
  /* 余白を完全に削除 */
  margin: 0;
  padding: 0;
  /* トラッキングピクセルがflexアイテムとして扱われないように */
  overflow: hidden;
  /* 他の要素への影響を完全に排除 */
  box-sizing: border-box;
}

.affiliate-banner-container>a {
  display: block;
  width: 300px;
  height: 250px;
  line-height: 0;
  font-size: 0;
  margin: 0;
  padding: 0;
  text-decoration: none;
  box-sizing: border-box;
}

.affiliate-banner-container>a>img {
  display: block;
  width: 300px;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 0;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
}

/* トラッキングピクセル: 完全に非表示（レイアウトに一切影響しない） */
.affiliate-banner-container>img[width="1"][height="1"],
.affiliate-banner-container img[width="1"][height="1"] {
  /* 完全に非表示、flexアイテムとしても扱われない */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
  top: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
  /* display: noneは計測に影響する可能性があるため、position: absoluteで非表示 */
}

/* アフィリエイトテキストリンク */
.affiliate-text-link-container {
  text-align: center;
  margin: 1rem 0;
}

.affiliate-text-link-container a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--brand);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.affiliate-text-link-container a:hover {
  background: #0052a3;
  transform: translateY(-1px);
}

.affiliate-text-link-container a:active {
  transform: translateY(0);
}

/* トラッキングピクセル（非表示）- 上記の詳細なスタイルで上書きされる */

/* Banner HTML Container */
.card-banner-container {
  width: 300px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: white;
}

.card-banner-container img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  vertical-align: bottom;
  /* Remove extra space below inline images */
}

/* Ensure banner container responds like the card-image on mobile */
@media (max-width: 768px) {
  .card-banner-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 300 / 250;
    /* Reset fixed dimensions for mobile flow if needed, but keeping aspect ratio is safer */
    min-height: auto;
  }
}

/* Disclaimer Section */
.disclaimer {
  padding-top: 60px !important;
  margin-top: 0 !important;
}
