/* ============================================================
   4peiron — 共通スタイル
   デザイン基準: https://www.startupclub.community/
   配色: Tokyo Night（#1a1b26 系の藍地／低彩度のカード）／
   ヘアラインの区切り／詰め気味の太い見出し／
   藤・ミント・オレンジの差し色。
   グロー・ネオン・斜めカットは使わない。
   ============================================================ */

/* critical:start */
:root {
  /* surfaces — Tokyo Night */
  --bg: #1a1b26;
  --bg-band: #16161e;      /* 交互に敷くセクション背景 */
  --surface: #1f2335;      /* カード */
  --surface-2: #24283b;    /* カード内の一段沈んだ面 */
  --surface-3: #292e42;    /* 選択中・ホバー面 */
  --border: #2e3350;
  --border-2: #3b4261;     /* ホバー時の輪郭 */
  --border-soft: rgba(192, 202, 245, 0.08);

  /* text */
  --text: #c0caf5;
  --text-hi: #d5dbf5;      /* 白の代わりに使う最明色 */
  --text-2: #a9b1d6;
  /* muted 系は、いちばん明るい面（--surface-3）の上でも WCAG AA の 4.5:1 を
     満たす明るさにしてある。Tokyo Night 本来の #787c99 / #565f89 は、
     暗い面の上では 2.2〜4.4:1 しかなく、Lighthouse のアクセシビリティで
     大きく減点されていた（issue #52） */
  --muted: #9699b7;
  --muted-2: #8a8fae;
  --text-muted: var(--muted); /* 既存ページのインラインスタイル互換 */

  /* accents */
  --primary: #bb9af7;      /* 藤色（ブランド） */
  --primary-2: #9d7cd8;
  --blue: #7aa2f7;
  --cyan: #7dcfff;
  --mint: #73daca;
  --green: #9ece6a;
  --orange: #ff9e64;
  --orange-2: #e08a4b;
  --gold: #e0af68;
  --danger: #f7768e;
  --ink: #1a1b26;          /* 明色ボタンの上に載せる文字色 */

  /* code — Tokyo Night シンタックス */
  --code-bg: #16161e;
  --code-fg: #c0caf5;
  --tok-comment: #8a8fae; /* --code-bg の上で 5.7:1（muted-2 と同じ理由） */
  --tok-keyword: #bb9af7;
  --tok-string: #9ece6a;
  --tok-number: #ff9e64;
  --tok-func: #7aa2f7;
  --tok-type: #2ac3de;
  --tok-op: #89ddff;
  --tok-prompt: #73daca;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1200px;
  /* 端からの余白。狭い画面では下のメディアクエリで詰める */
  --gutter: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  /* 内容が短いページでもフッターを最下部に置く */
  display: flex;
  flex-direction: column;
}
body > .site-footer { margin-top: auto; }

/* 中央上部のごく淡いスポットライト。派手な発光はしない */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(187, 154, 247, 0.08), transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 15%, rgba(122, 162, 247, 0.06), transparent 70%);
}

img, svg { max-width: 100%; display: block; }

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text-hi); }
/* 文の中のリンクは、色だけでなく下線でも見分けられるようにする。
   色だけだと、色覚によっては周りの文字と区別がつかない（issue #52） */
:where(p, label, .legal-body li) a:not(.btn) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}

::selection { background: rgba(122, 162, 247, 0.35); color: var(--text-hi); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* 固定ヘッダーの下にアンカー先が潜り込まないようにする */
[id] { scroll-margin-top: 84px; }

/* ---------- 見出しの共通トーン（詰め気味・太め） ---------- */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.18;
  color: var(--text);
}
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.05rem; letter-spacing: -0.02em; line-height: 1.4; }

/* 2行目に敷くハイライト（参照サイトの特徴的な処理）。
   以前は inline-block + ::after で敷いていたが、その形だと画面が狭くて
   中の文字が折り返したときに、帯がブロック全体の幅いっぱいに伸びてしまう。
   背景のグラデーションで描いて、行ごとに帯が付くようにしてある。 */
.hl {
  --hl: rgba(169, 177, 214, 0.18);
  display: inline;
  padding: 0 4px; margin: 0 -4px;
  background-image: linear-gradient(var(--hl), var(--hl));
  background-repeat: no-repeat;
  background-size: 100% 0.34em;
  /* インライン要素の背景は行ボックスではなくフォントの上下いっぱいに描かれるので、
     旧実装と同じ位置に見えるところまで持ち上げている */
  background-position: 0 calc(100% - 0.26em);
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hl-primary { --hl: rgba(187, 154, 247, 0.38); }
.hl-mint { --hl: rgba(115, 218, 202, 0.3); }

/* 本文中の強調（太字＋下線） */
strong, .em { color: var(--text); font-weight: 700; }
.u { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.t-primary { color: var(--primary); }
.t-mint { color: var(--mint); }
.t-orange { color: var(--orange); }

.eyebrow {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted-2);
}

/* ============================================================
   ヘッダー：中央に浮かぶバー
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  padding: 14px 0;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 52px; padding: 0 8px 0 18px;
  /* container 直下に置いているので、左右の余白はガターが作る */
  background: rgba(22, 22, 30, 0.86);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.logo {
  font-size: 0.95rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); white-space: nowrap;
}
.logo span { color: var(--primary); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--muted); font-size: 0.82rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text-hi); background: rgba(192, 202, 245, 0.06); }
.main-nav a.current { color: var(--text); }

.btn-login {
  background: var(--text-2); color: var(--ink) !important;
  font-weight: 700; font-size: 0.8rem !important;
  padding: 8px 15px !important; border-radius: var(--radius-sm);
  margin-left: 6px;
}
.btn-login:hover { background: var(--text-hi); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  width: 36px; height: 36px; cursor: pointer; font-size: 1rem;
}

/* 表示言語の切り替え（日本語 / English）。
   ヘッダーの中では 2 つ並びのトグル、狭い画面では 1 行いっぱいに広がる */
.lang-switch { display: inline-flex; margin-left: 6px; }
.lang-switch-group {
  display: inline-flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 2px;
}
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.76rem; font-weight: 600;
  color: var(--muted); padding: 5px 11px; border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.lang-btn:hover { color: var(--text-hi); }
.lang-btn.current { background: var(--surface-3); color: var(--text); cursor: default; }
.lang-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* 読み上げにだけ渡したい文字。画面には出さないが display:none とは違い、
   支援技術からは読める */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* critical:end */
/* ============================================================
   メンテナンス中の帯（スタッフにだけ見える）
   ============================================================ */
.maintenance-bar {
  background: rgba(255, 158, 100, 0.1);
  border-bottom: 1px solid rgba(255, 158, 100, 0.28);
  padding: 8px 0;
}

/* 帯は高さ1行ぶんで固定。折り返して header を押し下げると、
   メンテナンス中だけレイアウトが変わってしまうため。
   幅が足りないときは text-overflow に任せて末尾を削る */
.maintenance-bar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: nowrap;
}
.maintenance-bar-text {
  flex: 1 1 auto; min-width: 0;
  font-size: 0.82rem; color: var(--text-2); line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.maintenance-bar-icon { margin-right: 4px; }
.maintenance-bar-text strong { color: var(--orange); font-weight: 700; }
.maintenance-bar-until {
  margin-left: 6px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--orange-2);
}
/* 削られていいのはここだけ。見出しと再開予定より後ろに置いてある */
.maintenance-bar-note { margin-left: 8px; }
/* ボタンは何があっても縮めない（解除できないと帯の意味がない） */
.maintenance-bar-form { flex: 0 0 auto; }
.maintenance-bar-btn {
  background: var(--orange); color: var(--ink);
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-size: 0.78rem; font-weight: 700;
  padding: 7px 14px; white-space: nowrap;
}
.maintenance-bar-btn:hover { background: var(--orange-2); }
.maintenance-bar-btn:focus-visible { outline: 2px solid var(--text-hi); outline-offset: 2px; }

/* ============================================================
   ボタン
   ============================================================ */
/* critical:start */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.86rem; font-weight: 700;
  letter-spacing: -0.01em; cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--text-2); color: var(--ink); }
.btn-primary:hover { background: var(--text-hi); color: var(--ink); }

.btn-outline {
  background: rgba(192, 202, 245, 0.03); color: var(--text-2);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }

