/* ===== BCP講座シェル 共通スタイル =====
   シューリーズ全体のエディトリアル語彙（compliance/index.html が正本）に配色・角丸・
   フォント指定を揃えている。別ドキュメントのため変数定義は複製するが、値は一致させている。 */

:root {
  /* エディトリアル語彙のトークン。既存の変数名は維持し、値だけを差し替える */
  --dark: #131416;             /* ヘッダー・フッターの単色用（新規追加。他ページと共通） */

  --primary: #272727;          /* 旧: 青 #1a56db → ink相当の落ち着いた色 */
  --primary-light: #e8eaee;    /* 旧: 青の薄色 → 中立なライトグレー */
  --accent: #c0553f;           /* 旧: 赤 #dc2626 → editorialのアクセント */
  --accent-light: #fbf3f1;
  --success: #2f6b4c;          /* 旧: 緑 #16a34a → 彩度を落とした深緑 */
  --success-light: #eaf1ec;
  --warning: #7a5119;          /* 旧: 橙 #d97706 → 彩度を落とした琥珀 */
  --warning-light: #f5efe2;
  --gray-50: #f2f3f5;
  --gray-100: #e8eaee;
  --gray-200: #dcdee2;
  --gray-300: #898c91;
  --gray-500: #6c6f74;
  --gray-600: #57595d;
  --gray-700: #45474b;
  --gray-800: #272727;
  --gray-900: #1a1b1d;
  --radius: 2px;                /* 旧: 12px → 角丸をほぼ廃止 */
  --shadow: none;                /* 旧: ドロップシャドウ → 罫線ベースへ全廃 */
  --shadow-md: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }

body {
  overflow-x: hidden;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.7;
  font-size: 15px;
}

/* ===== Header（ツール本体と同じ書き癖） ===== */
.header {
  background: var(--dark);
  color: #fff;
  padding: 20px 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}
.header-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 10px;
  transition: color 0.2s;
}
.header-back:hover { color: #fff; }
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.header-brand .shield-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.header h1 {
  font-family: "Bodoni Moda", "Noto Sans JP", serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.header-sub {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

/* ===== 共通コンテナ ===== */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== 「この端末にのみ保存」注記 ===== */
.local-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  color: var(--warning);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ===== 講座エラー表示（manifest未読込などの防御） ===== */
.course-error-box, .lesson-error-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* ===== 講座トップ: 全体進捗 ===== */
.overall-progress {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.overall-meter {
  position: relative;
  width: 104px;
  height: 104px;
  flex-shrink: 0;
}
.overall-meter svg {
  width: 104px;
  height: 104px;
  transform: rotate(-90deg);
}
.overall-meter .track {
  fill: none;
  stroke: var(--gray-200);
  stroke-width: 9;
}
.overall-meter .progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}
.overall-pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.overall-pct small { font-size: 12px; font-weight: 600; }
.overall-details { flex: 1; min-width: 200px; }
.overall-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.overall-count { font-size: 13px; color: var(--gray-600); }

/* ===== モジュールカード（sectionと同系デザイン） ===== */
.module-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
  overflow: hidden;
}
.module-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.module-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}
.module-phase {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}
.module-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}

/* ===== 次にやるべきレッスン バナー ===== */
.next-lesson-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}
.next-lesson-label { font-weight: 700; color: var(--gray-900); }
.next-lesson-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.next-lesson-link:hover { text-decoration: underline; }

.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.lesson-row:last-child { border-bottom: none; }
a.lesson-row:hover { background: var(--gray-50); }
.lesson-row.disabled { opacity: 0.5; cursor: not-allowed; }

.lesson-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.lesson-status-icon.done { background: var(--success-light); color: var(--success); }
/* in_progress: --primary が無彩色（#272727）寄りになったため not_started の灰と紛れる。
   palette.md の情報色（青 #33455c）で色相を残す。#e4eaf1 はその薄色版で自己決定（palette.mdに定義なし）。 */
