/*
Theme Name: SNS AI Lab
Theme URI: https://sns-ai-lab.com/
Author: 神原
Author URI: https://sns-ai-lab.com/
Description: SNS AI Lab 教材サイト用カスタムテーマ。Zenn Book風 3カラムレイアウト（左サイドバー＝章ツリー／中央＝本文／右パネル＝配布物カード）。デモHTML（new-business/demo/）から移植。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sns-ai-lab
*/

/* ==========================================================
   SNS AI Lab 教材デモ — Zenn Book風レイアウト
   ========================================================== */

:root {
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-surface-2: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-text: #1f2937;
  --color-text-sub: #64748b;
  --color-text-muted: #94a3b8;
  --color-primary: #1e3a8a;      /* 濃紺 */
  --color-primary-soft: #eef2ff;
  --color-accent: #3b82f6;
  --color-info-bg: #eff6ff;
  --color-info-border: #3b82f6;
  --color-warn-bg: #fff7ed;
  --color-warn-border: #f97316;
  --color-success-bg: #ecfdf5;
  --color-success-border: #10b981;
  --color-code-bg: #f1f5f9;
  --color-code-text: #0f172a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic UI", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================
   ヘッダー（共通）
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-header .logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-header .logo a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.site-header .logo .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.site-header .nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
}
.site-header .nav a {
  color: var(--color-text-sub);
}
.site-header .nav a.active {
  color: var(--color-text);
  font-weight: 600;
}
.site-header .spacer { flex: 1; }
.site-header .progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-sub);
}
.site-header .progress-bar {
  width: 140px;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  overflow: hidden;
}
.site-header .progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1e3a8a);
  border-radius: 3px;
}
.site-header .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0e7ff;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* ==========================================================
   TOPページ — 章カードグリッド
   ========================================================== */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}
.hero h1 {
  font-size: 28px;
  line-height: 1.4;
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--color-text);
}
.hero .lead {
  font-size: 15px;
  color: var(--color-text-sub);
  margin: 0;
}
.hero .stats {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.hero .stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero .stat .num {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}
.hero .stat .label {
  font-size: 12px;
  color: var(--color-text-sub);
}

.chapter-list {
  max-width: 1080px;
  margin: 32px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.chapter-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: all 0.15s ease;
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
}
.chapter-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.chapter-card .num {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.chapter-card .title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 10px;
  line-height: 1.5;
}
.chapter-card .desc {
  font-size: 13px;
  color: var(--color-text-sub);
  margin: 0 0 14px;
  line-height: 1.7;
}
.chapter-card .meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  align-items: center;
}
.chapter-card .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 11px;
}
.chapter-card .badge.done {
  background: var(--color-success-bg);
  color: #047857;
}
.chapter-card .badge.in-progress {
  background: #fef3c7;
  color: #92400e;
}
.chapter-card .progress-mini {
  margin-top: 12px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}
.chapter-card .progress-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1e3a8a);
}

/* ==========================================================
   レッスンページ — 3カラムレイアウト
   ========================================================== */
.lesson-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 220px;
  gap: 0;
  max-width: 1360px;
  margin: 0 auto;
}

/* --- 左サイドバー --- */
.sidebar {
  border-right: 1px solid var(--color-border);
  padding: 28px 0 60px;
  background: var(--color-bg);
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  overflow-y: auto;
}
.sidebar h2 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  margin: 0 0 12px;
  padding: 0 24px;
}
.sidebar .chapter-group {
  margin-bottom: 4px;
}
.sidebar .chapter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}
.sidebar .chapter-title .num {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 700;
  min-width: 28px;
}
.sidebar .chapter-title .arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--color-text-muted);
  transition: transform 0.15s;
}
.sidebar .chapter-group.open .arrow {
  transform: rotate(90deg);
}
.sidebar .lesson-list {
  display: none;
  padding: 4px 0 6px;
  margin: 0;
  list-style: none;
}
.sidebar .chapter-group.open .lesson-list {
  display: block;
}
.sidebar .lesson-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 24px 6px 40px;
  font-size: 13px;
  color: var(--color-text-sub);
  border-left: 2px solid transparent;
  text-decoration: none;
  line-height: 1.5;
}
.sidebar .lesson-list li a:hover {
  background: rgba(59, 130, 246, 0.04);
  color: var(--color-text);
}
.sidebar .lesson-list li a.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-left-color: var(--color-primary);
  font-weight: 600;
}
.sidebar .check {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
  color: transparent;
}
.sidebar .check.done {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.sidebar .check.current {
  background: #fff;
  border-color: var(--color-primary);
  border-width: 4px;
}

/* --- メインコンテンツ --- */
.lesson-main {
  padding: 40px 56px 80px;
  background: var(--color-surface);
  min-height: calc(100vh - 56px);
}
.breadcrumb {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--color-text-sub); }
.breadcrumb .sep { margin: 0 6px; color: var(--color-text-muted); }