.btn-accent { background: var(--primary); color: var(--ink); }
.btn-accent:hover { background: var(--primary-2); color: var(--ink); }

.btn-ghost { background: none; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text-hi); background: rgba(192, 202, 245, 0.06); }

.btn-sm { padding: 7px 14px; font-size: 0.78rem; }
.btn-lg { padding: 13px 26px; font-size: 0.92rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   セクションの帯とヘアライン
   ============================================================ */
section { padding: 84px 0; border-top: 1px solid var(--border-soft); }
section.band { background: var(--bg-band); }
section.flush { border-top: none; }

.section-title { text-align: center; margin-bottom: 14px; }
.section-lead {
  color: var(--muted); max-width: 620px; margin: 0 auto 46px;
  text-align: center; font-size: 0.94rem;
}
.section-head { max-width: 560px; margin-bottom: 30px; }
.section-head p { color: var(--muted); font-size: 0.92rem; margin-top: 12px; }
/* critical:end */

/* 交互配置の2カラム（参照サイトの機能紹介セクション） */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.split.reverse .split-visual { order: -1; }
.split-body h2 { margin-bottom: 14px; }
.split-body > p { color: var(--muted); font-size: 0.92rem; margin-bottom: 20px; }

.check-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.check-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.88rem; color: var(--text-2);
}
.check-list li::before {
  content: "✓"; color: var(--mint); font-weight: 700;
  font-size: 0.82rem; line-height: 1.75; flex-shrink: 0;
}

/* ============================================================
   ヒーロー（中央寄せ）
   ============================================================ */
/* critical:start */
.hero { padding: 92px 0 72px; text-align: center; border-top: none; }
.hero h1 { margin: 0 auto 22px; max-width: 780px; }
.hero-sub {
  color: var(--muted); font-size: 0.95rem; max-width: 560px;
  margin: 0 auto 30px; line-height: 1.75;
}
.hero-ctas { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 46px; }
.hero-art {
  max-width: 860px; margin: 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
  background: var(--surface);
}

/* ヒーロー下のバナー */
.banner-carousel { position: relative; max-width: 620px; margin: 0 auto 44px; }
.banner-track { display: flex; overflow: hidden; border-radius: var(--radius); }
.banner {
  min-width: 100%; padding: 14px 20px;
  display: flex; align-items: center; gap: 10px; justify-content: center;
  font-size: 0.85rem; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.banner:hover { background: var(--surface-2); color: var(--text); }
.banner-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; cursor: pointer; font-size: 0.9rem;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--radius-pill);
}
.banner-nav:hover { color: var(--text); background: var(--surface-3); }
.banner-prev { left: -14px; } .banner-next { right: -14px; }
/* critical:end */

/* ============================================================
   数値／about
   ============================================================ */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 1px; background: var(--border-soft);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 40px;
}
.stat { background: var(--surface); padding: 22px 18px; text-align: center; }
.stat b {
  display: block; font-size: 1.7rem; font-weight: 800;
  letter-spacing: -0.04em; color: var(--text);
}
.stat span { font-size: 0.74rem; color: var(--muted-2); }

.about-card {
  display: grid; grid-template-columns: 88px 1fr; gap: 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; max-width: 800px; margin: 0 auto;
}
.avatar {
  width: 88px; height: 88px; border-radius: var(--radius-pill);
  background: linear-gradient(150deg, var(--primary), #7aa2f7);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em;
}
.about-card h3 { margin-bottom: 8px; }
.about-card p { font-size: 0.88rem; color: var(--muted); }

/* ============================================================
   コースカード
   ============================================================ */
.course-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px;
}
.course-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.course-card:hover { border-color: var(--border-2); background: var(--surface-2); }
.course-card h3 { font-size: 1.02rem; }
.course-card p { font-size: 0.85rem; color: var(--muted); flex: 1; }
.course-card .mod {
  font-family: var(--mono); font-size: 0.66rem; color: var(--muted-2);
  letter-spacing: 0.16em;
}
.course-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* トップのカテゴリー絞り込み（チップ自体はコラム／スタッフと共通） */
.course-filter { margin: -16px 0 22px; }

/* critical:start */
.badge {
  align-self: flex-start; font-size: 0.68rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-pill);
  border: 1px solid transparent; letter-spacing: 0;
}
.badge-free { background: rgba(115, 218, 202, 0.12); color: var(--mint); border-color: rgba(115, 218, 202, 0.28); }
.badge-mid { background: rgba(224, 175, 104, 0.12); color: var(--gold); border-color: rgba(224, 175, 104, 0.28); }
.badge-soon { background: var(--surface-2); color: var(--muted-2); border-color: var(--border); }
.badge-video { background: rgba(187, 154, 247, 0.12); color: var(--primary); border-color: rgba(187, 154, 247, 0.3); }
.badge-done { background: rgba(115, 218, 202, 0.12); color: var(--mint); border-color: rgba(115, 218, 202, 0.28); }
/* critical:end */

/* ============================================================
   学習の進捗バー（ダッシュボード・コース概要）
   進行中は藤色、修了したらミント（Free の札・正解の文字と同じ色）。
   ============================================================ */
.progress { width: 100%; }
.progress-track {
  height: 8px; border-radius: var(--radius-pill); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.progress-fill {
  height: 100%; border-radius: var(--radius-pill);
  background: var(--primary); transition: width 0.4s ease;
}
.progress.is-complete .progress-fill { background: var(--mint); }
.progress-meta {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 8px;
  font-size: 0.78rem; color: var(--muted);
}
.progress-percent { font-family: var(--mono); font-weight: 700; color: var(--text-2); }
.progress.is-complete .progress-percent { color: var(--mint); }

/* ダッシュボードの「学習をつづける」カード。ボタンは説明の長さによらず下端に */
.progress-card { display: flex; flex-direction: column; }
.progress-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.progress-card .progress { margin: 4px 0 18px; }
.progress-card .btn { margin-top: auto; align-self: flex-start; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.68rem; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); padding: 2px 9px; border-radius: var(--radius-pill);
}

/* ============================================================
   特徴カード
   ============================================================ */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: border-color 0.18s ease;
}
.feature:hover { border-color: var(--border-2); }
.feature .icon { font-size: 1.4rem; margin-bottom: 12px; }
.feature h3 { margin-bottom: 8px; }
.feature p { font-size: 0.86rem; color: var(--muted); }

/* メンバーシップ誘導 */
.membership-teaser {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 56px 36px; text-align: center;
}
.membership-teaser h2 { margin-bottom: 14px; }
.membership-teaser p { max-width: 520px; margin: 0 auto 26px; color: var(--muted); font-size: 0.92rem; }

/* ============================================================
   料金
   ============================================================ */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 16px; }
/* 2 枚だけ並べる行。auto-fit のままだと 1 枚が画面幅いっぱいに伸びて、
   上の 3 枚と大きさが揃わない。 */
.pricing-grid-narrow { max-width: 760px; }
.price-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.price-card.featured { border-color: rgba(187, 154, 247, 0.5); background: var(--surface-2); }
.price-card .plan-tag {
  position: absolute; top: 16px; right: 16px;
  background: rgba(224, 175, 104, 0.16); color: var(--gold);
  border: 1px solid rgba(224, 175, 104, 0.32);
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em;
  padding: 2px 9px; border-radius: var(--radius-pill);
}
.price-card h3 { font-size: 0.95rem; }
.price { font-size: 2rem; font-weight: 800; letter-spacing: -0.045em; color: var(--text); }
.price small { font-size: 0.78rem; font-weight: 500; color: var(--muted-2); margin-left: 4px; }
.plan-desc { font-size: 0.84rem; color: var(--muted); }
.plan-features { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.plan-features li {
  font-size: 0.83rem; color: var(--text-2);
  display: flex; gap: 9px; align-items: flex-start;
}
.plan-features li::before { content: "✓"; color: var(--mint); flex-shrink: 0; font-size: 0.8rem; }
.plan-features li.na { color: var(--muted-2); }
.plan-features li.na::before { content: "✓"; color: #3b4261; }

/* ============================================================
   進め方（flow）
   ============================================================ */
.flow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.flow-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.flow-card .cadence {
  display: inline-block; font-family: var(--mono); font-size: 0.66rem;
  color: var(--primary); background: rgba(187, 154, 247, 0.12);
  border: 1px solid rgba(187, 154, 247, 0.24);
  padding: 2px 9px; border-radius: var(--radius-pill); letter-spacing: 0.08em;
}
.flow-card h3 { margin: 12px 0 8px; }
.flow-card p { font-size: 0.86rem; color: var(--muted); }

/* ============================================================
   FAQ（左に見出し／右に一問一答のヘアライン区切り）
   ============================================================ */
.faq-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: start; }
.faq-list { border-top: 1px solid var(--border-soft); }
.faq-item { border-bottom: 1px solid var(--border-soft); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--text); font-family: inherit; font-size: 0.9rem; font-weight: 700;
  letter-spacing: -0.01em; padding: 18px 40px 18px 0; position: relative;
}
.faq-q:hover { color: var(--text-hi); }
.faq-q::after {
  content: "+"; position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%); color: var(--muted-2); font-weight: 400; font-size: 1.1rem;
}
.faq-item.open .faq-q::after { content: "−"; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.24s ease; }
.faq-a p { padding: 0 20px 20px 0; font-size: 0.86rem; color: var(--muted); }