.lesson-status-icon.in_progress { background: #e4eaf1; color: #33455c; }
.lesson-status-icon.not_started { background: var(--gray-100); color: var(--gray-500); }
.lesson-status-icon.soon { background: var(--gray-100); color: var(--gray-300); }

.lesson-title { flex: 1; font-weight: 600; font-size: 14px; color: var(--gray-900); }
.lesson-meta { font-size: 12px; color: var(--gray-500); flex-shrink: 0; }
.lesson-state-badge {
  font-size: 11px;
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 3px 10px;
  border-radius: var(--radius);
  flex-shrink: 0;
  white-space: nowrap;
}
.lesson-state-badge.badge-done { background: var(--success-light); color: var(--success); }
.lesson-state-badge.badge-progress { background: #e4eaf1; color: #33455c; }

/* ===== 修了画面（done.html）: 成果物一覧 ===== */
.deliverable-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.deliverable-item:last-child { border-bottom: none; }
.deliverable-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.deliverable-icon.done { background: var(--success-light); color: var(--success); }
.deliverable-icon.pending { background: var(--gray-100); color: var(--gray-500); }
.deliverable-label { font-size: 13px; color: var(--gray-900); }

.done-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin: 24px 0 8px;
}
.done-section-title:first-child { margin-top: 0; }

.no-cert-note {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 10px;
}

.done-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.done-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.done-action-link:hover { background: var(--gray-50); }

/* ===== レッスン画面（lesson.html） 2ペイン ===== */
.lesson-layout {
  display: flex;
  gap: 20px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
  align-items: flex-start;
}
.lesson-panel {
  width: 40%;
  min-width: 0;
}
.tool-pane {
  width: 60%;
  min-width: 0;
  position: sticky;
  top: 20px;
}
.tool-pane iframe {
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 480px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

/* ===== ステップブロック（教材パネルの中身） ===== */
.step-block {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  margin-bottom: 14px;
  padding: 16px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.step-block.step-current {
  border-color: var(--primary);
  border-width: 2px;
}
.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  flex: 1;
}
.step-time {
  font-size: 11px;
  color: var(--gray-500);
}

.why-para { font-size: 13px; margin-bottom: 8px; color: var(--gray-800); }
.why-para:last-child { margin-bottom: 0; }
.why-basis { font-size: 11px; color: var(--gray-500); margin-top: 8px; }

.breakdown-intro { font-size: 13px; color: var(--gray-600); margin-bottom: 8px; }
.breakdown-preset {
  white-space: pre-wrap;
  font-size: 13px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  line-height: 1.8;
  margin-bottom: 10px;
}
.breakdown-points {
  list-style: none;
  font-size: 13px;
}
.breakdown-points li {
  padding: 6px 0;
  border-top: 1px dashed var(--gray-200);
}
.breakdown-points li:first-child { border-top: none; }
.breakdown-points strong { color: var(--primary); }

.practice-steps {
  font-size: 13px;
  padding-left: 20px;
  margin-bottom: 10px;
}
.practice-steps li { padding: 3px 0; }
.practice-homework {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--gray-800);
  margin-bottom: 10px;
}
.homework-title { font-weight: 700; margin-bottom: 4px; color: var(--primary); }
.practice-open-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.practice-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.practice-open-btn:hover { opacity: 0.9; }

/* ゲート */
.gate-box {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
}
.gate-box.gate-fail { background: var(--warning-light); color: var(--gray-800); }
.gate-box.gate-pass { background: var(--success-light); color: var(--gray-800); }
.gate-stamp { font-size: 16px; font-weight: 800; color: var(--success); margin-bottom: 4px; }
.gate-msg { font-weight: 600; margin-bottom: 6px; }
.gate-missing-list { list-style: none; padding-left: 0; }
.gate-missing-list li {
  padding: 4px 0 4px 18px;
  position: relative;
  color: var(--warning);
}
.gate-missing-list li::before {
  content: "・";
  position: absolute;
  left: 0;
}

/* クイズ */
.quiz-q { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--gray-900); }
.quiz-choices { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.quiz-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
}
.quiz-choice:hover { background: var(--gray-50); }
.quiz-submit-btn {
  background: var(--gray-800);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.quiz-result {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.6;
}
.quiz-result.quiz-correct { background: var(--success-light); color: var(--success); }
.quiz-result.quiz-incorrect { background: var(--accent-light); color: var(--accent); }

/* 次のレッスンへ */
.next-lesson-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.next-lesson-btn:disabled {
  background: var(--gray-300);
  color: var(--gray-600);
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== モバイル用タブバー ===== */
.mobile-tabbar { display: none; }

@media (max-width: 768px) {
  .container { padding: 14px; }
  .lesson-layout {
    flex-direction: column;
    padding: 10px;
    padding-bottom: 74px; /* タブバー分の余白 */
  }
  .lesson-panel, .tool-pane {
    width: 100%;
    position: static;
  }
  .tool-pane iframe { height: calc(100vh - 190px); }

  body.show-tool .lesson-panel { display: none; }
  body.show-material .tool-pane { display: none; }

  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    z-index: 50;
  }
  .mobile-tabbar button {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
  }
  .mobile-tabbar button.active { color: var(--primary); }

  .overall-progress { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .header h1 { font-size: 17px; }
  .container { padding: 10px; }
}

/* ===== Footer（ツール本体と同じ書き癖） ===== */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 30px 20px;
  margin-top: 20px;
  font-size: 13px;
}
.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.footer-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-brand {
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}

/* 絵文字を使わない方針（2026-09-05）に沿って入れたインラインSVGアイコン。
   色は currentColor で親に追随する。文字の隣に置くので少しだけ下げる。 */
.ic { vertical-align: -0.16em; flex-shrink: 0; }
