/* 案A' 夜の書斎＋丸ゴシック（docs/design_v2_options.html .ma.ma2 準拠） */
:root {
  --ink: #1c1f33;
  --ink2: #262a44;
  --paper: #efe6d2;
  --brass: #c9a35c;
  --rose: #c2456a; /* 紙の上の差し色 */
  --rose-soft: #f2a3b8; /* 紺の上の差し色 */
  --mute: #d6cfbf; /* 紺地の補足（日付・ナビ）を明るく */
  --shelf-wood: #5a4329;
  --line: #3a3f5f;
  --f-head: "Shippori Mincho B1", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --f-maru: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-dot: "DotGothic16", ui-monospace, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* clip はスクロール容器を作らない（hidden だと sticky 目次が効かない） */
  overflow-x: clip;
  max-width: 100%;
  /* スクロールバーの有無で中央寄せがずれないようにする */
  scrollbar-gutter: stable;
  overflow-y: scroll;
  /* 追従ヘッダーの下に見出しが隠れないようにする */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 17px/1.9 var(--f-body);
  overflow-x: clip;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img,
table,
pre,
iframe,
.receipt,
.table-wrap {
  max-width: 100%;
}

a {
  color: var(--brass);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* ---- ヘッダー ---- */
.site-header {
  /* どの幅でも画面の上に追従する（目次ボタン40・目次シート50・年齢確認より下） */
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: transform 0.2s ease;
  padding: max(14px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px)) 14px
    max(16px, env(safe-area-inset-left, 0px));
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

/* スマホはヘッダーが高い（2段）ので、見出しへの移動はそのぶん下げる */
@media (max-width: 767px) {
  html {
    scroll-padding-top: 128px;
  }
}

.site-header .inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.site-header .brand {
  color: var(--paper);
  text-decoration: none;
  font-family: var(--f-head);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.35;
}

.site-header .brand .en {
  display: block;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--brass);
  font-weight: 500;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
  font-family: var(--f-maru);
  font-weight: 500;
}

.site-header nav a {
  color: var(--mute);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--paper);
}

/* ---- フッター ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px max(16px, env(safe-area-inset-right, 0px))
    max(40px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  font-size: 14px;
  color: var(--mute);
}

.site-footer .inner {
  max-width: 760px;
  margin: 0 auto;
}

.site-footer .footer-nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.site-footer a {
  color: var(--mute);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--paper);
}

.site-footer p {
  margin: 0;
}

/* PC 専用のサイト名・一文は狭い画面では出さない（見た目を変えない） */
.site-footer .fname,
.site-footer .ftag {
  display: none;
}

.page-layout .sidebar {
  display: none;
}

/* ---- メイン共通 ---- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 64px
    max(16px, env(safe-area-inset-left, 0px));
  min-width: 0;
}

/* 記事冒頭の PR 一文（本文と同サイズ・同色。飾りなし） */
.paper .pr {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.9;
  color: var(--ink);
  font-family: var(--f-body);
}

/* ---- トップ hero ---- */
.hero {
  padding: 34px 0 10px;
  display: grid;
  gap: 10px;
}

.hero h1 {
  margin: 0;
  font-family: var(--f-head);
  font-size: clamp(24px, 4vw, 37px);
  line-height: 1.45;
  font-weight: 700;
  border: 0;
  padding: 0;
  color: var(--paper);
}

.hero h1 em {
  font-style: normal;
  color: var(--rose-soft);
}

.hero p {
  margin: 0;
  font-size: 14px;
  color: var(--mute);
  max-width: 40em;
}

