/* notebook.css - 手帳モチーフ専用スタイル */
:root {
  --bg-color: #f7f2e8;
  --paper-color: #fffdfa;
  --text-main: #334155;
  --text-muted: #7b8797;
  --brand: #ef7f5b;
  --brand-light: #f7c7b1;
  --accent: #b84d2b;
  --rule-line: #dbe5ef;
  --line: #dde5ee;
}

/* 全体リセット */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 横スクロールのみ防止 */
  background-color: var(--bg-color);
  background-image: 
    linear-gradient(transparent 95%, rgba(239, 127, 91, 0.05) 5%),
    linear-gradient(90deg, transparent 95%, rgba(73, 149, 170, 0.05) 5%);
  background-size: 20px 20px;
  color: var(--text-main);
  font-family: "Quicksand", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  line-height: 1.6;
}

/* 非表示ユーティリティ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ヘッダー：手帳の表紙・リボン風 */
.site-header {
  background: var(--paper-color);
  border-bottom: 4px solid var(--brand);
  box-shadow: 0 4px 12px rgba(244, 114, 182, 0.15);
  padding: 16px 20px;
  text-align: center;
  position: relative;
  z-index: 10;
}
.header-inner {
  display: flex;
  justify-content: center;
}
.site-header a {
  display: block;
  max-width: 100%;
  text-decoration: none;
}
.site-branding {
  max-width: min(100%, 26rem);
}
.site-title {
  margin: 0;
  color: var(--accent);
  font-size: 1.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.site-subtitle {
  margin: 4px 0 0 0;
  color: var(--brand);
  font-size: 0.85rem;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.page-affiliate-note {
  max-width: 1100px;
  margin: 10px auto 0;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed var(--brand-light);
  border-radius: 999px;
}

/* ページレイアウト（2カラム枠） */
.layout-shell {
  max-width: 1100px; /* ノート800px + サイドバー300px */
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* メインコンテナ：ノート本体 */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 16px 24px;
  background: var(--paper-color);
  border-radius: 8px 16px 16px 8px; /* 右側がページのめくり風 */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  position: relative;
}
/* 左のバインダー穴 (PC向け) 850px以下のスマホ枠と競合しないよう851px〜に変更 */
@media (min-width: 851px) {
  .main-content::before {
    content: "";
    position: absolute;
    top: 24px; bottom: 24px; left: 16px;
    width: 14px;
    background-image: radial-gradient(circle, var(--bg-color) 40%, transparent 45%);
    background-size: 14px 36px;
    background-repeat: repeat-y;
  }
  .main-content { padding-left: 56px; }
}

/* 冒頭紹介テキスト */
.site-intro {
  position: relative;
  margin-bottom: 32px;
  padding-top: 8px;
}
.page-updated-at {
  position: absolute;
  top: -2px;
  right: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.62rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: right;
  opacity: 0.82;
}
.page-updated-at time {
  font-weight: 500;
}
.site-intro h2 {
  font-size: 1.35rem;
  color: var(--accent);
  margin: 0 0 12px 0;
  text-align: center;
}
.site-intro-copy {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  text-align: center;
}
.subpage-back-link {
  display: inline-flex;
  align-items: center;
  appearance: none;
  border: 1px solid var(--brand-light);
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 12px;
  margin: 4px 0 22px;
  color: var(--brand);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(244, 114, 182, 0.08);
  text-decoration: none;
}

.subpage-back-link:hover,
.subpage-back-link:focus-visible {
  background: var(--paper-color);
  border-color: var(--brand);
  text-decoration: none;
}

.subpage-title {
  margin: 0 0 22px;
  font-size: 2rem;
  line-height: 1.12;
}

body[data-page="operator"] .layout-shell,
body[data-page="privacy"] .layout-shell {
  margin-top: 12px;
}

body[data-page="operator"] .main-content,
body[data-page="privacy"] .main-content {
  padding: 12px 36px 28px;
}

/* パネル（各ブロック） */
.panel {
  margin-bottom: 24px;
}
.panel h2 {
  font-size: 1.25rem;
  color: var(--brand);
  border-bottom: 2px dashed var(--brand-light);
  padding-bottom: 8px;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h2::before {
  content: "★";
  color: #fca5a5;
  font-size: 1.15rem;
}

/* 月別ジャンプ (インデックスシール風) */
.month-toc {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* PCは6列に均等割り付け */
  gap: 12px;
  padding: 0;
}
.toc-btn {
  display: block; /* aタグをブロックにして広げる */
  padding: 8px 0;
  text-align: center;
  background: var(--paper-color);
  border: 2px solid var(--brand-light);
  color: var(--accent);
  border-radius: 24px; /* 左右対称の完全な角丸（カプセル風）に変更 */
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--brand-light);
  transition: all 0.2s ease;
}
.toc-btn:hover, .toc-btn:focus {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--brand);
  border-color: var(--brand);
  background: var(--paper-color);
}

/* 絞り込みセレクト */
.filter-controls {
  display: flex;
  gap: 16px;
}
.filter-controls select,
.filter-controls option {
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid var(--brand-light);
  background: var(--bg-color);
  color: var(--text-main);
  font-size: 1rem;
  font-family: "Quicksand", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "UD Digi Kyokasho NP-R", "UD デジタル 教科書体 NP-R", sans-serif;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  flex: 1;
  transition: border-color 0.2s;
}
.filter-controls select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.2);
}