/* ============================================================
   ニュースレター
   ============================================================ */
.newsletter-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 44px 36px; text-align: center;
}
.newsletter-box h2 { margin-bottom: 10px; }
.newsletter-box > p { color: var(--muted); font-size: 0.9rem; max-width: 460px; margin: 0 auto; }
.newsletter-form {
  display: flex; gap: 8px; margin: 22px auto 0; max-width: 440px; flex-wrap: wrap;
}
.newsletter-form input {
  flex: 1; min-width: 200px; padding: 11px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 0.88rem;
}
.newsletter-form input::placeholder { color: var(--muted-2); }
.newsletter-form input:focus { outline: none; border-color: var(--primary); }
.newsletter-art { display: none; }
.form-note { font-size: 0.8rem; color: var(--mint); margin-top: 12px; min-height: 1.2em; }

/* ============================================================
   フッター
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 32px; margin-top: 0; background: var(--bg-band);
}
.footer-top {
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px;
  padding-bottom: 40px;
}
.footer-brand strong { display: block; font-size: 0.95rem; font-weight: 800; margin-bottom: 12px; }
.footer-brand p { font-size: 0.82rem; color: var(--muted); max-width: 320px; }
.footer-heading {
  font-size: 0.78rem; font-weight: 700; letter-spacing: normal; line-height: inherit;
  margin-bottom: 14px; color: var(--text);
}
.footer-col a {
  display: block; font-size: 0.8rem; color: var(--muted);
  padding: 5px 0;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between;
  border-top: 1px solid var(--border-soft); padding-top: 22px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { font-size: 0.78rem; color: var(--muted-2); }
.footer-links a:hover { color: var(--text-2); }
.copyright { font-size: 0.78rem; color: var(--muted-2); }

/* ============================================================
   下層ページのヒーロー
   ============================================================ */
/* critical:start */
.page-hero { padding: 66px 0 40px; text-align: center; border-top: none; }
/* span のままだと上下の padding が行の高さに入らず、札が見出しに接してしまう */
.page-hero .badge { display: inline-block; margin-bottom: 16px; }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 14px; }
.page-hero p { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: 0.92rem; }
/* critical:end */

/* ============================================================
   コース詳細（レッスン一覧）
   ============================================================ */
.lesson-list { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--border-soft); }
.lesson-row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 4px; border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s ease;
}
.lesson-row:hover { background: rgba(192, 202, 245, 0.03); }
.lesson-num {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.lesson-row .lesson-meta { flex: 1; }
.lesson-row h3 { font-size: 0.94rem; }
.lesson-row p { font-size: 0.82rem; color: var(--muted); }
.lesson-row.is-done .lesson-num {
  background: rgba(115, 218, 202, 0.12); border-color: rgba(115, 218, 202, 0.28); color: var(--mint);
}

/* コース概要のヒーローに置く全体の進捗 */
.course-progress { max-width: 420px; margin: 22px auto 0; text-align: left; }
.page-hero .badge + .badge { margin-left: 6px; }

/* ============================================================
   レッスン本文
   ============================================================ */
/* critical:start */
.lesson-layout {
  display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px;
  /* container と同じクラスに当てるので、左右のガターを打ち消さないこと */
  padding: 44px var(--gutter) 80px; align-items: start;
}
/* グリッドの子は既定で「中身より狭くならない（min-width: auto）」。
   コードブロックのように折り返さない中身があると、列がその行の長さまで広がり、
   レッスン全体が画面からはみ出す（body の overflow-x: hidden で右側が切れる）。
   列と子の両方を 0 まで縮められるようにして、長い行はコードブロックの中で
   横に送らせる。 */
.lesson-sidebar, .lesson-content { min-width: 0; }
.lesson-sidebar { position: sticky; top: 96px; }
.lesson-sidebar h4 {
  font-size: 0.72rem; color: var(--muted-2); margin-bottom: 12px;
  font-family: var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
}
.lesson-sidebar ol { list-style: none; }
.lesson-sidebar li { margin-bottom: 2px; }
.lesson-sidebar a {
  display: block; padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 0.84rem; color: var(--muted);
}
.lesson-sidebar a:hover { color: var(--text); background: rgba(192, 202, 245, 0.05); }
.lesson-sidebar a.active { color: var(--text); background: var(--surface-2); }

/* 器（--container）を広げても、読む段は広げない。行が長くなるほど
   目が行頭に戻りにくくなる。サイドバーの右に余白が出るのは想定どおり。 */
.lesson-content { max-width: 820px; }
.lesson-content h1 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 8px; }
.lesson-content .crumb { font-size: 0.8rem; color: var(--muted-2); margin-bottom: 20px; }
.lesson-done { margin: 4px 0 8px; }
.lesson-done[hidden] { display: none; }
.side-done { color: var(--mint); font-weight: 700; }
.lesson-content h2 { font-size: 1.24rem; margin: 36px 0 12px; }
.lesson-content p { margin-bottom: 14px; color: var(--text-2); font-size: 0.94rem; }
.lesson-content code, .article-body code, .api-note code {
  background: var(--code-bg); color: var(--cyan);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-family: var(--mono); font-size: 0.85em;
  /* 空白を含まない長いコード名や URL でも、狭い画面で行を押し広げない */
  overflow-wrap: anywhere;
}