/* ---- 目的から探す（入口タイル） ---- */
.entries {
  margin: 8px 0 4px;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tile {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: #f4ecda;
  font-family: var(--f-maru);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
  min-width: 0;
}

.tile:hover {
  color: #f4ecda;
  border-color: var(--rose-soft);
}

.tile svg {
  width: 30px;
  height: 30px;
  display: block;
}

.tile strong {
  font-weight: 700;
  font-size: 14px;
}

.tile span {
  font-weight: 400;
  font-size: 12.5px;
  color: #cfc8b8;
  line-height: 1.45;
}

/* ---- カテゴリ本棚 ---- */
.shelf-wrap {
  margin: 8px 0 0;
  overflow: hidden;
}

.shelf {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 24px 0 0;
  border-bottom: 10px solid var(--shelf-wood);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.shelf::-webkit-scrollbar {
  height: 6px;
}

.shelf::-webkit-scrollbar-thumb {
  background: var(--line);
}

.sp {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 12px 7px;
  font-family: var(--f-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  border-radius: 2px 2px 0 0;
  flex: none;
  text-decoration: none;
  color: var(--paper);
  transition: transform 0.25s;
  display: block;
  white-space: nowrap;
  min-height: 120px;
}

.sp:hover {
  transform: translateY(-8px);
  color: var(--paper);
}

.sp small {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.75;
  margin-inline-start: 10px;
  text-orientation: upright;
  letter-spacing: 0.1em;
  display: inline-block;
}

.sp.s1 {
  background: #7b2e45;
  height: 170px;
}
.sp.s2 {
  background: #2f5a5a;
  height: 150px;
}
.sp.s3 {
  background: var(--paper);
  color: var(--ink);
  height: 182px;
}
.sp.s3:hover {
  color: var(--ink);
}
.sp.s4 {
  background: #4a3d70;
  height: 140px;
}
.sp.s5 {
  background: #8c6a33;
  height: 160px;
}
.sp.s6 {
  background: #35395c;
  height: 128px;
  border: 1px solid #555b87;
}

/* ---- セクション見出し・新着カード（案A'） ---- */
.section-label {
  font-family: var(--f-maru);
  font-size: 17px;
  font-weight: 900;
  margin: 28px 0 14px;
  color: #f4ecda;
  letter-spacing: 0.04em;
}

.books {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 0 8px;
}

.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  text-decoration: none;
  min-width: 0;
  box-shadow: 4px 4px 0 #0d0f1c;
}

.card:hover {
  color: var(--ink);
}

.card .eye {
  height: 118px;
  display: grid;
  place-items: center;
}

.card .eye img {
  height: 84px;
  width: auto;
  max-width: 90%;
}

.card .eye.e1 {
  background: linear-gradient(135deg, #3b2a4d, #5a2a48);
}

.card .eye.e2 {
  background: linear-gradient(135deg, #2b2f4d, #4a2c4a);
}

.card .cb {
  padding: 10px 12px 12px;
  display: grid;
  gap: 6px;
}

.card .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--f-maru);
}

.card .bd {
  font-size: 12px;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 9px;
  line-height: 1.7;
  background: var(--rose);
  color: #fff;
}

.card .bd.n {
  background: transparent;
  color: var(--rose);
  border: 1px solid var(--rose);
}

.card .ct {
  font-family: var(--f-maru);
  font-weight: 900;
  font-size: 15.5px;
  line-height: 1.55;
}

.card .cm {
  font-family: var(--f-body);
  font-size: 14px;
  color: #5e5a62;
}

/* ---- 紙面（記事・固定ページ本文） ---- */
.paper {
  background: var(--paper);
  color: var(--ink);
  padding: 20px 18px 36px;
  margin: 16px 0 0;
  border-radius: 2px;
  box-shadow: 4px 4px 0 #0d0f1c;
}

.paper a {
  color: var(--rose);
}

.paper a:hover {
  color: var(--ink);
}

/* BudouX: 文節の切れ目（U+200B）でのみ折り返す。長い英字・URL は anywhere で折る */
.budoux {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.paper h1 {
  font-family: var(--f-head);
  font-size: 26px;
  line-height: 1.5;
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--ink);
}

.paper h2 {
  font-family: var(--f-head);
  font-size: 22px;
  border-left: 4px solid var(--brass);
  padding-left: 12px;
  margin: 36px 0 12px;
  font-weight: 700;
  color: var(--ink);
}

.paper h3 {
  font-family: var(--f-head);
  font-size: 19px;
  margin: 28px 0 8px;
  font-weight: 700;
  color: var(--ink);
}

.paper p {
  margin: 0 0 1em;
  font-size: 18px;
  line-height: 1.9;
}

.paper .meta {
  font-size: 14px;
  color: #6d6555;
  margin: 0 0 16px;
  font-family: var(--f-body);
}

.paper .lead {
  background: #e8dcc4;
  padding: 12px 16px;
  border-radius: 2px;
  margin-bottom: 1.2em;
  font-size: 16.5px;
  line-height: 1.85;
}

.paper .toc {
  border: 1px solid #cfc4ad;
  border-radius: 2px;
  padding: 8px 16px;
  font-size: 14px;
  margin-bottom: 1.5em;
  background: #f5edd9;
}

.paper .toc ol {
  margin: 6px 0 0;
  padding-left: 1.4em;
}

.paper .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
  max-width: 100%;
}

.paper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  margin: 0;
}