/* リスト部分：罫線ノート風 */
.month-section {
  margin-bottom: 24px;
}
.month-heading {
  font-size: 1.3rem;
  color: var(--text-main);
  background: linear-gradient(transparent 60%, rgba(244, 114, 182, 0.3) 60%);
  display: inline-block;
  padding: 0 6px;
  margin: 0 0 8px 0;
  font-weight: 900;
}
.char-table {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule-line);
}
.char-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* スマホでバッジが折り返せるようにする */
  padding: 4px 8px; /* 上下の余白を極限まで削る */
  border-bottom: 1px dashed var(--rule-line);
  gap: 4px 12px;
  line-height: 1.3; /* 行間もギリギリまで詰める */
  transition: background 0.2s ease;
}
.char-row:hover {
  background: rgba(252, 231, 243, 0.4); /* ほんのり色付く */
}
.char-date {
  font-weight: 900;
  font-size: 1rem;
  color: var(--accent);
  width: 48px;
  flex-shrink: 0;
  font-family: "Quicksand", sans-serif;
}
.char-name {
  font-size: 1rem;
  font-weight: 700;
  flex: 1 1 auto;
}
/* バッジ領域をCSS Grid化して文字数によらず縦位置を固定 */
.char-meta {
  display: grid;
  grid-template-columns: 130px 220px; /* 一番長いサンダーボルトエンターテイメントが入るよう事務所側を拡張 */
  gap: 8px;
  justify-content: flex-end; /* PCでは右寄せ */
}
.badge {
  padding: 2px 4px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--paper-color);
  white-space: nowrap;
  
  /* セル幅ピッタリにして文字を中央寄せに統一 */
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.badge-group { background: #f472b6; grid-column: 1; }
.badge-agency { background: #38bdf8; grid-column: 2; }

/* 広告エリア（右サイドバー） */
.right-ad {
  width: 300px;
  flex-shrink: 0;
  padding: 14px 16px 16px;
  background: var(--paper-color);
  border-radius: 12px;
  border: 1px dashed var(--brand-light);
  text-align: center;
  position: sticky;
  top: 24px;
}
.ad-disclosure {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}
.ad-slot { margin-bottom: 24px; }

.right-ad .ad-slot {
  position: relative;
}

.right-ad .ad-slot > .pr-label {
  position: absolute;
  top: -0.35rem;
  right: 0.25rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.15rem;
  margin: 0;
  padding: 0 0.35rem;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(244, 114, 182, 0.24);
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(190, 24, 93, 0.12);
}
.ad-buy-links {
  display: flex; gap: 8px; justify-content: center; margin-top: 4px;
  flex-wrap: wrap; /* スマホではみ出さないよう折り返しを許可 */
}
.ad-buy-link {
  padding: 8px 16px;
  background: var(--paper-color);
  border: 1px solid var(--brand);
  color: var(--brand);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
}
.ad-buy-link:hover {
  background: var(--brand);
  color: var(--paper-color);
}

/* フッター */
.site-footer {
  text-align: center;
  padding: 12px 20px;
  margin-top: 16px;
  background: var(--paper-color);
  border-top: 4px solid var(--brand);
  box-shadow: 0 -4px 12px rgba(244, 114, 182, 0.05);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.back-to-top-btn {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0 0.9rem;
  border: 1px solid var(--brand-light);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(244, 114, 182, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.back-to-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top-btn:hover,
.back-to-top-btn:focus-visible {
  background: var(--paper-color);
  border-color: var(--brand);
}
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 12px 16px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.footer-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.95rem;
}
.footer-nav a:hover { text-decoration: underline; }
.copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.35;
}
.footer-disclaimer {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  line-height: 1.3;
}

@media (min-width: 851px) {
  .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .footer-nav {
    order: 2;
    justify-content: flex-end;
    gap: 10px 14px;
    margin-bottom: 0;
    flex-wrap: nowrap;
    flex: 0 0 auto;
  }

  .footer-nav a {
    white-space: nowrap;
  }

  .copyright {
    order: 1;
    text-align: left;
    flex: 1 1 auto;
  }

  .footer-disclaimer {
    margin-top: 2px;
  }
}

/* 画像レスポンシブとA8特有のテキストリンク・トラッキング画像対策 */
.ad-image-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* 親要素を突き破るのを確実に防ぐ */
}
.ad-image-slot > a {
  display: block;
  margin: 0;
}
.ad-image-slot > a > img {
  display: block;
  margin: 0 auto !important;
}
.ad-image-slot a {
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
}
.ad-image-slot img, .ad-code-area img, .sp-ad-viewport img,
.ad-product-unit iframe, .ad-product-unit table, .ad-product-unit td {
  max-width: 100% !important;
  height: auto !important;
  box-sizing: border-box;
}
/* トラッキングピクセルの非表示化（レイアウト崩れ防止） */
.ad-image-slot img[width="1"][height="1"],
.ad-code-area img[width="1"][height="1"] {
  display: none !important;
}

/* レイアウトが崩れるサイズの時（縦積み） */
@media (max-width: 850px) {
  .layout-shell {
    flex-direction: column;
    align-items: stretch;
    padding: 0; /* 一般的なスマホ(320px〜375px)で余白が過大になりはみ出すのを防ぐ */
    margin: 0;
  }
  .main-content {
    width: 100%;
    margin: 0; /* 画面いっぱいに広げる */
    padding: 16px 8px; /* 限界まで余白をスリム化し、内側のコンテンツ幅を確保 */
    border-radius: 0;
  }
  .right-ad {
    width: 100%;
    margin-top: 16px;
    position: static;
  }
}

/* モバイル表示最適化 */
@media (max-width: 600px) {
  .site-header { padding: 12px 16px; }
  .site-branding { max-width: min(100%, 16rem); }
  .site-title {
    font-size: 1.24rem;
    line-height: 1.3;
  }
  .site-intro {
    margin-bottom: 6px;
    padding: 0 4px;
  }
  .site-intro {
    padding-top: 12px;
  }
  .site-intro h2 {
    margin-bottom: 4px;
  }
  .site-intro-copy {
    font-size: 0.86rem;
    line-height: 1.22;
  }
  .page-updated-at {
    top: 0;
    font-size: 0.56rem;
  }
  .subpage-back-link {
    padding: 5px 11px;
    margin-bottom: 20px;
    font-size: 0.82rem;
  }
  .subpage-title {
    margin-bottom: 18px;
    font-size: 1.8rem;
  }
  .panel {
    padding: 8px 6px;
    margin-bottom: 4px;
  }
  .panel h2 {
    padding-bottom: 3px;
    margin-bottom: 6px;
  }
  .page-affiliate-note {
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    background: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
    line-height: 1.18;
  }
  .filter-controls { flex-direction: column; gap: 6px; }
  .filter-controls select,
  .filter-controls option {
    padding: 7px 10px;
    font-size: 0.92rem;
  }
  
  .month-toc {
    grid-template-columns: repeat(4, 1fr); /* スマホは4列に均等割り付け */
    gap: 6px;
  }
  .toc-btn { padding: 4px 0; font-size: 0.84rem; }
  .month-section {
    margin-bottom: 8px;
  }
  .month-heading {
    margin-bottom: 4px;
  }
  
  .char-row {
    padding: 4px 4px; /* スマホでも横並びを基本にし、上下余白を減らす */
  }
  .char-meta { 
    justify-content: flex-start; /* スマホでは左寄せ */
    grid-template-columns: 35% 62%; /* 固定幅を％に変更して画面端のはみ出しを防止 */
    gap: 3%;
    margin-left: 0; /* 余分な左余白を削除 */
    width: 100%;
    margin-top: 1px;
    margin-bottom: 1px;
  }
  .badge {
    font-size: 0.64rem; /* 長い事務所名が収まるよう小さく */
    letter-spacing: -0.05em; /* 文字間を詰める */
    white-space: normal; /* 折り返しを許可し、はみ出しを防ぐ */
    line-height: 1.2;
    padding: 2px;
  }
  
  /* PC用広告隠し */
  .ad-creative-pc { display: none; }
  .ad-creative-sp { display: block; }

  .site-footer {
    margin-top: 10px;
    padding: 10px 10px 9px;
  }

  .back-to-top-btn {
    min-height: 1.95rem;
    padding: 0 0.78rem;
    font-size: 0.76rem;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .footer-nav {
    gap: 8px 12px;
    margin-bottom: 4px;
  }

  .footer-nav a {
    font-size: 0.88rem;
  }

  .copyright {
    font-size: 0.8rem;
    line-height: 1.28;
  }

  .footer-disclaimer {
    margin-top: 1px;
    font-size: 0.7rem;
    line-height: 1.22;
  }
}
@media (min-width: 601px) {
  .ad-creative-sp { display: none; }
}

.page-links-panel {
  margin-top: 8px;
}

.mobile-ad-slot {
  display: none;
}

.mobile-ad-slot:empty {
  display: none;
}

.page-links-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.page-link-card {
  display: grid;
  gap: 8px;
  padding: 16px 14px;
  border: 2px solid var(--brand-light);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9fc 0%, #fff 100%);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(244, 114, 182, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.page-link-card:hover,
.page-link-card:focus-visible {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(244, 114, 182, 0.12);
  outline: none;
}

.page-link-card-title {
  margin: 0;
  color: var(--accent);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
}

.page-link-card-title-label,
.page-link-card-title-main,
.page-link-card-title-sub {
  display: block;
}

.page-link-card-title-label {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  vertical-align: top;
}

.page-link-card-title-main {
  white-space: nowrap;
}

.page-link-card-title-sub {
  font-size: 0.92em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.page-link-card-text {
  margin: 0;
  color: var(--text-main);
  font-size: 0.94rem;
  line-height: 1.45;
}

/* -------------------------------- */
/* スマホ版メインコンテンツ内広告の制御 */
/* -------------------------------- */
@media (min-width: 851px) {
  .sp-ad-viewport { 
    display: none !important; 
  }
}

@media (max-width: 850px) {
  /* 縦積み時に下にまとまっている右サイドバー全体を非表示 */
  .right-ad { 
    display: none !important;
  }
  
  /* メインコンテンツ内に挟み込んだ広告のスタイル */
  .sp-ad-viewport {
    display: block;
    margin: 1px 0;
    padding-inline: 4px;
    width: 100%;
    box-sizing: border-box;
  }
  .sp-ad-viewport .pr-label {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.15rem;
    margin: 2px 0 0;
    padding: 0 3px;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(190, 24, 93, 0.18);
  }
  .sp-ad-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    width: 100%;
    box-sizing: border-box;
    padding: 1.45rem 6px 6px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(244, 114, 182, 0.18);
    border-radius: 12px;
  }

  .sp-ad-card > .pr-label {
    position: absolute;
    top: 5px;
    right: 6px;
    z-index: 1;
    margin: 0;
    min-width: 1.9rem;
    justify-content: flex-end;
    padding: 0 5px 0 7px;
  }
  .sp-ad-card > .ad-product-unit {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    gap: 2px;
  }
  .sp-ad-card .ad-image-slot {
    align-items: center;
    min-width: 0;
  }
  .sp-ad-card .ad-image-slot > a,
  .sp-ad-card .ad-image-slot a {
    display: block;
    width: min(100%, var(--sp-text-max-width, 100%));
    max-width: 100%;
    min-width: 0;
    margin-inline: auto;
    overflow-wrap: break-word;
    word-break: normal;
    line-break: strict;
    white-space: normal;
    box-sizing: border-box;
  }
  .sp-ad-card .ad-product-unit[data-ad-id="AD01"] {
    --sp-text-max-width: 23em;
  }
  .sp-ad-card .ad-product-unit[data-ad-id="AD02"] {
    --sp-text-max-width: 18.6em;
  }
  .sp-ad-card .ad-product-unit[data-ad-id="AD02"] .ad-image-slot > a,
  .sp-ad-card .ad-product-unit[data-ad-id="AD02"] .ad-image-slot a {
    font-size: 0.78rem;
    line-height: 1.45;
  }
  .sp-ad-card .ad-product-unit[data-ad-id="AD03"] {
    --sp-text-max-width: 19em;
  }
  .sp-ad-card .ad-buy-links {
    width: 100%;
    justify-content: center;
    margin-top: 2px;
    gap: 4px;
  }
  .sp-ad-card .ad-buy-link {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 0.76rem;
  }

  .sp-ad-viewport--primary .sp-ad-card {
    justify-content: center;
    padding: 1.45rem 6px 6px;
  }

  .sp-ad-viewport--primary .sp-ad-card > .ad-product-unit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    flex: 1 1 auto;
  }

  .sp-ad-viewport--primary .sp-ad-card > .ad-product-unit .ad-image-slot {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .sp-ad-viewport--primary .sp-ad-card > .ad-product-unit .ad-buy-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    justify-content: flex-start;
    gap: 2px;
  }

  .sp-ad-viewport--primary .sp-ad-card > .ad-product-unit .ad-buy-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 6.9rem;
    min-height: 22px;
    padding: 3px 6px;
    font-size: 0.68rem;
    white-space: nowrap;
    width: auto;
    text-align: center;
  }

  .layout-shell {
    padding-top: 0;
  }

  .main-content {
    padding: 6px 4px;
  }

  body[data-page="operator"] .layout-shell,
  body[data-page="privacy"] .layout-shell {
    margin-top: 6px;
  }

  body[data-page="operator"] .main-content,
  body[data-page="privacy"] .main-content {
    padding: 0 20px 16px;
  }

  /* 挟み込んだ広告内ではSPバナーを強制表示（600-850px間でも見せるため） */
  .sp-ad-viewport .ad-creative-pc { display: none !important; }
  .sp-ad-viewport .ad-creative-sp { display: block !important; }

  .page-links-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page-link-card {
    padding: 14px 12px;
  }

  .page-link-card-title {
    font-size: 1rem;
  }

  .page-link-card-title-sub {
    font-size: 0.88em;
  }

  .mobile-ad-slot {
    display: block;
    margin: 4px 0;
  }
}