.lesson-main h1 {
  font-size: 28px;
  line-height: 1.5;
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.lesson-main h1 .lesson-num {
  font-size: 14px;
  color: var(--color-accent);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.lesson-main h2 {
  font-size: 22px;
  margin: 48px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  color: var(--color-text);
}
.lesson-main h3 {
  font-size: 18px;
  margin: 36px 0 10px;
  font-weight: 700;
  color: var(--color-text);
}
.lesson-main h4 {
  font-size: 15px;
  margin: 24px 0 8px;
  font-weight: 700;
  color: var(--color-primary);
}
.lesson-main p {
  margin: 12px 0;
  color: var(--color-text);
}
.lesson-main strong {
  color: var(--color-text);
  font-weight: 700;
  background: linear-gradient(transparent 65%, rgba(251, 191, 36, 0.4) 65%);
  padding: 0 2px;
}
.lesson-main ul, .lesson-main ol {
  padding-left: 1.5em;
  margin: 12px 0;
}
.lesson-main ul li, .lesson-main ol li {
  margin: 6px 0;
}
.lesson-main hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 40px 0;
}

/* 装飾ボックス */
.box {
  border-radius: var(--radius-md);
  padding: 18px 22px 18px 56px;
  margin: 24px 0;
  position: relative;
  line-height: 1.75;
  font-size: 14.5px;
}
.box::before {
  position: absolute;
  left: 18px;
  top: 18px;
  font-size: 22px;
  line-height: 1;
}
.box p:first-child { margin-top: 0; }
.box p:last-child { margin-bottom: 0; }

.box.info {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-info-border);
  color: #1e3a8a;
}
.box.info::before { content: "💡"; }

.box.warn {
  background: var(--color-warn-bg);
  border-left: 4px solid var(--color-warn-border);
  color: #7c2d12;
}
.box.warn::before { content: "⚠️"; }

.box.success {
  background: var(--color-success-bg);
  border-left: 4px solid var(--color-success-border);
  color: #064e3b;
}
.box.success::before { content: "✅"; }

.box.label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0;
  background: none;
  margin-right: 8px;
}

/* コードブロック */
pre, code {
  font-family: var(--font-mono);
}
.lesson-main pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-code-text);
  overflow-x: auto;
  margin: 16px 0;
}
.lesson-main code {
  background: var(--color-code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: #be185d;
}
.lesson-main pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ステップ */
.step-list {
  margin: 24px 0;
  padding: 0;
  list-style: none;
}
.step-list .step {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--color-border);
}
.step-list .step:last-child { border-bottom: none; }
.step-list .step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.step-list .step-body { flex: 1; }
.step-list .step-title {
  font-weight: 700;
  font-size: 15px;
  margin: 4px 0 4px;
}
.step-list .step-desc {
  font-size: 14px;
  color: var(--color-text-sub);
  margin: 0;
}

/* 動画埋め込み */
.video-embed {
  margin: 24px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #0f172a;
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f1f5f9;
  cursor: pointer;
}
.video-embed::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.3), transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(30, 58, 138, 0.4), transparent 60%);
}
.video-embed .play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.video-embed .play-btn::after {
  content: "";
  border-left: 18px solid var(--color-primary);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 4px;
}
.video-embed .video-meta {
  position: absolute;
  bottom: 16px;
  left: 20px;
  right: 20px;
  z-index: 1;
  font-size: 13px;
  color: #f8fafc;
  display: flex;
  justify-content: space-between;
}
.video-embed .video-meta .title {
  font-weight: 600;
}