/* critical:end */
/* コードランナー */
.runner {
  margin: 22px 0; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.runner-head {
  background: var(--surface-2); color: var(--muted);
  padding: 10px 16px; font-size: 0.76rem; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
/* ファイル名が長くても枠を押し広げない */
.runner-head > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.runner textarea {
  width: 100%; min-height: 180px; border: none; resize: vertical; display: block;
  background: var(--code-bg); color: var(--code-fg);
  caret-color: var(--tok-op);
  padding: 16px; font-size: 0.86rem; font-family: var(--mono); line-height: 1.7;
  tab-size: 4;
}
.runner textarea:focus { outline: none; }
.runner textarea::selection { background: rgba(122, 162, 247, 0.3); color: var(--text-hi); }
.runner-bar {
  background: var(--surface-2); padding: 10px 16px;
  display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--border);
}
.runner-out {
  background: var(--code-bg); color: var(--mint); padding: 14px 16px;
  font-family: var(--mono); font-size: 0.83rem; white-space: pre-wrap; min-height: 1.4em;
  border-top: 1px solid var(--border);
}
.runner-out .err { color: var(--danger); }
.runner-status { font-size: 0.74rem; color: var(--muted-2); }

.preview-frame { width: 100%; height: 240px; border: none; background: #fff; display: none; }
.codeblock {
  background: var(--code-bg); color: var(--code-fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin: 20px 0; overflow-x: auto;
  font-family: var(--mono); font-size: 0.84rem; line-height: 1.7; white-space: pre;
  tab-size: 4;
}
.codeblock-label {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 2px 11px; margin-bottom: 10px; letter-spacing: 0.06em;
  /* src/main/java/... のような長いパスでも、狭い画面ではみ出さずに折り返す */
  max-width: 100%; overflow-wrap: anywhere;
}

/* ---------- 表 ----------
   もとは空白で桁を揃えた文字列を .codeblock に入れていた。等幅フォントに
   日本語のグリフが無いので、全角の幅が半角ちょうど 2 つぶんにならず、
   列がまったく揃わなかった。幅の計算はブラウザに任せる。 */
.datatable-wrap { margin: 22px 0; }
.datatable-lead, .datatable-note {
  font-size: 0.88rem; color: var(--text-2); margin: 0 0 10px;
}
.datatable-note { margin: 12px 0 0; }
.datatable {
  width: 100%; border-collapse: collapse;
  font-size: 0.87rem; line-height: 1.65;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.datatable th {
  text-align: left; font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.04em; color: var(--muted);
  background: var(--surface-2); padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  /* 見出しは折り返さず、幅は中身に任せる */
  white-space: nowrap;
}
.datatable td {
  padding: 10px 14px; vertical-align: top;
  border-top: 1px solid var(--border-soft); color: var(--text-2);
}
.datatable tbody tr:first-child td { border-top: 0; }
.datatable tbody tr:nth-child(even) { background: rgba(192, 202, 245, 0.02); }
.datatable td:first-child { color: var(--text); font-weight: 600; }
/* 数字は右に寄せない。「1.5」と「—」が混ざる列があり、
   右寄せにすると桁がそろって見えて、比べられない値まで比べたくなる */
.datatable code {
  font-family: var(--mono); font-size: 0.92em;
  background: var(--code-bg); border-radius: 5px; padding: 1px 5px;
}
/* 広い画面では列名は見出し行にあるので、セルの中のものは出さない */
.datatable-key { display: none; }

/* 狭い画面。横に振りながら読むのはつらいので、1 行 1 枚のカードに組み替える。
   列名がセルから離れるため、セルの中に持たせた列名をここで出す。 */
@media (max-width: 680px) {
  .datatable, .datatable tbody, .datatable tr, .datatable td { display: block; }
  .datatable thead { display: none; }
  .datatable { border: 0; background: none; }
  .datatable tr {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
  }
  .datatable tbody tr:nth-child(even) { background: var(--surface); }
  .datatable td { border: 0; padding: 3px 0; }
  .datatable tbody tr:first-child td { border-top: 0; }
  .datatable td:first-child {
    font-size: 0.95rem; margin-bottom: 4px;
    padding-bottom: 7px; border-bottom: 1px solid var(--border-soft);
  }
  /* 中身が空のセルは、列名だけが残っても読む人の役に立たない */
  .datatable td:empty { display: none; }
  .datatable-key {
    display: inline; color: var(--muted); font-weight: 400;
    font-size: 0.78rem; margin-right: 7px;
  }
  /* 1 列目はカードの見出しなので、列名を添えない */
  .datatable td:first-child .datatable-key { display: none; }
}

/* ---------- 図 ----------
   もとは `+----+` や罫線文字で枠を描いていた。枠の中に日本語が入ると
   等幅でも桁が合わず、縦線の位置がばらばらになる。枠は CSS に描かせる。 */
.figure-wrap { margin: 22px 0; }
.figure-node {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 15px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
/* 長いハッシュのような、途中で切れない文字列を入れる箱がある。
   折り返させないと枠からはみ出して、頭のほうしか読めなくなる */
.figure-label {
  font-size: 0.88rem; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere;
}
.figure-sub, .figure-note {
  font-size: 0.76rem; color: var(--muted); overflow-wrap: anywhere;
}

/* 工程の流れ。1 つの「組」に 2 つ以上入れると枝分かれ・合流になる */
.figure-flow { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px 0; }
/* 矢印と、その矢印が指す段。折り返しても離れないように一組にしてある */
.figure-link {
  display: flex; align-items: center; gap: 12px;
  flex: 1 1 165px; min-width: 0;
}
.figure-flow .figure-step {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto; min-width: 0;
}
.figure-arrow { color: var(--primary); font-size: 1.1rem; flex: 0 0 auto; }

/* 対比。幅が足りなくなったところで折り返す（端末の名前では決めない） */
.figure-compare {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.figure-col {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.figure-col-title {
  font-size: 0.86rem; font-weight: 700; color: var(--text);
  margin: 0 0 10px; padding-bottom: 9px;
  border-bottom: 1px solid var(--border-soft);
}
.figure-col ul { margin: 0; padding-left: 18px; }
.figure-col li { font-size: 0.85rem; color: var(--text-2); margin: 5px 0; }

/* 層の積み重ね。上から順に積む。箱の高さはそろえない
   （「厚み」に意味があると読まれてしまう） */
.figure-stack {
  display: grid; gap: 14px; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.figure-layer {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; margin-bottom: 6px;
  font-size: 0.82rem; color: var(--text-2); text-align: center;
}
.figure-col-note { font-size: 0.76rem; color: var(--muted); margin: 8px 0 0; }

/* 相手とのやり取り。誰から誰へ、を 1 行ずつ */
.figure-sequence {
  list-style: none; margin: 0; padding: 0;
  counter-reset: figure-seq;
}
.figure-sequence li {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 8px;
  font-size: 0.85rem; color: var(--text-2);
}
.figure-sequence li::before {
  counter-increment: figure-seq; content: counter(figure-seq);
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  min-width: 1.4em;
}
.figure-party { font-weight: 600; color: var(--text); }
.figure-msg { flex: 1 1 200px; }

@media (max-width: 680px) {
  /* 縦に積む。矢印も下向きに倒す */
  .figure-flow, .figure-link { flex-direction: column; align-items: stretch; }
  .figure-flow .figure-arrow { align-self: center; transform: rotate(90deg); }
}

/* ---------- シンタックストークン（Tokyo Night） ---------- */
.codeblock .tok-comment { color: var(--tok-comment); font-style: italic; }
.codeblock .tok-string  { color: var(--tok-string); }
.codeblock .tok-number  { color: var(--tok-number); }
.codeblock .tok-keyword { color: var(--tok-keyword); }
.codeblock .tok-type    { color: var(--tok-type); }
.codeblock .tok-func    { color: var(--tok-func); }
.codeblock .tok-op      { color: var(--tok-op); }
.codeblock .tok-prompt  { color: var(--tok-prompt); }
.codeblock .tok-cmd     { color: var(--tok-func); }
.codeblock .tok-flag    { color: var(--tok-number); }

/* 演習（課題と実装手順） */
.task {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius); padding: 22px 24px; margin: 26px 0;
}
.lesson-content .task-label {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 10px; font-weight: 700;
}
.lesson-content .task p:last-child { margin-bottom: 0; }
.task ul {
  list-style: none; margin: 12px 0 0; display: flex; flex-direction: column; gap: 7px;
}
.task ul li {
  position: relative; padding-left: 20px;
  color: var(--text-2); font-size: 0.92rem; line-height: 1.75;
}
.task ul li::before {
  content: "▸"; position: absolute; left: 2px; color: var(--orange-2);
}
.task-out {
  background: var(--code-bg); color: var(--code-fg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-top: 14px; overflow-x: auto;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.7; white-space: pre;
}

.steps { margin: 24px 0; }
.lesson-content .steps-label {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px; font-weight: 700;
}
.steps ol {
  list-style: none; counter-reset: step;
  display: flex; flex-direction: column; gap: 10px; margin: 0;
}
.steps ol li {
  counter-increment: step; position: relative; padding: 11px 16px 11px 46px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 0.9rem; line-height: 1.7;
}
.steps ol li::before {
  content: counter(step); position: absolute; left: 14px; top: 11px;
  width: 20px; height: 20px; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--primary);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 解説動画。

   枠は 16:9 で高さを持たせる。iframe を素で置くと読み込み中の高さが 0 になり、
   本文が下から跳ね上がって読んでいる場所を見失う。 */
.lesson-video { margin: 26px 0; }
.lesson-video-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lesson-video-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.lesson-video figcaption {
  margin-top: 10px; font-size: 0.82rem; color: var(--muted);
  display: flex; flex-direction: column; gap: 4px;
}
.lesson-video-title { color: var(--text-2); font-weight: 700; font-size: 0.86rem; }

/* 映像プランでない人に出す案内。本文は読めるので、行き止まりには見せない */
.video-locked {
  background: var(--surface); border: 1px dashed var(--border-2);
  border-radius: var(--radius); padding: 28px 24px; margin: 26px 0;
  text-align: center;
}
.video-locked-icon { font-size: 1.6rem; margin-bottom: 8px; }
.video-locked h3 { font-size: 0.95rem; margin-bottom: 8px; }
.video-locked p { font-size: 0.84rem; color: var(--muted); }

/* クイズ */
.quiz {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin: 26px 0;
}
.quiz h3 { margin-bottom: 14px; }
.quiz-choices { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.quiz-choices label {
  display: flex; gap: 10px; align-items: center; cursor: pointer;
  padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: 0.88rem; transition: border-color 0.15s ease;
}
.quiz-choices label:hover { border-color: var(--border-2); }
.quiz-choices input[type="radio"] { accent-color: var(--primary); }
.quiz-result { font-weight: 700; font-size: 0.86rem; min-height: 1.4em; }
.quiz-result.ok { color: var(--mint); }
.quiz-result.ng { color: var(--danger); }
.quiz-note { margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.quiz-note a { color: var(--primary); }

.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; }

/* ============================================================
   認証まわり
   ============================================================ */
.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px; font-size: 0.8rem;
}
.user-chip a { color: var(--text-2); font-weight: 600; }
/* ダッシュボードへの入口。広い画面ではアイコンだけ、メニューが縦に並ぶ狭い画面では文字も出す */
.main-nav .nav-profile {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 30px; height: 30px; padding: 0; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--text-2);
}
.main-nav .nav-profile:hover { background: var(--border-2); color: var(--text-hi); }
.nav-profile-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.user-chip button {
  background: none; border: none; cursor: pointer;
  color: var(--muted-2); font-family: inherit; font-size: 0.76rem;
}
.user-chip button:hover { color: var(--text); }

.auth-card {
  max-width: 420px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 32px;
}
.auth-card label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); margin: 16px 0 6px;
}
.auth-card input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 0.9rem;
}
.auth-card input::placeholder { color: var(--muted-2); }
.auth-card input:focus { outline: none; border-color: var(--primary); }
.auth-msg { font-size: 0.84rem; margin-top: 12px; min-height: 1.3em; font-weight: 600; }
.auth-msg.ok { color: var(--mint); }
.auth-msg.ng { color: var(--danger); }
.plan-pill {
  display: inline-block; background: rgba(187, 154, 247, 0.14);
  border: 1px solid rgba(187, 154, 247, 0.32); color: var(--primary);
  border-radius: var(--radius-pill); padding: 4px 14px;
  font-weight: 700; font-size: 0.8rem;
}

/* ============================================================
   API ステータス通知（バックエンド未起動時）
   ============================================================ */
.api-note {
  display: none; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 24px;
  font-size: 0.82rem; color: var(--muted); line-height: 1.7;
}
.api-note.show { display: flex; }
.api-note b { color: var(--text-2); }

/* 読み込み中 */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius); color: transparent;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-card { height: 220px; border: 1px solid var(--border); }

.empty-state {
  text-align: center; padding: 64px 20px; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.88rem;
}
.empty-state b { display: block; color: var(--text); margin-bottom: 6px; font-size: 0.95rem; }

/* ============================================================
   ツールバー（検索＋フィルタ）— コラム／スタッフ共通
   ============================================================ */
/* 一覧のいちばん上に出る。後読みの css で高さが変わると、その下の一覧が
   まるごと押し下げられる（コラム一覧の CLS の元、issue #52） */
/* critical:start */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  justify-content: space-between; margin-bottom: 22px;
}
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
.search-box input {
  width: 100%; padding: 9px 14px 9px 34px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 0.86rem;
}
.search-box input::placeholder { color: var(--muted-2); }
.search-box input:focus { outline: none; border-color: var(--border-2); background: var(--surface-2); }
.search-box::before {
  content: "⌕"; position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%); color: var(--muted-2); font-size: 1rem; pointer-events: none;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; font-family: inherit;
  font-size: 0.78rem; font-weight: 600; padding: 6px 13px;
  border-radius: var(--radius-pill);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.active { background: var(--text-2); border-color: var(--text-2); color: var(--ink); }
.result-count { font-size: 0.78rem; color: var(--muted-2); margin-bottom: 20px; }
.result-count b { color: var(--text-2); }
/* critical:end */

/* ============================================================
   コラム一覧
   ============================================================ */
/* 注目記事は一覧のいちばん上に大きく出るので、最初の画面ぶんに入れる。
   後読みの css で 2 列に組み直されると、PC で CLS が 0.3 を超えていた（issue #52） */
/* critical:start */
.column-featured {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 28px;
  transition: border-color 0.18s ease;
}
.column-featured:hover { border-color: var(--border-2); }
.column-featured .cover { min-height: 260px; border-right: 1px solid var(--border); border-bottom: none; }
.column-featured .body { padding: 34px 32px; display: flex; flex-direction: column; gap: 14px; }
.column-featured h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
.column-featured p { color: var(--muted); font-size: 0.9rem; }
/* critical:end */

.column-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.column-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.column-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.column-card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.column-card h3 { font-size: 1rem; }
.column-card p { font-size: 0.84rem; color: var(--muted); flex: 1; }

/* 記事カバー：画像を持たないので低彩度のグラデーションで代用 */
/* critical:start */
.cover {
  position: relative; min-height: 148px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(187, 154, 247, 0.18), transparent 70%), var(--surface-2);
}
.cover.c-2 { background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(122, 162, 247, 0.16), transparent 70%), var(--surface-2); }
.cover.c-3 { background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(255, 158, 100, 0.14), transparent 70%), var(--surface-2); }
.cover .glyph { font-size: 2.4rem; opacity: 0.9; }
/* critical:end */
.cover .cat {
  position: absolute; left: 16px; top: 16px;
  background: rgba(22, 22, 30, 0.72); backdrop-filter: blur(6px);
  border: 1px solid var(--border); color: var(--text-2);
  font-size: 0.68rem; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.post-meta {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 0.74rem; color: var(--muted-2);
}
.post-meta .author { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.post-meta .mini-avatar {
  width: 20px; height: 20px; border-radius: var(--radius-pill);
  background: linear-gradient(150deg, var(--primary), #7aa2f7);
  color: var(--ink); font-size: 0.58rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.pager {
  display: flex; justify-content: center; align-items: center; gap: 14px;
  margin-top: 36px; font-size: 0.82rem;
}
.pager .page-state { color: var(--muted-2); }
.pager .page-state b { color: var(--text-2); }

/* ============================================================
   コラム記事
   ============================================================ */
/* critical:start */
.article-layout {
  /* 1fr のままだと、本文のコードブロックのように折り返さない中身が
     列を押し広げてしまう（.lesson-layout と同じ理由） */
  display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px;
  padding: 36px var(--gutter) 80px; align-items: start;
}
.article-layout > main { min-width: 0; }
.article-head { margin-bottom: 28px; }
.article-head .crumb { font-size: 0.8rem; color: var(--muted-2); margin-bottom: 16px; }
.article-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: 16px; }
.article-head .lead { color: var(--muted); font-size: 0.94rem; margin-bottom: 18px; }
/* critical:end */
/* プロジェクト本文。字の組みは .lesson-content を併用し、こちらは幅と余白だけ。
   サイドバーが無いので中央に置く。 */
.project-body { max-width: 820px; margin: 0 auto; padding: 44px 0 80px; }

.article-body { max-width: 680px; }
.article-body h2 { font-size: 1.3rem; margin: 40px 0 14px; }
.article-body h3 { font-size: 1.02rem; margin: 26px 0 10px; }
.article-body p { margin-bottom: 16px; color: var(--text-2); font-size: 0.95rem; }
/* リスト。
   以前は li を flex にして ::before で "—" を出していたが、その形だと
   入れ子のリストが親項目の横に並んでしまい、番号つきリストも "—" になった。
   マーカーを絶対配置にして、項目の中身は通常の流し込みに戻してある。 */
.article-body ul, .article-body ol { margin: 0 0 18px 0; padding-left: 0; list-style: none; }
.article-body li {
  position: relative; padding-left: 22px; margin-bottom: 8px;
  font-size: 0.92rem; color: var(--text-2);
}
.article-body li::before {
  position: absolute; left: 0; top: 0; color: var(--muted-2);
}
.article-body ul > li::before { content: "—"; }

/* 番号つきリストは、実際の番号を出す（list-style を切っているので自前で数える） */
.article-body ol { counter-reset: article-ol; }
.article-body ol > li { counter-increment: article-ol; }
.article-body ol > li::before {
  content: counter(article-ol) "."; font-family: var(--mono);
  font-size: 0.85em; line-height: 1.75;
}

/* 入れ子。深さで印を変えて、階層が読み取れるようにする */
.article-body li > ul, .article-body li > ol { margin: 8px 0 0; }
.article-body li > ul > li::before { content: "·"; }
.article-body li > ul > li > ul > li::before { content: "◦"; }
.article-body li > p { margin-bottom: 8px; }
.article-body li > p:last-child { margin-bottom: 0; }

.article-body blockquote {
  border-left: 2px solid var(--primary); background: var(--surface);
  padding: 16px 20px; margin: 22px 0; color: var(--text-2); font-size: 0.92rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body blockquote > p:last-child { margin-bottom: 0; }
.article-body .codeblock { margin: 20px 0; }

/* 以下は Markdown で書けるようになった記法。旧ブロック方式では出せなかったので
   スタイルが無く、そのままだと素の見た目で出てしまう。 */
.article-body a {
  color: var(--primary); text-decoration: underline;
  text-underline-offset: 2px; text-decoration-thickness: 1px;
}
.article-body a:hover { color: var(--primary-2); }
.article-body strong { color: var(--text-hi); font-weight: 700; }
.article-body em { font-style: italic; }
.article-body del, .article-body s { color: var(--muted-2); }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 20px 0; }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* 表は横に長くなりがちなので、はみ出す分だけ表の中でスクロールさせる
   （ページ全体が横スクロールしないように、描画側で table-scroll に包んでいる）。 */
.article-body .table-scroll { overflow-x: auto; margin: 20px 0; }
.article-body table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.article-body th, .article-body td {
  border: 1px solid var(--border); padding: 8px 12px; text-align: left;
}
.article-body th { background: var(--surface-2); color: var(--text-hi); font-weight: 600; }
.article-body td { color: var(--text-2); }

.article-toc { position: sticky; top: 96px; }
.article-toc h4 {
  font-size: 0.72rem; color: var(--muted-2); margin-bottom: 12px;
  font-family: var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
}
.article-toc a {
  display: block; padding: 6px 12px; font-size: 0.82rem;
  color: var(--muted); border-radius: var(--radius-sm);
}
.article-toc a:hover { color: var(--text); background: rgba(192, 202, 245, 0.05); }
.article-toc a.active { color: var(--text); background: var(--surface-2); }

.article-footer {
  margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--border-soft);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.like-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; padding: 10px 18px;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 0.84rem; font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.like-btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.like-btn.liked { background: rgba(187, 154, 247, 0.14); border-color: rgba(187, 154, 247, 0.42); color: var(--primary); }

.author-box {
  display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-top: 32px;
}
.author-box .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.author-box h3 { font-size: 0.94rem; margin-bottom: 4px; }
.author-box p { font-size: 0.82rem; color: var(--muted); }

.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; margin-top: 18px; }

/* ============================================================
   スタッフ紹介
   ============================================================ */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.staff-card {
  text-align: left; cursor: pointer; color: inherit; font: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.staff-card:hover { border-color: var(--border-2); background: var(--surface-2); transform: translateY(-2px); }
.staff-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.staff-head { display: flex; gap: 14px; align-items: center; }
.staff-avatar {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: var(--radius-pill);
  background: linear-gradient(150deg, var(--primary), #7aa2f7);
  color: var(--ink); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.03em;
  display: flex; align-items: center; justify-content: center;
}
.staff-avatar.a-2 { background: linear-gradient(150deg, var(--mint), #41a6b5); }
.staff-avatar.a-3 { background: linear-gradient(150deg, var(--orange), #e0af68); }
.staff-card h3 { font-size: 1rem; }
.staff-card .romaji { font-family: var(--mono); font-size: 0.68rem; color: var(--muted-2); letter-spacing: 0.06em; }
.staff-card .role { font-size: 0.82rem; color: var(--primary); font-weight: 600; }
.staff-card .bio { font-size: 0.84rem; color: var(--muted); flex: 1; }
.staff-card .more { font-size: 0.78rem; color: var(--muted-2); font-weight: 600; }
.staff-card:hover .more { color: var(--text-2); }
.team-badge {
  align-self: flex-start; font-size: 0.68rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}

/* 詳細モーダル */
.modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(16, 16, 22, 0.74); backdrop-filter: blur(4px);
}
.modal.open { display: flex; }
.modal-panel {
  position: relative; width: min(720px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.modal-body { padding: 34px; }
.modal-close {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 32px; height: 32px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem;
}
.modal-close:hover { color: var(--text); background: var(--surface-3); }
.staff-detail-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.staff-detail-head .staff-avatar { width: 76px; height: 76px; font-size: 1.5rem; }
.staff-detail-head h2 { font-size: 1.5rem; margin-bottom: 4px; }
.staff-detail-head .role { color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.detail-section { margin-top: 28px; }
.detail-section h4 {
  font-size: 0.72rem; font-family: var(--mono); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 14px;
}
.detail-section p { font-size: 0.9rem; color: var(--muted); }

.skill-list { display: flex; flex-direction: column; gap: 12px; }
.skill-row { display: grid; grid-template-columns: 130px 1fr 40px; gap: 14px; align-items: center; }
.skill-row .name { font-size: 0.84rem; color: var(--text-2); }
.skill-row .lv { font-family: var(--mono); font-size: 0.74rem; color: var(--muted-2); text-align: right; }
.skill-track {
  display: block; height: 6px; background: var(--surface-3);
  border-radius: var(--radius-pill); overflow: hidden;
}
.skill-fill {
  display: block; height: 100%; background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline { list-style: none; border-left: 1px solid var(--border); margin-left: 4px; }
.timeline li { position: relative; padding: 0 0 20px 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -4px; top: 9px;
  width: 7px; height: 7px; border-radius: var(--radius-pill);
  background: var(--primary);
}
.timeline .year { font-family: var(--mono); font-size: 0.74rem; color: var(--muted-2); }
.timeline .what { font-size: 0.88rem; color: var(--text-2); }
.timeline .where { font-size: 0.78rem; color: var(--muted-2); }

.quote-line {
  border-left: 2px solid var(--primary); background: var(--surface-2);
  padding: 16px 20px; font-size: 0.92rem; color: var(--text-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   規約・ポリシーなどの文書ページ
   ============================================================ */
.legal-body { max-width: 760px; margin: 0 auto; }
.legal-body h2 {
  font-size: 1.16rem; margin: 40px 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border-soft);
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { font-size: 0.98rem; margin: 24px 0 10px; }
.legal-body p { margin-bottom: 14px; color: var(--text-2); font-size: 0.92rem; }
.legal-body ul, .legal-body ol { margin: 0 0 18px 20px; }
.legal-body li { margin-bottom: 7px; color: var(--text-2); font-size: 0.92rem; }
.legal-updated {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em;
  color: var(--muted-2); margin-bottom: 30px;
}

/* 特定商取引法に基づく表記の項目一覧 */
.legal-table {
  display: grid; grid-template-columns: 210px 1fr;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 24px;
}
.legal-table dt, .legal-table dd {
  padding: 15px 18px; font-size: 0.9rem;
  border-top: 1px solid var(--border-soft);
}
.legal-table dt:first-of-type, .legal-table dt:first-of-type + dd { border-top: none; }
.legal-table dt { background: var(--surface); color: var(--text-2); font-weight: 600; }
.legal-table dd { margin: 0; color: var(--text-2); }
.legal-table dd p { margin-bottom: 8px; font-size: 0.9rem; }
.legal-table dd p:last-child { margin-bottom: 0; }

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 900px) {
  .split, .faq-layout { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse .split-visual { order: 0; }
  /* critical:start */
  .column-featured { grid-template-columns: 1fr; }
  .column-featured .cover { border-right: none; border-bottom: 1px solid var(--border); min-height: 180px; }
  /* critical:end */
  /* critical:start */
  .article-layout, .lesson-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .article-toc, .lesson-sidebar { position: static; order: -1; }
  /* critical:end */
  .footer-top { grid-template-columns: 1fr 1fr; }
}

/* ナビをたたむ幅。横一列に並べるのに要る幅は、ブラウザで測ると
   未ログインで 870px、ログイン中は 968px（「👤 プラン名 ＋ ログアウト」の
   チップが、ログインボタンより 98px 広い）。左右の余白 48px を足すと、
   ビューポートで 1016px 要る計算になる。
   720px でたたんでいた頃は、721〜1016px のノート PC やタブレットで
   ヘッダからはみ出していた（900px 幅のとき実測 39px）。
   1080px でたたむと、収まる幅でだけ横一列になり、64px の余裕が残る。 */
@media (max-width: 1080px) {
  /* critical:start */
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 72px; left: var(--gutter); right: var(--gutter);
    flex-direction: column; align-items: stretch; padding: 10px;
    background: rgba(22, 22, 30, 0.98); backdrop-filter: blur(14px);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 12px; }
  .user-chip { justify-content: space-between; margin-top: 6px; }
  .main-nav .nav-profile { width: auto; height: auto; padding: 8px 12px 8px 8px; }
  .nav-profile-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .btn-login { margin-left: 0; text-align: center; }
  .lang-switch { margin: 6px 0 2px; }
  .lang-switch-group { width: 100%; }
  .lang-btn { flex: 1; padding: 9px 11px; }
  /* critical:end */
}

@media (max-width: 720px) {
  /* critical:start */
  section { padding: 60px 0; }
  /* critical:end */
  .legal-table { grid-template-columns: 1fr; }
  .legal-table dd { border-top: none; padding-top: 0; }
  /* critical:start */
  .hero { padding: 60px 0 48px; }
  /* critical:end */
  .about-card { grid-template-columns: 1fr; text-align: center; }
  .about-card .avatar { margin: 0 auto; }
  .footer-top { grid-template-columns: 1fr; gap: 26px; }
  .skill-row { grid-template-columns: 104px 1fr 36px; }
  .modal-body { padding: 26px 22px; }

  /* 検索は 1 行いっぱいに。右に中途半端な余りが出ないようにする */
  /* critical:start */
  .search-box { max-width: none; }
  /* critical:end */

  /* iOS は 16px 未満の入力欄にフォーカスすると画面を勝手に拡大する。
     拡大されるとレイアウトが崩れて見えるので、入力欄だけ 16px に上げる */
  .search-box input,
  .newsletter-form input,
  .auth-card input,
  .contact-form input,
  .contact-form select,
  .contact-form textarea,
  .runner textarea { font-size: 16px; }
}

/* ------------------------------------------------------------
   スマートフォン。ここから先はガターを詰め、
   横並びのままだと窮屈になる箇所を縦に積み直す。
   ------------------------------------------------------------ */
@media (max-width: 560px) {
  /* critical:start */
  :root { --gutter: 18px; }

  /* 下限が大きすぎると、見出しの最後の 1〜2 文字だけが次の行に落ちる */
  h1 { font-size: clamp(1.75rem, 7.4vw, 2.4rem); }
  h2 { font-size: clamp(1.35rem, 5.6vw, 1.9rem); }

  section { padding: 52px 0; }
  .hero { padding: 44px 0 40px; }
  .page-hero { padding: 44px 0 28px; }
  .page-hero .badge { padding: 5px 14px; font-size: 0.72rem; margin-bottom: 14px; }
  .hero-ctas { flex-direction: column; align-items: stretch; margin-bottom: 34px; }
  .hero-ctas .btn { width: 100%; white-space: normal; }
  /* critical:end */

  /* 3 つなど奇数個のとき、2 列だと最後に空きマスができる。
     最後の 1 つを横いっぱいに伸ばして穴を埋める */
  .stats-row > .stat:nth-child(odd):last-child { grid-column: 1 / -1; }

  /* 余白の大きいカードは、狭い画面では中身が入らなくなるので詰める */
  .membership-teaser { padding: 36px 20px; }
  .newsletter-box { padding: 32px 20px; }
  .paywall { padding: 32px 20px; margin: 24px 0; }
  .empty-state { padding: 44px 18px; }
  .price-card { padding: 22px 20px; }
  .feature, .flow-card, .staff-card { padding: 20px; }
  .course-card { padding: 18px; }
  .about-card { padding: 24px 20px; }
  .quiz { padding: 20px 18px; margin: 22px 0; }
  .task { padding: 18px 16px; margin: 22px 0; }
  .steps ol li { padding: 10px 14px 10px 42px; }
  .steps ol li::before { left: 12px; top: 10px; }
  .auth-card { padding: 26px 20px; }
  .modal { padding: 14px; }
  .modal-body { padding: 24px 18px; }

  /* コース概要のレッスン一覧。
     番号・タイトル・バッジを 1 行に並べるとタイトルが 2〜3 行に折れて
     読めなくなるので、1 行目に番号とバッジ、2 行目に本文を置く */
  .lesson-list { max-width: none; }
  .lesson-row { flex-wrap: wrap; gap: 10px; padding: 16px 2px; }
  .lesson-row .lesson-num { width: 28px; height: 28px; font-size: 0.72rem; }
  .lesson-row .badge { margin-left: auto; }
  .lesson-row .lesson-meta { flex: 1 0 100%; order: 3; }
  .lesson-row .btn { order: 3; }

  .chapter-label { margin-top: 36px; }

  /* 前後リンクは横並びのままだとタイトルが画面からはみ出す */
  .lesson-nav { flex-direction: column; margin-top: 34px; }
  .lesson-nav .btn { width: 100%; white-space: normal; }

  /* critical:start */
  .article-layout { padding-bottom: 60px; }
  .lesson-layout { padding: 28px var(--gutter) 60px; }
  .lesson-content h2 { margin-top: 30px; }
  .article-body h2 { margin-top: 32px; }
  /* critical:end */

  .codeblock, .runner textarea { padding: 14px; font-size: 0.8rem; }
  .runner-head, .runner-bar { padding: 10px 14px; }

  /* critical:start */
  .toolbar { gap: 10px; margin-bottom: 18px; }
  /* critical:end */
  .article-footer { margin-top: 34px; }
  .author-box { grid-template-columns: 1fr; gap: 12px; }
  .site-footer { padding: 44px 0 28px; }
}

/* 目次は縦に長いので、狭い画面では本文の前に全部並べない。
   枠の中で送れる高さに収めて、本文をすぐ読み始められるようにする */
@media (max-width: 900px) {
  /* critical:start */
  .lesson-sidebar, .article-toc {
    max-height: 300px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 14px;
  }
  .lesson-sidebar h4, .article-toc h4 { margin-bottom: 10px; }
  .lesson-sidebar ol { margin: 0; }
  /* critical:end */
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
  .column-card:hover, .staff-card:hover { transform: none; }
}

/* ==========================================================================
   Django 化に伴う追加分
   旧実装では HTML に直接書いていたインラインスタイルと、
   フォームで包む必要が出た箇所のためのルール。
   ========================================================================== */

/* レイアウトの flex/grid 子要素をフォームで包んでも崩れないようにする */
form.contents { display: contents; }

/* コース概要の章見出し（旧 CH_LABEL_STYLE / CH_LEAD_STYLE） */
.chapter-label {
  max-width: 760px; margin: 52px auto 6px;
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2);
}
.chapter-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.chapter-progress { flex-shrink: 0; letter-spacing: 0.04em; color: var(--muted); }
.chapter-progress.is-complete { color: var(--mint); }
.chapter-lead {
  max-width: 760px; margin: 0 auto 14px;
  color: var(--muted); font-size: 0.86rem;
}

/* レッスンのサイドバー、章でまとめる表示（旧 SIDE_CH_STYLE / SIDE_SUB_STYLE） */
/* critical:start */
.side-chapter {
  display: block; padding: 10px 12px 4px;
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.12em; color: var(--muted-2);
}
.side-sub { margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--border-soft); }
/* critical:end */

/* プラン限定レッスンの案内 */
.paywall {
  margin: 32px 0; padding: 44px 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.paywall-icon { font-size: 2.6rem; margin-bottom: 12px; }
.paywall h2 { font-size: 1.1rem; margin-bottom: 10px; }
.paywall p { color: var(--muted); font-size: 0.9rem; max-width: 460px; margin: 0 auto; }

/* ============================================================
   ログイン・登録（allauth）
   allauth のページは container を持たないので、余白はここで作る。
   ページごとの template ではなく allauth/elements/* を上書きして
   いるので、見た目の指定はここに集約されている。
   ============================================================ */
.auth-title {
  font-size: 1.5rem; text-align: center; margin: 0 0 8px;
  padding-top: 56px;
}
/* allauth のページ本体は body 直下に出るので、左右と下の余白をここで足す */
.auth-card {
  max-width: min(420px, calc(100% - 32px));
  margin-bottom: 8px;
}
.auth-providers, .auth-actions-stack, .auth-lead, .auth-hr {
  max-width: min(420px, calc(100% - 32px));
}
.auth-subtitle {
  font-size: 0.86rem; font-weight: 700; color: var(--muted);
  text-align: center; margin: 22px 0 12px;
}
.auth-lead {
  font-size: 0.86rem; color: var(--muted); text-align: center;
  line-height: 1.8; margin: 0 auto 20px; max-width: 420px;
}
.auth-lead a { color: var(--primary); }
.auth-hr {
  border: none; border-top: 1px dashed var(--border);
  margin: 22px auto; max-width: 420px;
}
.auth-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.auth-actions > * { flex: 1; }
.auth-actions-stack {
  flex-direction: column; max-width: 420px; margin: 0 auto;
}
.auth-help {
  display: block; font-size: 0.76rem; color: var(--muted-2); margin-top: 6px;
}
.auth-check { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.auth-check label { margin: 0; }
.auth-check input { width: auto; }
.auth-card ul, .auth-card ol { font-size: 0.86rem; color: var(--muted); line-height: 1.9; }
.auth-card p { font-size: 0.88rem; line-height: 1.8; }

/* SNS のボタン */
.auth-providers {
  display: flex; flex-direction: column; gap: 10px;
  max-width: 420px; margin: 0 auto;
}
.auth-provider {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.auth-provider-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-3); font-size: 0.72rem; font-weight: 800;
}
.auth-provider-google:hover  { border-color: #4285f4; }
.auth-provider-github:hover  { border-color: var(--text-2); }
.auth-provider-line:hover    { border-color: #06c755; }
.auth-provider-twitter_oauth2:hover { border-color: var(--text-hi); }

/* ダッシュボードのプラン表示 */
.plan-note {
  display: inline-block; margin-left: 8px;
  font-size: 0.78rem; color: var(--muted);
}

/* ============================================================
   ダッシュボード
   余白は 3 段だけ使う。セクションの間 56px / 見出しと中身 20px / カードの内側 28px。
   カード同士の間はどこでも 20px。
   ============================================================ */
.dash-hero { padding-bottom: 48px; }
.dash-plan {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; margin-top: 24px;
}
.dash-plan .plan-note { margin-left: 0; }
.dash-alert { max-width: 560px; margin: 20px auto 0; text-align: left; }
.dash-sync {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 12px; margin-top: 16px;
  font-size: 0.82rem; color: var(--muted);
}

.dash-section { padding: 56px 0; }
.dash-title { font-size: 1.3rem; margin-bottom: 20px; }
.dash-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.dash-stack { display: grid; gap: 20px; }
.dash-lead { color: var(--muted); font-size: 0.9rem; line-height: 1.8; }
.dash-lead + .dash-lead { margin-top: 12px; }
.dash-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }

/* コースカードはボタンの位置をそろえる。説明文の長さが違ってもボタンは下端に */
.dash-courses { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.dash-courses .feature { display: flex; flex-direction: column; padding: 28px; }
.dash-courses .feature p { margin-bottom: 20px; }
.dash-courses .feature .btn { margin-top: auto; align-self: flex-start; }

/* 紹介コードの箱もほかのカードと同じ見た目・左寄せにそろえる */
.dash-stack .coupon-box {
  margin-top: 0; padding: 28px; border-radius: var(--radius); text-align: left;
}
.dash-stack .coupon-form { margin: 16px 0 0; }
.dash-stack .coupon-box form:not(.coupon-form) { margin-top: 16px; }

@media (max-width: 560px) {
  .dash-hero { padding-bottom: 36px; }
  .dash-section { padding: 40px 0; }
  .dash-card,
  .dash-courses .feature,
  .dash-stack .coupon-box { padding: 22px 20px; }
}

/* ============================================================
   紹介コード
   ============================================================ */
.coupon-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 22px; margin-top: 22px;
  text-align: center;
}
/* 単独セクションとして置くときは、上下の余白をページ共通のリズム（section の padding）に任せる。
   ダッシュボードのように他要素に続けて置く場合の margin-top はここでは邪魔になる。 */
.coupon-section .coupon-box { margin-top: 0; }
.coupon-box h3 { font-size: 0.98rem; margin-bottom: 6px; }
.coupon-form {
  display: flex; gap: 8px; margin: 14px auto 0; max-width: 380px; flex-wrap: wrap;
}
.coupon-form input {
  flex: 1; min-width: 180px; padding: 11px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 0.88rem; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.coupon-form input::placeholder { color: var(--muted-2); letter-spacing: normal; }
.coupon-form input:focus { outline: none; border-color: var(--primary); }
.coupon-note { font-size: 0.8rem; color: var(--muted); margin-top: 12px; line-height: 1.7; }
.coupon-applied { margin-top: 10px; font-size: 0.86rem; color: var(--text-2); }
.coupon-applied .plan-pill { margin-right: 8px; }

/* ============================================================
   お問い合わせフォーム
   ============================================================ */
.contact-form-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 34px 32px;
  max-width: 720px; margin: 0 auto;
}
.contact-form-box .section-title { margin-bottom: 8px; }
/* 見出しと本文は箱の左端にそろえる。.section-lead の既定は中央寄せ＋幅 620px で、
   箱の中に置くと中途半端に寄って見える。 */
.contact-form-box .section-lead { max-width: none; margin: 0 0 24px; text-align: left; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.contact-form .field { display: flex; flex-direction: column; gap: 6px; }
/* 2 つ並べる行。狭い画面では縦に積む */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-form label {
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
}
.contact-form label .req {
  display: inline-block; margin-left: 8px; padding: 1px 7px;
  background: rgba(247, 118, 142, 0.14); color: var(--danger);
  border: 1px solid rgba(247, 118, 142, 0.3);
  border-radius: var(--radius-pill); font-size: 0.62rem; font-weight: 800;
  letter-spacing: 0.06em; vertical-align: 1px;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 0.9rem; line-height: 1.7;
}
.contact-form textarea { resize: vertical; min-height: 150px; }
.contact-form ::placeholder { color: var(--muted-2); }
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { outline: none; border-color: var(--primary); }
/* select は OS 既定の下向き矢印が藍地に埋もれるので、自前で描く */
.contact-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}
.contact-form .field-help { font-size: 0.74rem; color: var(--muted-2); line-height: 1.6; }
.contact-form .field-error { font-size: 0.78rem; color: var(--danger); font-weight: 600; }
.contact-form .field-check {
  flex-direction: row; align-items: center; flex-wrap: wrap; gap: 9px;
}
.contact-form .field-check input { width: auto; accent-color: var(--primary); }
.contact-form .field-check label { font-size: 0.84rem; color: var(--text-2); }
.contact-form .field-check .field-error { flex-basis: 100%; }
.contact-form button[type="submit"] { align-self: flex-start; }
.form-errors {
  background: rgba(247, 118, 142, 0.08);
  border: 1px solid rgba(247, 118, 142, 0.3);
  border-left: 2px solid var(--danger);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 22px;
}
.form-errors p { font-size: 0.84rem; color: var(--danger); font-weight: 600; }
/* ハニーポット。人には見せず、読み上げも aria-hidden で止めてある。
   display:none だと埋めない bot がいるので、画面の外へ追い出す。 */
.hp-field {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden;
}

/* 折り返しの基準はサイト共通の breakpoint に合わせる（ナビが畳まれるのと同じ幅）。
   2 列のままだと、日本語のラベルが入力欄より長くなって折れる。 */
@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; }
  .contact-form button[type="submit"] { align-self: stretch; width: 100%; }
}
@media (max-width: 560px) {
  .contact-form-box { padding: 26px 20px; }
}

/* 種別カードの見出しは、その種別を選んだフォームへの入口。
   リンクだと分かるのは下線だけでよく、色まで変えると見出しに見えなくなる。 */
.feature h3 a { color: inherit; }
.feature h3 a:hover { color: var(--text-hi); text-decoration: underline; }