.paper th,
.paper td {
  /* 表のセルにも BudouX の区切り（U+200B）が入る。「、」は前の文節に付くので行頭に来ない */
  word-break: keep-all;
  line-break: strict;
  /* anywhere だと列の最小幅が1文字まで縮み、「FANZA」まで折れる。break-word は最小幅を変えない */
  overflow-wrap: break-word;
  border: 1px solid #cfc4ad;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.paper th {
  background: #e8dcc4;
  font-weight: 500;
}

.paper .embed {
  border: 2px dashed #cfc4ad;
  border-radius: 2px;
  padding: 24px 12px;
  text-align: center;
  color: #6d6555;
  font-size: 14px;
  margin: 12px 0;
}

.paper .cta {
  display: block;
  text-align: center;
  background: var(--brass);
  color: var(--ink) !important;
  text-decoration: none;
  font-weight: 700;
  font-family: var(--f-body);
  padding: 12px;
  border-radius: 2px;
  margin: 16px 0;
  box-shadow: 3px 3px 0 #0d0f1c;
}

.paper .cta:hover {
  filter: brightness(1.05);
}

.paper .ph {
  background: #f5e6a8;
  padding: 0 3px;
  border-radius: 2px;
}

.paper .note-box {
  border: 1px solid #cfc4ad;
  border-radius: 2px;
  padding: 8px 16px;
  font-size: 14px;
  color: #6d6555;
}

.paper .src {
  font-size: 14px;
  color: #6d6555;
  word-break: break-all;
}

/* 畳んだ出典（details）: 押せる範囲が分かる枠＋▼ */
.paper details.src {
  margin: 1.5em 0 0;
  border: 1px solid #cfc4ad;
  border-radius: 2px;
  background: #f5edd9;
  font-size: 14px;
  color: #6d6555;
  word-break: break-all;
}

.paper details.src summary {
  cursor: pointer;
  padding: 10px 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  list-style: none;
  font-size: 14px;
  line-height: 1.6;
}

.paper details.src summary::-webkit-details-marker {
  display: none;
}

.paper details.src summary::before {
  content: "▼ ";
  text-decoration: none;
  font-size: 0.85em;
}

.paper details.src[open] summary::before {
  content: "▲ ";
}

.paper details.src > *:not(summary) {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 14px;
  line-height: 1.7;
}

.paper details.src > *:not(summary) a {
  font-size: 14px;
}

.paper blockquote {
  margin: 1em 0;
  padding: 8px 14px;
  border-left: 3px solid var(--brass);
  color: #4a4538;
  background: #e8dcc4;
}

.paper ul,
.paper ol {
  padding-left: 1.4em;
  margin: 0 0 1em;
}

.paper li {
  margin: 0.35em 0;
  font-size: 18px;
  line-height: 1.9;
}

/* 紙面なしページ（404 等の短い案内） */
.plain {
  padding: 28px 0 8px;
  max-width: 40em;
}

.plain h1 {
  font-family: var(--f-head);
  font-size: 26px;
  margin: 0 0 12px;
  font-weight: 700;
}

/* カテゴリ一覧・カテゴリ別（ダーク背景＋カード） */
.cat-head {
  padding: 28px 0 4px;
}

.cat-head h1 {
  margin: 0 0 8px;
  font-family: var(--f-maru);
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.45;
  font-weight: 900;
  color: var(--paper);
}

.cat-head .meta {
  margin: 0;
  font-size: 14px;
  color: var(--mute);
  font-family: var(--f-body);
}

.cat-back {
  margin: 24px 0 0;
  font-size: 14px;
}

