/* INPASS 参考書データベース：表示用スタイル
   ・見出し（h2・h3）はテーマの装飾を打ち消し、ここのスタイルだけで表示する
   ・色は系統ごとに変わる（下の「系統別の色」を直せば、その系統の全ページに反映される） */

.ib {
  --m: #12324f;                 /* 主色（濃い色） */
  --a: #0f9d8a;                 /* 差し色 */
  --hl: color-mix(in srgb, var(--a) 50%, #fff);   /* 濃い背景の上で使う明るい差し色 */
  --l: #dfe5ea;                 /* 罫線 */
  --bg: #f3f6f8;                /* 淡い背景 */
  --t: #22272e;                 /* 本文 */
  --s: #6a7480;                 /* 補助の文字 */
  color: var(--t);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", Meiryo, sans-serif;
  font-weight: 500;                /* 本文もやや太めにして読みやすくする */
  line-height: 1.85;
  counter-reset: ibsec;
  word-break: auto-phrase;
  text-wrap: pretty;
  line-break: strict;
}

/* ---- 系統別の色 ---- */
/* 数学・情報は青系、理科（物理・化学・生物・農学）は緑系、工学はオレンジ */
.ib-g-math                    { --m: #123a66; --a: #2b8fd9; }
.ib-g-informatics             { --m: #1b2a6b; --a: #4a78f0; }
.ib-g-physics                 { --m: #0f4d45; --a: #17a08a; }
.ib-g-chemistry               { --m: #0f4c3a; --a: #2fa56b; }
.ib-g-biology                 { --m: #2f5d1e; --a: #6fa82e; }
.ib-g-agriculture-environment { --m: #3d4a1f; --a: #8a9a1a; }
.ib-g-engineering             { --m: #363b42; --a: #e07b00; }
.ib-g-medical-health          { --m: #5a1630; --a: #d6457a; }
.ib-g-economics-business      { --m: #4a2b0f; --a: #c8811a; }
.ib-g-law-society             { --m: #2c2c54; --a: #8e6bd1; }
.ib-g-humanities-psychology   { --m: #4a1f3d; --a: #c0569b; }
.ib-g-english                 { --m: #7a1f4f; --a: #f06292; }
.ib-g-essay                   { --m: #402218; --a: #c96a3b; }
.ib-g-japanese                { --m: #5c1a1a; --a: #d9534f; }
.ib-g-second-language         { --m: #1f3f4a; --a: #3f9db5; }

/* アイキャッチ画像は共有時のサムネイル用。参考書DBのページの上部には出さない */
body.ib-page .eye-catch-wrap { display: none; }

/* ---- テーマの装飾の打ち消し ---- */
/* 字間：テーマが本文に付けている字間を打ち消す（下で個別に字間を付けている部分は、そちらを優先） */
html body .ib { letter-spacing: normal; }
html body .ib :where(p, li, dt, dd, a, b, span, em, small, strong, div, label, button) { letter-spacing: inherit; }
html body .ib .ib-menu-eyebrow { letter-spacing: .32em; }
html body .ib .ib-menu-title { letter-spacing: .08em; }
html body .ib .ib-fact small { letter-spacing: .06em; }
html body .ib .ib-hero-card .ib-fact small { letter-spacing: 0; }
html body .ib .ib-route-col > small { letter-spacing: .08em; }
html body .ib .ib-side-banner small { letter-spacing: .12em; }
html body .ib .ib-side-banner b { letter-spacing: -.02em; }
html body .ib .ib-menu-badge span { letter-spacing: .04em; }
/* リンク・リスト・入力欄：テーマの下線や装飾を打ち消す */
html body .ib a { text-decoration: none; box-shadow: none; }
html body .ib ul.ib-check, html body .ib ul.ib-contents, html body .ib .ib-fields, html body .ib .ib-side-groups, html body .ib .ib-steps, html body .ib .ib-menu-stats, html body .ib .ib-search-result { list-style: none; }
/* メニュー画面の検索ボックス：テーマの入力欄の幅指定を受けない */
html body .ib .ib-menu-hero .ib-search { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
html body .ib .ib-search input { width: 100%; max-width: none; height: auto; }

/* 章の見出しは h2/h3 を使わず div で組む（テーマの見出しの装飾を受けないため） */
.ib .ib-h2, .ib .ib-h3 { display: block; box-sizing: border-box; }
.ib a { text-decoration: none; }
.ib p { margin: 0 0 1em; }
.ib ul { margin: 0 0 1em; }
.ib img { max-width: 100%; height: auto; }

/* ---- 見出し ---- */
.ib .ib-h2 { counter-increment: ibsec; display: flex; align-items: baseline; gap: .6em; font-size: 1.32em; font-weight: 900; line-height: 1.5;
  color: var(--m); border-bottom: 2px solid var(--m); padding: 0 0 .35em; margin: 2.4em 0 1em; }
.ib .ib-h2::before { content: counter(ibsec, decimal-leading-zero); flex: 0 0 auto; font-size: .75em; color: #fff; background: var(--a);
  border-radius: 4px; padding: .05em .5em; letter-spacing: .04em; }
.ib .ib-h2 a { color: inherit; }
/* 探すための見出し（番号を付けない。下の章番号にも数えない） */
.ib .ib-h2.ib-h-nav { counter-increment: none; align-items: center; font-size: 1.05em; color: var(--m); border-bottom: 0; padding: 0; margin: 1.6em 0 .8em; }
.ib .ib-h2.ib-h-nav::before { content: ""; width: 1.9em; height: 1.9em; border-radius: 50%; padding: 0; background: var(--a) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") no-repeat center / 1.05em; }
.ib .ib-h2.ib-h-nav::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--l); margin-left: .4em; }
.ib .ib-h3 { font-size: 1.06em; font-weight: 900; color: var(--a); margin: 1.5em 0 .5em; }
.ib .ib-h3::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--a); margin-right: .5em; }

.ib-pr { font-size: .78em; color: var(--s); }
.ib-lead { margin-bottom: 1.2em; }
.ib-updated { font-size: .82em; color: var(--s); text-align: right; margin-top: 1.5em; }
.ib-up { font-size: .92em; }
/* 「◯◯の参考書をすべて見る」「◯◯だけを見る」：押せることが分かるよう、枠付きのボタンにする */
.ib-more { margin: .6em 0 1.6em !important; }
html body .ib .ib-more a { display: inline-flex; align-items: center; gap: .5em; padding: .55em 1.3em; border: 2px solid var(--a); border-radius: 999px;
  color: var(--m) !important; background: #fff; font-size: .9em; font-weight: 700; line-height: 1.4; transition: background .15s, color .15s; }
html body .ib .ib-more a::after { content: "→"; color: var(--a); font-weight: 900; transition: transform .15s, color .15s; }
html body .ib .ib-more a:hover { background: var(--a); color: #fff !important; }
html body .ib .ib-more a:hover::after { color: #fff; transform: translateX(3px); }

/* ---- 書影（画像がないときは、書名を入れた表紙を表示する） ---- */
.ib-cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box; overflow: hidden;
  border-radius: 4px; background: linear-gradient(150deg, var(--m), color-mix(in srgb, var(--m) 70%, var(--a))); color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18); text-align: left; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.ib-cover b { font-weight: 700; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; }
.ib-cover small { opacity: .8; line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ib-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }   /* 背景は付けない：読み込めるまでは下の表紙が見える */
.ib-cover-main { width: 150px; height: 212px; padding: 14px 12px; flex: 0 0 150px; }
.ib-cover-main b { font-size: .95em; -webkit-line-clamp: 6; }
.ib-cover-main small { font-size: .72em; }
.ib-cover-thumb { width: 54px; height: 76px; padding: 6px 5px; flex: 0 0 54px; }
.ib-cover-thumb b { font-size: 9px; -webkit-line-clamp: 5; }
.ib-cover-thumb small { display: none; }
.ib-cover-now { width: 112px; height: 158px; padding: 10px 9px; flex: 0 0 auto; }
.ib-cover-now b { font-size: .78em; -webkit-line-clamp: 6; }
.ib-cover-now small { font-size: .62em; }

/* ---- 書籍ページの冒頭 ---- */
.ib-notice { border: 1px solid #e5b454; background: #fff8e6; border-radius: 8px; padding: .9em 1.1em; margin: 0 0 1.4em; }
.ib-notice p { margin: 0 0 .3em; }
.ib-hero { display: flex; gap: 22px; align-items: flex-start; background: var(--m); color: #fff; border-radius: 10px; padding: 22px 24px; margin: 0 0 18px; }
.ib-hero-body { flex: 1 1 auto; min-width: 0; }
.ib-hero .ib-cover-main { box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.ib-hero-title { font-size: 1.45em; font-weight: 900; line-height: 1.45; margin: 0 0 .25em !important; }
.ib-catch { font-size: .95em; font-weight: 500; line-height: 1.7; opacity: .92; margin: 0 0 14px !important; }
.ib-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 0 0 16px; }
.ib-fact { background: rgba(255, 255, 255, .1); border-radius: 8px; padding: 9px 12px; }
.ib-fact small { display: block; font-size: .7em; opacity: .75; letter-spacing: .06em; }
.ib-fact b { display: block; font-size: 1em; font-weight: 700; white-space: nowrap; }   /* 値は折り返さない */
/* レベルの目盛りは、値の上に1行で置く（「基礎」などが途中で折れないように） */
.ib-fact .ib-meter { display: flex; margin: 3px 0 5px; }

/* ---- 書籍ページの冒頭：最初に表示したときだけ、書影と情報の箱を順に浮かび上がらせる ---- */
@keyframes ib-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ib-pop { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.ib-hero .ib-cover-main { animation: ib-pop .7s cubic-bezier(.2, .8, .2, 1) both; }
.ib-hero .ib-fact { animation: ib-rise .5s ease-out both; }
.ib-hero .ib-fact:nth-child(1) { animation-delay: .15s; }
.ib-hero .ib-fact:nth-child(2) { animation-delay: .25s; }
.ib-hero .ib-fact:nth-child(3) { animation-delay: .35s; }
.ib-hero .ib-fact:nth-child(4) { animation-delay: .45s; }
.ib-hero .ib-fact:nth-child(5) { animation-delay: .55s; }
.ib-hero .ib-fact .ib-meter i.on { animation: ib-rise .4s ease-out .8s both; }
@media (prefers-reduced-motion: reduce) { .ib-hero .ib-cover-main, .ib-hero .ib-fact, .ib-hero .ib-fact .ib-meter i.on { animation: none; } }
.ib-meter { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.ib-meter i { width: 14px; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.ib-meter i.on { background: var(--hl); }

/* ---- 購入ボタン（販売先ごとの色） ---- */
/* 販売先のボタンは、横に1列で並べる（2つなら2等分、3つなら3等分） */
.ib-buy { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; position: relative; }   /* 幅が足りないときは2段に折り返す（重ならない） */
.ib-btn { display: block; white-space: nowrap; text-align: center; font-weight: 900; font-size: .92em; line-height: 1.4; padding: .7em .8em;
  border-radius: 999px; color: #fff !important; transition: filter .15s, transform .15s; }
.ib-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ib-btn-amazon { background: #f08a24; }
.ib-btn-rakuten { background: #d9333f; }
.ib-btn-yahoo { background: #3d7fe0; }
.ib-buy-box { border: 1px solid var(--l); border-radius: 10px; padding: 1em 1.2em; display: flex; gap: 16px; align-items: center; }
.ib-buy-box .ib-buy { flex: 1 1 auto; }
.ib-buy-title { font-weight: 700; margin: 0 0 .5em !important; }

/* 冒頭をアイキャッチ画像で見せる表示（設定の「書籍ページの冒頭」） */
.ib-hero-eyecatch { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; gap: 0; }
.ib-hero-eyecatch .ib-eyecatch-img { display: block; width: 100%; height: auto; }
.ib-hero-eyecatch .ib-hero-body { padding: 18px 22px 22px; }
.ib-eyecatch-top { margin: 0 0 16px; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.ib-eyecatch-top img { display: block; width: 100%; height: auto; }

/* ---- 書籍ページの冒頭（アイキャッチ画像と同じ構成をHTMLで組む） ----
   左：科目｜分野｜レベルのラベル → 書名と下線 → 説明文 → 情報の箱 → 購入ボタン → INPASSのロゴ／右：傾けた書影 */
.ib-hero-card { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 26px; align-items: center;
  padding: 28px 30px 24px; border-radius: 14px;
  background:
    radial-gradient(circle at 92% 6%, color-mix(in srgb, var(--a) 65%, transparent), transparent 46%),
    linear-gradient(90deg, var(--m), color-mix(in srgb, var(--m) 50%, var(--a))); }
.ib-hero-card::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px); background-size: 22px 22px; }
.ib-hero-card > * { position: relative; min-width: 0; }
.ib-hero-label { display: inline-flex; flex-wrap: wrap; align-items: center; margin: 0 0 14px !important; padding: .25em 1.1em; border-radius: 999px; background: var(--a);
  font-size: .82em; font-weight: 700; line-height: 1.6; }
.ib-hero-label span + span { margin-left: .8em; padding-left: .8em; border-left: 1px solid rgba(255, 255, 255, .6); }
.ib-hero-card .ib-hero-title { display: table; font-size: 1.85em; font-weight: 900; line-height: 1.35; margin: 0 0 14px !important; text-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.ib-ph { display: inline-block; word-break: auto-phrase; }
.ib-ph:not(:last-child) { margin-right: .2em; }   /* 区切りの空白が詰まって見えないように */   /* まとまりの途中では折らない（長すぎるときだけ文節で折る） */
.ib-hero-card .ib-hero-title::after { content: ""; display: block; height: 6px; border-radius: 3px; margin-top: .4em; background: color-mix(in srgb, var(--a) 50%, #fff); }
.ib-hero-desc { font-size: .93em; font-weight: 500; line-height: 1.8; opacity: .93; margin: 0 0 16px !important; }
.ib-hero-card .ib-facts { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.ib-hero-card .ib-fact { padding: 8px 10px; }
.ib-hero-card .ib-fact small { white-space: nowrap; letter-spacing: 0; }
.ib-hero-logo { margin: 16px 0 0 !important; line-height: 1; }
.ib-hero-logo img { height: 24px; width: auto; display: block; }
.ib-hero-visual { display: flex; justify-content: center; }
.ib-hero-card .ib-cover-main { width: 230px; height: 325px; flex: none; box-shadow: 0 16px 32px rgba(0, 0, 0, .42); }
@keyframes ib-pop-tilt { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

/* 書影のリンク（販売サイトへ）：押せることが分かるよう、乗せたときに少し浮かせる */
.ib-cover-link { display: inline-block; flex: none; line-height: 0; transition: transform .15s, filter .15s; }
.ib-cover-link:hover { transform: translateY(-3px); filter: brightness(1.04); }

/* ---- 書誌情報 ---- */
.ib-bib { border: 1px solid var(--l); border-radius: 10px; overflow: hidden; margin: 0 0 .6em; font-size: .93em; background: #fff; }
.ib-bib dl { display: grid; grid-template-columns: 8em 1fr; margin: 0; }
html body .ib .ib-bib dl { margin: 0 !important; padding: 0 !important; }
html body .ib .ib-bib dt, html body .ib .ib-bib dd { margin: 0 !important; }
html body .ib .ib-bib dt:last-of-type, html body .ib .ib-bib dd:last-of-type { border-bottom: 0 !important; }
.ib-bib dt, .ib-bib dd { margin: 0; padding: .6em 1em; border-bottom: 1px solid var(--l); line-height: 1.6; }
.ib-bib dt { background: color-mix(in srgb, var(--a) 12%, #fff); color: var(--m); font-weight: 700; border-right: 1px solid var(--l); }
.ib-bib dd { font-weight: 500; }
.ib-bib dt:last-of-type, .ib-bib dd:last-of-type { border-bottom: 0; }
.ib-bib + .ib-pr { margin: 0 0 1.6em !important; text-align: right; }

/* ---- 本文の部品 ---- */
.ib-contents { list-style: none; padding: 0; border: 1px solid var(--l); border-radius: 8px; overflow: hidden; }
.ib-contents li { padding: .5em .9em; border-bottom: 1px solid var(--l); font-size: .95em; }
.ib-contents li:nth-child(odd) { background: var(--bg); }
.ib-contents li:last-child { border-bottom: 0; }
.ib-contents .ib-note { font-size: .86em; color: var(--s); }
.ib-tiles { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin: 1em 0; }
.ib-tile { border: 1px solid var(--l); border-left: 5px solid var(--a); border-radius: 6px; padding: .7em 1em; }
.ib-tile small { display: block; color: var(--s); font-size: .78em; }
.ib-check { list-style: none; padding: .4em 1em; border: 1px solid var(--l); border-radius: 8px; background: var(--bg); }
.ib-check li { position: relative; padding: .5em 0 .5em 2em; border-bottom: 1px dashed #c9d2da; }
.ib-check li:last-child { border-bottom: 0; }
.ib-check li::before { content: ""; position: absolute; left: .2em; top: .85em; width: .9em; height: .9em; border: 2px solid var(--a); border-radius: 3px; background: #fff; }
.ib-univ { width: 100%; border-collapse: collapse; font-size: .9em; }
.ib-univ th, .ib-univ td { border: 1px solid var(--l); padding: .45em .6em; text-align: left; vertical-align: top; }
.ib-univ th { background: var(--bg); }

/* ---- 学習ルート（前に → いまここ → 次に） ---- */
.ib-route { display: grid; grid-template-columns: 1fr auto 1.15fr auto 1fr; gap: 8px; align-items: stretch; margin: 1em 0; }
.ib-route-col { border: 1px solid var(--l); border-radius: 8px; padding: .7em .8em; background: #fff; min-width: 0; display: flex; flex-direction: column; }
/* 見出しは上に置き、本の並びは箱の中で上下中央にそろえる */
.ib-route-col > small + * { margin-top: auto; }
.ib-route-col > :last-child { margin-bottom: auto; }
.ib-route-col > small { display: block; font-size: .72em; font-weight: 700; letter-spacing: .08em; color: var(--a); margin-bottom: .4em; }
.ib-route-now { background: var(--m); color: #fff; border: 3px solid var(--a); align-items: center; text-align: center; gap: .6em; padding: 1em .9em 1.2em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22); margin: -10px 0; position: relative; z-index: 1; }
.ib-route-now .ib-cover { box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.ib-route-now > small { color: #fff; background: var(--a); border-radius: 999px; padding: .2em 1.1em; margin: 0; font-size: .8em; }
.ib-route-now b { line-height: 1.45; font-size: 1.08em; }
.ib-route-arrow { align-self: center; color: var(--a); font-size: 1.3em; font-weight: 700; }
.ib-route-none { font-size: .82em; color: var(--s); }
.ib-mini { display: flex; gap: 10px; align-items: center; padding: .5em 0; border-bottom: 1px solid var(--l); color: var(--t) !important; }
.ib-mini:last-child { border-bottom: 0; }
.ib-mini:hover b { color: var(--a); }
.ib-mini-body { min-width: 0; }
.ib-mini b { display: block; font-size: .88em; line-height: 1.45; font-weight: 700; }
.ib-mini span.lv { display: block; font-size: .72em; color: var(--s); }
.ib-alts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 18px; }

/* ---- 一覧（行で見せる） ---- */
.ib-filter { border: 1px solid var(--l); background: var(--bg); border-radius: 8px; padding: .7em 1em; margin: 0 0 1.4em; }
.ib-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; margin: .25em 0; }
.ib-filter-label { font-size: .85em; font-weight: 700; width: 3.5em; }
.ib-chip { font: inherit; font-size: .85em; padding: .25em .9em; border: 1px solid var(--l); border-radius: 999px; background: #fff; color: var(--t); cursor: pointer; }
.ib-chip.is-on { background: var(--m); border-color: var(--m); color: #fff; }
.ib-section[hidden], .ib-row[hidden] { display: none; }
.ib-table { border: 1px solid var(--l); border-radius: 8px; overflow: hidden; margin: .6em 0 1.8em; }
.ib-row { display: grid; grid-template-columns: 54px 92px 1fr 128px; gap: 14px; align-items: center; padding: .7em .9em; border-bottom: 1px solid var(--l); color: var(--t) !important; }
.ib-row:last-child { border-bottom: 0; }
.ib-row:hover { background: var(--bg); }
.ib-row .ib-meter i { background: #d5dde4; }
.ib-row .ib-meter i.on { background: var(--a); }
.ib-row-level > span:not(.ib-meter) { display: block; font-size: .72em; color: var(--s); margin-top: 3px; }
.ib-row-main b { display: block; line-height: 1.45; font-weight: 700; }
.ib-row-main em { font-style: normal; font-size: .84em; color: #56606b; display: block; }
.ib-row-type { font-size: .76em; color: var(--s); text-align: right; line-height: 1.5; }
.ib-old { color: #b33; font-weight: 700; margin-right: .4em; font-size: .85em; }

/* ---- 一覧ページの冒頭 ---- */
.ib-list-hero { background: var(--m); color: #fff; border-radius: 10px; padding: 20px 24px 22px; margin: 0 0 1.4em; }
.ib-list-hero a { color: #fff; text-decoration: underline; }
.ib-list-hero-path { display: none; }   /* ページ見出しのラベルとパンくずで分かるため表示しない */
.ib-list-hero-title { font-size: 1.5em; font-weight: 800; line-height: 1.4; margin: 0 0 .3em !important; }
.ib-list-hero-title span { font-size: .55em; font-weight: 700; background: var(--a); border-radius: 999px; padding: .2em .9em; margin-left: .8em; vertical-align: middle; }
.ib-list-hero-lead { font-size: .92em; opacity: .92; margin: 0 0 1em !important; }
.ib-list-hero .ib-facts { margin: 0; grid-template-columns: repeat(4, 1fr); }
.ib-fields-menu { margin-bottom: 1.6em !important; }
.ib-fields-menu a { border-left: 5px solid var(--a) !important; font-weight: 700; padding: .8em 1em !important; }

/* ---- トップページ（メニュー） ---- */
/* テーマが出すページタイトルは、画面には出さず（読み上げ用に残す）、下の飾り付きのタイトルを見せる */
body.ib-page-top .entry-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.ib-page .date-tags { display: none; }
/* テーマ（Cocoon）のSNSシェアボタン・フォローボタンは、参考書DBのページでは表示しない */
body.ib-page .sns-share, body.ib-page .sns-follow { display: none !important; }   /* 参考書DBのページでは、テーマの投稿日・更新日を表示しない（ページ下部に「情報の最終確認日」を出している） */
/* 科目・分野・書籍ページのページ見出し（h1）：科目の色の帯に白抜きの文字、左に科目のアイコン（このプラグインのページだけ） */
body.ib-page:not(.ib-page-top) .entry-title { display: flex !important; align-items: center !important; gap: .6em !important; font-size: 1.45em !important; font-weight: 900 !important; line-height: 1.4 !important;
  letter-spacing: .03em !important; color: var(--m, #123a66) !important; margin: .2em 0 1em !important; padding: .5em .9em !important; border: 0 !important;
  border-left: 6px solid var(--a, #2b8fd9) !important; border-radius: 4px 12px 12px 4px !important;
  background: linear-gradient(100deg, color-mix(in srgb, var(--a, #2b8fd9) 14%, #fff), color-mix(in srgb, var(--a, #2b8fd9) 4%, #fff)) !important; box-shadow: none !important;
  text-align: left !important; text-shadow: none !important; }
body.ib-page:not(.ib-page-top) .entry-title::before { content: "" !important; display: block !important; position: static !important; flex: 0 0 auto !important; width: 1.7em !important; height: 1.7em !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important;
  background: var(--a, #2b8fd9) url('icons/white/default.svg') no-repeat center / 58% !important; box-shadow: 0 2px 6px rgba(0, 0, 0, .2) !important; }
body.ib-page.ib-g-agriculture-environment:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/agriculture-environment.svg') !important; }
body.ib-page.ib-g-biology:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/biology.svg') !important; }
body.ib-page.ib-g-chemistry:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/chemistry.svg') !important; }
body.ib-page.ib-g-economics-business:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/economics-business.svg') !important; }
body.ib-page.ib-g-engineering:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/engineering.svg') !important; }
body.ib-page.ib-g-english:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/english.svg') !important; }
body.ib-page.ib-g-essay:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/essay.svg') !important; }
body.ib-page.ib-g-humanities-psychology:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/humanities-psychology.svg') !important; }
body.ib-page.ib-g-informatics:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/informatics.svg') !important; }
body.ib-page.ib-g-japanese:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/japanese.svg') !important; }
body.ib-page.ib-g-law-society:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/law-society.svg') !important; }
body.ib-page.ib-g-math:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/math.svg') !important; }
body.ib-page.ib-g-medical-health:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/medical-health.svg') !important; }
body.ib-page.ib-g-physics:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/physics.svg') !important; }
body.ib-page.ib-g-second-language:not(.ib-page-top) .entry-title::before { background-image: url('icons/white/second-language.svg') !important; }
body.ib-page:not(.ib-page-top) .entry-title::after { content: none !important; display: none !important; }
@media (max-width: 640px) { body.ib-page:not(.ib-page-top) .entry-title { font-size: 1.15em !important; padding: .45em .7em !important; border-left-width: 5px !important; gap: .5em !important; } }
.ib-menu-hero { position: relative; overflow: hidden; text-align: center; color: #fff; border-radius: 18px; padding: 44px 28px 40px; margin: 0 0 1.6em;
  background:
    radial-gradient(circle at 12% 18%, rgba(74, 120, 240, .55), transparent 42%),
    radial-gradient(circle at 88% 85%, rgba(23, 160, 138, .5), transparent 45%),
    linear-gradient(135deg, #0d2747, #123a66 55%, #0f4d45); }
.ib-menu-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1.4px); background-size: 22px 22px; }
.ib-menu-hero > * { position: relative; }
/* 右上の一言（角に斜めにかかる黄色のリボン。先頭の点は点滅して「更新中」を示す） */
.ib-menu-badge { position: absolute !important; top: 44px; right: -78px; width: 320px; margin: 0 !important; transform: rotate(38deg); z-index: 2; text-align: center;
  background: #ffe94d; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); border-top: 2px dashed rgba(18, 58, 102, .25); border-bottom: 2px dashed rgba(18, 58, 102, .25); }
.ib-menu-badge span { display: inline-flex; align-items: center; gap: .5em; color: #123a66; font-weight: 900; font-size: .9em; letter-spacing: .04em; padding: .5em 0; }
.ib-menu-badge span::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: #e8452c; animation: ib-blink 1.4s ease-in-out infinite; }
@keyframes ib-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .ib-menu-badge span::before { animation: none; } }
.ib-menu-eyebrow { display: inline-block; font-size: .72em; font-weight: 700; letter-spacing: .32em; padding: .35em 1.2em .35em 1.5em; border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px; margin: 0 0 1.1em !important; }
.ib-menu-title { font-size: 2.3em; font-weight: 900; letter-spacing: .08em; line-height: 1.3; margin: 0 !important; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.ib-menu-title::after { content: ""; display: block; width: 84px; height: 5px; border-radius: 3px; margin: .45em auto .6em; background: linear-gradient(90deg, #4a9cf0, #2fd0a5); }
.ib-menu-hero-lead { font-size: 1em; font-weight: 500; opacity: .95; margin: 0 0 1.1em !important; }
.ib-menu-stats { list-style: none; display: flex; justify-content: center; gap: 0; padding: 0; margin: 0 0 1.5em !important; font-size: .88em; font-weight: 700; }
.ib-menu-stats li { padding: 0 1.4em; border-left: 1px solid rgba(255, 255, 255, .35); }
.ib-menu-stats li:first-child { border-left: 0; }
.ib-menu-stats b { display: inline-block; text-align: right; font-size: 2em; font-weight: 900; margin-right: .12em; font-variant-numeric: tabular-nums; }
.ib-menu-hero .ib-search { max-width: 640px; margin: 0 auto; text-align: left; }
.ib-menu-hero .ib-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ib-menu-hero .ib-search input { border-radius: 999px; padding: 1em 1.4em 1em 3.4em; font-size: 17px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23123a66' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") no-repeat 1.2em center / 1.3em; }
.ib-menu-hero .ib-search-result { box-shadow: 0 8px 24px rgba(0, 0, 0, .28); margin-top: .6em !important; }
.ib-search { margin: 0; position: relative; }
.ib-search label { display: block; font-weight: 700; font-size: .9em; margin-bottom: .3em; }
.ib-search input { width: 100%; box-sizing: border-box; padding: .75em 1em; font-size: 16px; border: 0; border-radius: 8px; background: #fff; color: #222; }
.ib-search-result { list-style: none; margin: .3em 0 0 !important; padding: 0; border-radius: 8px; background: #fff; max-height: 320px; overflow: auto; }
.ib-search-result li { border-bottom: 1px solid var(--l); }
.ib-search-result li:last-child { border-bottom: 0; }
.ib-search-result a { display: block; padding: .5em .9em; color: var(--t); }
.ib-search-result a:hover { background: var(--bg); }
.ib-search-result small { color: var(--s); margin-left: .6em; }
/* Enterで全件を出したとき */
.ib-search-result.is-all { max-height: 70vh; }
.ib-hit-head { padding: .6em .9em; font-size: .85em; font-weight: 700; color: #fff; background: #123a66; position: sticky; top: 0; z-index: 1; }
.ib-hit-more { padding: .5em .9em; font-size: .8em; color: var(--s); background: var(--bg); }
.ib-search-result a.ib-hit { display: flex; align-items: center; gap: 12px; padding: .5em .9em; }
.ib-hit-cover { flex: 0 0 34px; width: 34px; height: 48px; border-radius: 2px; background: #dfe5ea; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.ib-hit-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ib-hit-body { min-width: 0; }
.ib-hit-body b { display: block; font-weight: 700; line-height: 1.45; }
.ib-search-result .ib-hit-body small { display: block; margin: 0; font-size: .78em; }
.ib-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 1em; }
.ib-subject { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4em; text-align: center; min-height: 150px; box-sizing: border-box;
  padding: 1.1em .6em; border-radius: 14px; background: linear-gradient(155deg, var(--m), color-mix(in srgb, var(--m) 62%, var(--a))); color: #fff !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .14); transition: transform .15s, box-shadow .15s; }
.ib-subject:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
.ib-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--a); color: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
.ib-icon svg { width: 34px; height: 34px; display: block; }
.ib-subject b { font-size: 1em; font-weight: 900; line-height: 1.4; }
.ib-subject small { font-size: .74em; opacity: .85; }
.ib-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ib-group { border: 1px solid var(--l); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; scroll-margin-top: 80px; }
.ib-group-head { display: flex; align-items: center; gap: .7em; background: var(--m); color: #fff !important; padding: .8em 1em; cursor: pointer; list-style: none; }
.ib-group-head::-webkit-details-marker { display: none; }
.ib-group-go { color: #fff !important; }
.ib-group-name { font-size: 1.12em; font-weight: 800; line-height: 1.4; }
.ib-group-count { font-size: .76em; font-weight: 700; background: var(--a); border-radius: 999px; padding: .15em .8em; white-space: nowrap; }
.ib-group-go { margin-left: auto; font-size: .78em; white-space: nowrap; opacity: .9; }
.ib-group-go::after { content: " →"; }
.ib-group-head:hover .ib-group-go { text-decoration: underline; }
.ib-group-covers { display: flex; gap: 10px; padding: 14px 14px 4px; }
.ib-group-covers a { display: block; transition: transform .15s; }
.ib-group-covers a:hover { transform: translateY(-3px); }
.ib-fields { list-style: none; padding: 0; margin: 0 0 .8em; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5em; }
.ib-group .ib-fields { grid-template-columns: 1fr; gap: 0; margin: 0; padding: 8px 14px 12px; }
.ib-fields a { display: flex; justify-content: space-between; align-items: center; gap: .6em; padding: .55em .9em; border: 1px solid var(--l); border-radius: 6px; background: #fff; color: var(--t); font-size: .94em; }
.ib-group .ib-fields a { border: 0; border-bottom: 1px dashed var(--l); border-radius: 0; padding: .5em .2em; }
.ib-group .ib-fields li:last-child a { border-bottom: 0; }
.ib-fields a:hover { border-color: var(--a); color: var(--a); }
.ib-count { font-size: .8em; color: var(--s); white-space: nowrap; }
.ib-steps { list-style: none; padding: 0; margin: 0 0 1em; counter-reset: ibstep; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ib-steps li { counter-increment: ibstep; border: 1px solid var(--l); border-top: 4px solid var(--a); border-radius: 8px; padding: .9em 1em; }
.ib-steps li::before { content: "STEP " counter(ibstep); display: block; font-size: .72em; font-weight: 700; letter-spacing: .1em; color: var(--a); }
.ib-steps b { display: block; margin: .2em 0 .3em; }
.ib-steps span { font-size: .88em; color: #56606b; line-height: 1.7; display: block; }

/* ---- 左右の出し分け（books.js が検索欄を置けたときだけ効く） ----
   狭い画面：左右とも出さない／通常のPC：左に検索欄だけ／幅の広い画面：左に検索欄、右に既存のサイドバー
   検索欄・本文・サイドバーは、すき間を空けずに中央へ寄せて並べる */
.ib-rail { display: none; }
body.ib-rail-top .ib-rail { display: block; margin: 0 0 1.6em; }
@media (max-width: 1023px) {
  body.ib-has-rail #sidebar { display: none; }
}
@media (min-width: 1024px) {
  body.ib-has-rail .content-in { justify-content: center; gap: 20px; }
  body.ib-has-rail .ib-rail { display: block; flex: 0 0 280px; width: 280px; box-sizing: border-box; padding: 0; margin: 0; position: sticky; top: 84px; align-self: flex-start; order: -1; }
  body.ib-has-rail #sidebar { display: none; }
  body.ib-has-rail #main { min-width: 0; flex-shrink: 1; }
}
/* 幅の広い画面：左に検索欄、中央に本文、右に既存のサイドバー。テーマの固定幅（.wrap）を広げて3列を並べる */
@media (min-width: 1520px) {
  body.ib-has-rail .content-in, body.ib-has-rail .content-in.wrap { width: auto; max-width: 1640px; margin-left: auto; margin-right: auto; }
  body.ib-has-rail #sidebar { display: block; flex: 0 0 340px; }
  body.ib-has-rail #main { flex: 1 1 916px; max-width: 916px; }
}

/* ---- 検索欄の列（書名検索・科目・無料体験講義のバナー） ---- */
.ib-side-wrap { font-size: 15px; line-height: 1.6; }
.ib-side { border: 1px solid var(--l); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.ib-side-title { background: #123a66; color: #fff; font-weight: 900; font-size: .98em; padding: .55em .9em; margin: 0 !important; }
.ib-side .ib-search { padding: .7em .8em .2em; }
.ib-side .ib-search label { font-size: .8em; margin-bottom: .25em; }
.ib-side .ib-search input { border: 2px solid var(--l); padding: .5em .7em; font-size: 15px; border-radius: 6px; }
.ib-side .ib-search input:focus { border-color: #2b8fd9; outline: 0; }
.ib-side .ib-search-result { border: 1px solid var(--l); max-height: 260px; font-size: .9em; }
.ib-side-label { font-size: .8em; font-weight: 700; margin: .7em 0 .3em !important; padding: 0 .8em; }
.ib-side-groups { list-style: none; margin: 0 !important; padding: 0 .8em .5em; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ib-side-groups a { display: block; font-size: .78em; font-weight: 700; text-align: center; padding: .42em .2em; border-radius: 5px; background: var(--a); color: #fff !important; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-side-groups a:hover { filter: brightness(1.1); }
.ib-side-top { text-align: center; font-size: .8em; margin: 0 !important; padding: 0 .8em .7em; }
.ib-side-banner { display: block; margin-top: 12px; border-radius: 10px; padding: 1em .9em 1.1em; text-align: center; color: #fff !important; line-height: 1.5;
  background: radial-gradient(circle at 90% 0%, rgba(47, 208, 165, .55), transparent 55%), linear-gradient(140deg, #123a66, #1b2a6b);
  box-shadow: 0 4px 14px rgba(18, 58, 102, .3); transition: transform .15s, box-shadow .15s; }
.ib-side-banner:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(18, 58, 102, .4); }
.ib-side-banner small { display: inline-block; font-size: .7em; font-weight: 700; letter-spacing: .12em; background: #ffe94d; color: #123a66; border-radius: 999px; padding: .15em 1em; }
.ib-side-banner b { display: block; font-size: .98em; font-weight: 900; letter-spacing: -.02em; margin: .55em 0 .3em; }
.ib-side-banner span { display: block; font-size: .8em; font-weight: 500; }
.ib-side-banner mark { display: block; background: none; color: #ffe94d; font-size: 1.25em; font-weight: 900; }
.ib-side-banner em { display: block; font-style: normal; font-size: .84em; font-weight: 900; background: #fff; color: #123a66; border-radius: 999px; padding: .55em .5em; margin-top: .8em; }
.ib-side-banner em::after { content: " →"; }

/* ---- 検索結果ページ（/books/?q=…） ---- */
.ib-top.is-results .ib-menu-body { display: none; }
.ib-results { margin: 0 0 1em; }
.ib-results-head { font-size: 1.15em; font-weight: 700; margin: .4em 0 .8em !important; padding-bottom: .5em; border-bottom: 2px solid #123a66; }
.ib-results-head b { color: #123a66; font-weight: 900; }
.ib-results-none { padding: 1.2em; background: var(--bg); border-radius: 8px; }
.ib-result { display: flex; gap: 16px; align-items: center; padding: .8em 1em; border-bottom: 1px solid var(--l); color: var(--t) !important; }
.ib-result:last-child { border-bottom: 0; }
.ib-result:hover { background: var(--bg); }
.ib-result-body { min-width: 0; }
.ib-result-tag { display: inline-block; font-size: .72em; font-weight: 700; color: #fff; background: var(--a); border-radius: 999px; padding: .1em .8em; margin-bottom: .3em; }
.ib-result-body b { display: block; font-weight: 700; line-height: 1.45; }
.ib-result-body em { display: block; font-style: normal; font-size: .84em; color: #56606b; }
.ib-result-body small { display: block; font-size: .76em; color: var(--s); }

/* ---- 無料体験講義の申し込み ----
   メニュー画面の冒頭と同じ、紺〜青緑のグラデーションの上に、白いフォームを載せる（科目によらず同じ色） */
.ib-apply { position: relative; margin: 2.8em 0 0; border-radius: 16px; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(74, 120, 240, .5), transparent 45%),
    radial-gradient(circle at 95% 100%, rgba(23, 160, 138, .5), transparent 45%),
    linear-gradient(135deg, #0d2747, #123a66 55%, #0f4d45); }
.ib-apply::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.4px); background-size: 22px 22px; }
.ib-apply > * { position: relative; }
.ib-apply-camp { text-align: center; padding: 2em 1.4em 1.2em; }
.ib-apply-camp::before { content: "CAMPAIGN"; display: inline-block; font-size: .7em; font-weight: 900; letter-spacing: .3em; color: #123a66; background: #ffe94d;
  border-radius: 999px; padding: .3em 1.2em .3em 1.5em; margin-bottom: .9em; }
.ib-apply-camp-title { font-size: 1.55em; font-weight: 900; color: #fff; line-height: 1.4; margin: 0 0 .5em !important; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.ib-apply-camp-title::after { content: ""; display: block; width: 72px; height: 4px; border-radius: 2px; margin: .5em auto 0; background: linear-gradient(90deg, #4a9cf0, #2fd0a5); }
/* 「！」で区切ったまとまりは、途中で折り返さない（狭い画面では、まとまりの境目で折り返す） */
/* まとまり（読点・句点・！の区切り）ごとに次の行へ送る。まとまりが1行より長いときだけ、その中を文節で折る */
.ib-nw { display: inline-block; word-break: auto-phrase; }
.ib-apply-camp p { margin: 0 0 .4em; font-weight: 700; }
.ib-apply-camp mark { display: inline-block; background: none; color: #ffe94d; font-size: 1.3em; font-weight: 900; padding: 0; margin-top: .15em; }
.ib-apply-camp .ib-apply-note { font-weight: 500; font-size: .9em; color: rgba(255, 255, 255, .85); margin-top: .7em; }
.ib-apply-form { background: #fff; color: var(--t); margin: 0 1.4em; padding: 1.6em 1.6em 1.8em; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.ib-apply-form-title { font-size: 1.2em; font-weight: 900; text-align: center; color: #123a66; margin: 0 0 .6em !important; }
.ib-apply-form-lead { font-size: .88em; text-align: center; color: var(--s); margin: 0 0 1.4em !important; }
.ib-apply-form label, .ib-apply-form .wpcf7-form p { color: #123a66; font-size: .9em; font-weight: 700; }
.ib-apply-form input[type="text"], .ib-apply-form input[type="email"], .ib-apply-form input[type="tel"], .ib-apply-form textarea, .ib-apply-form select {
  width: 100%; box-sizing: border-box; border: 2px solid #dfe5ea; border-radius: 8px; padding: .65em .8em; font-size: 16px; margin-top: .3em; background: #f7f9fb; color: #222; transition: border-color .15s, background .15s; }
.ib-apply-form input:focus, .ib-apply-form textarea:focus, .ib-apply-form select:focus { outline: 0; border-color: #2b8fd9; background: #fff; }
.ib-apply-form textarea { min-height: 8em; }
/* 送信ボタン：一定の間隔で、光の帯が左から右へ流れる（画像を使わず、背景の重ね合わせで動かす） */
.ib-apply-form input[type="submit"], .ib-apply-form button[type="submit"] { width: 100%; border: 0; border-radius: 999px; color: #fff; cursor: pointer; margin-top: .5em;
  background-image: linear-gradient(110deg, transparent 0 42%, rgba(255, 255, 255, .55) 50%, transparent 58% 100%), linear-gradient(90deg, #2b8fd9, #17a08a);
  background-size: 250% 100%, 100% 100%; background-repeat: no-repeat; background-position: 130% 0, 0 0; animation: ib-shine 3.2s ease-in-out infinite;
  font-weight: 900; font-size: 1.05em; letter-spacing: .1em; padding: .9em 1em; box-shadow: 0 6px 16px rgba(23, 120, 160, .35); }
@keyframes ib-shine { 0% { background-position: 130% 0, 0 0; } 45%, 100% { background-position: -30% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .ib-apply-form input[type="submit"], .ib-apply-form button[type="submit"] { animation: none; } }
.ib-apply-form input[type="submit"]:hover, .ib-apply-form button[type="submit"]:hover { filter: brightness(1.08); }
.ib-apply-form .wpcf7-response-output { color: var(--t); }
.ib-apply-form .wpcf7-not-valid-tip { color: #d63a2c; font-weight: 500; }
.ib-apply-lp { text-align: center; padding: 1.4em 1.2em 1.8em; }
.ib-apply-lp p { margin: 0 0 .7em; font-size: .9em; color: rgba(255, 255, 255, .88); }
.ib-btn-lp { display: inline-block; flex: none; max-width: 100%; box-sizing: border-box; background: #ffe94d; color: #123a66 !important; border: 0; padding: .75em 2.4em; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.ib-btn-lp::after { content: " →"; }
.ib-btn-lp:hover { background: #fff; color: #123a66 !important; }

@media (max-width: 640px) {
  .ib-hero { flex-direction: column; align-items: center; padding: 18px 16px; }
  .ib-hero-card { grid-template-columns: 88px minmax(0, 1fr); column-gap: 12px; row-gap: 0; align-items: start; padding: 14px 12px 12px; border-radius: 12px; }
  .ib-hero-card .ib-hero-body { display: contents; }
  .ib-hero-visual { grid-column: 1; grid-row: 1 / span 2; justify-content: flex-start; }
  .ib-hero-card .ib-cover-main { width: 88px; height: 124px; padding: 8px 7px; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }
  .ib-hero-card .ib-cover-main b { font-size: .62em; }
  .ib-hero-card .ib-cover-main small { display: none; }
  .ib-hero-label { grid-column: 2; grid-row: 1; justify-self: start; font-size: .64em; padding: .15em .8em; margin: 0 0 6px !important; }
  .ib-hero-label span + span { margin-left: .5em; padding-left: .5em; }
  .ib-hero-card .ib-hero-title { grid-column: 2; grid-row: 2; font-size: 1.08em; line-height: 1.4; margin: 0 !important; }
  .ib-hero-card .ib-hero-title::after { height: 4px; margin-top: .3em; }
  .ib-hero-desc { grid-column: 1 / -1; font-size: .76em; line-height: 1.6; margin: 10px 0 8px !important;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .ib-hero-card .ib-facts { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 0 0 8px; }
  .ib-hero-card .ib-fact { padding: 5px 7px; border-radius: 6px; }
  .ib-hero-card .ib-fact small { font-size: .6em; }
  .ib-hero-card .ib-fact b { font-size: .8em; }
  .ib-hero-card .ib-fact .ib-meter { margin: 1px 0 2px; }
  .ib-hero-card .ib-meter i { width: 10px; height: 6px; }
  .ib-hero-card .ib-buy { grid-column: 1 / -1; }
  .ib-hero-logo { grid-column: 1 / -1; margin: 8px 0 0 !important; }
  .ib-hero-logo img { height: 15px; }
  .ib-hero-body { width: 100%; }
  .ib-route { grid-template-columns: 1fr; }
  .ib-route-now { margin: 0; }
  .ib-buy { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
  .ib-btn { font-size: .8em; padding: .75em .2em; }
  .ib-route-arrow { transform: rotate(90deg); justify-self: center; }
  .ib-tiles { grid-template-columns: 1fr; }
  .ib-row { grid-template-columns: 54px 1fr; }
  .ib-row-level, .ib-row-type { display: none; }
  .ib-buy-box { flex-direction: column; align-items: stretch; }
  .ib-bib dl { grid-template-columns: 6em 1fr; }
  .ib-groups, .ib-steps { grid-template-columns: 1fr; }
  .ib-list-hero .ib-facts { grid-template-columns: repeat(2, 1fr); }
  .ib-menu-hero { padding: 30px 16px 28px; }
  .ib-menu-title { font-size: 1.6em; }
  .ib-apply-form { margin: 0 .7em; padding: 1.3em 1em 1.5em; }
  .ib-apply-camp-title { font-size: 1.3em; }
  .ib-menu-badge { top: 30px; right: -92px; width: 300px; }
  .ib-menu-badge span { font-size: .72em; padding: .35em 0; }
  .ib-menu-eyebrow { margin-top: 1.6em !important; }
  .ib-menu-stats li { padding: 0 .9em; }
  .ib-subjects { grid-template-columns: repeat(2, 1fr); }
  .ib-subject { min-height: 120px; }

  /* ---- スマホでは縦に間延びしないよう詰める ---- */
  /* メニュー画面：科目のボタンは横長に（アイコン左・名前と冊数を右） */
  .ib-subjects { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ib-subject { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 0; padding: .55em .7em; gap: .55em; border-radius: 10px; }
  .ib-subject .ib-icon { width: 34px; height: 34px; flex: 0 0 34px; }
  .ib-subject .ib-icon svg { width: 20px; height: 20px; }
  .ib-subject b { font-size: .82em; line-height: 1.3; }
  .ib-subject small { margin-left: auto; font-size: .7em; white-space: nowrap; }
  /* 分野から探す：科目ごとに開閉（最初は閉じる）、書影は出さない、分野は小さな札で並べる */
  .ib-groups { gap: 8px; }
  .ib-group-head { padding: .6em .9em; }
  .ib-group-name { font-size: 1em; }
  .ib-group-head::after { content: "▾"; margin-left: .3em; font-size: .9em; opacity: .85; transition: transform .2s; }
  details.ib-group:not([open]) .ib-group-head::after { transform: rotate(-90deg); }
  .ib-group-covers { display: none; }
  .ib-group .ib-fields { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 10px 12px; }
  .ib-group .ib-fields a { border: 1px solid var(--l); border-radius: 999px; padding: .3em .8em; font-size: .82em; gap: .4em; }
  .ib-group .ib-fields li:last-child a { border-bottom: 1px solid var(--l); }
  .ib-steps li { padding: .7em .9em; }

  /* 科目・分野の一覧ページ：冒頭の帯と「分野から探す」を詰める */
  .ib-list-hero { padding: 12px 12px; margin-bottom: .6em; }
  .ib-list-hero-path { display: none; }   /* パンくずと重なるため、スマホでは出さない */
  .ib-list-hero-title { font-size: 1.25em; margin-bottom: .2em !important; }
  .ib-list-hero-lead { font-size: .78em; line-height: 1.55; margin-bottom: .5em !important; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .ib-list-hero .ib-facts { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .ib-list-hero .ib-fact { padding: 5px 7px; }
  .ib-list-hero .ib-fact small { font-size: .62em; }
  .ib-list-hero .ib-fact b { font-size: .85em; }
  .ib .ib-h2.ib-h-nav { margin: 1em 0 .5em; }
  .ib-fields-menu { grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 1em !important; }
  .ib-fields-menu a { padding: .4em .6em !important; font-size: .8em; border-left-width: 4px !important; }
  .ib-filter { padding: .5em .7em; margin-bottom: 1em; }
  .ib-filter-row { gap: .3em; }
  .ib-filter-label { width: 3em; font-size: .78em; }
  .ib-chip { font-size: .75em; padding: .2em .7em; }
  .ib-list .ib-pr { margin-bottom: .4em; }

  /* 無料体験講義の案内：1画面に近づける */
  .ib-apply { margin-top: 2em; border-radius: 12px; }
  .ib-apply-camp { padding: 1.1em .9em .7em; }
  .ib-apply-camp::before { margin-bottom: .5em; font-size: .62em; }
  .ib-apply-camp-title { font-size: 1.1em; margin-bottom: .3em !important; }
  .ib-apply-camp-title::after { margin-top: .3em; height: 3px; width: 56px; }
  .ib-apply-camp p { font-size: .82em; margin-bottom: .2em; }
  .ib-apply-camp mark { font-size: 1.2em; }
  .ib-apply-camp .ib-apply-note { font-size: .75em; margin-top: .3em; }
  .ib-apply-form { margin: 0 .6em; padding: 1em .9em 1.1em; }
  .ib-apply-form-title { font-size: 1em; margin-bottom: .3em !important; }
  .ib-apply-form-lead { font-size: .74em; line-height: 1.6; margin-bottom: .8em !important; }
  .ib-apply-form .wpcf7-form p { margin: 0 0 .55em; font-size: .82em; }
  .ib-apply-form input[type="text"], .ib-apply-form input[type="email"], .ib-apply-form input[type="tel"], .ib-apply-form textarea, .ib-apply-form select { padding: .45em .7em; margin-top: .15em; }
  .ib-apply-form textarea { min-height: 4.5em; height: 4.5em; }
  .ib-apply-form input[type="submit"], .ib-apply-form button[type="submit"] { padding: .7em 1em; font-size: .95em; margin-top: .2em; }
  .ib-apply-lp { padding: .9em .8em 1.1em; }
  .ib-apply-lp p { font-size: .76em; margin-bottom: .5em; }
  .ib-btn-lp { font-size: .82em; padding: .6em 1.4em; max-width: 100%; box-sizing: border-box; white-space: normal; }
}
