/* ==========================================================================
   AI Heartland — BRUTUS準拠の誌面（シゴトのホント／Cloudory と同じ意匠の系統）
   純白 #ffffff × 漆黒 #101010、雑誌グリッド、重い見出し、トピック（クラスタ）カラー、
   暗色帯 #191919、英字＋和文の対訳キャプション、角は四角・罫線で区切る。
   商用フォント不使用: 本文=Noto Sans JP / 見出し=Zen Kaku Gothic New / 英字=Jost / コード=JetBrains Mono。

   - 色の単位は「トピック（_data/clusters.yml の id）」。記事は tags の先頭一致でトピックが決まる。
     --cat-<id> を足すときは tools/visual/brand.mjs の CATS と _data/clusters.yml の color も同じ値にする。
   - 動きは assets/js/site.js が付ける .motion / .is-in で出す。動きを減らす設定の人には出さない（末尾の品質フロア）。
   - 記事本文（_posts）は書き換えない。過去記事が使っている装飾クラス（point-box・box-tip・marker-yellow …）は
     「本文の装飾（旧記法の受け皿）」でこの意匠に寄せて受け止める。
   - このファイル1枚だけ。ページや include に <style> を書かない。
   ========================================================================== */

:root {
  --ink:      #101010;   /* 本文・見出し（純黒ではなく僅かに浮いた漆黒） */
  --charcoal: #191919;   /* 暗色帯・コード */
  --footer:   #2a2f33;
  --muted:    #8a8a8a;
  --sub:      #5c5c5c;   /* 補足の文字（白地で 6:1） */
  --line:     #eaeaea;
  --rule:     #d9d4c7;
  --bg:       #ffffff;
  --cream:    #f4f3ef;
  --beige:    #e2dfd7;
  --paper:    #faf9f6;

  /* トピック（クラスタ）カラー。_data/clusters.yml の id と対応 */
  --cat-claude-code:    #a95f26; /* Claude Code — Copper */
  --cat-ai-agent:       #275ba1; /* AIエージェント — Deep Navy */
  --cat-ai-coding:      #6d4fa1; /* AIコーディング — Violet */
  --cat-mcp:            #2f7fb6; /* MCP — Connector Blue */
  --cat-rag:            #b07a00; /* RAG — Amber */
  --cat-llm:            #577590; /* LLM — Slate Blue */
  --cat-security:       #c1272d; /* セキュリティ — Alert Red */
  --cat-devops:         #46505a; /* DevOps — Steel */
  --cat-claude-api:     #c1502e; /* Claude API・料金 — Rust */
  --cat-ui-design:      #a83a6c; /* UI生成 — Berry */
  --cat-docs-knowledge: #2f6f4f; /* ナレッジ — Forest */
  --cat-news:           #191919; /* ニュース — Ink */
  --cat-default:        #52606d; /* トピックに属さない記事 */

  /* 本文の色つき強調専用。トピックカラーとは独立した意味色 */
  --warn: #c1272d;
  --info: #1f6feb;
  --good: #1a7f37;

  --font-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  --font-display: "Zen Kaku Gothic New", "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-en: "Jost", "Futura", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw:      1160px;  /* home / hub（雑誌ワイド） */
  --maxw-read: 760px;   /* 静的ページ */
  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --shadow-lift: 0 14px 30px -18px rgba(16,16,16,.35);
  --dock-h: 60px;
  --anchor-ad: 0px;     /* 画面下に AdSense のアンカー広告が出ている間、その高さ（site.js が入れる） */
  --deep: #101010;
  --band: #101010;      /* 白い文字を載せる帯・番号札の面（cat-* の中ではトピック色を黒で沈めた色） */
  --solid: #101010;     /* 黒いボタン・選択中のピル */
  --masthead: #101010;  /* ヘッダーの帯 */
  --rule2: #cfcfcf;     /* 入力欄・ボタンの枠 */
  --stripe: #fafaf8;    /* 表の縞・行のホバー */
  --info-bg: #f2f6fd; --warn-bg: #fbf2f1; --danger-bg: #f9e9e8;
  --code-ink: #3a2a1e;  /* 本文中の `code` の文字 */
  --marker-yellow: #ffe58f;
  --dock-ink: #2b2b2b;
  color-scheme: light;      /* トピックカラーを黒で沈めた濃さ（白い文字を載せる帯・文字色）。cat-* の中で上書きされる */
}

/* --------------------------------------------------------- ダークモード
   <html class="dark">（<head> の1行が、保存した選択 → 無ければ端末の設定 の順で付ける。切替はヘッダーの月のボタン）。
   色はトークンだけを差し替える。部品ごとに色を書き足さないこと。画像（カバー・図）は明るい紙のまま出す。 */