/* トップ: すべての記事へ（押せると分かる枠） */
.page-home .cat-back {
  margin: 28px 0 0;
  text-align: center;
}

.page-home .cat-back a {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--f-maru);
  font-weight: 700;
  font-size: 15px;
  color: var(--paper);
}

.page-home .cat-back a:hover {
  border-color: var(--rose-soft);
  color: var(--rose-soft);
}

.cat-back a {
  color: var(--mute);
  text-decoration: none;
}

.cat-back a:hover {
  color: var(--paper);
}

.cat-empty {
  color: var(--mute);
  font-size: 14px;
}

.plain a {
  color: var(--brass);
}

/* ---- レシート（案C .rc 移植・ドット飾りは据え置き） ---- */
.receipt {
  background: #fbfaf5;
  color: #2b2433;
  font-family: var(--f-dot);
  font-size: 13px;
  line-height: 1.55;
  padding: 16px 16px 22px;
  margin: 1.4em auto;
  max-width: 280px;
  transform: rotate(1.5deg);
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 97%, #000) 0 0 / 14px
    100%;
  mask: radial-gradient(circle 6px at 50% 100%, transparent 97%, #000) 0 0 / 14px 100%;
  display: grid;
  gap: 3px;
  box-shadow: 0 2px 0 #d4cfc4, 6px 8px 18px rgba(13, 15, 28, 0.35);
  border: 1px solid #ddd6c8;
}

.receipt .t {
  text-align: center;
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}

.receipt .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.receipt .row .lab {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.receipt .row .val {
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.receipt hr {
  border: 0;
  border-top: 1px dashed #9a90a6;
  margin: 6px 0;
  width: 100%;
}

/* ---- 年齢確認 ---- */
.age-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(13, 15, 28, 0.92);
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
}

.age-gate.is-open {
  display: flex;
}

.age-gate .panel {
  background: var(--paper);
  color: var(--ink);
  max-width: 400px;
  width: 100%;
  padding: 28px 24px;
  border-radius: 2px;
  text-align: center;
  box-shadow: 6px 6px 0 #0d0f1c;
}

.age-gate .panel p {
  margin: 0 0 12px;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.7;
  word-break: keep-all;
}

.age-gate .panel strong {
  font-family: var(--f-head);
  font-size: 20px;
  font-weight: 700;
}

.age-gate .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.age-gate button {
  font-family: var(--f-body);
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 2px;
  border: 1px solid #cfc4ad;
  cursor: pointer;
  background: #e8dcc4;
  color: var(--ink);
}

.age-gate button.yes {
  background: var(--brass);
  color: var(--ink);
  border-color: var(--brass);
  font-weight: 700;
}

@media (max-width: 480px) {
  /* 狭い画面では表の文字を少し小さくして、列を詰めずに収める */
  .paper table {
    font-size: 14px;
  }

  .paper th,
  .paper td {
    padding: 6px 5px;
  }


  .paper {
    padding: 16px 14px 28px;
  }

  .paper h1 {
    font-size: 22px;
  }

  .paper h2 {
    font-size: 20px;
  }

  .paper p,
  .paper li,
  .paper .pr {
    font-size: 17px;
  }

  .books {
    grid-template-columns: 1fr;
  }

  .receipt {
    max-width: 100%;
    transform: rotate(0.8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp,
  .site-header {
    transition: none;
  }

  .sp:hover {
    transform: none;
  }

  .receipt {
    transform: none;
  }
}

/* 比較表: 行の見出し列が細く折れないように */
.paper td:first-child {
  min-width: 6.5em;
}

/* 狭い画面の4列の表（3サービスの比較）は1列目の最小幅を外して、横にはみ出さないようにする */
@media (max-width: 480px) {
  .paper td:first-child {
    min-width: 0;
  }

  .paper table:has(tr > :nth-child(4)) {
    font-size: 13px;
  }
}

/* 広い画面では紙面の余白を広げ、ヘッダーと左右の端をそろえる */
@media (min-width: 700px) {
  .paper { padding: 40px 52px 48px; }
}

/* パンくず */
.paper .crumb {
  font-size: 14px;
  color: #6d6555;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.paper .crumb a { color: #6d6555; }

/* 本棚の空きを埋める無地の背表紙（リンクなし） */
.sp.blank {
  pointer-events: none;
  padding: 12px 9px;
  border: 1px solid rgba(239, 230, 210, 0.08);
}
.sp.blank:nth-child(3n) { background: #2c3050; min-height: 132px; }
.sp.blank:nth-child(3n+1) { background: #3a2f45; min-height: 150px; }
.sp.blank:nth-child(3n+2) { background: #24283f; min-height: 118px; }

/* 新着カード: 768px〜2列（スマホは1列のまま） */
@media (min-width: 768px) {
  .books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- サイドバー部品（1080px未満は非表示） ---- */
.sidebar {
  min-width: 0;
  font-size: 14px;
  color: var(--mute);
}

.side-toc,
.side-block {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 16px;
}

.side-toc strong,
.side-block strong {
  display: block;
  font-family: var(--f-maru);
  font-size: 14px;
  font-weight: 700;
  color: var(--paper);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

.side-toc ol,
.side-block ul {
  margin: 0;
  padding: 0 0 0 1.2em;
  list-style: decimal;
}

.side-block ul {
  list-style: none;
  padding: 0;
}

.side-toc a,
.side-block a {
  color: var(--mute);
  text-decoration: none;
  line-height: 1.55;
}

.side-toc a:hover,
.side-block a:hover,
.side-toc a.is-active {
  color: var(--rose-soft);
}

.side-toc li,
.side-block li {
  margin: 0.4em 0;
}

.side-block li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}

.side-block .n,
.side-block .d {
  font-size: 12px;
  color: #9a9488;
  flex: none;
}

.side-recent li {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0.55em 0;
  padding-bottom: 0.45em;
  border-bottom: 1px solid rgba(58, 63, 95, 0.65);
}

.side-recent li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* ---- まず読む3本（トップ／サイドバー） ---- */
.feat-block {
  margin: 16px 0 0;
}

.top-entries .feat-block {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.feat-block strong {
  display: block;
  font-family: var(--f-maru);
  font-size: 14px;
  font-weight: 700;
  color: var(--paper);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

.feat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.feat-list li {
  margin: 0;
}

.feat-list a {
  display: grid;
  grid-template-columns: 1.25em 56px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  text-decoration: none;
  color: var(--mute);
  min-width: 0;
}

.feat-list a:hover {
  color: var(--rose-soft);
}

.feat-num {
  font-family: var(--f-maru);
  font-weight: 700;
  font-size: 14px;
  color: var(--brass);
  text-align: center;
}

.feat-eye {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}

.feat-eye img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.feat-eye.e1 {
  background: linear-gradient(135deg, #3b2a4d, #5a2a48);
}

.feat-eye.e2 {
  background: linear-gradient(135deg, #2b2f4d, #4a2c4a);
}

.feat-t {
  font-family: var(--f-maru);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-width: 0;
}

/* 390px 前後: アイキャッチを外して番号＋題名だけ */
@media (max-width: 420px) {
  .top-entries .feat-list a {
    grid-template-columns: 1.25em minmax(0, 1fr);
  }

  .top-entries .feat-eye {
    display: none;
  }
}

/* ---- 関連記事（記事末尾） ---- */
.related {
  margin: 28px 0 20px;
  padding-top: 8px;
}

.related-label {
  font-family: var(--f-maru);
  font-size: 17px;
  font-weight: 900;
  margin: 0 0 12px;
  color: var(--ink);
  letter-spacing: 0.04em;
  border: 0;
  padding: 0;
}

.related .books {
  gap: 10px;
}

/* 本文幅では横長カード（左アイキャッチ・右題名）が読みやすい */
.related .card {
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: stretch;
}

.related .card .eye {
  height: auto;
  min-height: 88px;
}

.related .card .eye img {
  height: 52px;
}

.related .card .cb {
  padding: 10px 12px;
  align-content: center;
}

.related .card .cm {
  font-size: 13px;
}

@media (min-width: 768px) and (max-width: 1079px) {
  .related .books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related .card {
    grid-template-columns: 1fr;
  }

  .related .card .eye {
    height: 100px;
  }
}

@media (min-width: 1080px) {
  .related .books {
    grid-template-columns: 1fr;
  }
}

/* ---- スマホ目次 FAB（記事・1080px未満） ---- */
.toc-fab {
  position: fixed;
  z-index: 40;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  font-family: var(--f-maru);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.toc-fab:hover,
.toc-fab:focus-visible {
  filter: brightness(1.06);
  outline: 2px solid var(--rose-soft);
  outline-offset: 2px;
}

.toc-sheet[hidden],
.toc-fab[hidden] {
  display: none !important;
}

.toc-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.toc-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 28, 0.62);
}

.toc-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(72vh, 520px);
  overflow: auto;
  background: var(--ink2);
  color: var(--paper);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
}

.toc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.toc-sheet-head strong {
  font-family: var(--f-maru);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.toc-sheet-close {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mute);
  font-family: var(--f-maru);
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}

.toc-sheet-nav ol {
  margin: 0;
  padding: 0 0 0 1.2em;
  list-style: decimal;
}

.toc-sheet-nav li {
  margin: 0.45em 0;
}

.toc-sheet-nav a {
  color: var(--mute);
  text-decoration: none;
  line-height: 1.55;
  font-size: 15px;
}

.toc-sheet-nav a:hover,
.toc-sheet-nav a.is-active {
  color: var(--rose-soft);
}

body.toc-sheet-open {
  overflow: hidden;
}

/* FAB が本文末尾に被らないよう余白 */
@media (max-width: 1079px) {
  main.page-article {
    padding-bottom: calc(64px + 52px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 1080px) {
  .toc-fab,
  .toc-sheet {
    display: none !important;
  }
}

/* ---- タブレット 768〜1079: 1列・幅760・カード2列 ---- */
@media (min-width: 768px) and (max-width: 1079px) {
  .site-header .inner,
  .site-footer .inner,
  main {
    max-width: 760px;
  }
}

/* ---- PC 1080px〜: 外枠1200・左右余白32 ---- */
@media (min-width: 1080px) {
  .site-header {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }

  main {
    max-width: 1200px;
  }

  /* main は左右 padding 込みで 1200px なので、中身の幅 1136px にそろえる */
  .site-header .inner,
  .site-footer .inner {
    max-width: 1136px;
  }

  main {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }

  .site-footer {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }

  .footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 28px 48px;
    align-items: start;
  }

  .footer-brand {
    order: -1;
  }

  .site-footer .fname,
  .site-footer .ftag {
    display: block;
  }

  .site-footer .fname {
    margin: 0 0 8px;
    font-family: var(--f-head);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--paper);
  }

  .site-footer .ftag {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--mute);
    max-width: 28em;
  }

  .site-footer .footer-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    margin-bottom: 0;
    align-content: start;
  }

  /* トップ: 左55%（キャッチ＋本棚）／右45%（目的から探す） */
  .top-split {
    display: grid;
    grid-template-columns: minmax(0, 55%) minmax(0, 45%);
    grid-template-areas:
      "hero entries"
      "shelf entries";
    /* 右列のほうが高いので、余りは1段目の下に回し、本棚は右列の下端にそろえる */
    grid-template-rows: auto 1fr;
    gap: 8px 36px;
    align-items: start;
    margin-bottom: 8px;
  }

  .top-split > .hero {
    grid-area: hero;
  }

  .top-split > .top-entries {
    grid-area: entries;
    align-self: stretch;
  }

  .top-split > .shelf-wrap {
    grid-area: shelf;
    align-self: end;
  }

  .top-entries .entries {
    margin: 34px 0 0;
  }

  .top-entries .tiles {
    grid-template-columns: 1fr 1fr;
  }

  .books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* 記事・固定: 本文〜760 + サイド〜320 + すき間40
     */
  .page-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) minmax(280px, 320px);
    gap: 40px;
    justify-content: space-between;
  }

  .page-layout .sidebar {
    display: block;
    padding-top: 16px;
    min-height: 0;
  }

  /* サイドは追従させない（ユーザー判断 2026-10-26。追従はヘッダーだけ） */

  /* PC では本文内目次を隠し、サイドの目次だけにする */
  .page-article .paper .toc {
    display: none;
  }
}