/* リライト前後の比較 */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}
.compare .col {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.compare .col-head {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.compare .col.before .col-head {
  background: #fef2f2;
  color: #991b1b;
}
.compare .col.after .col-head {
  background: var(--color-success-bg);
  color: #065f46;
}
.compare .col-body {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.8;
  background: #fff;
}

/* 前後ナビ */
.lesson-nav {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lesson-nav a {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.15s;
}
.lesson-nav a:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-2);
}
.lesson-nav .label {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.lesson-nav .title {
  font-size: 14px;
  font-weight: 600;
}
.lesson-nav .next { text-align: right; }

/* 完了ボタン */
.complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 24px;
}
.complete-btn:hover {
  background: #1e40af;
}

/* --- 右パネル：関連配布物 --- */
.side-panel {
  border-left: 1px solid var(--color-border);
  padding: 28px 20px;
  font-size: 13px;
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  overflow-y: auto;
  background: var(--color-bg);
}
.side-panel h3 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.resource-card {
  display: block;
  padding: 10px 12px 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.resource-card:hover {
  background: var(--color-surface-2);
  border-color: var(--color-accent);
  text-decoration: none;
}
.resource-card.type-resource { border-left-color: #3b82f6; }
.resource-card.type-video { border-left-color: #ef4444; }

.resource-card .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
  margin: 0 0 4px;
}
.resource-card .desc {
  font-size: 12.5px;
  color: var(--color-text-sub);
  line-height: 1.55;
  margin: 0 0 6px;
}
.resource-card .step-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  padding: 2px 8px;
  border-radius: 4px;
}
.resource-card .duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
}
.resource-card .duration::before {
  content: "▶";
  font-size: 9px;
}

.side-panel .panel-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  margin: 28px 0 12px;
}
.next-lesson-card {
  display: block;
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.next-lesson-card:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}
.next-lesson-card .label {
  font-size: 10px;
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.next-lesson-card .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

/* ==========================================================
   汎用ページ（page.php フォールバック）
   ========================================================== */
.generic-page {
  max-width: 880px;
  margin: 40px auto 80px;
  padding: 40px 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.generic-page h1 {
  font-size: 26px;
  margin: 0 0 24px;
  font-weight: 700;
}

/* ==========================================================
   WordPress標準クラス（最低限の互換）
   ========================================================== */
.alignleft  { float: left;  margin: 0 16px 16px 0; }
.alignright { float: right; margin: 0 0 16px 16px; }
.aligncenter { display: block; margin: 0 auto 16px; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: var(--color-text-muted); text-align: center; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}

/* レスポンシブ */
@media (max-width: 1100px) {
  .lesson-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .side-panel { display: none; }
}
@media (max-width: 768px) {
  /* --- ヘッダー：モバイル簡素化 --- */
  .site-header {
    padding: 0 14px;
    gap: 10px;
    height: 52px;
  }
  .site-header .logo { font-size: 14px; }
  .site-header .logo .logo-mark { width: 26px; height: 26px; font-size: 13px; }
  .site-header .nav { display: none; }
  .site-header .progress { font-size: 11px; gap: 6px; }
  .site-header .progress > span:first-child { display: none; }
  .site-header .progress-bar { width: 64px; height: 5px; }
  .site-header .avatar { width: 30px; height: 30px; font-size: 12px; }

  /* --- TOPページ --- */
  .hero { padding: 28px 16px 16px; }
  .hero h1 { font-size: 22px; line-height: 1.45; }
  .hero .lead { font-size: 14px; }
  .hero .stats {
    margin-top: 18px;
    padding: 14px 16px;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hero .stat { flex-shrink: 0; }
  .hero .stat .num { font-size: 19px; }

  .chapter-list {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 12px;
    margin: 20px auto 60px;
  }

  /* --- レッスンページ --- */
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .lesson-main {
    padding: 24px 16px 60px;
    min-width: 0;
    overflow-x: hidden;
  }
  .lesson-main * { max-width: 100%; }
  .breadcrumb {
    font-size: 11px;
    word-break: break-all;
    line-height: 1.5;
  }
  .lesson-main h1 { font-size: 22px; word-break: break-word; }
  .lesson-main h1 .lesson-num { font-size: 12px; }
  .lesson-main h2 { font-size: 18px; margin: 36px 0 12px; word-break: break-word; }
  .lesson-main h3 { font-size: 16px; word-break: break-word; }
  .lesson-main h4 { font-size: 14.5px; word-break: break-word; }
  .lesson-main p, .lesson-main ul, .lesson-main ol {
    font-size: 15px;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* 装飾ボックス */
  .box { padding: 14px 16px 14px 46px; font-size: 14px; }
  .box::before { left: 14px; top: 14px; font-size: 18px; }

  /* コードブロック */
  .lesson-main pre {
    padding: 12px 14px;
    font-size: 12.5px;
    border-radius: 4px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-all;
  }

  /* ステップ */
  .step-list .step { gap: 12px; padding: 14px 0; }
  .step-list .step-num { width: 28px; height: 28px; font-size: 12px; }
  .step-list .step-title { font-size: 14.5px; }
  .step-list .step-desc { font-size: 13px; }

  /* リライト比較：縦並びに */
  .compare {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* 動画埋め込み */
  .video-embed .play-btn { width: 56px; height: 56px; }
  .video-embed .play-btn::after {
    border-left-width: 14px;
    border-top-width: 9px;
    border-bottom-width: 9px;
  }
  .video-embed .video-meta { font-size: 12px; left: 14px; right: 14px; bottom: 12px; }

  /* 前後ナビ：縦並びに */
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav .next { text-align: left; }

  .complete-btn { width: 100%; justify-content: center; }
}