html.dark {
  color-scheme: dark;
  --ink: #e9e8e4; --charcoal: #0b0b0b; --footer: #0c0d0e; --muted: #8d8d8a; --sub: #b6b5b0;
  --line: #2a2a29; --rule: #3a3833; --bg: #131313; --cream: #1c1c1a; --beige: #2a2925; --paper: #181817;
  --deep: #e9e8e4; --band: #2b2b2b; --solid: #2f2f2f; --masthead: #0b0b0b;
  --rule2: #3d3d3b; --stripe: #181818; --info-bg: #142036; --warn-bg: #2a1716; --danger-bg: #331817;
  --code-ink: #f0d9c4; --marker-yellow: rgba(255, 205, 0, .32); --dock-ink: #dedede;
  --shadow-lift: 0 14px 30px -18px rgba(0,0,0,.8);
}
/* トピック色: 帯（白い文字を載せる面）は黒で沈め、文字・罫に使う色は白で持ち上げる（暗い地で読めるように） */
html.dark [class*="cat-"] { --deep: color-mix(in srgb, var(--cat, var(--ink)) 58%, #fff); --band: color-mix(in srgb, var(--cat, var(--ink)) 62%, #000); }
html.dark .cat-news { --cat: #8d8d8a; }
html.dark a:hover { color: color-mix(in srgb, var(--cat-ai-agent) 50%, #fff); }
html.dark .post-body img, html.dark .post-hero img, html.dark .article-card .thumb { border-color: var(--line); }
html.dark .post-body .mermaid { background: #1a1a19; }
html.dark .post-body pre { background: #0b0b0b; }
html.dark .dock { background: linear-gradient(180deg, rgba(30,30,30,.72), rgba(20,20,20,.62)); border-color: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 32px -10px rgba(0,0,0,.7); }
html.dark .dock-item { text-shadow: none; }
html.dark .dock-item::after { background: rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
html.dark .search-ov { background: rgba(0,0,0,.6); }
html.dark .sticky-ad, html.dark .sheet { box-shadow: 0 -20px 50px -20px rgba(0,0,0,.9); }
html.dark .post-ad__creative img { filter: brightness(.92); }
html.dark .post-body .marker-green { background: linear-gradient(transparent 60%, rgba(46,180,90,.3) 60%); }
html.dark .post-body .marker-pink { background: linear-gradient(transparent 60%, rgba(230,70,80,.3) 60%); }
html.dark .post-body .marker-blue { background: linear-gradient(transparent 60%, rgba(70,140,255,.3) 60%); }
html.dark .post mark { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--cat, #888) 45%, transparent) 62%); }
html.dark :is(.post mark.key-warn, .post-body :is(.box-warning, .warning-box, .box-warn, .warn-box, .box-danger, .callout-warn) > strong:first-child) { color: #ff7b72; }
html.dark .post mark.key-info { color: #79b0ff; }
html.dark .post mark.key-good { color: #6fdc8c; }
html.dark :where(a, button, .hub-card, .article-card):focus-visible { outline-color: #fff; }

/* 明暗の切替ボタン（ヘッダーのタブ列の右） */
.theme-toggle .moon { display: block; }
.theme-toggle .sun { display: none; }
html.dark .theme-toggle .moon { display: none; }
html.dark .theme-toggle .sun { display: block; }

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: var(--font-jp); font-size: 16px; line-height: 1.5;
  word-wrap: break-word; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--cat-ai-agent); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

main { max-width: var(--maxw-read); margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }
main.wide { max-width: var(--maxw); }

h1, h2, h3, h4 { font-family: var(--font-jp); line-height: 1.4; color: var(--ink); }
h1, h2 { font-family: var(--font-display); font-weight: 900; letter-spacing: .02em; }
h1 { font-size: clamp(1.65rem, 1.25rem + 1.8vw, 2.35rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.6rem); font-weight: 700; margin-top: 3rem; }
h3 { font-size: 1.1rem; font-weight: 700; margin-top: 2rem; }

/* 雑誌シグネチャー: 英字 + 和文の対訳キャプション */
.mag-head { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; margin: 0 0 1.2rem; }
.mag-head .en {
  font-family: var(--font-en); font-weight: 700; text-transform: uppercase;
  letter-spacing: .24em; font-size: .78rem; line-height: 1;
  color: color-mix(in srgb, var(--cat, var(--ink)) 72%, #000);
}
.mag-head .ja {
  font-family: var(--font-display); font-weight: 900; letter-spacing: .03em;
  font-size: clamp(1.45rem, 1.15rem + 1.5vw, 2rem); line-height: 1.35; color: var(--ink);
}

/* トピックカラーの割り当て（このクラスが付いた要素の中で var(--cat) と var(--cat-tint) を使う） */
.cat-claude-code    { --cat: var(--cat-claude-code);    --cat-tint: rgba(169, 95, 38, .22); }
.cat-ai-agent       { --cat: var(--cat-ai-agent);       --cat-tint: rgba(39, 91, 161, .20); }
.cat-ai-coding      { --cat: var(--cat-ai-coding);      --cat-tint: rgba(109, 79, 161, .20); }
.cat-mcp            { --cat: var(--cat-mcp);            --cat-tint: rgba(47, 127, 182, .22); }
.cat-rag            { --cat: var(--cat-rag);            --cat-tint: rgba(176, 122, 0, .24); }
.cat-llm            { --cat: var(--cat-llm);            --cat-tint: rgba(87, 117, 144, .22); }
.cat-security       { --cat: var(--cat-security);       --cat-tint: rgba(193, 39, 45, .16); }
.cat-devops         { --cat: var(--cat-devops);         --cat-tint: rgba(70, 80, 90, .20); }
.cat-claude-api     { --cat: var(--cat-claude-api);     --cat-tint: rgba(193, 80, 46, .20); }
.cat-ui-design      { --cat: var(--cat-ui-design);      --cat-tint: rgba(168, 58, 108, .18); }
.cat-docs-knowledge { --cat: var(--cat-docs-knowledge); --cat-tint: rgba(47, 111, 79, .20); }
.cat-news           { --cat: var(--cat-news);           --cat-tint: rgba(16, 16, 16, .12); }
.cat-default        { --cat: var(--cat-default);        --cat-tint: rgba(82, 96, 109, .20); }
[class*="cat-"] { --deep: color-mix(in srgb, var(--cat, var(--ink)) 72%, #000); --band: color-mix(in srgb, var(--cat, var(--ink)) 72%, #000); }

/* --------------------------------------------------------- ヘッダー（帯）とタブ列 */
.masthead-wrap { position: sticky; top: 0; z-index: 20; background: var(--bg); transition: transform .35s var(--ease-out); }
.masthead-wrap.is-hidden { transform: translateY(-100%); }
body.nav-open .masthead-wrap { transform: none; }
.site-header {
  --head: var(--masthead);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  height: 60px; padding: 0 clamp(1rem, 4vw, 2rem); background: var(--head); color: #fff;
}
.site-header.is-cat { --head: color-mix(in srgb, var(--cat) 72%, #000); }
.site-header .brand { flex: none; display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; min-width: 0; }
.site-header .brand .mark { flex: none; width: 22px; height: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.site-header .brand .mark i { display: block; background: currentColor; }
.site-header .brand .mark i:nth-child(2) { opacity: .55; }
.site-header .brand .mark i:nth-child(3) { opacity: .3; }
.site-header .brand .en { font-family: var(--font-en); font-weight: 800; font-size: 1.24rem; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
.site-header .brand .ja { font-family: var(--font-jp); font-weight: 700; font-size: .7rem; letter-spacing: .08em; opacity: .85; white-space: nowrap; }
.site-header nav { display: none; }
.nav-toggle { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; border: 0; background: none; color: #fff; cursor: pointer; }
.nav-toggle .bars { display: grid; gap: 6px; width: 26px; }
.nav-toggle .bars i { display: block; height: 2px; background: currentColor; transition: transform .3s var(--ease-out), opacity .2s; }
body.nav-open .nav-toggle { color: var(--ink); }
body.nav-open .nav-toggle .bars i:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.nav-open .nav-toggle .bars i:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle .bars i:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
body.nav-open .site-header .brand { color: var(--ink); }
.site-header .brand, .nav-toggle { position: relative; z-index: 16; }

.subnav { display: flex; align-items: center; height: 52px; padding: 0 clamp(.4rem, 3vw, 1.5rem); border-bottom: 1px solid var(--line); background: var(--bg); }
.subnav-tabs {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: .1rem; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.subnav-tabs::-webkit-scrollbar { display: none; }
.subnav-tab {
  flex: none; position: relative; padding: .42rem .95rem; border: 1.5px solid transparent; border-radius: 999px;
  font-family: var(--font-jp); font-weight: 800; font-size: .84rem; color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.subnav-tab + .subnav-tab::before { content: ""; position: absolute; left: -1px; top: 25%; bottom: 25%; width: 1px; background: var(--line); }
.subnav-tab:hover { color: var(--deep); }
.subnav-tab.is-here { color: var(--deep); border-color: currentColor; }
.subnav-tab.is-here::before, .subnav-tab.is-here + .subnav-tab::before { display: none; }
.subnav-icon { position: relative; flex: none; display: grid; place-items: center; width: 42px; height: 42px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.subnav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.subnav-icon .dock-badge { top: 4px; left: auto; right: 2px; }

/* メニュー展開時: トピックを色面タイルのグリッドで見せるメガメニュー */
body.nav-open .site-header nav {
  display: block; position: fixed; inset: 0; z-index: 15; background: var(--bg); overflow-y: auto;
  padding: 5.5rem 1.4rem calc(3rem + var(--dock-h)); animation: menu-in .35s var(--ease-out) both;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(12px); } }
body.nav-open .nav-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .6rem; max-width: var(--maxw); margin: 0 auto; }
body.nav-open .nav-cat {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: .3rem; min-height: 120px;
  padding: 1.1rem 1.1rem 1.2rem; text-decoration: none; color: #fff; overflow: hidden;
  background: color-mix(in srgb, var(--cat) 82%, #000); transition: transform .25s var(--ease-out);
}
body.nav-open .nav-cat::before {
  content: attr(data-en); position: absolute; right: -.3rem; top: .2rem; font-family: var(--font-en); font-weight: 800;
  font-size: 2.6rem; line-height: 1; letter-spacing: -.02em; color: rgba(255,255,255,.1); white-space: nowrap;
}
body.nav-open .nav-cat .en { position: relative; font-family: var(--font-en); font-weight: 700; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
body.nav-open .nav-cat strong { position: relative; font-family: var(--font-jp); font-weight: 900; font-size: 1.08rem; }
body.nav-open .nav-cat .count { position: relative; font-family: var(--font-en); font-size: .72rem; opacity: .7; }
body.nav-open .nav-cat:hover { transform: translateY(-3px); }
body.nav-open .nav-links { display: flex; flex-wrap: wrap; gap: .6rem 1.8rem; max-width: var(--maxw); margin: 1.8rem auto 0; padding-top: 1.6rem; border-top: 1px solid var(--line); }
body.nav-open .nav-links a { font-family: var(--font-jp); font-weight: 900; font-size: 1rem; color: var(--ink); text-decoration: none; }
body.nav-open .nav-links a:hover { text-decoration: underline; text-underline-offset: .2em; }
body.nav-open { overflow: hidden; }

/* --------------------------------------------------------- ヒーロー（home） */
.hero { padding: 2.4rem 0 2rem; }
.hero .mag-head { margin-bottom: 1.4rem; }
.hero .mag-head .en { display: none; }  /* ヘッダーの英字ロゴと重なるので出さない */
.hero .mag-head .ja { font-family: var(--font-jp); font-weight: 800; font-size: .95rem; letter-spacing: .32em; }
.hero-title { margin: 0 0 1.1rem; font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.3; letter-spacing: .03em; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; animation: line-up .9s var(--ease-out) both; animation-delay: calc(.08s + var(--i, 0) * .12s); }
.hero .lede { color: var(--sub); font-size: 1rem; line-height: 1.85; max-width: 52ch; margin: 0; }
.hero .mag-head, .hero .lede, .hero-stats { animation: fade-up .8s var(--ease-out) both; }
.hero .lede { animation-delay: .35s; }
.hero-stats { animation-delay: .5s; }
@keyframes line-up { from { transform: translateY(105%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1rem 2.6rem; margin: 1.8rem 0 0; }
.hero-stats .stat { display: flex; flex-direction: column-reverse; gap: .1rem; }
.hero-stats dt { font-size: .78rem; font-weight: 700; color: var(--muted); }
.hero-stats dd { margin: 0; font-family: var(--font-en); font-weight: 700; font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.hero-stats small { font-family: var(--font-jp); font-size: .8rem; font-weight: 700; margin-left: .2rem; }

.marquee {
  position: relative; overflow: hidden; margin: 0 calc(50% - 50vw); padding: .9rem 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 2.4rem; width: max-content; animation: marquee 56s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: baseline; gap: .5rem; white-space: nowrap; text-decoration: none; font-family: var(--font-jp); font-weight: 900; font-size: clamp(1.05rem, .9rem + .8vw, 1.5rem); color: var(--ink); }
.marquee-item .en { font-family: var(--font-en); font-weight: 700; font-size: .7em; letter-spacing: .08em; color: var(--cat); }
.marquee-item::after { content: "／"; margin-left: 2.4rem; color: var(--line); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }

.action-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .75rem; margin: 2rem 0; }
.action-tile {
  position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1.5rem 1.4rem;
  background: var(--bg); color: var(--ink); text-decoration: none; border: 1px solid var(--line);
  transition: background .25s var(--ease), transform .25s var(--ease-out), box-shadow .25s var(--ease), border-color .25s;
}
.action-tile::after { content: "→"; position: absolute; top: 1.35rem; right: 1.3rem; font-family: var(--font-en); font-weight: 700; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s var(--ease-out); }
.action-tile .num { font-family: var(--font-en); font-weight: 800; font-size: .74rem; letter-spacing: .22em; color: var(--muted); }
.action-tile strong { font-family: var(--font-jp); font-weight: 900; font-size: 1.3rem; }
.action-tile .desc { font-size: .82rem; line-height: 1.5; color: var(--sub); }
.action-tile:hover { background: var(--solid); border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.action-tile:hover::after { opacity: 1; transform: none; color: #fff; }
.action-tile:hover strong, .action-tile:hover .num, .action-tile:hover .desc { color: #fff; }

/* トピックの色面カード（写真は使わず、色面に大きな英字を透かす） */
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: .9rem; margin: 2rem 0 3.5rem; }
.hub-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: .45rem; min-height: 200px;
  padding: 1.8rem 1.5rem 1.6rem; text-decoration: none; color: #fff; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, color-mix(in srgb, var(--cat) 88%, #fff) 0%, color-mix(in srgb, var(--cat) 70%, #000) 100%);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease);
}
.hub-card::before {
  content: attr(data-en); position: absolute; z-index: -1; left: 1.2rem; top: .9rem; right: -2rem;
  font-family: var(--font-en); font-weight: 800; font-size: 3.4rem; line-height: .9; letter-spacing: -.02em;
  color: rgba(255,255,255,.1); white-space: nowrap; overflow: hidden;
}
.hub-card::after { content: ""; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.4px); background-size: 14px 14px; mask-image: linear-gradient(transparent 30%, #000); }
.hub-card .en { font-family: var(--font-en); font-weight: 700; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.hub-card strong { font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; line-height: 1.35; }
.hub-card .desc { font-size: .84rem; line-height: 1.65; opacity: .92; }
.hub-card .count { font-family: var(--font-en); font-weight: 700; font-size: .8rem; opacity: .8; }
.hub-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); color: #fff; }
.hub-card strong::after { content: " →"; font-family: var(--font-en); display: inline-block; opacity: 0; transform: translateX(-8px); transition: opacity .3s, transform .3s var(--ease-out); }
.hub-card:hover strong::after { opacity: 1; transform: none; }

/* --------------------------------------------------------- 一覧の部品 */
.popular-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.popular-list li { border-top: 1px solid var(--line); }
.popular-list li:last-child { border-bottom: 1px solid var(--line); }
.popular-list a { display: flex; align-items: baseline; gap: 1rem; padding: 1rem .2rem; text-decoration: none; color: var(--ink); }
.popular-list .rank { flex: none; width: 2ch; font-family: var(--font-en); font-weight: 700; font-size: 1.3rem; color: var(--deep); }
.popular-list .ttl { flex: 1; font-family: var(--font-jp); font-weight: 700; line-height: 1.5; }
.popular-list a:hover .ttl { text-decoration: underline; }
.popular-list .badge { flex: none; font-family: var(--font-jp); font-size: .66rem; font-weight: 700; color: var(--deep); border: 1px solid currentColor; padding: .15rem .5rem; }
.popular-list.has-thumb a { align-items: flex-start; gap: .8rem; }
.popular-list.has-thumb .thumb { position: relative; flex: none; width: 72px; aspect-ratio: 1200 / 630; background: var(--cream) center/cover no-repeat; border: 1px solid var(--line); }
.popular-list.has-thumb .thumb .rank { position: absolute; top: -7px; left: -7px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; background: var(--band); color: #fff; font-size: .68rem; }
.popular-list.has-thumb .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.popular-list.has-thumb .ttl { font-size: .86rem; line-height: 1.5; }
.popular-list.has-thumb .badge { align-self: flex-start; font-size: .6rem; padding: .1rem .45rem; }

.job-jump { display: flex; flex-wrap: wrap; gap: .55rem .6rem; margin: 2.8rem 0 0; padding-top: 2.4rem; border-top: 1px solid var(--line); }
.job-jump a { font-family: var(--font-jp); font-size: .78rem; font-weight: 700; text-decoration: none; color: var(--deep); border: 1px solid currentColor; padding: .38rem .9rem; border-radius: 999px; transition: background .2s var(--ease), color .2s var(--ease); }
.job-jump a:hover { background: var(--band); border-color: var(--band); color: #fff; }

.job-section { padding: 2.6rem 0; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.job-section .section-top { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem 1rem; margin-bottom: .2rem; padding: 1rem 1.3rem; background: var(--band); color: #fff; }
.job-section .mag-head { margin: 0; flex-direction: row; align-items: baseline; gap: .9rem; }
.job-section .mag-head .en { color: #fff; font-weight: 800; letter-spacing: .26em; font-size: .9rem; }
.job-section .mag-head .ja { color: #fff; font-size: .95rem; font-family: var(--font-jp); font-weight: 700; opacity: .85; }
.job-section .count { font-family: var(--font-en); font-size: .78rem; color: rgba(255,255,255,.75); }
.job-section .section-link { margin-left: auto; flex: none; font-size: .82rem; font-weight: 700; color: #fff; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: .1rem; }
.job-section .section-link:hover { opacity: .7; color: #fff; }
.home-section { padding: 2.8rem 0 1rem; border-top: 1px solid var(--line); }
.home-section > .section-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.home-section > .section-top .mag-head { margin: 0; }
.home-section > .section-top .section-link { font-size: .86rem; font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--ink); padding-bottom: .15rem; }
.home-section .lead { color: var(--sub); font-size: .92rem; line-height: 1.85; margin: .4rem 0 0; max-width: 64ch; }

.more-link { text-align: center; margin-top: 2.6rem; }
.more-link a { display: inline-block; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .92rem; border-bottom: 2px solid var(--ink); padding-bottom: .2rem; }
.more-link a:hover { color: var(--muted); border-color: var(--muted); }

/* 記事カード */
.article-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 2.2rem 1.4rem; margin-top: 1.6rem; }
.article-cards[hidden] { display: none; }
.article-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.article-card[hidden] { display: none; }
.article-card .thumb { position: relative; aspect-ratio: 1200 / 630; background: var(--cream); overflow: hidden; box-shadow: 0 0 0 1px rgba(16,16,16,.05); transition: box-shadow .3s var(--ease), transform .3s var(--ease-out); }
.article-card .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.article-card:hover .thumb { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.article-card .thumb--plate { display: flex; align-items: flex-end; padding: .9rem 1rem; background: linear-gradient(160deg, color-mix(in srgb, var(--cat) 86%, #fff), color-mix(in srgb, var(--cat) 70%, #000)); }
.article-card .thumb--plate .en { font-family: var(--font-en); font-weight: 800; font-size: 1.3rem; letter-spacing: .06em; color: #fff; text-transform: uppercase; }
.article-card .body { padding-top: .85rem; display: flex; flex-direction: column; gap: .45rem; }
.article-card .kicker { font-family: var(--font-jp); font-weight: 800; font-size: .7rem; letter-spacing: .08em; color: var(--deep); }
.article-card .ttl { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.6; letter-spacing: .02em; }
.article-card .desc { font-size: .8rem; line-height: 1.7; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card time { font-family: var(--font-en); font-size: .76rem; color: var(--muted); letter-spacing: .02em; }
.article-card:hover { color: var(--ink); }
.article-card:hover .thumb img { transform: scale(1.05); }
.article-card:hover .ttl { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.article-cards--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 1.6rem 1.1rem; }
.article-cards--compact .article-card .ttl { font-size: .92rem; }

/* --------------------------------------------------------- ハブ（トピック・カテゴリ・タグ・一覧） */
.hub-masthead { padding: 2.2rem 0 2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; }
.hub-masthead .mag-head { flex-direction: column-reverse; gap: .3rem; margin-bottom: 1.2rem; }
.hub-masthead .mag-head .ja { font-family: var(--font-jp); font-weight: 800; font-size: .95rem; letter-spacing: .3em; color: var(--deep); }
.hub-masthead .mag-head .en { font-family: var(--font-en); font-weight: 800; letter-spacing: -.01em; line-height: .95; font-size: clamp(2.6rem, 1.4rem + 6.5vw, 5.8rem); color: var(--ink); text-transform: uppercase; }
.hub-masthead .mag-head .en::after { content: "."; color: var(--deep); }
.hub-masthead h1 { margin: 0; font-size: clamp(1.25rem, 1.05rem + .9vw, 1.6rem); }
.hub-masthead .hub-lede { margin: .9rem 0 0; color: var(--sub); font-size: .95rem; line-height: 1.9; max-width: 68ch; }
.hub-masthead .hub-meta { margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-family: var(--font-en); font-size: .82rem; color: var(--muted); }
.hub-masthead .hub-meta b { font-weight: 800; color: var(--ink); font-size: 1.1rem; margin-right: .2rem; }

main.wide > h2, .hub-band {
  margin: 3rem 0 1.4rem; padding: 1.05rem 1.4rem; color: #fff; background: var(--band);
  font-family: var(--font-jp); font-weight: 800; font-size: 1rem; letter-spacing: .12em; line-height: 1.5;
}
main.wide > h3 { margin-top: 2.4rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
main.wide > p.hub-note, .hub-note { color: var(--sub); font-size: .9rem; line-height: 1.85; margin: .2rem 0 1rem; max-width: 72ch; }

/* ハブの本文（トピックの解説・カテゴリの導入）。記事本文と同じ組みを、ハブの幅で使う */
.hub-body { max-width: var(--maxw-read); }
.hub-body .post-toc { margin: 0 0 2.4rem; }
.hub-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1px; margin: 1.6rem 0 2.4rem; background: var(--line); border: 1px solid var(--line); }
.hub-point { background: var(--bg); padding: 1.1rem 1.2rem 1.2rem; }
.hub-point b { display: block; font-family: var(--font-jp); font-weight: 900; font-size: .95rem; color: var(--deep); margin-bottom: .35rem; }
.hub-point span { font-size: .84rem; line-height: 1.75; color: var(--sub); }

/* ハブ先頭の「最初に読む」 */
.hub-decide { margin: 2rem 0 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.num-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.num-card { position: relative; display: flex; flex-direction: column; gap: .8rem; padding: 1.5rem 1.5rem 1.3rem; border: 1px solid var(--line); background: var(--bg); transition: border-color .25s, transform .25s var(--ease-out), box-shadow .25s; }
.num-card:hover { border-color: var(--band); transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.num-bar { margin: 0; display: flex; align-items: baseline; gap: .9rem; padding: .55rem .9rem; background: var(--band); color: #fff; }
.num-bar .n { font-family: var(--font-en); font-weight: 800; letter-spacing: .14em; }
.num-bar .q { font-size: .8rem; font-weight: 700; letter-spacing: .08em; opacity: .9; }
.num-ttl { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; line-height: 1.6; letter-spacing: .02em; }
.num-ttl a { color: var(--ink); text-decoration: none; }
.num-ttl a::after { content: ""; position: absolute; inset: 0; }
.num-desc { margin: 0; color: var(--sub); font-size: .86rem; line-height: 1.85; }
.read-more { margin-top: auto; font-family: var(--font-en); font-weight: 800; font-size: .8rem; letter-spacing: .22em; color: var(--deep); transition: letter-spacing .25s var(--ease-out); }
.num-card:hover .read-more { letter-spacing: .32em; }

.list-search { display: flex; align-items: center; gap: .7rem; margin: 0 0 1.8rem; padding: 0 1.1rem; height: 54px; border: 1px solid var(--rule2); background: var(--bg); cursor: text; transition: border-color .2s, box-shadow .2s; }
.list-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(16,16,16,.06); }
.list-search svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--sub); stroke-width: 2; stroke-linecap: round; }
.list-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 1rem; color: var(--ink); }
.list-search input::placeholder { color: var(--muted); }
.list-search-count { flex: none; font-family: var(--font-en); font-weight: 700; font-size: .8rem; color: var(--muted); }

/* 絞り込みのピル（一覧・タグ） */
.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.6rem; }
.chip { display: inline-flex; align-items: baseline; gap: .35rem; padding: .4rem .85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font-family: var(--font-jp); font-weight: 700; font-size: .8rem; text-decoration: none; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.chip small { font-family: var(--font-en); font-size: .72rem; color: var(--muted); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--solid); border-color: var(--solid); color: #fff; }
.chip.is-on small, .chip[aria-pressed="true"] small { color: rgba(255,255,255,.7); }

/* 月ごとの区切り（/articles/・/news/） */
main.wide > .month-head, .month-head { background: none; color: var(--ink); padding: 0 0 .6rem; letter-spacing: .06em;
  display: flex; align-items: baseline; gap: .8rem; margin: 2.8rem 0 0; padding-bottom: .6rem; border-bottom: 2px solid var(--ink); font-family: var(--font-en); font-weight: 800; font-size: 1.15rem; letter-spacing: .06em; }
.month-head small { font-family: var(--font-jp); font-weight: 700; font-size: .76rem; color: var(--muted); letter-spacing: 0; }
.month-head[hidden] { display: none; }

/* 行の一覧（ニュース・タグの記事一覧など、サムネを出さない密な一覧） */
.row-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.row-list li { border-top: 1px solid var(--line); }
.row-list li:last-child { border-bottom: 1px solid var(--line); }
.row-list a { display: grid; grid-template-columns: 6.2rem 1fr; gap: .2rem 1rem; padding: .9rem .2rem; text-decoration: none; color: var(--ink); }
.row-list time { font-family: var(--font-en); font-size: .8rem; color: var(--muted); padding-top: .15rem; }
.row-list .ttl { font-weight: 700; line-height: 1.6; }
.row-list .desc { grid-column: 2; font-size: .82rem; color: var(--sub); line-height: 1.7; }
.row-list a:hover .ttl { text-decoration: underline; text-underline-offset: .2em; }

/* タグの一覧 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 2rem; }
.tag-index { columns: 3 220px; column-gap: 2rem; margin: 1rem 0 2rem; }
.tag-index a { display: flex; justify-content: space-between; gap: .6rem; break-inside: avoid; padding: .45rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 700; }
.tag-index a small { font-family: var(--font-en); color: var(--muted); font-weight: 700; }
.tag-section { scroll-margin-top: 120px; }

/* --------------------------------------------------------- 記事 */
.post > header { margin-bottom: 2rem; }
.post .badge { display: inline-flex; align-items: baseline; gap: .45em; margin: 0 0 1rem; background: var(--band); color: #fff; padding: .25rem .7rem; text-decoration: none; }
.post .badge:hover { color: #fff; opacity: .9; }
.post .badge .en { font-family: var(--font-en); font-weight: 700; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.post .badge .ja { font-family: var(--font-jp); font-weight: 700; font-size: .78rem; }
.post > header h1 { margin: 0 0 .5rem; }
.post .en-title { margin: 0 0 .9rem; font-family: var(--font-en); font-size: .9rem; line-height: 1.6; color: var(--muted); letter-spacing: .01em; }
.post-meta { margin: 0; color: var(--muted); font-size: .84rem; font-family: var(--font-en); letter-spacing: .01em; line-height: 1.9; }
.post-meta > * + *::before { content: "・"; margin: 0 .6rem; color: var(--rule); }
.post-meta .jp { font-family: var(--font-jp); }
.post-meta a { color: var(--sub); }
.post-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.post-tags a, .post-tags span { display: inline-block; padding: .2rem .65rem; border: 1px solid var(--line); font-size: .74rem; font-weight: 700; color: var(--sub); text-decoration: none; }
.post-tags a:hover { border-color: var(--ink); color: var(--ink); }
.post-tags .fact { font-family: var(--font-en); color: var(--ink); border-color: var(--rule); background: var(--paper); }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.1rem; }

.fav-toggle, .share-btn {
  display: inline-flex; align-items: center; gap: .45rem; border: 2px solid var(--ink); background: none; color: var(--ink);
  font-family: var(--font-jp); font-weight: 900; font-size: .82rem; padding: .45rem 1rem; cursor: pointer; text-decoration: none; border-radius: 999px;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s, transform .15s var(--ease-out);
}
.fav-toggle:active, .share-btn:active { transform: scale(.95); }
.fav-toggle .fav-icon { font-size: 1.05rem; line-height: 1; }
.fav-toggle[aria-pressed="true"] { background: var(--band); color: #fff; border-color: var(--band); }
.share-btn:hover { background: var(--band); color: #fff; border-color: var(--band); }
.share-btn svg { width: 15px; height: 15px; fill: currentColor; }
.share-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.post-share-end { margin: 2.6rem 0 0; padding: 1.3rem 1.4rem; background: var(--cream); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; }
.post-share-end p { margin: 0; font-weight: 900; font-size: .95rem; }

.post-hero { margin: 1.6rem 0 2.4rem; }
.post-hero img { display: block; width: 100%; height: auto; background: var(--cream); }

/* 本文とサイド（目次・保存・人気）の2カラム。SP は 目次 → 本文 → 人気 の縦積み */
.post-layout { display: flex; flex-direction: column; }
.post-aside { order: -1; display: flex; flex-direction: column; gap: 2rem; margin-bottom: 2.4rem; }
.post-aside > * { margin: 0; }
.post-main { order: 0; min-width: 0; }
.post-popular { order: 1; }
@media (min-width: 1001px) {
  .post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem 3rem; grid-template-areas: "main aside" "main pop"; }
  .post-main { grid-area: main; }
  .post-aside { grid-area: aside; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; margin-bottom: 0; }
  .post-popular { grid-area: pop; position: sticky; top: 84px; align-self: start; }
}

.crumbs { font-size: .78rem; color: var(--muted); margin: 0 0 1.4rem; line-height: 1.9; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span { margin: 0 .35em; }
.crumbs [aria-current] { color: var(--ink); font-weight: 700; margin: 0; }

.post-toc, .post-popular, .post-favorites { background: var(--cream); border-top: 3px solid var(--cat, var(--ink)); padding: 1.3rem 1.4rem 1.4rem; }
.post-toc .toc-ttl, .post-popular .toc-ttl, .post-favorites .toc-ttl { margin: 0 0 .8rem; font-weight: 900; font-size: .95rem; letter-spacing: .04em; }
.post-toc ol { counter-reset: toc; list-style: none; margin: 0; padding: 0; }
.post-toc li { counter-increment: toc; margin: .1rem 0; display: flex; gap: .7em; font-size: .9rem; line-height: 1.7; }
.post-toc li::before { content: counter(toc, decimal-leading-zero); flex: none; font-family: var(--font-en); font-weight: 700; font-size: .8rem; color: var(--deep, var(--muted)); padding-top: .18em; }
.post-toc a { color: var(--ink); text-decoration: none; }
.post-toc a:hover, .post-toc a.is-active { text-decoration: underline; text-underline-offset: .2em; }
.post-toc a.is-active { font-weight: 700; }
.post-popular .popular-list li:first-child, .post-favorites .popular-list li:first-child { border-top: none; }
.post-popular .popular-list a { padding: .7rem 0; }
.post-favorites .popular-list a { padding: .6rem 0; }
.post-favorites .popular-list .ttl { font-size: .88rem; }
.post-favorites[hidden] { display: none; }

/* 記事の「なぜ読むか」（frontmatter の why） */
.post-why { position: relative; margin: 0 0 2.4rem; padding: 1.2rem 1.4rem 1.25rem 1.4rem; background: var(--paper); border-left: 4px solid var(--cat, var(--ink)); }
.post-why .label { display: block; margin-bottom: .35rem; font-family: var(--font-en); font-weight: 800; font-size: .7rem; letter-spacing: .24em; color: var(--deep); }
.post-why p { margin: 0; font-size: 1rem; line-height: 1.85; font-weight: 700; }

/* --------------------------------------------------------- 記事本文 */
.post-body { font-size: 17px; line-height: 1.9; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 1.25rem 0; }
.post-body > p:first-of-type { font-size: 1.04em; }
.post-body ul, .post-body ol { padding-left: 1.4rem; margin: 1.2rem 0; }
.post-body li { margin: .45rem 0; line-height: 1.85; }
.post-body li > ul, .post-body li > ol { margin: .3rem 0; }
.post-body ul > li::marker { color: var(--cat, var(--ink)); }
.post-body ol > li::marker { color: var(--deep, var(--ink)); font-family: var(--font-en); font-weight: 700; }
/* 「<li>・本文」の書き方（過去記事の慣習）は ・ が点の役目をするので、リストの点を出さない（_plugins/li_dot.rb が付ける） */
.post-body li.li-dot { list-style: none; margin-left: -1.1rem; }
.post-body img { display: block; margin: 0 auto; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.6rem 0; }
.post-body a { text-decoration-color: var(--cat, var(--ink)); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.post-body a:hover { color: var(--deep, var(--ink)); }
.post-body strong { font-weight: 800; }
.post-body kbd { font-family: var(--font-mono); font-size: .82em; padding: .1em .45em; border: 1px solid var(--rule2); border-bottom-width: 2px; background: var(--bg); }

.post-body h2 { position: relative; padding: 1.1rem 0 .5rem; margin: 3.4rem 0 1.2rem; border-top: 3px solid var(--ink); scroll-margin-top: 90px; }
.post-body h2::before { content: ""; position: absolute; left: 0; top: -3px; width: 3.5rem; height: 3px; background: var(--cat, var(--ink)); }
.post-body h3 { padding-left: .75rem; border-left: 4px solid var(--cat, var(--ink)); line-height: 1.5; margin: 2.4rem 0 1rem; scroll-margin-top: 90px; }
.post-body h4 { font-size: 1rem; font-weight: 800; margin: 1.8rem 0 .6rem; line-height: 1.5; }
.post-body h4::before { content: "▸"; color: var(--cat, var(--ink)); margin-right: .4em; }
.post-body h5, .post-body h6 { font-size: .95rem; margin: 1.5rem 0 .5rem; }

.post-body blockquote { background: var(--cream); border-left: 4px solid var(--cat, var(--ink)); margin: 1.8rem 0; padding: 1.1rem 1.3rem; color: var(--sub); font-size: .95em; line-height: 1.85; }
.post-body blockquote > :first-child { margin-top: 0; }
.post-body blockquote > :last-child { margin-bottom: 0; }
.post-body blockquote.twitter-tweet { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--ink); }

/* 表: 見出し行を色面に、1列目を太字、狭い画面では横スクロール */
.post-body table { border-collapse: collapse; width: 100%; font-size: .86em; line-height: 1.65; margin: 1.8rem 0; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.post-body thead th { background: var(--band); color: #fff; border-color: var(--band); font-weight: 700; }
.post-body th { background: var(--cream); font-weight: 700; }
.post-body tbody tr:nth-child(even) { background: var(--stripe); }
.post-body tbody td:first-child { font-weight: 700; }
/* 表の中のコードは長ければ折り返す（折り返さないと隣の列が押しつぶされ、1列目が1字ずつ縦に折れる） */
.post-body td code, .post-body th code { white-space: normal; overflow-wrap: anywhere; }
/* 1列目は見出しの列。スマホで1字ずつ折れないよう最低幅を持たせる（「観/点」のような縦書きになる） */
.post-body :is(td, th):first-child { min-width: 5.5em; }
.post-body .table-wrap, .post-body .table-scroll, .post-body .table-wrapper, .post-body .post-table-wrap { overflow-x: auto; margin: 1.8rem 0; }
.post-body .table-wrap table, .post-body .table-scroll table, .post-body .table-wrapper table, .post-body .post-table-wrap table { margin: 0; }

/* 図版 */
.post-body figure { margin: 2.2rem 0; }
.post-body figure img, .post-body > p > img, .post-body .section-visual img { width: 100%; border: 1px solid var(--line); background: var(--bg); }
.post-body figcaption { margin-top: .6rem; font-size: .8rem; color: var(--muted); line-height: 1.7; padding-left: .7rem; border-left: 2px solid var(--cat, var(--line)); }
.post-body p > img + em, .post-body p > a > img + em { display: block; margin-top: .4rem; font-size: .8rem; font-style: normal; color: var(--muted); }
.post-body .section-visual, .post-body .section-figure, .post-body .post-figure, .post-body .article-infographic, .post-body .content-image { margin: 2.4rem 0; }

/* 動画 */
.post-body .video-embed, .post-body .video-container, .post-body .video-wrapper, .post-body .hero-video { margin: 2rem 0; }
.post-body .video-container, .post-body .video-wrapper { position: relative; aspect-ratio: 16 / 9; }
.post-body .video-container iframe, .post-body .video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-body iframe { max-width: 100%; }
.post-body video { display: block; width: 100%; height: auto; background: #000; }
.post-body .video-embed > div { border-radius: 0 !important; }

/* コード（highlight.js の github-dark を読み込んだ上で、地の色と枠だけをこの誌面に合わせる） */
.post-body code { font-family: var(--font-mono); font-size: .86em; background: var(--cream); padding: .12em .4em; color: var(--code-ink); }
.post-body a code { color: inherit; }
.post-body pre, .post-body div.highlight { position: relative; }
.post-body pre { margin: 1.8rem 0; padding: 2rem 1.2rem 1.1rem; overflow-x: auto; background: var(--charcoal); color: #eaeaea; font-size: .84em; line-height: 1.7; border-top: 3px solid var(--cat, #444); }
.post-body div.highlight pre, .post-body .highlighter-rouge pre { margin: 0; }
.post-body div.highlighter-rouge { margin: 1.8rem 0; }
.post-body pre code, .post-body pre code.hljs { display: block; background: none; padding: 0; color: inherit; font-size: 1em; overflow-x: visible; }
.post-body pre::before { content: attr(data-lang); position: absolute; top: .55rem; left: 1.2rem; font-family: var(--font-en); font-size: .62rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.code-copy-btn { position: absolute; top: .45rem; right: .5rem; z-index: 1; padding: .25rem .6rem; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); font: 700 .66rem/1.4 var(--font-en); letter-spacing: .1em; cursor: pointer; }
.code-copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.code-copy-btn.copied { border-color: #7ee2a8; color: #7ee2a8; }

/* Mermaid（本文の <div class="mermaid">）。描画前の素のテキストは隠しておく */
.post-body .mermaid { margin: 2.2rem 0; padding: 1.4rem 1rem; background: var(--bg); border: 1px solid var(--line); border-top: 3px solid var(--cat, var(--ink)); text-align: center; overflow-x: auto; }
.post-body .mermaid svg { max-width: 100%; height: auto; }
/* 前もって描いた SVG（docs/_mermaid → _plugins/mermaid_svg.rb）。色は明るい版だけを持つので、ダークでは反転して暗くする */
.post-body .mermaid.is-svg svg { display: block; margin: 0 auto; }
html.dark .post-body .mermaid.is-svg svg { filter: invert(.88) hue-rotate(180deg); }

/* 折りたたみ */
.post-body details { margin: 1.6rem 0; border: 1px solid var(--line); background: var(--bg); }
.post-body details > summary { cursor: pointer; padding: .85rem 1.1rem; font-weight: 800; list-style: none; position: relative; padding-right: 2.4rem; }
.post-body details > summary::-webkit-details-marker { display: none; }
.post-body details > summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-family: var(--font-en); font-weight: 700; font-size: 1.2rem; color: var(--deep, var(--ink)); }
.post-body details[open] > summary::after { content: "−"; }
.post-body details[open] > summary { border-bottom: 1px solid var(--line); }
.post-body details > :not(summary) { margin-left: 1.1rem; margin-right: 1.1rem; }

.post-body .task-list-item { list-style: none; margin-left: -1.3rem; }
.post-body .task-list-item input { margin-right: .5em; accent-color: var(--cat, var(--ink)); }

/* 要点ボックス（新しい記法。シゴトのホント／Cloudory と共通）
   <div class="point" markdown="1"> / <div class="point point--dark" markdown="1"> */
.post-body .point {
  border: 1px solid var(--line); border-top: 3px solid var(--cat, var(--ink));
  padding: 1.3rem 1.5rem; margin: 2.2rem 0; background: var(--bg);
}
.post-body .point > :first-child { margin-top: 0; }
.post-body .point > :last-child { margin-bottom: 0; }
.post-body .point > p:first-child, .post-body .point > strong:first-child { display: block; font-weight: 900; font-size: 1.04em; line-height: 1.5; padding-left: .7rem; border-left: 4px solid var(--cat, var(--ink)); margin-bottom: 1rem; }
.post-body .point ul { list-style: none; padding-left: 0; margin: .6rem 0; }
.post-body .point ul li { position: relative; padding-left: 1.3rem; margin: .5rem 0; }
.post-body .point ul li::before { content: ""; position: absolute; left: .2rem; top: .7em; width: .5rem; height: .5rem; background: var(--cat, var(--ink)); }
.post-body .point ul li.li-dot { padding-left: 0; margin-left: 0; }
.post-body .point ul li.li-dot::before { display: none; }
.post-body .point--dark ul li::before { background: var(--cat, #fff); }
.post-body .point--dark { background: var(--charcoal); color: #fff; border: none; border-top: 3px solid var(--cat, #fff); }
.post-body .point--dark a, .post-body .point--dark strong { color: #fff; }
.post-body .point--dark code { background: rgba(255,255,255,.12); color: #f0d9c4; }

/* マーカーと強調（新しい記法）: <mark> / <mark class="key"> / <mark class="key-warn|key-info|key-good"> */
.post mark { background: linear-gradient(transparent 62%, var(--cat-tint, #f4f3ef) 62%); color: inherit; padding: 0 .08em; }
.post mark.key { background: none; color: var(--deep, var(--ink)); font-weight: 800; }
.post mark.key-warn { background: none; color: var(--warn); font-weight: 800; }
.post mark.key-info { background: none; color: var(--info); font-weight: 800; }
.post mark.key-good { background: none; color: var(--good); font-weight: 800; }
.post-body u { text-decoration-color: var(--cat, var(--ink)); text-decoration-thickness: 1px; text-underline-offset: .15em; }

/* 本文中の関連記事カード: {% include linkcard.html slug="..." %}／記事一覧から自動で挿す「あわせて読みたい」 */
.post-body .linkcard, .post-body .related-inline, .post-body .tool-card {
  display: flex; gap: 1rem; align-items: center; margin: 1.6rem 0;
  border: 1px solid var(--line); border-left: 4px solid var(--cat, var(--ink));
  padding: .9rem 1.1rem; text-decoration: none; color: var(--ink); background: var(--bg); transition: background .18s var(--ease);
}
.post-body .linkcard:hover, .post-body .related-inline:hover, .post-body .tool-card:hover { background: var(--cream); color: var(--ink); }
.post-body .linkcard .thumb { flex: none; width: 150px; aspect-ratio: 1200 / 630; overflow: hidden; }
.post-body .linkcard .thumb img { width: 100%; height: 100%; object-fit: cover; border: none; }
.post-body .linkcard .body, .post-body .related-inline .ri-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }
.post-body .linkcard .eyebrow, .post-body .related-inline .ri-label { font-family: var(--font-en); font-size: .66rem; font-weight: 700; letter-spacing: .14em; color: var(--deep, var(--muted)); }
.post-body .linkcard .ttl, .post-body .related-inline .ri-title, .post-body .tool-card .tc-title { font-weight: 800; font-size: .95rem; line-height: 1.55; }
.post-body .related-inline .ri-desc, .post-body .tool-card .tc-desc { font-size: .8rem; line-height: 1.65; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-body .linkcard time { font-family: var(--font-en); font-size: .74rem; color: var(--muted); }
.post-body .related-inline .ri-arrow, .post-body .tool-card .tc-arrow { flex: none; font-family: var(--font-en); font-size: 1.4rem; color: var(--deep, var(--muted)); }
.post-body .related-inline-group { margin: 2.4rem 0; padding: 1.1rem 1.2rem .4rem; background: var(--cream); }
.post-body .related-inline-group .related-inline { margin: .7rem 0 .8rem; }
.post-body .related-inline-grouplabel { font-family: var(--font-jp); font-weight: 900; font-size: .9rem; }
.post-body .related-inline-grouplabel::before { content: "READ ALSO"; display: block; margin-bottom: .2rem; font-family: var(--font-en); font-size: .64rem; font-weight: 700; letter-spacing: .2em; color: var(--deep, var(--muted)); }

/* --------------------------------------------------------- 本文の装飾（旧記法の受け皿）
   過去記事が使っている class を、この誌面の部品に寄せて表示する。記事本文は書き換えない。
   要点系（point-box・conclusion-box・box-point・tldr・check-box） → 上罫の白箱
   補足系（box-tip・box-info・info-box・box-note・memo-box・callout-info） → 左罫のクリーム箱
   注意系（box-warning・warning-box・box-warn・warn-box・box-danger・callout-warn） → 赤の左罫 */
.post-body :is(.point-box, .conclusion-box, .box-point, .tldr, .check-box, .box-check) {
  margin: 2.2rem 0; padding: 1.3rem 1.5rem; background: var(--bg);
  border: 1px solid var(--line); border-top: 3px solid var(--cat, var(--ink)); line-height: 1.85;
}
.post-body .conclusion-box { background: var(--paper); }
.post-body :is(.box-tip, .box-info, .info-box, .box-note, .memo-box, .callout-info, .box-quote, .quote-box) {
  margin: 1.8rem 0; padding: 1.1rem 1.3rem; background: var(--cream);
  border-left: 4px solid var(--cat, var(--ink)); font-size: .96em; line-height: 1.85;
}
.post-body :is(.box-info, .info-box, .callout-info) { border-left-color: var(--info); background: var(--info-bg); }
.post-body :is(.box-warning, .warning-box, .box-warn, .warn-box, .box-danger, .callout-warn) {
  margin: 1.8rem 0; padding: 1.1rem 1.3rem; background: var(--warn-bg);
  border-left: 4px solid var(--warn); font-size: .96em; line-height: 1.85;
}
.post-body .box-danger { background: var(--danger-bg); }
/* 箱の中の余白・先頭の太字見出し */
.post-body :is(.point-box, .conclusion-box, .box-point, .tldr, .check-box, .box-check, .box-tip, .box-info, .info-box, .box-note, .memo-box, .callout-info, .box-quote, .quote-box, .box-warning, .warning-box, .box-warn, .warn-box, .box-danger, .callout-warn) > :first-child { margin-top: 0; }
.post-body :is(.point-box, .conclusion-box, .box-point, .tldr, .check-box, .box-check, .box-tip, .box-info, .info-box, .box-note, .memo-box, .callout-info, .box-quote, .quote-box, .box-warning, .warning-box, .box-warn, .warn-box, .box-danger, .callout-warn) > :last-child { margin-bottom: 0; }
.post-body :is(.point-box, .conclusion-box, .box-point, .tldr, .check-box, .box-check) > strong:first-child,
.post-body :is(.point-box, .conclusion-box, .box-point, .tldr, .check-box, .box-check) > p:first-child > strong:only-child,
.post-body .point-box-title {
  display: block; margin-bottom: .7rem; padding-left: .7rem; border-left: 4px solid var(--cat, var(--ink));
  font-weight: 900; font-size: 1.04em; line-height: 1.5;
}
.post-body :is(.box-tip, .box-info, .info-box, .box-note, .memo-box, .callout-info, .box-warning, .warning-box, .box-warn, .warn-box, .box-danger, .callout-warn) > strong:first-child { display: inline-block; margin-bottom: .2rem; font-weight: 900; }
.post-body :is(.box-warning, .warning-box, .box-warn, .warn-box, .box-danger, .callout-warn) > strong:first-child { color: var(--warn); }
.post-body :is(.point-box, .conclusion-box, .box-point, .tldr, .box-tip, .box-info, .info-box, .box-note, .box-warning, .warning-box, .box-warn, .box-danger) ul { padding-left: 1.2rem; margin: .6rem 0; }
.post-body :is(.point-box, .conclusion-box, .box-point, .tldr, .box-tip, .box-info, .info-box, .box-note, .box-warning, .warning-box, .box-warn, .box-danger) li { margin: .35rem 0; }

/* マーカー（旧記法）。トピックの色をうすく敷く。色名はおおよその意味で受ける */
.post-body .marker-yellow { background: linear-gradient(transparent 60%, var(--marker-yellow) 60%); font-weight: 700; }
.post-body .marker-green { background: linear-gradient(transparent 60%, rgba(26,127,55,.2) 60%); font-weight: 700; }
.post-body .marker-pink { background: linear-gradient(transparent 60%, rgba(193,39,45,.17) 60%); font-weight: 700; }
.post-body .marker-blue { background: linear-gradient(transparent 60%, rgba(31,111,235,.17) 60%); font-weight: 700; }
.post-body div:is(.marker-yellow, .marker-green, .marker-pink, .marker-blue) {
  display: block; margin: 1.8rem 0; padding: 1.1rem 1.3rem; font-weight: 400; line-height: 1.85;
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid #e0b400;
}
.post-body div.marker-green { border-left-color: var(--good); }
.post-body div.marker-pink { border-left-color: var(--warn); }
.post-body div.marker-blue { border-left-color: var(--info); }
.post-body div:is(.marker-yellow, .marker-green, .marker-pink, .marker-blue) > strong:first-child { display: block; margin-bottom: .4rem; font-weight: 900; }
.post-body .marker-under { text-decoration: underline; text-decoration-color: var(--cat, var(--ink)); text-decoration-thickness: 2px; text-underline-offset: .2em; }

/* 出典・典拠 */
.post-body :is(.references, .references-aside, .references-note) {
  margin: 2.2rem 0 !important; padding: 1.1rem 1.3rem !important; background: var(--cream) !important;
  border: 0 !important; border-top: 3px solid var(--ink) !important; border-radius: 0 !important; font-size: .86em; line-height: 1.8;
}
.post-body :is(.references, .references-aside) ul { padding-left: 1.1rem; margin: .5rem 0 0; }
.post-body :is(.references, .references-aside) li { margin: .3rem 0; word-break: break-all; }
.post-body h2[id*="参照"] + ul, .post-body h2[id*="参考"] + ul, .post-body h2[id*="出典"] + ul, .post-body h2[id^="sources"] + ul { font-size: .86em; color: var(--sub); }
.post-body h2[id*="参照"] + ul li, .post-body h2[id*="参考"] + ul li, .post-body h2[id*="出典"] + ul li { word-break: break-all; }

/* ランキング・手順・ターミナル・折りたたみ箱（旧記法） */
.post-body .rank-list { list-style: none; padding: 0; }
.post-body .rank-item { display: flex; gap: 1rem; margin: 1rem 0; padding: 1rem 1.2rem; border: 1px solid var(--line); border-top: 3px solid var(--cat, var(--ink)); }
.post-body .rank-item__rank { flex: none; display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .4rem; background: var(--band); color: #fff; font-family: var(--font-en); font-weight: 800; }
.post-body .rank-item__body { flex: 1; min-width: 0; }
.post-body .rank-item__title { font-weight: 900; }
.post-body .rank-item__meta { display: flex; flex-wrap: wrap; gap: .3rem; margin: .35rem 0; font-size: .74rem; color: var(--sub); }
.post-body .rank-badge { display: inline-block; padding: .05rem .5rem; border: 1px solid var(--line); background: var(--paper); font-weight: 700; }
.post-body .rank-item__score { font-family: var(--font-en); font-weight: 700; color: var(--deep, var(--ink)); }
.post-body .rank-item__verdict { margin-top: .4rem; font-size: .9rem; }
.post-body :is(.steps, .flow-steps) { counter-reset: st; list-style: none; padding-left: 0; }
.post-body :is(.steps, .flow-steps) > li { counter-increment: st; position: relative; padding: .2rem 0 .8rem 2.8rem; margin: 0; }
.post-body :is(.steps, .flow-steps) > li::before { content: counter(st, decimal-leading-zero); position: absolute; left: 0; top: .2rem; font-family: var(--font-en); font-weight: 800; color: var(--deep, var(--ink)); }
.post-body .terminal { margin: 1.8rem 0; background: var(--charcoal); color: #eaeaea; font-family: var(--font-mono); font-size: .84em; line-height: 1.7; padding: 1.1rem 1.2rem; overflow-x: auto; }
.post-body .terminal__cmd { color: #fff; }
.post-body .terminal__out { color: #c9c9c9; }
.post-body .terminal__muted { color: #8d8d8d; }
.post-body .details-box { margin: 1.6rem 0; border: 1px solid var(--line); }
.post-body .details-box__body { padding: 1rem 1.2rem; }
.post-body .editor { font-weight: 700; }

/* --------------------------------------------------------- 記事末尾 */
.post-section { margin-top: 3.4rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.post-section .mag-head .en { color: var(--deep, var(--ink)); }
.post-section .mag-head .ja { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.6rem); }

.post-faq dl { margin: 0; }
.post-faq dt, .post-faq dd { display: flex; gap: .9rem; margin: 0; }
.post-faq dt { font-weight: 800; font-size: 1.02rem; line-height: 1.6; color: var(--ink); padding-top: 1.4rem; }
.post-faq dd { padding: .7rem 0 1.4rem; border-bottom: 1px solid var(--line); line-height: 1.85; font-size: .96rem; }
.post-faq dd > div { min-width: 0; }
.post-faq dd p { margin: 0 0 .6rem; }
.post-faq dd p:last-child { margin-bottom: 0; }
.post-faq dt::before, .post-faq dd::before { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-family: var(--font-en); font-weight: 700; font-size: .88rem; border-radius: 50%; }
.post-faq dt::before { content: "Q"; color: #fff; background: var(--band); }
.post-faq dd::before { content: "A"; color: var(--deep, var(--ink)); border: 1px solid currentColor; }

/* 記事の「AIに相談する」 */
.ask-ai { margin: 3rem 0 2.5rem; border: 1px solid var(--rule2); background: var(--bg); }
.ask-ai[hidden] { display: none; }
.ask-ai-head { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem 1.1rem; padding: 1.15rem 1.4rem; background: var(--charcoal); color: #fff; }
.ask-ai-head .en { font-family: var(--font-en); font-weight: 700; font-size: .78rem; letter-spacing: .26em; opacity: .75; }
.ask-ai-head .ja { font-family: var(--font-jp); font-weight: 900; font-size: 1.1rem; letter-spacing: .04em; }
.ask-ai-body { padding: 1.3rem 1.4rem 1.4rem; }
.ask-ai-lede { margin: 0 0 1.1rem; color: var(--sub); font-size: .88rem; line-height: 1.9; }
.ask-ai-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.ask-chip { border: 1px solid var(--rule2); background: var(--bg); color: var(--ink); cursor: pointer; font-family: var(--font-jp); font-weight: 800; font-size: .84rem; padding: .65rem .95rem; text-align: left; transition: border-color .2s, color .2s, background .2s, transform .15s var(--ease-out); }
.ask-chip:hover { border-color: var(--ink); }
.ask-chip:active { transform: scale(.97); }
.ask-chip.is-accent { color: var(--deep, var(--ink)); border-color: currentColor; }
.ask-chip[aria-pressed="true"] { background: var(--solid); border-color: var(--solid); color: #fff; }
.ask-ai-input { display: block; width: 100%; min-height: 6.5rem; resize: vertical; margin-bottom: 1rem; padding: .9rem 1rem; border: 1px solid var(--rule2); border-radius: 0; background: var(--bg); font: inherit; font-size: 1rem; line-height: 1.8; color: var(--ink); }
.ask-ai-input:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(16,16,16,.06); }
.ask-ai-go { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.ask-btn { display: flex; align-items: center; min-height: 3.4rem; padding: .8rem 1rem; border: 1px solid var(--rule2); color: var(--ink); text-decoration: none; font-family: var(--font-jp); font-weight: 900; font-size: .92rem; line-height: 1.45; transition: border-color .2s, background .2s, transform .15s var(--ease-out); }
.ask-btn:hover { border-color: var(--ink); color: var(--ink); }
.ask-btn:active { transform: scale(.97); }
.ask-btn.is-primary { background: var(--band); border-color: transparent; color: #fff; }
.ask-btn.is-primary:hover { color: #fff; filter: brightness(1.1); }
.ask-copy { margin: 1rem 0 0; padding: 0 0 .15rem; border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--sub); font: inherit; font-size: .86rem; cursor: pointer; }
.ask-copy:hover { color: var(--ink); }
.ask-ai-status { min-height: 1.2em; margin: .5rem 0 0; font-size: .82rem; font-weight: 700; color: var(--good); }
.ask-ai-note { margin: .4rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.85; }

/* GitHub・公式リンク（OSS 記事） */
.post-links { display: flex; flex-wrap: wrap; gap: .6rem; margin: 2.6rem 0 0; }
.post-link-btn { display: inline-flex; align-items: center; gap: .55rem; padding: .85rem 1.3rem; border: 2px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 900; font-size: .9rem; transition: background .2s, color .2s; }
.post-link-btn svg { width: 18px; height: 18px; fill: currentColor; }
.post-link-btn.primary { background: var(--solid); color: #fff; }
.post-link-btn:hover { background: var(--band); border-color: var(--band); color: #fff; }

/* 次に読む（同じトピックの1本） */
.next-read { display: flex; align-items: center; gap: 1.2rem; margin: 2.6rem 0 0; padding: 1.4rem 1.5rem; background: var(--charcoal); color: #fff; text-decoration: none; transition: background .2s; }
.next-read:hover { color: #fff; background: #000; }
.next-read .lab { display: block; margin-bottom: .35rem; font-family: var(--font-en); font-weight: 800; font-size: .7rem; letter-spacing: .24em; color: rgba(255,255,255,.6); }
.next-read .ttl { display: block; font-family: var(--font-display); font-weight: 900; font-size: 1.08rem; line-height: 1.55; }
.next-read .arr { flex: none; margin-left: auto; font-family: var(--font-en); font-size: 1.6rem; transition: transform .25s var(--ease-out); }
.next-read:hover .arr { transform: translateX(4px); }

/* 前後の記事 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 2.6rem 0 0; background: var(--line); border: 1px solid var(--line); }
.post-nav a, .post-nav span { display: block; padding: 1rem 1.1rem; background: var(--bg); color: var(--ink); text-decoration: none; font-size: .84rem; font-weight: 700; line-height: 1.6; }
.post-nav a small { display: block; margin-bottom: .25rem; font-family: var(--font-en); font-size: .66rem; letter-spacing: .18em; color: var(--muted); }
.post-nav a:last-child { text-align: right; }
.post-nav a:hover { background: var(--cream); }

/* 編集部ボックス（著者・編集方針） */
.author-box { border-top: 3px solid var(--ink); margin-top: 3.4rem; padding-top: 1.25rem; font-size: .88rem; color: var(--sub); line-height: 1.9; }
.author-box p { margin: 0 0 .5rem; }
.author-box-label { font-family: var(--font-en); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.author-box-name { font-family: var(--font-jp); font-weight: 900; font-size: 1.05rem; color: var(--ink); }
.author-box-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: .9rem 0 1rem; padding: 0; list-style: none; background: var(--line); border: 1px solid var(--line); }
.author-box-checks li { background: var(--bg); padding: .75rem .85rem; font-size: .78rem; line-height: 1.6; }
.author-box-checks b { display: block; color: var(--ink); font-size: .84rem; }
.author-box-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: .75rem; }
.author-box-links a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* トピックへの導線 */
.topic-link { display: flex; align-items: center; gap: 1rem; margin: 2rem 0 0; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-left: 4px solid var(--cat, var(--ink)); text-decoration: none; color: var(--ink); }
.topic-link:hover { background: var(--cream); color: var(--ink); }
.topic-link .en { display: block; font-family: var(--font-en); font-weight: 700; font-size: .68rem; letter-spacing: .18em; color: var(--deep); }
.topic-link .ttl { display: block; font-weight: 900; font-size: .98rem; }
.topic-link .desc { display: block; font-size: .8rem; color: var(--sub); line-height: 1.65; margin-top: .15rem; }
.topic-link .arr { flex: none; margin-left: auto; font-family: var(--font-en); font-size: 1.3rem; color: var(--deep); }

/* --------------------------------------------------------- 広告・内部リンク枠・PR（_includes/ad-unit.html ほか） */
.post-ad { margin: 2.4rem 0; padding: .8rem .9rem 1rem; border: 1px solid var(--line); background: var(--bg); text-align: center; }
.post-ad__label { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; font-size: .7rem; color: var(--muted); }
.post-ad__label-tag { font-family: var(--font-en); font-weight: 800; letter-spacing: .14em; padding: .05rem .45rem; border: 1px solid var(--rule); color: var(--sub); }
.post-ad__label-link { color: var(--muted); }
.post-ad__creative a { display: inline-block; max-width: 100%; }
.post-ad__creative img { max-width: 100%; height: auto; border-radius: 0 !important; }
.post-ad__creative a[style*="background"] { border-radius: 0 !important; background: var(--solid) !important; }
ins.adsbygoogle { display: block; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
/* creative が描画される前から高さを予約して CLS を 0 にする（top/mid は A8 の 300x250、bottom は記事末テキスト CTA の実測高）。
   content-visibility:auto は使わない（contain-intrinsic-size 無しだと画面外で高さ 0 に畳み、入ったときに逆に動く） */
.post-ad--top .post-ad__creative, .post-ad--mid .post-ad__creative { min-height: 250px; display: flex; align-items: center; justify-content: center; }
.post-ad--bottom .post-ad__creative { min-height: 132px; }
@media (max-width: 639px) {
  .post-ad--top .post-ad__creative, .post-ad--mid .post-ad__creative { min-height: clamp(210px, 78vw, 250px); }
}
/* 画面に近づくまでの mid のプレースホルダ: 高さだけ確保し、枠線・背景は出さない（空の四角い枠に見せない） */
.post-ad--pending { border-color: transparent; background: transparent; }
.post-ad--mid.post-ad--pending .post-ad__creative { min-height: 250px; }
/* AdSense 手動 In-article 枠: 上の flex 中央寄せを打ち消す。flex アイテムの <ins> は幅 0 に解決されうるが、
   AdSense は枠の幅から広告サイズを決めるので、幅 0 だと配信されない */
.post-ad--adsense .post-ad__creative { display: block; min-height: 0; line-height: normal; }
@media (max-width: 639px) { .post-ad--top.post-ad--adsense .post-ad__creative { min-height: 0; } }
.post-house { margin: 2.2rem 0; padding: 1.1rem 1.2rem .6rem; background: var(--cream); }
.post-house__label { font-family: var(--font-jp); font-weight: 900; font-size: .9rem; margin-bottom: .4rem; }
.post-house__label::before { content: "READ ALSO"; display: block; margin-bottom: .2rem; font-family: var(--font-en); font-size: .64rem; font-weight: 700; letter-spacing: .2em; color: var(--deep, var(--muted)); }
.post-house__list { list-style: none; margin: 0; padding: 0; }
.post-house__item { border-top: 1px solid var(--rule); }
.post-house__link { display: flex; align-items: baseline; gap: .7rem; padding: .7rem .1rem; text-decoration: none; color: var(--ink); }
.post-house__link:hover .post-house__title { text-decoration: underline; text-underline-offset: .2em; }
.post-house__kicker { flex: none; font-size: .66rem; font-weight: 800; color: var(--deep, var(--ink)); border: 1px solid currentColor; padding: .05rem .4rem; }
.post-house__title { font-weight: 700; font-size: .9rem; line-height: 1.55; }
.post-house__foot { border-top: 1px solid var(--rule); }
.post-house__x { display: inline-block; margin: .6rem 0 .5rem; font-size: .8rem; color: var(--sub); }
.post-house__kicker--pillar { background: var(--band); border-color: var(--band); color: #fff; }

.post-commercial-cta { display: flex; align-items: center; gap: 1rem; margin: 2.4rem 0; padding: 1.2rem 1.4rem; border: 2px solid var(--ink); text-decoration: none; color: var(--ink); }
.post-commercial-cta:hover { background: var(--solid); color: #fff; }
.post-commercial-cta-emoji { display: none; }
.post-commercial-cta-body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.post-commercial-cta-label { font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.post-commercial-cta:hover .post-commercial-cta-label, .post-commercial-cta:hover .post-commercial-cta-desc { color: rgba(255,255,255,.75); }
.post-commercial-cta-title { font-family: var(--font-display); font-weight: 900; font-size: 1.05rem; line-height: 1.5; }
.post-commercial-cta-desc { font-size: .82rem; color: var(--sub); line-height: 1.6; }
.post-commercial-cta-arrow { flex: none; margin-left: auto; font-family: var(--font-en); font-size: 1.5rem; }

.aff-reco { margin: 2.6rem 0 0; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.aff-reco-head { display: flex; align-items: baseline; gap: .7rem; }
.aff-reco-title { font-family: var(--font-jp); font-weight: 900; font-size: 1rem; }
.aff-reco-prtag, .aff-pr { font-family: var(--font-en); font-size: .64rem; font-weight: 800; letter-spacing: .1em; padding: .05rem .4rem; border: 1px solid var(--rule); color: var(--sub); }
.aff-reco-disclosure { margin: .4rem 0 1rem; font-size: .76rem; color: var(--muted); line-height: 1.7; }
.aff-reco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.aff-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; background: var(--bg); color: var(--ink); text-decoration: none; }
.aff-card:hover { background: var(--cream); color: var(--ink); }
.aff-card-cat { font-size: .68rem; font-weight: 800; color: var(--deep, var(--muted)); }
.aff-card-name { font-weight: 900; font-size: .95rem; }
.aff-card-desc { font-size: .8rem; color: var(--sub); line-height: 1.65; }
.aff-card-go { margin-top: auto; font-family: var(--font-en); font-size: .74rem; font-weight: 700; color: var(--muted); }
.aff-sponsor { margin-top: 1rem; text-align: center; }
.aff-sponsor-label { display: block; margin-bottom: .4rem; font-size: .7rem; color: var(--muted); }

/* 追従の PR レール（_includes/sticky-ad.html + assets/js/sticky-ad.js）。SP は下部ナビの上に浮かせ、PC は右の余白に置く */
.sticky-ad { display: none; position: fixed; z-index: 28; box-sizing: border-box; background: var(--bg); border: 1px solid var(--line); border-top: 3px solid var(--ink); box-shadow: 0 10px 30px -12px rgba(0,0,0,.3); opacity: 0; visibility: hidden; transition: opacity .25s ease, transform .25s ease; }
.sticky-ad[hidden] { display: none !important; }
.sticky-ad.is-visible { opacity: 1; visibility: visible; }
.sticky-ad__close { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--cream); color: var(--ink); font-size: 15px; line-height: 26px; text-align: center; cursor: pointer; padding: 0; }
.sticky-ad__label { font-family: var(--font-en); font-weight: 800; font-size: .62rem; letter-spacing: .14em; padding: .05rem .4rem; border: 1px solid var(--rule); color: var(--sub); }
.sticky-ad__cta p { margin: 0; }
.sticky-ad__cta-title { font-size: .8rem; font-weight: 800; line-height: 1.5; color: var(--ink); }
.sticky-ad__cta-btn { display: inline-block; padding: .55rem 1rem; background: var(--solid); color: #fff; font-size: .78rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.sticky-ad__cta-btn:hover { color: #fff; background: #000; }
@media (max-width: 1023px) {
  .sticky-ad { display: block; left: 12px; right: 12px; bottom: calc(var(--dock-h) + 20px + var(--anchor-ad) + env(safe-area-inset-bottom)); padding: .7rem 2.4rem .7rem .9rem; transform: translateY(12px); }
  .sticky-ad.is-visible { transform: none; }
  .sticky-ad__cta { display: flex; align-items: center; gap: .7rem; }
  .sticky-ad__cta-title { flex: 1; font-size: .74rem; }
  .sticky-ad__label { display: none; }
  body.has-sticky-ad { padding-bottom: 76px; }
}
@media (min-width: 1581px) {
  .sticky-ad { display: block; right: 20px; bottom: 96px; width: 280px; max-width: calc((100vw - 1160px) / 2 - 24px); padding: 1rem 1rem 1.1rem; transform: translateY(12px); }
  .sticky-ad.is-visible { transform: none; }
  .sticky-ad__cta { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
}

/* --------------------------------------------------------- 静的ページ（about・privacy・contact） */
.page-body { font-size: 16px; line-height: 1.95; }
.page-body h1 { margin: 0 0 1.4rem; }
.page-body h2 { position: relative; padding-top: 1rem; border-top: 3px solid var(--ink); }
.page-body h2::before { content: ""; position: absolute; left: 0; top: -3px; width: 3.5rem; height: 3px; background: var(--cat, var(--cat-ai-agent)); }
.page-body h3 { padding-left: .7rem; border-left: 4px solid var(--ink); }
.page-body table { border-collapse: collapse; width: 100%; font-size: .9em; margin: 1.6rem 0; }
.page-body th, .page-body td { border: 1px solid var(--line); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.page-body th { background: var(--cream); }
.page-body blockquote { background: var(--cream); border-left: 4px solid var(--ink); margin: 1.6rem 0; padding: 1rem 1.2rem; }
.page-body code { font-family: var(--font-mono); font-size: .86em; background: var(--cream); padding: .1em .4em; }
.page-body .point, .page-body .box-tip, .page-body .box-info { margin: 1.8rem 0; padding: 1.2rem 1.4rem; background: var(--cream); border-left: 4px solid var(--ink); }
.page-lede { color: var(--sub); font-size: 1rem; line-height: 1.95; }
.form-row { display: flex; flex-direction: column; gap: .4rem; margin: 1rem 0; }
.form-row label { font-weight: 800; font-size: .88rem; }
.form-row input, .form-row textarea, .form-row select { font: inherit; font-size: 1rem; padding: .7rem .8rem; border: 1px solid var(--rule2); border-radius: 0; background: var(--bg); }
.form-row input:focus, .form-row textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(16,16,16,.06); }
.btn-ink { display: inline-block; padding: .85rem 1.6rem; border: 2px solid var(--solid); background: var(--solid); color: #fff; font: 900 .95rem/1 var(--font-jp); text-decoration: none; cursor: pointer; }
.btn-ink:hover { background: #000; color: #fff; }

/* 404 */
.notfound { padding: 3rem 0 2rem; }
.notfound .code { font-family: var(--font-en); font-weight: 800; font-size: clamp(4rem, 2rem + 10vw, 9rem); line-height: .9; letter-spacing: -.03em; margin: 0; }

/* --------------------------------------------------------- フッター（暗色帯） */
.site-footer { background: var(--footer); color: rgba(255,255,255,.7); margin-top: 4rem; padding: 3rem 1.25rem calc(3.6rem + var(--dock-h) + env(safe-area-inset-bottom)); font-size: .84rem; line-height: 2; }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); }
.site-footer .mag-head { margin-bottom: .6rem; }
.site-footer .mag-head .en { color: #fff; font-size: 1.1rem; letter-spacing: .06em; }
.site-footer .mag-head .ja { color: rgba(255,255,255,.75); font-family: var(--font-jp); font-size: .82rem; font-weight: 700; letter-spacing: .06em; }
.site-footer .desc { margin: 0; font-size: .8rem; line-height: 1.9; color: rgba(255,255,255,.6); }
.site-footer h2 { margin: 0 0 .5rem; color: #fff; font-family: var(--font-en); font-size: .72rem; letter-spacing: .22em; font-weight: 700; text-transform: uppercase; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .copy { max-width: var(--maxw); margin: 2.2rem auto 0; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.12); font-family: var(--font-en); font-size: .74rem; color: rgba(255,255,255,.5); }
@media (max-width: 760px) { .site-footer .inner { grid-template-columns: 1fr 1fr; } .site-footer .inner > :first-child { grid-column: 1 / -1; } }

/* --------------------------------------------------------- 下部ナビ（すりガラスの浮いたバー） */
.dock {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + var(--anchor-ad) + env(safe-area-inset-bottom));
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: var(--dock-h); padding: 5px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.66), rgba(255,255,255,.5));
  -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -1px 0 rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.06), 0 12px 32px -10px rgba(0,0,0,.28);
  animation: dock-in .6s var(--ease-out) .15s backwards; transition: bottom .25s var(--ease-out);
}
@keyframes dock-in { from { transform: translateY(calc(100% + 24px)); opacity: 0; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .dock { background: rgba(255,255,255,.94); } }
@media (prefers-reduced-transparency: reduce) { .dock { background: rgba(255,255,255,.96); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.dock-item {
  position: relative; z-index: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: 999px; background: none; color: var(--dock-ink); text-decoration: none; cursor: pointer;
  font-family: var(--font-jp); font-size: .62rem; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
  text-shadow: 0 0 6px rgba(255,255,255,.7); -webkit-tap-highlight-color: transparent; transition: color .2s, transform .2s var(--ease-out);
}
.dock-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock-item:hover { color: var(--ink); }
.dock-item:active { transform: scale(.9); }
.dock-item::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: rgba(255,255,255,.72); box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 2px 8px -2px rgba(0,0,0,.18); opacity: 0; transform: scale(.85); transition: opacity .25s, transform .3s var(--ease-out); }
.dock-item.is-current, .dock-item[aria-expanded="true"] { color: var(--deep, var(--ink)); }
.dock-item.is-current::after, .dock-item[aria-expanded="true"]::after { opacity: 1; transform: none; }
.dock-item.is-current svg { stroke-width: 2; }
.dock-item:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.dock-badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; background: var(--cat-security); color: #fff; font: 700 .6rem/1 var(--font-en); animation: pop .35s var(--ease-out); }
.dock-badge[hidden] { display: none; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.dock-ico { position: relative; display: grid; place-items: center; width: 23px; height: 23px; }
.dock-ico > svg { position: relative; z-index: 1; width: 17px; height: 17px; }
.dock-ring { position: absolute; left: 50%; top: 50%; width: 29px; height: 29px; transform: translate(-50%, -50%) rotate(-90deg); }
.dock-ring svg { display: block; width: 29px; height: 29px; }
.dock-ring circle { fill: none; stroke-width: 2.4; }
.dock-ring .track { stroke: var(--line); }
.dock-ring .bar { stroke: var(--deep, var(--ink)); stroke-linecap: round; transition: stroke-dashoffset .15s linear; }
.read-progress { position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: 3px; background: var(--band); transform: scaleX(0); transform-origin: 0 50%; }
@media (min-width: 1001px) {
  .dock { left: 50%; right: auto; width: 520px; transform: translateX(-50%); bottom: calc(16px + var(--anchor-ad)); }
  @keyframes dock-in { from { transform: translate(-50%, calc(100% + 24px)); opacity: 0; } }
}

/* --------------------------------------------------------- サイト内検索の画面 */
.search-ov { position: fixed; inset: 0; z-index: 50; background: rgba(16,16,16,.4); opacity: 0; transition: opacity .2s var(--ease); }
.search-ov[hidden] { display: none; }
.search-ov.is-open { opacity: 1; }
.search-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); transform: translateY(14px); transition: transform .28s var(--ease-out); }
.search-ov.is-open .search-panel { transform: none; }
body.search-open { overflow: hidden; }
.search-top { flex: none; display: flex; align-items: center; gap: .7rem; padding: calc(.8rem + env(safe-area-inset-top)) 1rem .8rem; border-bottom: 1px solid var(--line); }
.search-back { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.search-back svg, .search-field svg, .search-clear svg, .search-row svg, .search-pill svg, .search-del svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-back svg { width: 22px; height: 22px; }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: .6rem; height: 48px; padding: 0 .5rem 0 1rem; border: 1px solid var(--rule2); border-radius: 999px; background: var(--paper); }
.search-field:focus-within { border-color: var(--ink); background: var(--bg); }
.search-field > svg { flex: none; width: 20px; height: 20px; color: var(--sub); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field input::placeholder { color: var(--muted); }
.search-clear { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--muted); color: #fff; cursor: pointer; }
.search-clear[hidden] { display: none; }
.search-clear svg { width: 16px; height: 16px; stroke-width: 2.6; }
.search-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1.1rem 1rem calc(2rem + env(safe-area-inset-bottom)); }
.search-idle[hidden], .search-sugg[hidden], .search-hist[hidden] { display: none; }
.search-entry { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: 1.6rem; }
.search-pill { display: flex; align-items: center; justify-content: center; gap: .55rem; height: 52px; border-radius: 999px; border: 0; background: var(--cream); color: var(--ink); text-decoration: none; cursor: pointer; font-family: var(--font-jp); font-weight: 800; font-size: .9rem; }
.search-pill:hover { background: var(--beige); color: var(--ink); }
.search-pill svg { width: 20px; height: 20px; }
.search-h { margin: 0 0 .8rem; font-family: var(--font-jp); font-weight: 900; font-size: 1rem; color: var(--sub); }
.search-h-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 1.8rem; }
.search-hist-clear { border: 0; background: none; color: var(--sub); font: inherit; font-size: .82rem; text-decoration: underline; cursor: pointer; }
.search-pop { display: flex; flex-wrap: wrap; gap: .5rem; }
.search-chip { border: 1px solid var(--rule2); border-radius: 999px; background: var(--bg); color: var(--ink); cursor: pointer; padding: .5rem 1rem; font-family: var(--font-jp); font-weight: 700; font-size: .86rem; text-decoration: none; }
.search-chip:hover { border-color: var(--ink); color: var(--ink); }
.search-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-bottom: 1.6rem; }
.search-topic { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .8rem; border-left: 4px solid var(--cat); background: var(--paper); text-decoration: none; color: var(--ink); }
.search-topic:hover { background: var(--cream); color: var(--ink); }
.search-topic b { font-size: .86rem; }
.search-topic small { font-family: var(--font-en); font-size: .7rem; color: var(--muted); }
.search-rows { list-style: none; margin: 0; padding: 0; }
.search-rows li { display: flex; align-items: center; border-top: 1px solid var(--line); }
.search-rows li:last-child { border-bottom: 1px solid var(--line); }
.search-sugg li:first-child { border-top: 0; }
.search-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: .9rem; padding: .75rem 0; min-height: 64px; border: 0; background: none; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; font: inherit; }
.search-row:hover { color: var(--ink); background: var(--stripe); }
.search-row .ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--cream); color: var(--sub); }
.search-row .ico svg { width: 21px; height: 21px; }
.search-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.search-row .m { font-weight: 700; font-size: .95rem; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-row .s { font-size: .76rem; color: #8a8a8a; }
.search-row .end { flex: none; color: var(--muted); padding-right: .2rem; }
.search-row .end svg { width: 22px; height: 22px; }
.search-del { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: #8a8a8a; cursor: pointer; }
.search-del svg { width: 18px; height: 18px; }
.search-hist .search-row .end { display: none; }
@media (min-width: 761px) {
  .search-panel { inset: 7vh auto auto 50%; width: 660px; max-height: 82vh; transform: translate(-50%, 14px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
  .search-ov.is-open .search-panel { transform: translate(-50%, 0); }
  .search-top { padding-top: .9rem; }
}

/* --------------------------------------------------------- シート（保存した記事・目次） */
.sheet[hidden], .sheet-backdrop[hidden] { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(16,16,16,.38); opacity: 0; transition: opacity .25s var(--ease); }
.sheet-backdrop.is-open { opacity: 1; }
.sheet { position: fixed; z-index: 36; left: 50%; bottom: 0; width: min(100%, 640px); max-height: 78vh; display: flex; flex-direction: column; padding: .6rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom)); background: var(--bg); border-radius: 14px 14px 0 0; box-shadow: 0 -20px 50px -20px rgba(0,0,0,.35); transform: translate(-50%, 104%); transition: transform .32s var(--ease-out); }
.sheet.is-open { transform: translate(-50%, 0); }
.sheet-grip { width: 42px; height: 5px; margin: 0 auto .6rem; border-radius: 99px; background: var(--line); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sheet-head .mag-head { margin: .2rem 0 .6rem; }
.sheet-head .mag-head .ja { font-size: 1.15rem; }
.sheet-close { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; background: var(--cream); color: var(--ink); font-size: 1.2rem; line-height: 1; }
.sheet-list, .sheet-toc { overflow-y: auto; overscroll-behavior: contain; }
.sheet-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.sheet-toc li { counter-increment: toc; border-top: 1px solid var(--line); }
.sheet-toc a { display: flex; gap: .8rem; padding: .85rem .1rem; text-decoration: none; color: var(--ink); font-weight: 700; line-height: 1.5; font-size: .94rem; }
.sheet-toc a::before { content: counter(toc, decimal-leading-zero); flex: none; font-family: var(--font-en); color: var(--deep, var(--muted)); }
.sheet-empty { color: var(--muted); font-size: .88rem; line-height: 1.8; margin: .4rem 0 0; }
.sheet-empty[hidden] { display: none; }
body.sheet-open { overflow: hidden; }

/* --------------------------------------------------------- スクロールで出す（site.js の REVEAL と同じ一覧にする） */
.motion .action-tile:not(.is-in),
.motion .hub-card:not(.is-in),
.motion .article-card:not(.is-in),
.motion .job-section .section-top:not(.is-in),
.motion .hero-stats .stat:not(.is-in),
.motion .num-card:not(.is-in),
.motion .post-body > h2:not(.is-in),
.motion .post-body > figure:not(.is-in),
.motion .post-faq:not(.is-in),
.motion .author-box:not(.is-in) { opacity: 0; transform: translateY(22px); }
.motion .is-in { animation: reveal .7s var(--ease-out) var(--d, 0ms) backwards; }
@keyframes reveal { from { opacity: 0; transform: var(--reveal-from, translateY(22px)); } }
.post-body > h2 { --reveal-from: translateX(-16px); }
.post-body > figure { --reveal-from: scale(.97); }
.motion .post-body > h2:not(.is-in) { transform: translateX(-16px); }
.motion .post-body > figure:not(.is-in) { transform: scale(.97); }
.motion .post-body > h2::before { transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease-out) .15s; }
.motion .post-body > h2.is-in::before { transform: none; }

/* --------------------------------------------------------- 品質フロア */
:where(a, button, .hub-card, .article-card):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .marquee-track { animation: none; }
  @view-transition { navigation: none; }
}
@media print {
  .masthead-wrap, .dock, .sheet, .sheet-backdrop, .search-ov, .post-aside, .post-popular, .post-ad, .post-house, .sticky-ad, .ask-ai, .site-footer, .read-progress { display: none !important; }
  .post-layout { display: block; }
}

@media (max-width: 640px) {
  main, main.wide { padding: 1.6rem 1.1rem 3.5rem; }
  main.home { padding-top: .75rem; }
  .site-header { height: 54px; }
  .site-header .brand .en { font-size: 1.1rem; }
  .site-header .brand .ja { display: none; }
  .hero { padding: .45rem 0 .9rem; }
  .hero .mag-head { margin-bottom: 1rem; }
  .hero-title { font-size: 1.7rem; line-height: 1.32; margin-bottom: .6rem; }
  .hero .lede { font-size: .86rem; line-height: 1.7; }
  .hero-stats { margin-top: 1.2rem; }
  .action-bar { grid-template-columns: 1fr; gap: .45rem; margin: .8rem 0 1.25rem; }
  .action-tile { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: .1rem .7rem; padding: .62rem 1.05rem; }
  .action-tile .num { grid-column: 1; grid-row: 1; }
  .action-tile strong { grid-column: 2; grid-row: 1; font-size: 1.05rem; }
  .action-tile .desc { grid-column: 2; grid-row: 2; font-size: .75rem; line-height: 1.4; }
  .hub-cards { grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1.4rem 0 2.4rem; }
  .hub-card { min-height: 112px; padding: 1rem .95rem .95rem; gap: .25rem; }
  .hub-card::before { font-size: 2.1rem; left: .8rem; top: .6rem; }
  .hub-card strong { font-size: 1rem; }
  .hub-card .desc { display: none; }
  .hub-card .en { font-size: .62rem; }
  .hero-stats { gap: .8rem 1.4rem; }
  .hero-stats dd { font-size: 1.7rem; }
  body.nav-open .nav-cats { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  body.nav-open .nav-cat { min-height: 96px; padding: .9rem .9rem 1rem; }
  .hub-masthead { padding: .75rem 0 1.2rem; }
  .num-card { padding: 1.3rem 1.2rem 1.2rem; }
  .post-body { font-size: 16px; line-height: 1.85; }
  .post-body h2 { margin-top: 2.8rem; }
  .post-toc { margin: 0 -1.1rem; padding: 1.2rem 1.1rem 1.3rem; }
  .post-body table { display: block; width: max-content; min-width: 100%; max-width: 100%; overflow-x: auto; }
  .post-body pre { margin-left: -1.1rem; margin-right: -1.1rem; }
  .post-body div.highlighter-rouge { margin-left: -1.1rem; margin-right: -1.1rem; }  /* div だけ（同じクラスの本文中の `code` に当てると前後の文字に被さる） */
  .post-body div.highlighter-rouge pre { margin: 0; }
  .post-body figure.section-visual, .post-body .mermaid { margin-left: -1.1rem; margin-right: -1.1rem; }
  .post-body figure.section-visual img { border-left: none; border-right: none; }
  .post-body figure.section-visual figcaption { margin-left: 1.1rem; margin-right: 1.1rem; }
  .post-body .linkcard { flex-direction: column; align-items: stretch; gap: .8rem; }
  .post-body .linkcard .thumb { width: 100%; }
  .ask-ai-go { grid-template-columns: 1fr; }
  .author-box-checks { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a:last-child { text-align: left; }
  .row-list a { grid-template-columns: 1fr; }
  .row-list .desc { grid-column: 1; }
}

/* ==========================================================================
   動く図解（姉妹サイト Cloudory から移植。2026-10）: _includes/mfig.html（_plugins/motion_figures.rb が記事の図の画像を差し替える）
   シーンは docs/_figures/<slug>.json、画像は tools/visual/figure_builder.mjs が同じシーンから作る。
   色は図の中だけのトークン（--mf-*・--fill）で持ち、ダークモードはトークンだけを差し替える（下の html.dark .mfig）。
     --deep … 文字・罫のトピック色（ダークでは持ち上げた色）  --fill … 白い文字を載せる面（ダークでは沈めた色）
   ========================================================================== */
/* ---------------------------------------------------------
   枠: 上にトピックの色の帯 → 小見出し → 太字の見出し → 図 → 区切り線 → 灰色の説明。
   動き: 図が見えたとき（.mfig.is-in）に、中の要素が順に出る。動きを減らす設定・JS 無しでは最初から完成形。
   出す前の状態は「.motion .mfig:not(.is-in) …」、出す動きは「.motion .mfig.is-in …」に書く（fill: backwards で、
   出し終えたら元の指定に戻る）。--i は要素の順番（テンプレートが style で渡す）。 */
.mfig {
  --mf-paper: #fff; --mf-card: #fff; --mf-surface: #fafafa; --mf-mute: #ebe8e0; --mf-line: #e3e3e3;
  --mf-cool: #eef0f4; --mf-cool-ink: #22304f; --mf-ink: #2b2b2b; --mf-sub: #666; --mf-faint: #8a8a8a;
  --fill: var(--deep);
}
.post .mfig, .mfig {
  --deep: color-mix(in srgb, var(--cat, var(--ink)) 72%, #000);
  --tint: color-mix(in srgb, var(--cat, var(--ink)) 9%, var(--mf-paper));
  margin: 2.4rem 0; padding: 1.5rem 1.4rem 1.3rem; background: var(--bg);
  border: 1px solid var(--mf-line); border-top: 4px solid var(--deep);
}
/* 記事本文の段落・リストの指定（.post-body p の余白、ol/ul の字下げ、図版の説明の縦線）を図の中では打ち消す。
   打ち消しは (0,2,0) なので、図の中の余白はそれ以上の強さ（.mfig を前に付ける）で書く */
.post-body .mfig :where(p, ul, ol, li) { margin: 0; }
.post-body .mfig :where(ul, ol) { padding-left: 0; list-style: none; }
.mfig .mfig-kicker { margin: 0 0 .5rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; font-family: var(--font-jp); font-weight: 800; font-size: .8rem; letter-spacing: .16em; color: var(--deep); }
.mfig .mfig-kicker .en { font-family: var(--font-en); font-weight: 800; font-size: .74rem; letter-spacing: .26em; text-transform: uppercase; }
.mfig .mfig-kicker .en + .ja { font-size: .72rem; letter-spacing: .1em; color: var(--mf-faint); }
.mfig .mfig-title { margin: 0 0 1.3rem; font-family: var(--font-jp); font-weight: 900; font-size: clamp(1.08rem, 1rem + .5vw, 1.3rem); line-height: 1.55; letter-spacing: .02em; color: var(--ink); }
.mfig-title b { color: var(--deep); }
.mfig-body { margin: 0; }
.mfig-body p { margin: 0; }
.post .mfig .mfig-note, .mfig-note {
  margin: 1.3rem 0 0; padding: 1rem 0 0; border: 0; border-top: 1px solid var(--mf-line); text-align: left;
  font-family: var(--font-jp); font-size: .84rem; line-height: 1.9; color: var(--mf-faint); letter-spacing: .02em;
}
.mfig b { font-weight: 900; }

/* 2項対比 */
.mf-cmp { display: grid; gap: .75rem; }
.mf-cmp-card { padding: 1.15rem 1.2rem 1.1rem; border-radius: 12px; }
.mf-cmp-card.is-left { background: var(--mf-cool); color: var(--mf-cool-ink); }
.mf-cmp-card.is-right { background: var(--tint); color: var(--deep); }
.mf-cmp-card .h { font-family: var(--font-jp); font-weight: 900; font-size: 1.08rem; line-height: 1.45; }
.mf-cmp-card .sub { margin-top: .35rem; font-size: .86rem; font-weight: 700; opacity: .85; }
.mfig .mf-cmp-card ul { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .45rem; }
.mfig .mf-cmp-card li { position: relative; padding-left: 1.05rem; font-size: .9rem; line-height: 1.7; color: var(--mf-ink); }
.mf-cmp-card li b { font-weight: 800; }
.mf-cmp-card li .s { display: block; font-size: .82rem; line-height: 1.6; color: var(--mf-sub); }
.mf-cmp-card li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 7px; border-radius: 2px; background: currentColor; opacity: .55; }
.mf-cmp-card.is-left li::before { color: var(--mf-cool-ink); }
.mf-cmp-card.is-right li::before { color: var(--deep); opacity: 1; }
@media (min-width: 700px) { .mf-cmp { grid-template-columns: 1fr 1fr; } }

/* 段階（縦のタイムライン） */
.mf-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.mf-steps li { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: .9rem; padding-bottom: 1.15rem; }
.mf-steps li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: color-mix(in srgb, var(--deep) 35%, var(--mf-paper)); transform-origin: 50% 0; }
.mf-steps li:last-child { padding-bottom: 0; }
.mf-steps .dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 2.5px solid var(--deep); background: var(--bg); color: var(--deep); font: 800 .78rem/1 var(--font-en);
}
.mf-steps .dot:empty::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--fill); }
.mf-steps .tx { padding-top: .25rem; }
.mf-steps .lv { display: inline-block; margin-bottom: .35rem; padding: .12rem .65rem; border-radius: 999px; background: var(--tint); color: var(--deep); font-weight: 800; font-size: .78rem; }
.mf-steps .t { font-weight: 800; font-size: 1rem; line-height: 1.6; }
.mf-steps .s { margin-top: .25rem; font-size: .87rem; line-height: 1.8; color: var(--mf-sub); }

/* 段階の "path": "rise"（右肩上がりの道のりとゴールの旗）。スマホは縦のタイムラインのまま、最後の点に旗 */
.mf-rise { position: relative; }
.mf-rise-line { display: none; }
.mf-rise li:last-child .dot { background: var(--fill); color: #fff; }
.mf-rise li:last-child .dot:empty::after { background: var(--mf-card); }
.mf-flag { position: absolute; z-index: 2; left: 19px; top: -17px; width: 20px; height: 25px; transform-origin: 3px 100%; }
.mf-flag svg { display: block; width: 100%; height: 100%; }
.mf-flag .pole { stroke: var(--mf-ink); stroke-width: 2; stroke-linecap: round; }
.mf-flag .cloth { fill: var(--deep); }
@media (min-width: 700px) {
  .mf-rise { padding-top: 46px; }
  .mf-rise .mf-steps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .mf-rise .mf-steps li::after { display: none; }
  .mf-rise .mf-steps li { display: block; padding: calc((var(--n) - 1 - var(--i)) * 36px) .55rem 0; text-align: center; }
  .mf-rise .mf-steps .dot { margin: 0 auto .75rem; }
  .mf-rise .mf-steps .tx { padding-top: 0; }
  .mf-rise-line {
    display: block; position: absolute; left: 0; top: calc(46px + 17px); width: 100%;
    height: calc((var(--n) - 1) * 36px); overflow: visible; pointer-events: none;
  }
  .mf-rise-line polyline { fill: none; stroke: var(--deep); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
  .mf-flag { left: calc(50% - 3px); top: -40px; width: 30px; height: 38px; }
}

/* 判断基準（番号つきのカード） */
.mf-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.mf-checks li { display: grid; grid-template-columns: 26px 1fr; gap: .8rem; padding: 1rem 1.1rem; border: 1px solid var(--mf-line); border-radius: 12px; background: var(--mf-surface); }
.mf-checks .ck svg { width: 26px; height: 26px; fill: none; stroke: var(--deep); stroke-linecap: round; stroke-linejoin: round; }
.mf-checks .ck rect { stroke-width: 1.8; }
.mf-checks .ck path { stroke-width: 2.6; stroke-dasharray: 20; stroke-dashoffset: 0; }
.mf-checks .t { font-weight: 900; font-size: 1rem; line-height: 1.6; color: var(--deep); }
.mf-checks .t .n { margin-right: .35em; font-family: var(--font-en); }
.mf-checks .s { margin-top: .3rem; font-size: .9rem; line-height: 1.85; color: var(--mf-ink); }

/* 数値の比較（横棒） */
.mf-bars { display: grid; gap: 1.05rem; }
.mf-bar .bl { font-weight: 800; font-size: .9rem; line-height: 1.5; }
.mf-bar .bl small { display: inline-block; margin-left: .5em; font-weight: 500; font-size: .76rem; color: var(--mf-faint); }
.mf-bar .row { display: flex; align-items: center; gap: .8rem; margin-top: .35rem; }
.mf-bar .track { flex: 1; height: 14px; border-radius: 999px; background: var(--mf-surface); overflow: hidden; }
.mf-bar .fill { display: block; width: var(--w); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--deep), color-mix(in srgb, var(--cat, var(--ink)) 80%, var(--mf-paper))); transform-origin: 0 50%; }
.mf-bar .bv { flex: none; min-width: 4.2em; text-align: right; font-family: var(--font-en); font-weight: 800; font-size: 1.1rem; color: var(--deep); font-variant-numeric: tabular-nums; }

/* 数字3つ */
.mf-stats { display: grid; gap: .6rem; }
.mf-stat {
  display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr; grid-template-rows: auto 1fr; column-gap: 1rem; align-items: center;
  padding: .9rem 1rem; border-radius: 12px; background: var(--tint);
}
.mf-stat .big { grid-row: 1 / span 2; }
.mfig .mf-stat .lab { margin-top: 0; align-self: end; }
.mfig .mf-stat .sub { align-self: start; }
@media (min-width: 700px) {
  .mf-stats { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .7rem; }
  .mf-stat { display: block; padding: 1rem .9rem 1.05rem; text-align: center; }
  .mfig .mf-stat .lab { margin-top: .55rem; }
}
.mf-stat .big { font-family: var(--font-en); font-weight: 800; font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem); line-height: 1.05; color: var(--deep); font-variant-numeric: tabular-nums; }
.mf-stat .big small { margin-left: .15rem; font-family: var(--font-jp); font-size: .9rem; font-weight: 800; }
.mf-stat .lab { margin-top: .55rem; font-weight: 800; font-size: .88rem; line-height: 1.5; }
.mf-stat .sub { margin-top: .3rem; font-size: .76rem; line-height: 1.6; color: var(--mf-faint); }
/* 割合を10人で見せる（単位が % の数字だけ）。"picto": false のシーンは帯のゲージ */
.mf-picto, .mf-ratio { grid-column: 1 / -1; grid-row: 3; margin-top: .75rem; }
.mf-picto { display: block; width: 100%; max-width: 250px; height: auto; overflow: visible; }
.mf-picto .bg { fill: color-mix(in srgb, var(--deep) 20%, var(--mf-paper)); }
.mf-picto .fg { fill: var(--deep); transform-box: fill-box; transform-origin: 0 50%; }
.mf-ratio { display: block; height: 8px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--deep) 16%, var(--mf-paper)); }
.mf-ratio span { display: block; width: var(--w); height: 100%; border-radius: inherit; background: var(--fill); transform-origin: 0 50%; }
@media (min-width: 700px) { .mf-picto { margin: .8rem auto 0; } }

/* 流れ（PC は横一列、スマホは縦）: カードの間に矢印 */
.mf-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }
.mf-flow li { position: relative; padding: .95rem 1rem 1rem; border: 1px solid var(--mf-line); border-top: 3px solid var(--deep); border-radius: 0 0 10px 10px; background: var(--bg); }
.mf-flow li:not(:last-child)::after {
  content: ""; position: absolute; left: 50%; bottom: -1.15rem; width: 10px; height: 10px; margin-left: -5px;
  border-right: 2.5px solid var(--deep); border-bottom: 2.5px solid var(--deep); transform: rotate(45deg);
}
.mf-flow .n { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-bottom: .4rem; border-radius: 50%; background: var(--fill); color: #fff; font: 800 .72rem/1 var(--font-en); }
.mf-flow .t { font-weight: 800; font-size: .95rem; line-height: 1.55; }
.mf-flow .s { margin-top: .3rem; font-size: .82rem; line-height: 1.75; color: var(--mf-sub); }
@media (min-width: 700px) {
  .mf-flow { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1.5rem; }
  .mf-flow li:not(:last-child)::after { left: auto; right: -1.1rem; top: 50%; bottom: auto; margin: -5px 0 0; transform: rotate(-45deg); }
}

/* 2軸4象限: 十字の軸の線が伸び、象限が順に出る */
.mf-mx .grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mf-mx .line { position: absolute; z-index: 0; background: var(--ink); }
.mf-mx .line-x { left: -4px; right: -4px; top: 50%; height: 2px; margin-top: -1px; transform-origin: 0 50%; }
.mf-mx .line-y { top: -4px; bottom: -4px; left: 50%; width: 2px; margin-left: -1px; transform-origin: 50% 0; }
.mf-mx .q { position: relative; z-index: 1; padding: .95rem .85rem 1rem; border: 1px solid var(--mf-line); border-radius: 12px; background: var(--mf-surface); text-align: center; }
.mf-mx .q .t { font-weight: 900; font-size: .95rem; line-height: 1.5; }
.mf-mx .q .s { margin-top: .4rem; font-size: .8rem; line-height: 1.7; color: var(--mf-sub); }
.mf-mx .q.is-hot { background: var(--fill); border-color: var(--deep); color: #fff; }
.mf-mx .q.is-hot .s { color: rgba(255,255,255,.85); }
.mf-mx .ax { font-weight: 800; font-size: .8rem; color: var(--mf-ink); text-align: center; letter-spacing: .02em; }
.mf-mx .ax-y { margin-bottom: .7rem; }
.mf-mx .ax-x { margin-top: .7rem; }

/* 段階のカード（項目に tag があるとき）: 各段をカードにし、下にその段で残すものの札 */
.mf-steps--card li { padding-bottom: .85rem; }
.mf-steps--card .tx { padding: .85rem 1rem .95rem; border: 1px solid var(--mf-line); border-radius: 12px; background: var(--mf-surface); }
.mf-steps--card .tag { display: inline-block; margin-top: .6rem; padding: .3rem .7rem; border-radius: 6px; background: var(--tint); color: var(--deep); font-weight: 800; font-size: .8rem; line-height: 1.55; }
.mfig .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 対応（左 → 右） */
.mf-pair { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.1fr); gap: .65rem .3rem; }
.mf-pair .hd { align-self: end; text-align: center; font-weight: 800; font-size: .8rem; line-height: 1.5; color: var(--mf-faint); letter-spacing: .03em; }
.mf-pair .hd small { display: block; margin-top: .1rem; font-weight: 500; font-size: .7rem; }
.mf-pair .hd-r { color: var(--deep); }
.mf-pair .l, .mf-pair .r { display: flex; align-items: center; padding: .8rem .9rem; border-radius: 10px; font-size: .9rem; line-height: 1.7; }
.mf-pair .l { background: var(--mf-surface); color: var(--mf-ink); }
.mf-pair .r { background: var(--tint); color: var(--deep); font-weight: 800; }
.mf-pair .ar { display: grid; place-items: center; }
.mf-pair .ar svg { width: 22px; height: 11px; fill: none; stroke: var(--deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform-origin: 0 50%; overflow: visible; }
@media (min-width: 700px) {
  .mf-pair { grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); gap: .75rem .4rem; }
  .mf-pair .l, .mf-pair .r { padding: .95rem 1.2rem; font-size: .95rem; }
  .mf-pair .ar svg { width: 26px; height: 13px; }
}

/* 循環: 輪の上の点と矢印。点と名前の位置は --x / --y（輪の正方形に対する %） */
.mf-cyc { --ring: min(100%, 440px); }
.mf-cyc .ring { position: relative; width: var(--ring); aspect-ratio: 1; margin: calc(var(--ring) * var(--ct, 0) * -1) auto calc(var(--ring) * var(--cb, 0) * -1); }
.mf-cyc .wheel { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mf-cyc .wheel .base { fill: none; stroke: color-mix(in srgb, var(--deep) 8%, var(--mf-paper)); stroke-width: 5; stroke-dasharray: 1; }
.mf-cyc .wheel .arc path { fill: none; stroke: color-mix(in srgb, var(--deep) 48%, var(--mf-paper)); stroke-width: .75; stroke-linecap: round; stroke-dasharray: 1; }
.mf-cyc .wheel .arc polygon { fill: color-mix(in srgb, var(--deep) 48%, var(--mf-paper)); }
.mfig .mf-cyc .nodes { list-style: none; margin: 0; padding: 0; }
.mf-cyc .node {
  position: absolute; left: var(--x); top: var(--y); width: 12%; aspect-ratio: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center; border: 2.5px solid var(--deep); border-radius: 50%; background: var(--mf-card); color: var(--deep); font: 800 .9rem/1 var(--font-en);
}
.mf-cyc .is-cut .node { background: var(--fill); color: #fff; }
.mf-cyc .lab { position: absolute; width: 20%; font-weight: 800; font-size: .76rem; line-height: 1.45; color: var(--mf-ink); }
.mf-cyc :is(.side-right, .side-left) .lab { width: var(--lw, 20%); }
.mf-cyc .side-right .lab { left: calc(var(--x) + 8%); top: var(--y); transform: translateY(-50%); }
.mf-cyc .side-left .lab { right: calc(100% - var(--x) + 8%); top: var(--y); transform: translateY(-50%); text-align: right; }
.mf-cyc .side-top .lab { left: var(--x); bottom: calc(100% - var(--y) + 8%); width: 40%; transform: translateX(-50%); text-align: center; }
.mf-cyc .side-bottom .lab { left: var(--x); top: calc(var(--y) + 8%); width: 40%; transform: translateX(-50%); text-align: center; }
.mf-cyc .is-cut .lab { color: var(--deep); }
.mf-cyc .tag { display: table; margin-top: .3rem; padding: .2rem .6rem; border-radius: 999px; background: var(--fill); color: #fff; font-size: .68rem; white-space: nowrap; }
.mf-cyc .side-left .tag { margin-left: auto; }
.mf-cyc .side-top .tag, .mf-cyc .side-bottom .tag { margin-inline: auto; }
.mf-cyc .center { position: absolute; left: 50%; top: var(--cy, 50%); width: 34%; text-wrap: balance; transform: translate(-50%, -50%); text-align: center; }
.mf-cyc .center .ct { font-weight: 900; font-size: 1rem; line-height: 1.35; color: var(--deep); }
.mf-cyc .center .cs { margin-top: .2rem; font-size: .66rem; line-height: 1.45; color: var(--mf-faint); font-weight: 700; }
.mf-cyc .rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .7rem; margin-top: .6rem; }
.mf-cyc .rule { padding: .9rem 1rem 1rem; border: 1px solid var(--mf-line); border-radius: 12px; background: var(--mf-surface); }
.mf-cyc .rule .k { font: 800 .7rem/1.2 var(--font-en); letter-spacing: .14em; color: var(--deep); }
.mf-cyc .rule .t { margin-top: .45rem; font-weight: 900; font-size: .98rem; line-height: 1.55; }
.mf-cyc .rule .s { margin-top: .35rem; font-size: .84rem; line-height: 1.75; color: var(--mf-sub); }
@media (min-width: 700px) {
  .mf-cyc .lab { font-size: .84rem; }
  .mf-cyc .side-right .lab, .mf-cyc .side-left .lab { width: 40%; }
  .mf-cyc .center .ct { font-size: 1.15rem; }
  .mf-cyc .center .cs { font-size: .74rem; }
}

/* 氷山: 水面の上の頂と、水面の下で広がる層 */
.mf-ice { position: relative; }
.mf-ice .berg { position: relative; width: min(100%, 520px); margin: 0 auto; }
.mf-ice .tip {
  display: flex; align-items: flex-end; justify-content: center; width: 38%; height: 72px; margin: 0 auto; padding-bottom: .5rem;
  background: var(--fill); clip-path: polygon(50% 0, 100% 100%, 0 100%); color: #fff; font-weight: 900; font-size: .95rem; line-height: 1.2;
}
.mf-ice .water { position: absolute; left: 0; right: 0; top: 72px; border-top: 2px dashed color-mix(in srgb, var(--deep) 30%, var(--mf-faint)); transform-origin: 0 50%; }
.mf-ice .water span { position: absolute; right: 0; font-weight: 800; font-size: .7rem; letter-spacing: .06em; color: color-mix(in srgb, var(--deep) 55%, var(--mf-faint)); white-space: nowrap; }
.mf-ice .water .above { bottom: .3rem; }
.mf-ice .water .below { top: .3rem; }
.mfig .mf-ice .mass { position: relative; list-style: none; margin: 0; padding: 1.4rem 0 1.1rem; display: grid; gap: .55rem; justify-items: center; }
.mf-ice .mass::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--deep) 7%, var(--mf-paper)); clip-path: polygon(31% 0, 69% 0, 100% 100%, 0 100%); }
.mf-ice .mass li {
  position: relative; width: var(--w); padding: .5rem .9rem; border: 1.5px solid color-mix(in srgb, var(--deep) 22%, var(--mf-paper)); border-radius: 999px;
  background: var(--mf-card); text-align: center; font-weight: 800; font-size: .84rem; line-height: 1.5; color: var(--deep);
}
.mf-ice .bottom { width: fit-content; max-width: 100%; margin: 1rem auto 0; padding: .6rem 2rem; border-radius: 999px; background: var(--fill); color: #fff; text-align: center; font-weight: 900; font-size: .9rem; line-height: 1.5; }
@media (max-width: 640px) { .mf-ice .water span { font-size: .64rem; } }
@media (min-width: 700px) { .mf-ice .tip { height: 84px; font-size: 1.05rem; } .mf-ice .water { top: 84px; } .mf-ice .mass li { font-size: .92rem; } }

/* 棒と折れ線 */
.mf-chart { --plot-h: 200px; }
.mf-chart .axis { font-weight: 800; font-size: .8rem; color: var(--mf-sub); }
.mf-chart .plot { position: relative; margin-top: 1.5rem; }
.mfig .mf-chart .cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.mf-chart .col { display: grid; grid-template-rows: var(--plot-h) auto; }
.mf-chart .area { position: relative; border-bottom: 2px solid var(--mf-line); }
.mf-chart .bar { position: absolute; left: 0; right: 0; width: min(68%, 72px); margin: 0 auto; bottom: 0; height: var(--h); border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--deep) 28%, var(--mf-paper)); transform-origin: 50% 100%; }
.mf-chart .is-hot .bar { background: var(--fill); }
.mf-chart .is-zero .bar { display: none; }
.mf-chart .v { position: absolute; z-index: 2; left: 0; right: 0; width: fit-content; margin: 0 auto; padding: 1px 3px; border-radius: 4px; background: color-mix(in srgb, var(--mf-card) 85%, transparent); bottom: calc(var(--h) + 4px); text-align: center; font: 800 .78rem/1 var(--font-en); color: var(--mf-faint); white-space: nowrap; text-shadow: 0 0 3px var(--mf-card), 0 0 3px var(--mf-card), 0 0 2px var(--mf-card); }
.mf-chart .is-hot .v { color: var(--deep); }
.mf-chart .x { padding: .45rem .1rem 0; text-align: center; font-size: .7rem; font-weight: 700; line-height: 1.35; color: var(--mf-faint); word-break: keep-all; overflow-wrap: anywhere; }
/* 図の中の短い文は、最後の1文字だけが次の行に落ちないように */
.mfig { text-wrap: pretty; }
.mf-chart .x small, .mf-cyc .lab, .mf-ice .mass li { text-wrap: balance; }
.mf-chart .x small { display: block; margin-top: .2rem; font-size: .64rem; font-weight: 500; color: var(--mf-faint); }
.mf-chart .line { position: absolute; z-index: 1; left: 0; top: 0; width: 100%; height: var(--plot-h); overflow: visible; pointer-events: none; }
.mf-chart .line polyline { fill: none; stroke: var(--deep); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mf-chart .legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; margin-top: .9rem; font-size: .78rem; font-weight: 800; color: var(--mf-sub); }
.mf-chart .lg-bar::before { content: ""; display: inline-block; width: 14px; height: 11px; margin-right: .45em; border-radius: 3px; background: color-mix(in srgb, var(--deep) 28%, var(--mf-paper)); }
.mf-chart .lg-line { color: var(--deep); }
.mf-chart .lg-line::before { content: ""; display: inline-block; width: 22px; height: 3px; margin-right: .45em; border-radius: 2px; background: var(--fill); vertical-align: .3em; }
@media (min-width: 700px) { .mf-chart { --plot-h: 240px; } .mf-chart .x { font-size: .78rem; } .mf-chart .v { font-size: .85rem; } }

/* 2つの場の対比と割合: 上下のカードと、2つに分かれた帯 */
.mf-split { display: grid; gap: .7rem; }
.mf-split .card { padding: 1rem 1.15rem 1.05rem; border-radius: 12px; background: var(--mf-cool); color: var(--mf-cool-ink); }
.mf-split .card.is-hot { background: var(--tint); color: var(--deep); }
.mf-split .card .t { font-weight: 900; font-size: 1.12rem; line-height: 1.45; }
.mf-split .card .s { margin-top: .35rem; font-size: .9rem; line-height: 1.7; }
.mf-split .bl { margin-top: .5rem; font-weight: 800; font-size: .84rem; color: var(--mf-sub); }
.mf-split .bar { display: flex; height: 46px; border-radius: 10px; overflow: hidden; }
.mf-split .seg { position: relative; display: grid; place-items: center; width: var(--w); min-width: 0; }
.mf-split .seg-1 { background: var(--fill); color: #fff; transform-origin: 0 50%; }
.mf-split .seg-2 { background: color-mix(in srgb, var(--deep) 22%, var(--mf-paper)); color: var(--deep); transform-origin: 100% 50%; }
.mf-split .seg b { padding: 0 .4rem; font-weight: 900; font-size: .9rem; line-height: 1.25; text-align: center; font-variant-numeric: tabular-nums; }
@media (min-width: 700px) { .mf-split .seg b { font-size: .98rem; } }
.mf-split .lg { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .8rem; font-weight: 800; color: var(--mf-sub); }
.mf-split .lg span::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: .4em; border-radius: 3px; vertical-align: -1px; }
.mf-split .lg-1::before { background: var(--fill); }
.mf-split .lg-2::before { background: color-mix(in srgb, var(--deep) 22%, var(--mf-paper)); }
@media (min-width: 700px) { .mf-split .card { padding: 1.15rem 1.4rem 1.2rem; } .mf-split .bar { height: 52px; } }

/* --- 動き（図が見えたときだけ。出す前の状態 → 出す動き） */
.motion .mfig:not(.is-in) :is(.mf-cmp-card, .mf-cmp-card li, .mf-steps .dot, .mf-steps .tx, .mf-checks li, .mf-bar, .mf-stat, .mf-flow li, .mf-mx .q, .mf-mx .ax) { opacity: 0; }
.motion .mfig:not(.is-in) .mf-steps li::after { transform: scaleY(0); }
.motion .mfig:not(.is-in) .mf-bar .fill { transform: scaleX(0); }
.motion .mfig:not(.is-in) .mf-mx .line-x { transform: scaleX(0); }
.motion .mfig:not(.is-in) .mf-mx .line-y { transform: scaleY(0); }
.motion .mfig:not(.is-in) .mf-checks .ck path { stroke-dashoffset: 20; }
.motion .mfig:not(.is-in) .mf-flag { opacity: 0; }
.motion .mfig:not(.is-in) :is(.mf-picto .fg, .mf-ratio span) { transform: scaleX(0); }
.motion .mfig:not(.is-in) .mf-rise-line { clip-path: inset(0 100% 0 0); }
.motion .mfig:not(.is-in) :is(.mf-pair .hd, .mf-pair .l, .mf-pair .r, .mf-cyc .node, .mf-cyc .lab, .mf-cyc .center, .mf-cyc .rule, .mf-cyc .arc polygon, .mf-ice .tip, .mf-ice .mass li, .mf-ice .bottom, .mf-chart .v, .mf-chart .legend) { opacity: 0; }
.motion .mfig:not(.is-in) .mf-pair .ar svg, .motion .mfig:not(.is-in) .mf-ice .water { transform: scaleX(0); }
.motion .mfig:not(.is-in) .mf-ice .mass::before { opacity: 0; }
.motion .mfig:not(.is-in) :is(.mf-cyc .wheel .base, .mf-cyc .arc path) { stroke-dashoffset: 1; }
.motion .mfig:not(.is-in) .mf-chart .bar { transform: scaleY(0); }
.motion .mfig:not(.is-in) .mf-chart .line { clip-path: inset(0 100% 0 0); }
.motion .mfig:not(.is-in) :is(.mf-split .card, .mf-split .bl, .mf-split .seg b, .mf-split .lg) { opacity: 0; }
.motion .mfig:not(.is-in) .mf-split .seg { transform: scaleX(0); }

@keyframes mf-fade-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes mf-from-left { from { opacity: 0; transform: translateX(-22px); } }
@keyframes mf-from-right { from { opacity: 0; transform: translateX(22px); } }
@keyframes mf-pop { 0% { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
@keyframes mf-rise { from { opacity: 0; transform: scale(.92) translateY(8px); } }
@keyframes mf-grow-x { from { transform: scaleX(0); } }
@keyframes mf-grow-y { from { transform: scaleY(0); } }
@keyframes mf-draw { from { stroke-dashoffset: 20; } }
@keyframes mf-reveal-x { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes mf-flag { 0% { opacity: 0; transform: scaleY(.2); } 55% { opacity: 1; transform: scaleY(1.08) rotate(-4deg); } 80% { transform: rotate(2deg); } 100% { opacity: 1; transform: none; } }
@keyframes mf-pop-s { 0% { opacity: 0; scale: .4; } 70% { scale: 1.12; } 100% { opacity: 1; scale: 1; } }
@keyframes mf-dash { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mf-surface { from { opacity: 0; transform: translateY(45%); } }
@keyframes mf-fade { from { opacity: 0; } }
@keyframes mf-cut { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--deep) 45%, transparent); } 50% { box-shadow: 0 0 0 9px transparent; } }
@keyframes mf-hot { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--deep) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }

.motion .mfig.is-in .mf-cmp-card.is-left { animation: mf-from-left .7s var(--ease-out) .15s backwards; }
.motion .mfig.is-in .mf-cmp-card.is-right { animation: mf-from-right .7s var(--ease-out) .35s backwards; }
.motion .mfig.is-in .mf-cmp-card li { animation: mf-fade-up .5s var(--ease-out) backwards; animation-delay: calc(.45s + var(--i) * .2s + var(--j) * .08s); }
.motion .mfig.is-in .mf-steps li::after { animation: mf-grow-y .45s var(--ease-out) backwards; animation-delay: calc(.45s + var(--i) * .28s); }
.motion .mfig.is-in .mf-steps .dot { animation: mf-pop .55s var(--ease-out) backwards; animation-delay: calc(.25s + var(--i) * .28s); }
.motion .mfig.is-in .mf-steps .tx { animation: mf-fade-up .6s var(--ease-out) backwards; animation-delay: calc(.35s + var(--i) * .28s); }
.motion .mfig.is-in .mf-rise-line { animation: mf-reveal-x 1.3s var(--ease-out) .2s backwards; }
.motion .mfig.is-in .mf-flag { animation: mf-flag .8s var(--ease-out) backwards; animation-delay: calc(.45s + var(--n) * .28s); }
.motion .mfig.is-in .mf-pair .hd { animation: mf-fade .5s var(--ease-out) .1s backwards; }
.motion .mfig.is-in .mf-pair .l { animation: mf-from-left .55s var(--ease-out) backwards; animation-delay: calc(.2s + var(--i) * .24s); }
.motion .mfig.is-in .mf-pair .ar svg { animation: mf-grow-x .35s var(--ease-out) backwards; animation-delay: calc(.45s + var(--i) * .24s); }
.motion .mfig.is-in .mf-pair .r { animation: mf-rise .55s var(--ease-out) backwards; animation-delay: calc(.6s + var(--i) * .24s); }
.motion .mfig.is-in .mf-cyc .wheel .base { animation: mf-dash 1.2s var(--ease-out) .1s backwards; }
.motion .mfig.is-in .mf-cyc .node { animation: mf-pop-s .5s var(--ease-out) backwards; animation-delay: calc(.35s + var(--i) * .2s); }
.motion .mfig.is-in .mf-cyc .lab { animation: mf-fade .5s var(--ease-out) backwards; animation-delay: calc(.45s + var(--i) * .2s); }
.motion .mfig.is-in .mf-cyc .arc path { animation: mf-dash .4s ease-in-out backwards; animation-delay: calc(.5s + var(--i) * .2s); }
.motion .mfig.is-in .mf-cyc .arc polygon { animation: mf-fade .2s linear backwards; animation-delay: calc(.85s + var(--i) * .2s); }
.motion .mfig.is-in .mf-cyc .center { animation: mf-fade .7s var(--ease-out) backwards; animation-delay: calc(.5s + var(--n) * .2s); }
.motion .mfig.is-in .mf-cyc .is-cut .node { animation: mf-pop-s .5s var(--ease-out) backwards, mf-cut 1.2s ease-out 2; animation-delay: calc(.35s + var(--i) * .2s), calc(.8s + var(--n) * .2s); }
.motion .mfig.is-in .mf-cyc .tag { animation: mf-from-left .5s var(--ease-out) backwards; animation-delay: calc(.7s + var(--n) * .2s); }
.motion .mfig.is-in .mf-cyc .rule { animation: mf-fade-up .55s var(--ease-out) backwards; animation-delay: calc(.6s + var(--n) * .2s + var(--i) * .12s); }
.motion .mfig.is-in .mf-ice .tip { animation: mf-surface .8s var(--ease-out) .1s backwards; }
.motion .mfig.is-in .mf-ice .water { animation: mf-grow-x .7s var(--ease-out) .35s backwards; }
.motion .mfig.is-in .mf-ice .mass::before { animation: mf-fade .6s var(--ease-out) .5s backwards; }
.motion .mfig.is-in .mf-ice .mass li { animation: mf-fade-up .5s var(--ease-out) backwards; animation-delay: calc(.65s + var(--i) * .2s); }
.motion .mfig.is-in .mf-ice .bottom { animation: mf-pop .55s var(--ease-out) backwards; animation-delay: calc(.85s + var(--n) * .2s); }
.motion .mfig.is-in .mf-chart .bar { animation: mf-grow-y .6s var(--ease-out) backwards; animation-delay: calc(.15s + var(--i) * .07s); }
.motion .mfig.is-in .mf-chart .v { animation: mf-fade .35s var(--ease-out) backwards; animation-delay: calc(.55s + var(--i) * .07s); }
.motion .mfig.is-in .mf-chart .line { animation: mf-reveal-x 1.1s ease-in-out backwards; animation-delay: calc(.55s + var(--n) * .07s); }
.motion .mfig.is-in .mf-chart .legend { animation: mf-fade .5s var(--ease-out) backwards; animation-delay: calc(.7s + var(--n) * .07s); }
.motion .mfig.is-in .mf-split .card { animation: mf-fade-up .55s var(--ease-out) backwards; animation-delay: calc(.15s + var(--i) * .22s); }
.motion .mfig.is-in .mf-split .bl { animation: mf-fade .5s var(--ease-out) .55s backwards; }
.motion .mfig.is-in .mf-split .seg { animation: mf-grow-x .8s var(--ease-out) .7s backwards; }
.motion .mfig.is-in .mf-split .seg b, .motion .mfig.is-in .mf-split .lg { animation: mf-fade .4s var(--ease-out) 1.3s backwards; }
.motion .mfig.is-in .mf-checks li { animation: mf-fade-up .6s var(--ease-out) backwards; animation-delay: calc(.15s + var(--i) * .22s); }
.motion .mfig.is-in .mf-checks .ck path { animation: mf-draw .5s var(--ease-out) backwards; animation-delay: calc(.5s + var(--i) * .22s); }
.motion .mfig.is-in .mf-bar { animation: mf-fade-up .5s var(--ease-out) backwards; animation-delay: calc(.1s + var(--i) * .15s); }
.motion .mfig.is-in .mf-bar .fill { animation: mf-grow-x 1.1s var(--ease-out) backwards; animation-delay: calc(.3s + var(--i) * .15s); }
.motion .mfig.is-in .mf-stat { animation: mf-rise .6s var(--ease-out) backwards; animation-delay: calc(.15s + var(--i) * .15s); }
.motion .mfig.is-in .mf-picto .fg { animation: mf-grow-x 1.5s cubic-bezier(.45, 0, .25, 1) backwards; animation-delay: calc(.6s + var(--i) * .2s); }
.motion .mfig.is-in .mf-ratio span { animation: mf-grow-x 1.1s var(--ease-out) backwards; animation-delay: calc(.5s + var(--i) * .15s); }
.motion .mfig.is-in .mf-flow li { animation: mf-fade-up .55s var(--ease-out) backwards; animation-delay: calc(.15s + var(--i) * .25s); }
.motion .mfig.is-in .mf-mx .line-x { animation: mf-grow-x .8s var(--ease-out) .1s backwards; }
.motion .mfig.is-in .mf-mx .line-y { animation: mf-grow-y .8s var(--ease-out) .25s backwards; }
.motion .mfig.is-in .mf-mx .q { animation: mf-rise .55s var(--ease-out) backwards; animation-delay: calc(.55s + var(--i) * .15s); }
.motion .mfig.is-in .mf-mx .q.is-hot { animation: mf-rise .55s var(--ease-out) backwards, mf-hot 1.4s ease-out 1.4s 1; animation-delay: calc(.55s + var(--i) * .15s), 1.4s; }
.motion .mfig.is-in .mf-mx .ax { animation: mf-fade-up .5s var(--ease-out) 1.1s backwards; }

@media (max-width: 640px) {
  .post .mfig, .mfig { margin-left: -1.1rem; margin-right: -1.1rem; padding: 1.3rem 1.1rem 1.1rem; border-left: 0; border-right: 0; }
  .mf-mx .grid { gap: 8px; }
  .mf-mx .q { padding: .8rem .6rem .85rem; }
  .mf-mx .q .t { font-size: .86rem; }
  .mf-mx .q .s { font-size: .74rem; }
}

/* ==========================================================================
   初心者向けの動く図解（旅・積み木・門・天秤）と、章末の確認テスト
   ========================================================================== */

/* --- 旅（journey）: 駅が並び、パケットが最初の駅から最後の駅まで動く。駅は通過した順に灯る */
.mf-jn { position: relative; padding-top: 1.6rem; }
.mf-jn-track, .mf-jn-fly { position: absolute; left: calc(50% / var(--n)); right: calc(50% / var(--n)); top: 1.4rem; height: 6px; }
.mf-jn-track { z-index: 0; }
.mf-jn-fly { z-index: 3; pointer-events: none; }
.mf-jn .rail { position: absolute; inset: 0; border-radius: 99px; background: color-mix(in srgb, var(--deep) 16%, var(--mf-paper)); }
.mf-jn .rail-lit { position: absolute; left: 0; top: 0; height: 100%; width: 100%; border-radius: 99px; background: var(--fill); transform-origin: 0 50%; }
.mf-jn .packet {
  position: absolute; top: -16px; left: 100%; transform: translate(-50%, -50%);
  min-width: 22px; height: 22px; padding: 0 .55rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 99px;
  background: var(--mf-card); border: 2.5px solid var(--deep); color: var(--deep); font-size: .72rem; font-weight: 800; white-space: nowrap; line-height: 1;
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.4);
}
.mf-jn .packet:empty { width: 22px; padding: 0; background: var(--fill); }
.mfig .mf-jn-nodes { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.mf-jn-nodes li { text-align: center; padding: 0 .2rem; }
.mf-jn .node { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto .6rem; border-radius: 50%; border: 2.5px solid var(--deep); background: var(--bg); color: var(--deep); font: 800 .82rem/1 var(--font-en); }
.mf-jn li.is-lit .node, .mf-jn .node.is-lit { background: var(--fill); color: #fff; }
.mf-jn .t { font-weight: 800; font-size: .9rem; line-height: 1.5; }
.mf-jn .s { margin-top: .25rem; font-size: .78rem; line-height: 1.6; color: var(--mf-sub); }
@media (max-width: 640px) {
  .mf-jn-track, .mf-jn-fly { left: 17px; right: auto; top: calc(50% / var(--n)); bottom: calc(50% / var(--n)); width: 6px; height: auto; }
  .mf-jn { padding-top: .2rem; }
  .mf-jn .rail-lit { width: 100%; height: 100%; transform-origin: 50% 0; }
  .mf-jn .packet { left: 50%; top: calc(100% - 26px); transform: translate(-50%, -50%); font-size: 0; min-width: 18px; width: 18px; height: 18px; padding: 0; background: var(--fill); }
  .mfig .mf-jn-nodes { grid-template-columns: 1fr; gap: .9rem; }
  .mf-jn-nodes li { display: grid; grid-template-columns: 40px 1fr; gap: .6rem; text-align: left; align-items: center; }
  .mf-jn .node { margin: 0; }
  .mf-jn .t, .mf-jn .s { grid-column: 2; }
  .mf-jn .s { margin-top: 0; }
}
@keyframes mf-jn-x { from { left: 0%; } to { left: 100%; } }
@keyframes mf-jn-y { from { top: 0%; } to { top: calc(100% - 26px); } }
.motion .mfig:not(.is-in) :is(.mf-jn .node, .mf-jn .t, .mf-jn .s) { opacity: 0; }
.motion .mfig:not(.is-in) .mf-jn .rail-lit { transform: scaleX(0); }
.motion .mfig:not(.is-in) .mf-jn .packet { opacity: 0; }
.motion .mfig.is-in .mf-jn .node { animation: mf-pop .5s var(--ease-out) backwards; animation-delay: calc(.1s + var(--i) * .15s); }
.motion .mfig.is-in .mf-jn :is(.t, .s) { animation: mf-fade-up .5s var(--ease-out) backwards; animation-delay: calc(.2s + var(--i) * .15s); }
.motion .mfig.is-in .mf-jn .rail-lit { animation: mf-grow-x calc(var(--n) * .7s) linear .6s backwards; }
.motion .mfig.is-in .mf-jn .packet { animation: mf-jn-x calc(var(--n) * .7s) linear .6s backwards, mf-fade .3s .6s backwards; }
/* 通過した駅から順に塗る: 駅 i はパケットが着く時刻（.6s + i/(n-1) * n*.7s）で塗る（背景だけを遅らせて切り替える） */
.motion .mfig.is-in .mf-jn .node { transition: background-color .25s, color .25s; transition-delay: calc(.6s + var(--i) * .7s * var(--n) / max(1, calc(var(--n) - 1))); background: var(--fill); color: #fff; }
.motion .mfig:not(.is-in) .mf-jn .node { background: var(--bg); color: var(--deep); }
@media (max-width: 640px) {
  .motion .mfig.is-in .mf-jn .rail-lit { animation-name: mf-grow-y; }
  .motion .mfig.is-in .mf-jn .packet { animation-name: mf-jn-y, mf-fade; }
  .motion .mfig:not(.is-in) .mf-jn .rail-lit { transform: scaleY(0); }
}

/* --- 積み木（stack）: 層が下から積み上がり、上から own 段が自分の色になる */
.mf-stk-cols { display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); gap: .6rem; align-items: end; }
.mf-stk .col { position: relative; }
.mf-stk .h { margin: 0 0 .45rem; text-align: center; font-weight: 900; font-size: .88rem; line-height: 1.4; }
.mfig .mf-stk .layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 4px; }
.mfig .mf-stk .layers li { padding: .42rem .3rem; border-radius: 6px; text-align: center; font-size: .72rem; font-weight: 800; line-height: 1.3; background: var(--mf-mute); color: var(--mf-faint); }
.mf-stk .layers li.is-mine { background: var(--fill); color: #fff; }
.mf-stk .line { position: absolute; left: -3px; right: -3px; height: 2px; background: var(--ink); bottom: calc(var(--at) * 0px); display: none; }
.mfig .mf-stk .lg { display: flex; justify-content: center; gap: 1.2rem; margin: .9rem 0 0; font-size: .78rem; font-weight: 800; color: var(--mf-sub); }
.mf-stk .lg span::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: .4em; border-radius: 3px; vertical-align: -1px; background: var(--mf-mute); }
.mf-stk .lg .lg-mine::before { background: var(--fill); }
@media (min-width: 700px) { .mf-stk-cols { gap: 1rem; } .mfig .mf-stk .layers li { font-size: .82rem; padding: .5rem .4rem; } .mf-stk .h { font-size: .95rem; } }
@media (max-width: 480px) { .mf-stk-cols { gap: .35rem; } .mfig .mf-stk .layers li { font-size: .62rem; padding: .35rem .15rem; } }
.motion .mfig:not(.is-in) :is(.mf-stk .layers li, .mf-stk .h, .mf-stk .lg) { opacity: 0; }
.motion .mfig.is-in .mf-stk .h { animation: mf-fade .4s var(--ease-out) backwards; animation-delay: calc(var(--j) * .15s); }
.motion .mfig.is-in .mf-stk .layers li { animation: mf-fade-up .4s var(--ease-out) backwards; animation-delay: calc(.15s + var(--j) * .15s + var(--i) * .09s); }
.motion .mfig.is-in .mf-stk .layers li.is-mine { animation: mf-fade-up .4s var(--ease-out) backwards, mf-stk-mine .6s var(--ease-out) backwards; animation-delay: calc(.15s + var(--j) * .15s + var(--i) * .09s), calc(.9s + var(--j) * .15s + var(--l) * .09s); }
@keyframes mf-stk-mine { from { background: var(--mf-mute); color: var(--mf-faint); } }
.motion .mfig.is-in .mf-stk .lg { animation: mf-fade .5s var(--ease-out) backwards; animation-delay: calc(1.3s + var(--c) * .15s); }

/* --- 門（gate）: 札が門に向かい、開いていれば通り抜け、閉じていれば跳ね返る */
.mf-gate .wall-name { margin: 0 0 .7rem; text-align: center; font-size: .76rem; font-weight: 800; letter-spacing: .1em; color: var(--mf-faint); }
.mfig .mf-gate .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.mf-gate li { display: grid; grid-template-columns: minmax(0, 5.6rem) 1fr 40px minmax(0, 6rem); align-items: center; gap: .5rem; }
.mf-gate .pk { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; text-align: right; }
.mf-gate .pk b { font: 800 1.05rem/1.1 var(--font-en); color: var(--deep); }
.mf-gate .pk span { font-size: .72rem; color: var(--mf-sub); font-weight: 700; }
.mf-gate .lane { position: relative; height: 4px; border-radius: 99px; background: var(--mf-mute); }
.mf-gate .ball { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--fill); transform: translate(-50%, -50%); }
.mf-gate .is-closed .ball { background: var(--warn); }
.mf-gate .door { position: relative; width: 40px; height: 34px; border: 2.5px solid var(--deep); border-radius: 7px 7px 3px 3px; background: var(--bg); }
.mf-gate .leaf { position: absolute; inset: 3px; border-radius: 3px 3px 2px 2px; background: var(--fill); transform-origin: 0 50%; }
.mf-gate .is-closed .door { border-color: var(--warn); }
.mf-gate .is-closed .leaf { background: var(--warn); }
.mf-gate .res { font-size: .88rem; font-weight: 900; color: var(--deep); line-height: 1.3; }
.mf-gate .is-closed .res { color: var(--warn); }
.mf-gate .res small { display: block; font-size: .68rem; font-weight: 600; color: var(--mf-sub); margin-top: .15rem; }
.mf-gate .is-limited .res::before { content: "条件つきで"; display: block; font-size: .66rem; font-weight: 700; color: var(--mf-sub); }
@media (min-width: 700px) { .mf-gate li { grid-template-columns: 9rem 1fr 48px 9rem; gap: .9rem; } .mf-gate .door { width: 48px; height: 40px; } .mf-gate .res { font-size: 1rem; } }
@keyframes mf-gate-pass { 0% { left: 0%; opacity: 0; } 12% { opacity: 1; } 60% { left: 100%; opacity: 1; } 80% { left: 140%; opacity: 0; } 100% { left: 140%; opacity: 0; } }
@keyframes mf-gate-bounce { 0% { left: 0%; opacity: 0; } 12% { opacity: 1; } 55% { left: 100%; } 100% { left: 55%; opacity: 1; } }
@keyframes mf-gate-open { 0%, 40% { transform: none; } 60%, 100% { transform: scaleX(.22) skewY(-24deg); } }
@keyframes mf-gate-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
.motion .mfig:not(.is-in) :is(.mf-gate li, .mf-gate .wall-name) { opacity: 0; }
.motion .mfig:not(.is-in) .mf-gate .ball { left: 0; opacity: 0; }
.motion .mfig.is-in .mf-gate .wall-name { animation: mf-fade .4s backwards; }
.motion .mfig.is-in .mf-gate li { animation: mf-fade-up .45s var(--ease-out) backwards; animation-delay: calc(.1s + var(--i) * .3s); }
.motion .mfig.is-in .mf-gate .is-open .ball { animation: mf-gate-pass 1.6s ease-in-out backwards; animation-delay: calc(.5s + var(--i) * .3s); left: 140%; opacity: 0; }
.motion .mfig.is-in .mf-gate .is-open .leaf { animation: mf-gate-open 1.6s ease-in-out backwards; animation-delay: calc(.5s + var(--i) * .3s); transform: scaleX(.22) skewY(-24deg); }
.motion .mfig.is-in .mf-gate .is-closed .ball { animation: mf-gate-bounce 1.6s ease-in-out backwards; animation-delay: calc(.5s + var(--i) * .3s); left: 55%; }
.motion .mfig.is-in .mf-gate .is-closed .door { animation: mf-gate-shake .45s ease-in-out backwards; animation-delay: calc(1.35s + var(--i) * .3s); }
.motion .mfig:not(.is-in) .mf-gate .res { opacity: 0; }
.motion .mfig.is-in .mf-gate .res { animation: mf-fade .35s backwards; animation-delay: calc(1.5s + var(--i) * .3s); }
/* 動き無しでは最終状態: 開いた門は通り抜けたあと、閉じた門は跳ね返ったあと */
.mf-gate .is-open .leaf { transform: scaleX(.22) skewY(-24deg); }
.mf-gate .is-open .ball { left: 140%; opacity: 0; }
.mf-gate .is-closed .ball { left: 55%; }

/* --- 天秤（balance）: 皿に項目が落ち、竿が傾く */
.mf-bal .beam-wrap { position: relative; padding-top: 2.2rem; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.mf-bal .beam { position: absolute; left: 12%; right: 12%; top: 1.1rem; height: 6px; border-radius: 99px; background: var(--fill); transform-origin: 50% 50%; transition: transform .8s var(--ease-out); }
.mf-bal .rope { position: absolute; top: 6px; width: 2px; height: 1rem; background: color-mix(in srgb, var(--deep) 45%, var(--mf-paper)); }
.mf-bal .rope.l { left: 6%; } .mf-bal .rope.r { right: 6%; }
.mf-bal .pivot { position: absolute; left: 50%; top: 1.1rem; width: 0; height: 0; margin-left: -14px; border-left: 14px solid transparent; border-right: 14px solid transparent; border-bottom: 30px solid color-mix(in srgb, var(--deep) 30%, var(--mf-paper)); }
.mf-bal .pan { padding: .9rem 1rem; border-radius: 12px; background: var(--mf-surface); border: 1px solid var(--mf-line); border-top: 4px solid var(--deep); transition: transform .8s var(--ease-out); }
.mf-bal .pan .h { margin: 0 0 .5rem; font-weight: 900; font-size: .95rem; color: var(--deep); line-height: 1.4; }
.mfig .mf-bal .pan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.mfig .mf-bal .pan li { position: relative; padding-left: .95rem; font-size: .84rem; line-height: 1.6; color: var(--mf-ink); }
.mf-bal .pan li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 2px; background: var(--fill); }
.mf-bal .pv { margin: .9rem 0 0; text-align: center; font-weight: 900; font-size: .9rem; color: var(--deep); }
.mf-bal.is-left .beam { transform: rotate(-6deg); } .mf-bal.is-right .beam { transform: rotate(6deg); }
.mf-bal.is-left .pan-l { transform: translateY(14px); } .mf-bal.is-left .pan-r { transform: translateY(-14px); }
.mf-bal.is-right .pan-r { transform: translateY(14px); } .mf-bal.is-right .pan-l { transform: translateY(-14px); }
@media (min-width: 700px) { .mf-bal .beam-wrap { gap: 3rem; padding: 2.6rem 1rem 0; } .mf-bal .beam { top: 1.3rem; } .mf-bal .pivot { top: 1.3rem; } }
@keyframes mf-bal-drop { from { opacity: 0; transform: translateY(-26px); } 70% { transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes mf-bal-rock { 0% { transform: rotate(0); } 30% { transform: rotate(-4deg); } 60% { transform: rotate(3deg); } 100% { transform: rotate(0); } }
.motion .mfig:not(.is-in) :is(.mf-bal .pan .h, .mf-bal .pan li, .mf-bal .pv) { opacity: 0; }
.motion .mfig:not(.is-in) .mf-bal .beam, .motion .mfig:not(.is-in) .mf-bal .pan { transform: none; }
.motion .mfig.is-in .mf-bal .pan .h { animation: mf-fade .4s backwards .1s; }
.motion .mfig.is-in .mf-bal .pan li { animation: mf-bal-drop .5s var(--ease-out) backwards; animation-delay: calc(.35s + var(--i) * .25s); }
.motion .mfig.is-in .mf-bal.is-even .beam { animation: mf-bal-rock 1.4s ease-in-out 1.2s; }
.motion .mfig.is-in .mf-bal .pv { animation: mf-fade-up .5s var(--ease-out) 1.6s backwards; }

/* 動く図解のダークモード: トークンだけを差し替える（--deep は html.dark [class*="cat-"] が持ち上げた色にする） */
html.dark .mfig {
  --mf-paper: #131313; --mf-card: #1c1c1a; --mf-surface: #1a1a19; --mf-mute: #2a2925; --mf-line: #2f2f2d;
  --mf-cool: #1c2130; --mf-cool-ink: #c9d3ea; --mf-ink: #e2e1dc; --mf-sub: #b0afaa; --mf-faint: #8d8d8a;
  --fill: color-mix(in srgb, var(--cat, #8d8d8a) 72%, #000);
  --tint: color-mix(in srgb, var(--cat, #8d8d8a) 24%, #131313);
  --deep: color-mix(in srgb, var(--cat, #8d8d8a) 45%, #fff);   /* 図の中の色文字は、暗い面の上で読める明るさまで持ち上げる */
}
